Skip to content

[KDD'2026] "VideoRAG: Chat with Your Videos"

Update Vimo with VideoRAG

Re-bin69c821bf3b7f
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 385f50c..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-# Byte-compiled / optimized / DLL files
-videorag/__pycache__/
-*.py[cod]
-*$py.class
\ No newline at end of file
diff --git a/README.md b/README.md
index 04825e7..4f42240 100644
--- a/README.md
+++ b/README.md
@@ -1,334 +1,147 @@
<div align="center">
-
-# VideoRAG: Infinite Context Video AI
-
-<a href='https://arxiv.org/abs/2502.01549'><img src='https://img.shields.io/badge/arXiv-2502.01549-b31b1b'></a>
-<a href='https://github.com/HKUDS/VideoRAG/issues/1'><img src='https://img.shields.io/badge/群聊-wechat-green'></a>
-<a href='https://discord.gg/ZzU55kz3'><img src='https://discordapp.com/api/guilds/1296348098003734629/widget.png?style=shield'></a>
-
-**🔮 Neural-Enhanced Video Intelligence | 🌐 Infinite Context Processing | 🚀 Next-Gen RAG Architecture**
+ <picture>
+ <img src="Vimo-desktop/figures/Vimo-logo.png" width="30%" alt="Vimo: Chat with Your Videos">
+ </picture>
+
+ <h1>Vimo: Chat with Your Videos</h1>
+
+ <a href='https://arxiv.org/abs/2502.01549'><img src='https://img.shields.io/badge/arXiv-2502.01549-b31b1b'></a>
+ <a href='https://github.com/HKUDS/VideoRAG/issues/1'><img src='https://img.shields.io/badge/群聊-wechat-green'></a>
+ <a href='https://discord.gg/ZzU55kz3'><img src='https://discordapp.com/api/guilds/1296348098003734629/widget.png?style=shield'></a>
+ [![Platform](https://img.shields.io/badge/platform-macOS%20|%20Windows%20|%20Linux-lightgrey.svg)]()
+
+ **🎬 Intelligent Video Conversations | Powered by Advanced AI | Extreme Long-Context Processing**
</div>
-
-<div align="center">
- <img src="https://readme-typing-svg.herokuapp.com?font=Orbitron&size=32&color=%23FF6B6B&center=true&vCenter=true&width=700&height=60&lines=%E2%9A%A1+Extreme+Long-Context+Processing;%F0%9F%9A%80+Multi-Modal+Knowledge+Indexing;%F0%9F%94%AE+Neural+Video+Understanding;%F0%9F%8E%AC+134%2B+Hours+Benchmark" alt="VideoRAG Features Animation"/>
-</div>
-
<br/>
-<img src='VideoRAG_cover.png' />
+<img src='VideoRAG-algorithm/VideoRAG_cover.png' />
- This is the PyTorch implementation for VideoRAG proposed in this paper:
+Vimo is a revolutionary desktop application that lets you **chat with your videos** using cutting-edge AI technology. Built on the powerful [VideoRAG framework](https://arxiv.org/abs/2502.01549), Vimo can understand and analyze videos of any length - from short clips to hundreds of hours of content - and answer your questions with remarkable accuracy.
- >**VideoRAG: Retrieval-Augmented Generation with Extreme Long-Context Videos**
- >Xubin Ren*, Lingrui Xu*, Long Xia, Shuaiqiang Wang, Dawei Yin, Chao Huang†
+## 🌟 Why Vimo?
-\* denotes equal contribution.
-† denotes corresponding author
+**For Video Enthusiasts & Professionals:**
+- **Effortless Video Analysis**: Upload any video and start asking questions immediately
+- **Natural Conversations**: Chat with your videos as if talking to a human expert
+- **No Length Limits**: Process everything from 30-second clips to 100+ hour documentaries
+- **Deep Understanding**: Combines visual content, audio, and context for comprehensive answers
- In this paper, we proposed a retrieval-augmented generation framework specifically designed for processing and understanding **extremely long-context videos**.
+**For Researchers & Developers:**
+- **State-of-the-Art Algorithm**: Built on VideoRAG, featuring graph-driven knowledge indexing
+- **Benchmark Performance**: Evaluated on 134+ hours across lectures, documentaries, and entertainment
+- **Open Source**: Full access to VideoRAG implementation and research findings
+- **Scalable Architecture**: Efficient processing with single GPU (RTX 3090) capability
## 📋 Table of Contents
-- [⚡ VideoRAG Framework](#-videorag-framework)
-- [🛠️ Installation](#️-installation)
- [🚀 Quick Start](#-quick-start)
-- [🧪 Experiments](#-experiments)
-- [🦙 Ollama Support](#-ollama-support)
+- [✨ Key Features](#-key-features)
+- [🔬 VideoRAG Algorithm](#-videorag-algorithm)
+- [🛠️ Development Setup](#️-development-setup)
+- [🧪 Benchmarks & Evaluation](#-benchmarks--evaluation)
- [📖 Citation](#-citation)
+- [🤝 Contributing](#-contributing)
- [🙏 Acknowledgement](#-acknowledgement)
-## ⚡ VideoRAG Framework
-
-<p align="center">
-<img src="VideoRAG.png" alt="VideoRAG" />
-</p>
-
-VideoRAG introduces a novel dual-channel architecture that synergistically combines graph-driven textual knowledge grounding for modeling cross-video semantic relationships with hierarchical multimodal context encoding to preserve spatiotemporal visual patterns, enabling unbounded-length video understanding through dynamically constructed knowledge graphs that maintain semantic coherence across multi-video contexts while optimizing retrieval efficiency via adaptive multimodal fusion mechanisms.
-
-💻 **Efficient Extreme Long-Context Video Processing**
-- Leveraging a Single NVIDIA RTX 3090 GPU (24G) to comprehend Hundreds of Hours of video content 💪
-
-🗃️ **Structured Video Knowledge Indexing**
-- Multi-Modal Knowledge Indexing Framework distills hundreds of hours of video into a concise, structured knowledge graph 🗂️
-
-🔍 **Multi-Modal Retrieval for Comprehensive Responses**
-- Multi-Modal Retrieval Paradigm aligns textual semantics and visual content to identify the most relevant video for comprehensive responses 💬
-
-📚 **The New Established LongerVideos Benchmark**
-- The new established LongerVideos Benchmark features over 160 Videos totaling 134+ Hours across lectures, documentaries, and entertainment 🎬
-
-## 🛠️ Installation
-
-### 📦 Environment Setup
-
-To utilize VideoRAG, please first create a conda environment with the following commands:
-
-```bash
-# Create and activate conda environment
-conda create --name videorag python=3.11
-conda activate videorag
-```
-
-### 📚 Core Dependencies
-
-Install the essential packages for VideoRAG:
+## 🚀 Quick Start of Vimo
-```bash
-# Core numerical and deep learning libraries
-pip install numpy==1.26.4
-pip install torch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2
-pip install accelerate==0.30.1
-pip install bitsandbytes==0.43.1
-
-# Video processing utilities
-pip install moviepy==1.0.3
-pip install git+https://github.com/facebookresearch/pytorchvideo.git@28fe037d212663c6a24f373b94cc5d478c8c1a1d
-
-# Multi-modal and vision libraries
-pip install timm ftfy regex einops fvcore eva-decord==0.6.1 iopath matplotlib types-regex cartopy
-
-# Audio processing and vector databases
-pip install ctranslate2==4.4.0 faster_whisper==1.0.3 neo4j hnswlib xxhash nano-vectordb
-
-# Language models and utilities
-pip install transformers==4.37.1
-pip install tiktoken openai tenacity
-```
-
-### 🔧 ImageBind Installation
-
-Install ImageBind using the provided code in this repository:
-
-```bash
-cd ImageBind
-pip install .
-```
-
-### 📥 Model Checkpoints
-
-Download the necessary checkpoints in **the repository's root folder** for MiniCPM-V, Whisper, and ImageBind:
-
-```bash
-# Ensure git-lfs is installed
-git lfs install
-
-# Download MiniCPM-V model
-git lfs clone https://huggingface.co/openbmb/MiniCPM-V-2_6-int4
-
-# Download Whisper model
-git lfs clone https://huggingface.co/Systran/faster-distil-whisper-large-v3
-
-# Download ImageBind checkpoint
-mkdir .checkpoints
-cd .checkpoints
-wget https://dl.fbaipublicfiles.com/imagebind/imagebind_huge.pth
-cd ../
-```
-
-### 📁 Final Directory Structure
-
-Your final directory structure after downloading all checkpoints should look like this:
-
-```shell
-VideoRAG/
-├── .checkpoints/
-├── faster-distil-whisper-large-v3/
-├── ImageBind/
-├── LICENSE
-├── longervideos/
-├── MiniCPM-V-2_6-int4/
-├── README.md
-├── reproduce/
-├── notesbooks/
-├── videorag/
-├── VideoRAG_cover.png
-└── VideoRAG.png
-```
-
-## 🚀 Quick Start
-
-VideoRAG is capable of extracting knowledge from multiple videos and answering queries based on those videos. Now, try VideoRAG with your own videos 🤗.
+### Option 1: Download Vimo App (Coming Soon)
> [!NOTE]
-> Currently, VideoRAG has only been tested in an English environment. To process videos in multiple languages, it is recommended to modify the ```WhisperModel``` in [asr.py](https://github.com/HKUDS/VideoRAG/blob/main/videorag/_videoutil/asr.py). For more details, please refer to [faster-whisper](https://github.com/systran/faster-whisper).
-
-**At first**, let the VideoRAG extract and indexing the knowledge from given videos (Only one GPU with 24GB of memory is sufficient, such as the RTX 3090):
-```python
-import os
-import logging
-import warnings
-import multiprocessing
+> We are preparing the **Beta release** for macOS Apple Silicon first, with Windows and Linux versions coming soon!
-warnings.filterwarnings("ignore")
-logging.getLogger("httpx").setLevel(logging.WARNING)
-
-# Please enter your openai key
-os.environ["OPENAI_API_KEY"] = ""
-
-from videorag._llm import openai_4o_mini_config
-from videorag import VideoRAG, QueryParam
-
-
-if __name__ == '__main__':
- multiprocessing.set_start_method('spawn')
-
- # Please enter your video file path in this list; there is no limit on the length.
- # Here is an example; you can use your own videos instead.
- video_paths = [
- 'movies/Iron-Man.mp4',
- 'movies/Spider-Man.mkv',
- ]
- videorag = VideoRAG(llm=openai_4o_mini_config, working_dir=f"./videorag-workdir")
- videorag.insert_video(video_path_list=video_paths)
-```
-
-**Then**, ask any questions about the videos! Here is an exmaple:
-```python
-import os
-import logging
-import warnings
-import multiprocessing
-
-warnings.filterwarnings("ignore")
-logging.getLogger("httpx").setLevel(logging.WARNING)
-
-# Please enter your openai key
-os.environ["OPENAI_API_KEY"] = ""
-
-from videorag._llm import *
-from videorag import VideoRAG, QueryParam
-
-
-if __name__ == '__main__':
- multiprocessing.set_start_method('spawn')
-
- query = 'What is the relationship between Iron Man and Spider-Man? How do they meet, and how does Iron Man help Spider-Man?'
- param = QueryParam(mode="videorag")
- # if param.wo_reference = False, VideoRAG will add reference to video clips in the response
- param.wo_reference = True
-
- videorag = videorag = VideoRAG(llm=openai_4o_mini_config, working_dir=f"./videorag-workdir")
- videorag.load_caption_model(debug=False)
- response = videorag.query(query=query, param=param)
- print(response)
-```
-
-## 🧪 Experiments
-
-### LongerVideos
-We constructed the LongerVideos benchmark to evaluate the model's performance in comprehending multiple long-context videos and answering open-ended queries. All the videos are open-access videos on YouTube, and we record the URLs of the collections of videos as well as the corresponding queries in the [JSON](https://github.com/HKUDS/VideoRAG/longervideos/dataset.json) file.
-
-| Video Type | #video list | #video | #query | #avg. queries per list | #overall duration |
-|------------------|------------:|-------:|-------:|-----------------------:|-------------------------|
-| **Lecture** | 12 | 135 | 376 | 31.3 | ~ 64.3 hours |
-| **Documentary** | 5 | 12 | 114 | 22.8 | ~ 28.5 hours |
-| **Entertainment**| 5 | 17 | 112 | 22.4 | ~ 41.9 hours |
-| **All** | 22 | 164 | 602 | 27.4 | ~ 134.6 hours |
-
-### Process LongerVideos with VideoRAG
-
-Here are the commands you can refer to for preparing the videos used in LongerVideos.
-
-```shell
-cd longervideos
-python prepare_data.py # create collection folders
-sh download.sh # obtain videos
-```
+<div align="left">
+ <a href="https://github.com/HKUDS/Vimo/releases">
+ <img src="https://img.shields.io/badge/Coming%20Soon-Mac%20Download-007ACC?style=for-the-badge&logo=apple&logoColor=white" alt="Coming Soon - Mac Release" height="50">
+ </a>
+</div>
-Then, you can run the following example command to process and answer queries for LongerVideos with VideoRAG:
+### Option 2: Run from Source Code
-```shell
-# Please enter your openai_key in line 19 at first
-python videorag_longervideos.py --collection 4-rag-lecture --cuda 0
-```
+For detailed setup instructions:
-### Evaluation
+- **Vimo Desktop App**: See [Vimo-desktop](Vimo-desktop) for complete installation and configuration steps
-We conduct win-rate comparisons as well as quantitative comparisons with RAG-based baselines and long-context video understanding methods separately. **NaiveRAG, GraphRAG and LightRAG** are implemented using the `nano-graphrag` library, which is consistent with our VideoRAG, ensuring a fair comparison.
+**Quick Overview:**
+1. Set up the Python backend environment and start the VideoRAG server
+2. Launch the Electron frontend application
+3. Start chatting with your videos!
-In this part, we directly provided the **answers from all the methods** (including VideoRAG) as well as the evaluation codes for experiment reproduction. Please utilize the following commands to download the answers:
+## ✨ Key Features
-```shell
-cd reproduce
-wget https://archive.org/download/videorag/all_answers.zip
-unzip all_answers
-```
+### For Everyone
+- **Drag & Drop Upload**: Simply drag video files into Vimo
+- **Smart Conversations**: Ask questions in natural language
+- **Multi-Format Support**: Works with MP4, MKV, AVI, and more
+- **Cross-Platform**: Available on macOS, Windows, and Linux
-#### Win-Rate Comparison
+### For Power Users
+- **Extreme Long Videos**: Process videos up to hundreds of hours
+- **Multi-Video Analysis**: Compare and analyze multiple videos simultaneously
+- **Advanced Retrieval**: Find specific moments and scenes with precision
+- **Export Capabilities**: Save insights and references for later use
-We conduct the win-rate comparison with RAG-based baselines. To reproduce the results, please follow these steps:
+### For Researchers
+- **VideoRAG Framework**: Access to cutting-edge retrieval-augmented generation
+- **Benchmark Dataset**: LongerVideos benchmark with 134+ hours of content
+- **Performance Metrics**: Detailed evaluation against existing methods
+- **Extensible Architecture**: Build upon our open-source foundation
-```shell
-cd reproduce/winrate_comparison
+## 🔬 VideoRAG Algorithm
-# First Step: Upload the batch request to OpenAI (remember to enter your key in the file, same for the following steps).
-python batch_winrate_eval_upload.py
+<p align="center">
+<img src="VideoRAG-algorithm/VideoRAG.png" alt="VideoRAG Architecture" width="80%" />
+</p>
-# Second Step: Download the results. Please enter the batch ID and then the output file ID in the file. Generally, you need to run this twice: first to obtain the output file ID, and then to download it.
-python batch_winrate_eval_download.py
+VideoRAG introduces a novel dual-channel architecture that combines:
-# Third Step: Parsing the results. Please the output file ID in the file.
-python batch_winrate_eval_parse.py
+- **Graph-Driven Knowledge Indexing**: Multi-modal knowledge graphs for structured video understanding
+- **Hierarchical Context Encoding**: Preserves spatiotemporal visual patterns across long sequences
+- **Adaptive Retrieval**: Dynamic retrieval mechanisms optimized for video content
+- **Cross-Video Understanding**: Semantic relationship modeling across multiple videos
-# Fourth Step: Calculate the results. Please enter the parsed result file name in the file.
-python batch_winrate_eval_calculate.py
+### Technical Highlights
-```
+- **Efficient Processing**: Handle hundreds of hours on a single RTX 3090 (24GB)
+- **Structured Indexing**: Distill long videos into concise knowledge representations
+- **Multi-Modal Retrieval**: Align textual queries with visual and audio content
+- **LongerVideos Benchmark**: 160+ videos, 134+ hours across diverse domains
-#### Quantitative Comparison
+### Performance Comparison
-We conduct a quantitative comparison, which extends the win-rate comparison by assigning a 5-point score to long-context video understanding methods. We use the answers from NaiveRAG as the baseline response for scoring each query. To reproduce the results, please follow these steps:
+Our VideoRAG algorithm significantly outperforms existing methods in long-context video understanding:
-```shell
-cd reproduce/quantitative_comparison
+<div align="center">
+ <img src="Vimo-desktop/figures/table.png" width="80%" alt="Performance Comparison" />
+</div>
-# First Step: Upload the batch request to OpenAI (remember to enter your key in the file, same for the following steps).
-python batch_quant_eval_upload.py
+### Experiments and Evaluation
-# Second Step: Download the results. Please enter the batch ID and then the output file ID in the file. Generally, you need to run this twice: first to obtain the output file ID, and then to download it.
-python batch_quant_eval_download.py
+See [VideoRAG-algorithm](VideoRAG-algorithm) for detailed development setup including:
+- Conda environment creation
+- Model checkpoints download
+- Dependencies installation
+- Evaluation scripts
-# Third Step: Parsing the results. Please the output file ID in the file.
-python batch_quant_eval_parse.py
+## 🧪 LongerVideos Benchmark
-# Fourth Step: Calculate the results. Please enter the parsed result file name in the file.
-python batch_quant_eval_calculate.py
-```
+We created the LongerVideos benchmark to evaluate long-context video understanding:
-## 🦙 Ollama Support
+| Video Type | #Collections | #Videos | #Queries | Avg. Duration |
+|------------------|-------------|---------|----------|---------------|
+| **Lectures** | 12 | 135 | 376 | ~64.3 hours |
+| **Documentaries**| 5 | 12 | 114 | ~28.5 hours |
+| **Entertainment**| 5 | 17 | 112 | ~41.9 hours |
+| **Total** | 22 | 164 | 602 | ~134.6 hours |
-This project also supports ollama. To use, edit the ollama_config in [_llm.py](https://github.com/HKUDS/VideoRAG/blob/main/videorag/_llm.py).
-Adjust the paramters of the models being used
+For detailed evaluation instructions and reproduction scripts, see [VideoRAG-algorithm/reproduce](VideoRAG-algorithm/reproduce).
-```
-ollama_config = LLMConfig(
- embedding_func_raw = ollama_embedding,
- embedding_model_name = "nomic-embed-text",
- embedding_dim = 768,
- embedding_max_token_size=8192,
- embedding_batch_num = 1,
- embedding_func_max_async = 1,
- query_better_than_threshold = 0.2,
- best_model_func_raw = ollama_complete ,
- best_model_name = "gemma2:latest", # need to be a solid instruct model
- best_model_max_token_size = 32768,
- best_model_max_async = 1,
- cheap_model_func_raw = ollama_mini_complete,
- cheap_model_name = "olmo2",
- cheap_model_max_token_size = 32768,
- cheap_model_max_async = 1
-)
-```
-And specify the config when creating your VideoRag instance
+## 📖 Citation
-### Jupyter Notebook
-To test the solution on a single video, just load the notebook in the [notebook folder](VideoRAG/nodebooks) and
-update the paramters to fit your situation.
+If you find Vimo or VideoRAG helpful in your research, please cite our paper:
-## 📖 Citation
-If you find this work is helpful to your research, please consider citing our paper:
```bibtex
@article{VideoRAG,
title={VideoRAG: Retrieval-Augmented Generation with Extreme Long-Context Videos},
@@ -338,10 +151,30 @@ If you find this work is helpful to your research, please consider citing our pa
}
```
+## 🤝 Contributing
+
+We welcome contributions from the community! Whether you're:
+
+- **Reporting bugs** or suggesting features for Vimo
+- **Improving VideoRAG algorithms** or adding new capabilities
+- **Enhancing documentation** or creating tutorials
+- **Designing UI/UX improvements** for better user experience
+
+Feel free to submit issues and pull requests. Together, we're building the future of intelligent video interaction!
+
## 🙏 Acknowledgement
-We extend our heartfelt gratitude to the open-source community and the foundational projects that made VideoRAG possible. Special thanks to the creators and maintainers of [nano-graphrag](https://github.com/gusye1234/nano-graphrag) and [LightRAG](https://github.com/HKUDS/LightRAG) for their pioneering work in graph-based retrieval systems.
+Vimo builds upon the incredible work of the open-source community:
+
+- **[VideoRAG](https://arxiv.org/abs/2502.01549)**: The core algorithm powering Vimo's intelligence
+- **[nano-graphrag](https://github.com/gusye1234/nano-graphrag)** & **[LightRAG](https://github.com/HKUDS/LightRAG)**: Graph-based retrieval foundations
+- **[ImageBind](https://github.com/facebookresearch/ImageBind)**: Multi-modal representation learning
+- **[uitars-desktop](https://github.com/bytedance/UI-TARS-desktop)**: Desktop application architecture inspiration
-Our framework builds upon the collective wisdom of these exceptional projects, and we are honored to contribute to the advancement of multimodal AI research. We also acknowledge the broader research community for their continued dedication to pushing the boundaries of video understanding and retrieval-augmented generation.
+**🌟 Transform how you interact with videos. Start your journey with Vimo today!**
-**🌟 Thank you for your interest in our work! Together, we're shaping the future of intelligent video AI. 🌟**
+---
+
+<div align="center">
+ <sub>Built with ❤️ by the VideoRAG@HKUDS team.</sub>
+</div>
\ No newline at end of file
diff --git a/VideoRAG-algorithm/.gitignore b/VideoRAG-algorithm/.gitignore
new file mode 100644
index 0000000..7951e8d
--- /dev/null
+++ b/VideoRAG-algorithm/.gitignore
@@ -0,0 +1,14 @@
+# Byte-compiled / optimized / DLL files
+videorag/__pycache__/
+*.py[cod]
+*$py.class
+
+# OS files
+.DS_Store
+.DS_Store?
+._*
+.Spotlight-V100
+.Trashes
+ehthumbs.db
+Thumbs.db
+Desktop.ini
\ No newline at end of file
diff --git a/ImageBind/.assets/bird_audio.wav b/VideoRAG-algorithm/ImageBind/.assets/bird_audio.wav
similarity index 100%
rename from ImageBind/.assets/bird_audio.wav
rename to VideoRAG-algorithm/ImageBind/.assets/bird_audio.wav
diff --git a/ImageBind/.assets/bird_image.jpg b/VideoRAG-algorithm/ImageBind/.assets/bird_image.jpg
similarity index 100%
rename from ImageBind/.assets/bird_image.jpg
rename to VideoRAG-algorithm/ImageBind/.assets/bird_image.jpg
diff --git a/ImageBind/.assets/car_audio.wav b/VideoRAG-algorithm/ImageBind/.assets/car_audio.wav
similarity index 100%
rename from ImageBind/.assets/car_audio.wav
rename to VideoRAG-algorithm/ImageBind/.assets/car_audio.wav
diff --git a/ImageBind/.assets/car_image.jpg b/VideoRAG-algorithm/ImageBind/.assets/car_image.jpg
similarity index 100%
rename from ImageBind/.assets/car_image.jpg
rename to VideoRAG-algorithm/ImageBind/.assets/car_image.jpg
diff --git a/ImageBind/.assets/dog_audio.wav b/VideoRAG-algorithm/ImageBind/.assets/dog_audio.wav
similarity index 100%
rename from ImageBind/.assets/dog_audio.wav
rename to VideoRAG-algorithm/ImageBind/.assets/dog_audio.wav
diff --git a/ImageBind/.assets/dog_image.jpg b/VideoRAG-algorithm/ImageBind/.assets/dog_image.jpg
similarity index 100%
rename from ImageBind/.assets/dog_image.jpg
rename to VideoRAG-algorithm/ImageBind/.assets/dog_image.jpg
diff --git a/ImageBind/CODE_OF_CONDUCT.md b/VideoRAG-algorithm/ImageBind/CODE_OF_CONDUCT.md
similarity index 100%
rename from ImageBind/CODE_OF_CONDUCT.md
rename to VideoRAG-algorithm/ImageBind/CODE_OF_CONDUCT.md
diff --git a/ImageBind/CONTRIBUTING.md b/VideoRAG-algorithm/ImageBind/CONTRIBUTING.md
similarity index 100%
rename from ImageBind/CONTRIBUTING.md
rename to VideoRAG-algorithm/ImageBind/CONTRIBUTING.md
diff --git a/ImageBind/LICENSE b/VideoRAG-algorithm/ImageBind/LICENSE
similarity index 100%
rename from ImageBind/LICENSE
rename to VideoRAG-algorithm/ImageBind/LICENSE
diff --git a/ImageBind/README.md b/VideoRAG-algorithm/ImageBind/README.md
similarity index 100%
rename from ImageBind/README.md
rename to VideoRAG-algorithm/ImageBind/README.md
diff --git a/ImageBind/build/lib/imagebind/__init__.py b/VideoRAG-algorithm/ImageBind/build/lib/imagebind/__init__.py
similarity index 100%
rename from ImageBind/build/lib/imagebind/__init__.py
rename to VideoRAG-algorithm/ImageBind/build/lib/imagebind/__init__.py
diff --git a/ImageBind/build/lib/imagebind/bpe/bpe_simple_vocab_16e6.txt.gz b/VideoRAG-algorithm/ImageBind/build/lib/imagebind/bpe/bpe_simple_vocab_16e6.txt.gz
similarity index 100%
rename from ImageBind/build/lib/imagebind/bpe/bpe_simple_vocab_16e6.txt.gz
rename to VideoRAG-algorithm/ImageBind/build/lib/imagebind/bpe/bpe_simple_vocab_16e6.txt.gz
diff --git a/ImageBind/build/lib/imagebind/data.py b/VideoRAG-algorithm/ImageBind/build/lib/imagebind/data.py
similarity index 100%
rename from ImageBind/build/lib/imagebind/data.py
rename to VideoRAG-algorithm/ImageBind/build/lib/imagebind/data.py
diff --git a/ImageBind/build/lib/imagebind/models/__init__.py b/VideoRAG-algorithm/ImageBind/build/lib/imagebind/models/__init__.py
similarity index 100%
rename from ImageBind/build/lib/imagebind/models/__init__.py
rename to VideoRAG-algorithm/ImageBind/build/lib/imagebind/models/__init__.py
diff --git a/ImageBind/build/lib/imagebind/models/helpers.py b/VideoRAG-algorithm/ImageBind/build/lib/imagebind/models/helpers.py
similarity index 100%
rename from ImageBind/build/lib/imagebind/models/helpers.py
rename to VideoRAG-algorithm/ImageBind/build/lib/imagebind/models/helpers.py
diff --git a/ImageBind/build/lib/imagebind/models/imagebind_model.py b/VideoRAG-algorithm/ImageBind/build/lib/imagebind/models/imagebind_model.py
similarity index 100%
rename from ImageBind/build/lib/imagebind/models/imagebind_model.py
rename to VideoRAG-algorithm/ImageBind/build/lib/imagebind/models/imagebind_model.py
diff --git a/ImageBind/build/lib/imagebind/models/multimodal_preprocessors.py b/VideoRAG-algorithm/ImageBind/build/lib/imagebind/models/multimodal_preprocessors.py
similarity index 100%
rename from ImageBind/build/lib/imagebind/models/multimodal_preprocessors.py
rename to VideoRAG-algorithm/ImageBind/build/lib/imagebind/models/multimodal_preprocessors.py
diff --git a/ImageBind/build/lib/imagebind/models/transformer.py b/VideoRAG-algorithm/ImageBind/build/lib/imagebind/models/transformer.py
similarity index 100%
rename from ImageBind/build/lib/imagebind/models/transformer.py
rename to VideoRAG-algorithm/ImageBind/build/lib/imagebind/models/transformer.py
diff --git a/ImageBind/imagebind.egg-info/PKG-INFO b/VideoRAG-algorithm/ImageBind/imagebind.egg-info/PKG-INFO
similarity index 100%
rename from ImageBind/imagebind.egg-info/PKG-INFO
rename to VideoRAG-algorithm/ImageBind/imagebind.egg-info/PKG-INFO
diff --git a/ImageBind/imagebind.egg-info/SOURCES.txt b/VideoRAG-algorithm/ImageBind/imagebind.egg-info/SOURCES.txt
similarity index 100%
rename from ImageBind/imagebind.egg-info/SOURCES.txt
rename to VideoRAG-algorithm/ImageBind/imagebind.egg-info/SOURCES.txt
diff --git a/ImageBind/imagebind.egg-info/dependency_links.txt b/VideoRAG-algorithm/ImageBind/imagebind.egg-info/dependency_links.txt
similarity index 100%
rename from ImageBind/imagebind.egg-info/dependency_links.txt
rename to VideoRAG-algorithm/ImageBind/imagebind.egg-info/dependency_links.txt
diff --git a/ImageBind/imagebind.egg-info/top_level.txt b/VideoRAG-algorithm/ImageBind/imagebind.egg-info/top_level.txt
similarity index 100%
rename from ImageBind/imagebind.egg-info/top_level.txt
rename to VideoRAG-algorithm/ImageBind/imagebind.egg-info/top_level.txt
diff --git a/ImageBind/imagebind/__init__.py b/VideoRAG-algorithm/ImageBind/imagebind/__init__.py
similarity index 100%
rename from ImageBind/imagebind/__init__.py
rename to VideoRAG-algorithm/ImageBind/imagebind/__init__.py
diff --git a/ImageBind/imagebind/bpe/bpe_simple_vocab_16e6.txt.gz b/VideoRAG-algorithm/ImageBind/imagebind/bpe/bpe_simple_vocab_16e6.txt.gz
similarity index 100%
rename from ImageBind/imagebind/bpe/bpe_simple_vocab_16e6.txt.gz
rename to VideoRAG-algorithm/ImageBind/imagebind/bpe/bpe_simple_vocab_16e6.txt.gz
diff --git a/ImageBind/imagebind/data.py b/VideoRAG-algorithm/ImageBind/imagebind/data.py
similarity index 100%
rename from ImageBind/imagebind/data.py
rename to VideoRAG-algorithm/ImageBind/imagebind/data.py
diff --git a/ImageBind/imagebind/models/__init__.py b/VideoRAG-algorithm/ImageBind/imagebind/models/__init__.py
similarity index 100%
rename from ImageBind/imagebind/models/__init__.py
rename to VideoRAG-algorithm/ImageBind/imagebind/models/__init__.py
diff --git a/ImageBind/imagebind/models/helpers.py b/VideoRAG-algorithm/ImageBind/imagebind/models/helpers.py
similarity index 100%
rename from ImageBind/imagebind/models/helpers.py
rename to VideoRAG-algorithm/ImageBind/imagebind/models/helpers.py
diff --git a/ImageBind/imagebind/models/imagebind_model.py b/VideoRAG-algorithm/ImageBind/imagebind/models/imagebind_model.py
similarity index 100%
rename from ImageBind/imagebind/models/imagebind_model.py
rename to VideoRAG-algorithm/ImageBind/imagebind/models/imagebind_model.py
diff --git a/ImageBind/imagebind/models/multimodal_preprocessors.py b/VideoRAG-algorithm/ImageBind/imagebind/models/multimodal_preprocessors.py
similarity index 100%
rename from ImageBind/imagebind/models/multimodal_preprocessors.py
rename to VideoRAG-algorithm/ImageBind/imagebind/models/multimodal_preprocessors.py
diff --git a/ImageBind/imagebind/models/transformer.py b/VideoRAG-algorithm/ImageBind/imagebind/models/transformer.py
similarity index 100%
rename from ImageBind/imagebind/models/transformer.py
rename to VideoRAG-algorithm/ImageBind/imagebind/models/transformer.py
diff --git a/ImageBind/model_card.md b/VideoRAG-algorithm/ImageBind/model_card.md
similarity index 100%
rename from ImageBind/model_card.md
rename to VideoRAG-algorithm/ImageBind/model_card.md
diff --git a/ImageBind/requirements.txt b/VideoRAG-algorithm/ImageBind/requirements.txt
similarity index 100%
rename from ImageBind/requirements.txt
rename to VideoRAG-algorithm/ImageBind/requirements.txt
diff --git a/ImageBind/setup.py b/VideoRAG-algorithm/ImageBind/setup.py
similarity index 100%
rename from ImageBind/setup.py
rename to VideoRAG-algorithm/ImageBind/setup.py
diff --git a/VideoRAG-algorithm/README.md b/VideoRAG-algorithm/README.md
new file mode 100644
index 0000000..bb89730
--- /dev/null
+++ b/VideoRAG-algorithm/README.md
@@ -0,0 +1,336 @@
+<div align="center">
+
+# VideoRAG: Infinite Context Video AI
+
+</div>
+
+<br/>
+
+<img src='VideoRAG_cover.png' />
+
+ This is the PyTorch implementation for VideoRAG proposed in this paper:
+
+ >**VideoRAG: Retrieval-Augmented Generation with Extreme Long-Context Videos**
+ >Xubin Ren*, Lingrui Xu*, Long Xia, Shuaiqiang Wang, Dawei Yin, Chao Huang†
+
+\* denotes equal contribution.
+† denotes corresponding author
+
+ In this paper, we proposed a retrieval-augmented generation framework specifically designed for processing and understanding **extremely long-context videos**.
+
+## 📋 Table of Contents
+
+- [⚡ VideoRAG Framework](#-videorag-framework)
+- [🛠️ Installation](#️-installation)
+- [🚀 Quick Start](#-quick-start)
+- [🧪 Experiments](#-experiments)
+- [🦙 Ollama Support](#-ollama-support)
+- [📖 Citation](#-citation)
+- [🙏 Acknowledgement](#-acknowledgement)
+
+## ⚡ VideoRAG Framework
+
+<p align="center">
+<img src="VideoRAG.png" alt="VideoRAG" />
+</p>
+
+VideoRAG introduces a novel dual-channel architecture that synergistically combines graph-driven textual knowledge grounding for modeling cross-video semantic relationships with hierarchical multimodal context encoding to preserve spatiotemporal visual patterns, enabling unbounded-length video understanding through dynamically constructed knowledge graphs that maintain semantic coherence across multi-video contexts while optimizing retrieval efficiency via adaptive multimodal fusion mechanisms.
+
+💻 **Efficient Extreme Long-Context Video Processing**
+- Leveraging a Single NVIDIA RTX 3090 GPU (24G) to comprehend Hundreds of Hours of video content 💪
+
+🗃️ **Structured Video Knowledge Indexing**
+- Multi-Modal Knowledge Indexing Framework distills hundreds of hours of video into a concise, structured knowledge graph 🗂️
+
+🔍 **Multi-Modal Retrieval for Comprehensive Responses**
+- Multi-Modal Retrieval Paradigm aligns textual semantics and visual content to identify the most relevant video for comprehensive responses 💬
+
+📚 **The New Established LongerVideos Benchmark**
+- The new established LongerVideos Benchmark features over 160 Videos totaling 134+ Hours across lectures, documentaries, and entertainment 🎬
+
+## 🛠️ Installation
+
+### 📦 Environment Setup
+
+To utilize VideoRAG, please first create a conda environment with the following commands:
+
+```bash
+# Create and activate conda environment
+conda create --name videorag python=3.11
+conda activate videorag
+```
+
+### 📚 Core Dependencies
+
+Install the essential packages for VideoRAG:
+
+```bash
+# Core numerical and deep learning libraries
+pip install numpy==1.26.4
+pip install torch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2
+pip install accelerate==0.30.1
+pip install bitsandbytes==0.43.1
+
+# Video processing utilities
+pip install moviepy==1.0.3
+pip install git+https://github.com/facebookresearch/pytorchvideo.git@28fe037d212663c6a24f373b94cc5d478c8c1a1d
+
+# Multi-modal and vision libraries
+pip install timm ftfy regex einops fvcore eva-decord==0.6.1 iopath matplotlib types-regex cartopy
+
+# Audio processing and vector databases
+pip install ctranslate2==4.4.0 faster_whisper==1.0.3 neo4j hnswlib xxhash nano-vectordb
+
+# Language models and utilities
+pip install transformers==4.37.1
+pip install tiktoken openai tenacity
+```
+
+### 🔧 ImageBind Installation
+
+Install ImageBind using the provided code in this repository:
+
+```bash
+cd ImageBind
+pip install .
+```
+
+### 📥 Model Checkpoints
+
+Download the necessary checkpoints in **the repository's root folder** for MiniCPM-V, Whisper, and ImageBind:
+
+```bash
+# Ensure git-lfs is installed
+git lfs install
+
+# Download MiniCPM-V model
+git lfs clone https://huggingface.co/openbmb/MiniCPM-V-2_6-int4
+
+# Download Whisper model
+git lfs clone https://huggingface.co/Systran/faster-distil-whisper-large-v3
+
+# Download ImageBind checkpoint
+mkdir .checkpoints
+cd .checkpoints
+wget https://dl.fbaipublicfiles.com/imagebind/imagebind_huge.pth
+cd ../
+```
+
+### 📁 Final Directory Structure
+
+Your final directory structure after downloading all checkpoints should look like this:
+
+```shell
+VideoRAG/
+├── .checkpoints/
+├── faster-distil-whisper-large-v3/
+├── ImageBind/
+├── LICENSE
+├── longervideos/
+├── MiniCPM-V-2_6-int4/
+├── README.md
+├── reproduce/
+├── notesbooks/
+├── videorag/
+├── VideoRAG_cover.png
+└── VideoRAG.png
+```
+
+## 🚀 Quick Start
+
+VideoRAG is capable of extracting knowledge from multiple videos and answering queries based on those videos. Now, try VideoRAG with your own videos 🤗.
+
+> [!NOTE]
+> Currently, VideoRAG has only been tested in an English environment. To process videos in multiple languages, it is recommended to modify the ```WhisperModel``` in [asr.py](https://github.com/HKUDS/VideoRAG/blob/main/videorag/_videoutil/asr.py). For more details, please refer to [faster-whisper](https://github.com/systran/faster-whisper).
+
+**At first**, let the VideoRAG extract and indexing the knowledge from given videos (Only one GPU with 24GB of memory is sufficient, such as the RTX 3090):
+```python
+import os
+import logging
+import warnings
+import multiprocessing
+
+warnings.filterwarnings("ignore")
+logging.getLogger("httpx").setLevel(logging.WARNING)
+
+# Please enter your openai key
+os.environ["OPENAI_API_KEY"] = ""
+
+from videorag._llm import openai_4o_mini_config
+from videorag import VideoRAG, QueryParam
+
+
+if __name__ == '__main__':
+ multiprocessing.set_start_method('spawn')
+
+ # Please enter your video file path in this list; there is no limit on the length.
+ # Here is an example; you can use your own videos instead.
+ video_paths = [
+ 'movies/Iron-Man.mp4',
+ 'movies/Spider-Man.mkv',
+ ]
+ videorag = VideoRAG(llm=openai_4o_mini_config, working_dir=f"./videorag-workdir")
+ videorag.insert_video(video_path_list=video_paths)
+```
+
+**Then**, ask any questions about the videos! Here is an exmaple:
+```python
+import os
+import logging
+import warnings
+import multiprocessing
+
+warnings.filterwarnings("ignore")
+logging.getLogger("httpx").setLevel(logging.WARNING)
+
+# Please enter your openai key
+os.environ["OPENAI_API_KEY"] = ""
+
+from videorag._llm import *
+from videorag import VideoRAG, QueryParam
+
+
+if __name__ == '__main__':
+ multiprocessing.set_start_method('spawn')
+
+ query = 'What is the relationship between Iron Man and Spider-Man? How do they meet, and how does Iron Man help Spider-Man?'
+ param = QueryParam(mode="videorag")
+ # if param.wo_reference = False, VideoRAG will add reference to video clips in the response
+ param.wo_reference = True
+
+ videorag = videorag = VideoRAG(llm=openai_4o_mini_config, working_dir=f"./videorag-workdir")
+ videorag.load_caption_model(debug=False)
+ response = videorag.query(query=query, param=param)
+ print(response)
+```
+
+## 🧪 Experiments
+
+### LongerVideos
+We constructed the LongerVideos benchmark to evaluate the model's performance in comprehending multiple long-context videos and answering open-ended queries. All the videos are open-access videos on YouTube, and we record the URLs of the collections of videos as well as the corresponding queries in the [JSON](https://github.com/HKUDS/VideoRAG/longervideos/dataset.json) file.
+
+| Video Type | #video list | #video | #query | #avg. queries per list | #overall duration |
+|------------------|------------:|-------:|-------:|-----------------------:|-------------------------|
+| **Lecture** | 12 | 135 | 376 | 31.3 | ~ 64.3 hours |
+| **Documentary** | 5 | 12 | 114 | 22.8 | ~ 28.5 hours |
+| **Entertainment**| 5 | 17 | 112 | 22.4 | ~ 41.9 hours |
+| **All** | 22 | 164 | 602 | 27.4 | ~ 134.6 hours |
+
+### Process LongerVideos with VideoRAG
+
+Here are the commands you can refer to for preparing the videos used in LongerVideos.
+
+```shell
+cd longervideos
+python prepare_data.py # create collection folders
+sh download.sh # obtain videos
+```
+
+Then, you can run the following example command to process and answer queries for LongerVideos with VideoRAG:
+
+```shell
+# Please enter your openai_key in line 19 at first
+python videorag_longervideos.py --collection 4-rag-lecture --cuda 0
+```
+
+### Evaluation
+
+We conduct win-rate comparisons as well as quantitative comparisons with RAG-based baselines and long-context video understanding methods separately. **NaiveRAG, GraphRAG and LightRAG** are implemented using the `nano-graphrag` library, which is consistent with our VideoRAG, ensuring a fair comparison.
+
+In this part, we directly provided the **answers from all the methods** (including VideoRAG) as well as the evaluation codes for experiment reproduction. Please utilize the following commands to download the answers:
+
+```shell
+cd reproduce
+wget https://archive.org/download/videorag/all_answers.zip
+unzip all_answers
+```
+
+#### Win-Rate Comparison
+
+We conduct the win-rate comparison with RAG-based baselines. To reproduce the results, please follow these steps:
+
+```shell
+cd reproduce/winrate_comparison
+
+# First Step: Upload the batch request to OpenAI (remember to enter your key in the file, same for the following steps).
+python batch_winrate_eval_upload.py
+
+# Second Step: Download the results. Please enter the batch ID and then the output file ID in the file. Generally, you need to run this twice: first to obtain the output file ID, and then to download it.
+python batch_winrate_eval_download.py
+
+# Third Step: Parsing the results. Please the output file ID in the file.
+python batch_winrate_eval_parse.py
+
+# Fourth Step: Calculate the results. Please enter the parsed result file name in the file.
+python batch_winrate_eval_calculate.py
+
+```
+
+#### Quantitative Comparison
+
+We conduct a quantitative comparison, which extends the win-rate comparison by assigning a 5-point score to long-context video understanding methods. We use the answers from NaiveRAG as the baseline response for scoring each query. To reproduce the results, please follow these steps:
+
+```shell
+cd reproduce/quantitative_comparison
+
+# First Step: Upload the batch request to OpenAI (remember to enter your key in the file, same for the following steps).
+python batch_quant_eval_upload.py
+
+# Second Step: Download the results. Please enter the batch ID and then the output file ID in the file. Generally, you need to run this twice: first to obtain the output file ID, and then to download it.
+python batch_quant_eval_download.py
+
+# Third Step: Parsing the results. Please the output file ID in the file.
+python batch_quant_eval_parse.py
+
+# Fourth Step: Calculate the results. Please enter the parsed result file name in the file.
+python batch_quant_eval_calculate.py
+```
+
+## 🦙 Ollama Support
+
+This project also supports ollama. To use, edit the ollama_config in [_llm.py](https://github.com/HKUDS/VideoRAG/blob/main/videorag/_llm.py).
+Adjust the paramters of the models being used
+
+```
+ollama_config = LLMConfig(
+ embedding_func_raw = ollama_embedding,
+ embedding_model_name = "nomic-embed-text",
+ embedding_dim = 768,
+ embedding_max_token_size=8192,
+ embedding_batch_num = 1,
+ embedding_func_max_async = 1,
+ query_better_than_threshold = 0.2,
+ best_model_func_raw = ollama_complete ,
+ best_model_name = "gemma2:latest", # need to be a solid instruct model
+ best_model_max_token_size = 32768,
+ best_model_max_async = 1,
+ cheap_model_func_raw = ollama_mini_complete,
+ cheap_model_name = "olmo2",
+ cheap_model_max_token_size = 32768,
+ cheap_model_max_async = 1
+)
+```
+And specify the config when creating your VideoRag instance
+
+### Jupyter Notebook
+To test the solution on a single video, just load the notebook in the [notebook folder](VideoRAG/nodebooks) and
+update the paramters to fit your situation.
+
+## 📖 Citation
+If you find this work is helpful to your research, please consider citing our paper:
+```bibtex
+@article{VideoRAG,
+ title={VideoRAG: Retrieval-Augmented Generation with Extreme Long-Context Videos},
+ author={Ren, Xubin and Xu, Lingrui and Xia, Long and Wang, Shuaiqiang and Yin, Dawei and Huang, Chao},
+ journal={arXiv preprint arXiv:2502.01549},
+ year={2025}
+}
+```
+
+## 🙏 Acknowledgement
+
+We extend our heartfelt gratitude to the open-source community and the foundational projects that made VideoRAG possible. Special thanks to the creators and maintainers of [nano-graphrag](https://github.com/gusye1234/nano-graphrag) and [LightRAG](https://github.com/HKUDS/LightRAG) for their pioneering work in graph-based retrieval systems.
+
+Our framework builds upon the collective wisdom of these exceptional projects, and we are honored to contribute to the advancement of multimodal AI research. We also acknowledge the broader research community for their continued dedication to pushing the boundaries of video understanding and retrieval-augmented generation.
+
+**🌟 Thank you for your interest in our work! Together, we're shaping the future of intelligent video AI. 🌟**
diff --git a/VideoRAG.png b/VideoRAG-algorithm/VideoRAG.png
similarity index 100%
rename from VideoRAG.png
rename to VideoRAG-algorithm/VideoRAG.png
diff --git a/VideoRAG_cover.png b/VideoRAG-algorithm/VideoRAG_cover.png
similarity index 100%
rename from VideoRAG_cover.png
rename to VideoRAG-algorithm/VideoRAG_cover.png
diff --git a/longervideos/dataset.json b/VideoRAG-algorithm/longervideos/dataset.json
similarity index 100%
rename from longervideos/dataset.json
rename to VideoRAG-algorithm/longervideos/dataset.json
diff --git a/longervideos/download.sh b/VideoRAG-algorithm/longervideos/download.sh
similarity index 100%
rename from longervideos/download.sh
rename to VideoRAG-algorithm/longervideos/download.sh
diff --git a/longervideos/prepare_data.py b/VideoRAG-algorithm/longervideos/prepare_data.py
similarity index 100%
rename from longervideos/prepare_data.py
rename to VideoRAG-algorithm/longervideos/prepare_data.py
diff --git a/notesbooks/videorag.ipynb b/VideoRAG-algorithm/notesbooks/videorag.ipynb
similarity index 100%
rename from notesbooks/videorag.ipynb
rename to VideoRAG-algorithm/notesbooks/videorag.ipynb
diff --git a/process_videos.py b/VideoRAG-algorithm/process_videos.py
similarity index 100%
rename from process_videos.py
rename to VideoRAG-algorithm/process_videos.py
diff --git a/query_videos.py b/VideoRAG-algorithm/query_videos.py
similarity index 100%
rename from query_videos.py
rename to VideoRAG-algorithm/query_videos.py
diff --git a/reproduce/quantitative_comparison/batch_quant_eval_calculate.py b/VideoRAG-algorithm/reproduce/quantitative_comparison/batch_quant_eval_calculate.py
similarity index 100%
rename from reproduce/quantitative_comparison/batch_quant_eval_calculate.py
rename to VideoRAG-algorithm/reproduce/quantitative_comparison/batch_quant_eval_calculate.py
diff --git a/reproduce/quantitative_comparison/batch_quant_eval_download.py b/VideoRAG-algorithm/reproduce/quantitative_comparison/batch_quant_eval_download.py
similarity index 100%
rename from reproduce/quantitative_comparison/batch_quant_eval_download.py
rename to VideoRAG-algorithm/reproduce/quantitative_comparison/batch_quant_eval_download.py
diff --git a/reproduce/quantitative_comparison/batch_quant_eval_parse.py b/VideoRAG-algorithm/reproduce/quantitative_comparison/batch_quant_eval_parse.py
similarity index 100%
rename from reproduce/quantitative_comparison/batch_quant_eval_parse.py
rename to VideoRAG-algorithm/reproduce/quantitative_comparison/batch_quant_eval_parse.py
diff --git a/reproduce/quantitative_comparison/batch_quant_eval_upload.py b/VideoRAG-algorithm/reproduce/quantitative_comparison/batch_quant_eval_upload.py
similarity index 100%
rename from reproduce/quantitative_comparison/batch_quant_eval_upload.py
rename to VideoRAG-algorithm/reproduce/quantitative_comparison/batch_quant_eval_upload.py
diff --git a/reproduce/winrate_comparison/batch_winrate_eval_calculate.py b/VideoRAG-algorithm/reproduce/winrate_comparison/batch_winrate_eval_calculate.py
similarity index 100%
rename from reproduce/winrate_comparison/batch_winrate_eval_calculate.py
rename to VideoRAG-algorithm/reproduce/winrate_comparison/batch_winrate_eval_calculate.py
diff --git a/reproduce/winrate_comparison/batch_winrate_eval_download.py b/VideoRAG-algorithm/reproduce/winrate_comparison/batch_winrate_eval_download.py
similarity index 100%
rename from reproduce/winrate_comparison/batch_winrate_eval_download.py
rename to VideoRAG-algorithm/reproduce/winrate_comparison/batch_winrate_eval_download.py
diff --git a/reproduce/winrate_comparison/batch_winrate_eval_parse.py b/VideoRAG-algorithm/reproduce/winrate_comparison/batch_winrate_eval_parse.py
similarity index 100%
rename from reproduce/winrate_comparison/batch_winrate_eval_parse.py
rename to VideoRAG-algorithm/reproduce/winrate_comparison/batch_winrate_eval_parse.py
diff --git a/reproduce/winrate_comparison/batch_winrate_eval_upload.py b/VideoRAG-algorithm/reproduce/winrate_comparison/batch_winrate_eval_upload.py
similarity index 100%
rename from reproduce/winrate_comparison/batch_winrate_eval_upload.py
rename to VideoRAG-algorithm/reproduce/winrate_comparison/batch_winrate_eval_upload.py
diff --git a/videorag/__init__.py b/VideoRAG-algorithm/videorag/__init__.py
similarity index 100%
rename from videorag/__init__.py
rename to VideoRAG-algorithm/videorag/__init__.py
diff --git a/videorag/_llm.py b/VideoRAG-algorithm/videorag/_llm.py
similarity index 100%
rename from videorag/_llm.py
rename to VideoRAG-algorithm/videorag/_llm.py
diff --git a/videorag/_op.py b/VideoRAG-algorithm/videorag/_op.py
similarity index 100%
rename from videorag/_op.py
rename to VideoRAG-algorithm/videorag/_op.py
diff --git a/videorag/_splitter.py b/VideoRAG-algorithm/videorag/_splitter.py
similarity index 100%
rename from videorag/_splitter.py
rename to VideoRAG-algorithm/videorag/_splitter.py
diff --git a/videorag/_storage/__init__.py b/VideoRAG-algorithm/videorag/_storage/__init__.py
similarity index 100%
rename from videorag/_storage/__init__.py
rename to VideoRAG-algorithm/videorag/_storage/__init__.py
diff --git a/videorag/_storage/gdb_neo4j.py b/VideoRAG-algorithm/videorag/_storage/gdb_neo4j.py
similarity index 100%
rename from videorag/_storage/gdb_neo4j.py
rename to VideoRAG-algorithm/videorag/_storage/gdb_neo4j.py
diff --git a/videorag/_storage/gdb_networkx.py b/VideoRAG-algorithm/videorag/_storage/gdb_networkx.py
similarity index 100%
rename from videorag/_storage/gdb_networkx.py
rename to VideoRAG-algorithm/videorag/_storage/gdb_networkx.py
diff --git a/videorag/_storage/kv_json.py b/VideoRAG-algorithm/videorag/_storage/kv_json.py
similarity index 100%
rename from videorag/_storage/kv_json.py
rename to VideoRAG-algorithm/videorag/_storage/kv_json.py
diff --git a/videorag/_storage/vdb_hnswlib.py b/VideoRAG-algorithm/videorag/_storage/vdb_hnswlib.py
similarity index 100%
rename from videorag/_storage/vdb_hnswlib.py
rename to VideoRAG-algorithm/videorag/_storage/vdb_hnswlib.py
diff --git a/videorag/_storage/vdb_nanovectordb.py b/VideoRAG-algorithm/videorag/_storage/vdb_nanovectordb.py
similarity index 100%
rename from videorag/_storage/vdb_nanovectordb.py
rename to VideoRAG-algorithm/videorag/_storage/vdb_nanovectordb.py
diff --git a/videorag/_utils.py b/VideoRAG-algorithm/videorag/_utils.py
similarity index 100%
rename from videorag/_utils.py
rename to VideoRAG-algorithm/videorag/_utils.py
diff --git a/videorag/_videoutil/__init__.py b/VideoRAG-algorithm/videorag/_videoutil/__init__.py
similarity index 100%
rename from videorag/_videoutil/__init__.py
rename to VideoRAG-algorithm/videorag/_videoutil/__init__.py
diff --git a/videorag/_videoutil/asr.py b/VideoRAG-algorithm/videorag/_videoutil/asr.py
similarity index 100%
rename from videorag/_videoutil/asr.py
rename to VideoRAG-algorithm/videorag/_videoutil/asr.py
diff --git a/videorag/_videoutil/caption.py b/VideoRAG-algorithm/videorag/_videoutil/caption.py
similarity index 100%
rename from videorag/_videoutil/caption.py
rename to VideoRAG-algorithm/videorag/_videoutil/caption.py
diff --git a/videorag/_videoutil/feature.py b/VideoRAG-algorithm/videorag/_videoutil/feature.py
similarity index 100%
rename from videorag/_videoutil/feature.py
rename to VideoRAG-algorithm/videorag/_videoutil/feature.py
diff --git a/videorag/_videoutil/split.py b/VideoRAG-algorithm/videorag/_videoutil/split.py
similarity index 100%
rename from videorag/_videoutil/split.py
rename to VideoRAG-algorithm/videorag/_videoutil/split.py
diff --git a/videorag/base.py b/VideoRAG-algorithm/videorag/base.py
similarity index 100%
rename from videorag/base.py
rename to VideoRAG-algorithm/videorag/base.py
diff --git a/videorag/prompt.py b/VideoRAG-algorithm/videorag/prompt.py
similarity index 100%
rename from videorag/prompt.py
rename to VideoRAG-algorithm/videorag/prompt.py
diff --git a/videorag/videorag.py b/VideoRAG-algorithm/videorag/videorag.py
similarity index 100%
rename from videorag/videorag.py
rename to VideoRAG-algorithm/videorag/videorag.py
diff --git a/videorag_longervideos.py b/VideoRAG-algorithm/videorag_longervideos.py
similarity index 100%
rename from videorag_longervideos.py
rename to VideoRAG-algorithm/videorag_longervideos.py
diff --git a/Vimo-desktop/.gitignore b/Vimo-desktop/.gitignore
new file mode 100644
index 0000000..5322d10
--- /dev/null
+++ b/Vimo-desktop/.gitignore
@@ -0,0 +1,128 @@
+# Dependencies
+node_modules/
+bower_components/
+
+# Build outputs
+dist/
+out/
+build/
+*.tsbuildinfo
+python_backend/build/
+python_backend/dist/
+python_backend/log.txt
+python_backend/videorag_api.spec
+resources/
+electron-builder.yml
+package_build.json
+
+# Python
+__pycache__/
+*.py[cod]
+*$py.class
+*.so
+.Python
+env/
+venv/
+ENV/
+env.bak/
+venv.bak/
+*.egg-info/
+.pytest_cache/
+.coverage
+htmlcov/
+
+# Environment files
+.env
+.env.local
+.env.production
+.env.development
+.env.test
+
+# OS files
+.DS_Store
+.DS_Store?
+._*
+.Spotlight-V100
+.Trashes
+ehthumbs.db
+Thumbs.db
+Desktop.ini
+
+# IDE files
+.vscode/
+.idea/
+*.swp
+*.swo
+*~
+.project
+.classpath
+.settings/
+
+# Logs
+*.log
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+pnpm-debug.log*
+
+# Runtime data
+pids
+*.pid
+*.seed
+*.pid.lock
+
+# Coverage directory used by tools like istanbul
+coverage/
+*.lcov
+
+# Dependency directories
+jspm_packages/
+
+# Optional npm cache directory
+.npm
+
+# Optional eslint cache
+.eslintcache
+
+# Microbundle cache
+.rpt2_cache/
+.rts2_cache_cjs/
+.rts2_cache_es/
+.rts2_cache_umd/
+
+# Optional REPL history
+.node_repl_history
+
+# Output of 'npm pack'
+*.tgz
+
+# Yarn Integrity file
+.yarn-integrity
+
+# dotenv environment variables file
+.env.test
+
+# parcel-bundler cache (https://parceljs.org/)
+.cache
+.parcel-cache
+
+# next.js build output
+.next
+
+# nuxt.js build output
+.nuxt
+
+# vuepress build output
+.vuepress/dist
+
+# Serverless directories
+.serverless/
+
+# FuseBox cache
+.fusebox/
+
+# DynamoDB Local files
+.dynamodb/
+
+# TernJS port file
+.tern-port
\ No newline at end of file
diff --git a/Vimo-desktop/README.md b/Vimo-desktop/README.md
new file mode 100644
index 0000000..1ddd3aa
--- /dev/null
+++ b/Vimo-desktop/README.md
@@ -0,0 +1,133 @@
+
+<div align="center">
+ <picture>
+ <img src="figures/Vimo-logo.png" width="30%" alt="Vimo: Agentic Video Understanding">
+ </picture>
+
+ <h1>Vimo: Chat with Your Videos</h1>
+
+
+ [![Version](https://img.shields.io/badge/version-Beta-blue.svg)](package.json)
+ [![Status](https://img.shields.io/badge/status-In%20Development-yellow.svg)]()
+ [![Platform](https://img.shields.io/badge/platform-macOS%20|%20Windows%20|%20Linux-lightgrey.svg)]()
+ [![arXiv](https://img.shields.io/badge/arXiv-2502.01549-b31b1b.svg)](https://arxiv.org/abs/2502.01549)
+ [![Powered by](https://img.shields.io/badge/powered%20by-VideoRAG-orange.svg)](https://github.com/HKUDS/VideoRAG)
+ [![Visitors](https://komarev.com/ghpvc/?username=HKUDS&repo=Vimo&style=flat-square&label=Visitors&color=blue)](https://github.com/HKUDS/Vimo)
+
+</div>
+
+## 1. Introduction
+
+Vimo is a state-of-the-art agentic video understanding platform with intelligent conversational capabilities and comprehensive video analysis. Built upon the advanced [VideoRAG](https://github.com/HKUDS/VideoRAG) technology from HKUDS, Vimo achieves exceptional performance across video comprehension, content extraction, and interactive QA tasks while being meticulously optimized for real-world deployment scenarios.
+
+<div align="center">
+ <a href="https://www.youtube.com/watch?v=T9yo4mY2cms">
+ <img src="https://img.youtube.com/vi/T9yo4mY2cms/maxresdefault.jpg" width="80%" alt="Vimo Introduction Video">
+ </a>
+</div>
+
+### Key Features
+
+* **Agentic Intelligence**: Specifically designed for conversational video analysis, autonomous content understanding, and intelligent user interaction.
+* **Multi-modal Processing**: Advanced fusion of visual, audio, and temporal information for comprehensive video understanding.
+* **Real-time Interaction**: Optimized for responsive user experience with efficient query responses.
+
+### Core Technology
+
+Vimo is powered by [VideoRAG](https://github.com/HKUDS/VideoRAG), which is a retrieval-augmented generation framework specifically designed for processing and understanding extremely long-context videos. For detailed performance comparison, please refer to our [paper](https://arxiv.org/abs/2502.01549).
+
+<div align="center">
+ <picture>
+ <img src="figures/table.png" width="100%" alt="Vimo: Agentic Video Understanding">
+ </picture>
+</div>
+
+## 2. Quick Start
+
+### Option 1: Install Vimo App & Run it
+
+> [!NOTE]
+> We are starting with a **Beta version** and will continuously improve our Vimo based on feedback and suggestions from the open-source community. The first packaged release will be available once we complete our preparations.
+> Future releases will be available for **macOS Apple Silicon** first, with Windows and Linux versions coming later!
+
+<div align="left">
+ <a href="https://github.com/HKUDS/Vimo">
+ <img src="https://img.shields.io/badge/Coming%20Soon-Mac-007ACC?style=for-the-badge&logo=apple&logoColor=white" alt="Coming Soon - Mac Release" height="60">
+ </a>
+</div>
+
+The packaged version will be available soon! In the meantime, please use Option 2 to run Vimo from source code.
+
+
+
+### Option 2: Run Vimo from Source Code
+
+> [!NOTE]
+> Ensure the backend service is running before launching the frontend application.
+> This setup has been tested and verified to work seamlessly on macOS with M1 chips.
+
+#### Step 1: Set Up and Start Backend Service
+
+Since Vimo utilizes a Python-based VideoRAG server as its backend, please follow the steps below to create the appropriate Python environment:
+
+```bash
+conda create --name vimo python=3.11
+conda activate vimo
+
+# Core numerical and deep learning libraries
+pip install numpy==1.26.4 torch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2
+
+# Video processing utilities
+pip install moviepy==1.0.3
+pip install git+https://github.com/Re-bin/pytorchvideo.git@58f50da4e4b7bf0b17b1211dc6b283ba42e522df
+pip install --no-deps git+https://github.com/facebookresearch/ImageBind.git@3fcf5c9039de97f6ff5528ee4a9dce903c5979b3
+
+# Multi-modal and vision libraries
+pip install timm ftfy regex einops fvcore eva-decord==0.6.1 iopath matplotlib types-regex cartopy
+
+# Audio processing and vector databases
+pip install neo4j hnswlib xxhash nano-vectordb
+
+# Language models and utilities
+pip install tiktoken openai tenacity dashscope
+
+# Server
+pip install flask psutil flask_cors setproctitle
+```
+
+Once the environment is set up, start the VideoRAG server using the following commands:
+
+``` bash
+# Navigate to backend directory and start API server
+cd python_backend
+python videorag_api.py
+```
+
+#### Step 2: Launch Frontend Application
+
+After successfully starting the backend service, proceed to launch the frontend application by running the following commands in the project root directory:
+
+```bash
+# Install dependencies
+pnpm install
+
+# Start development server
+pnpm dev
+```
+
+> ⚠️ **File Location Notice (Current Version)**: Once a video is imported into Vimo, avoid moving or renaming the video file on your computer. In the current beta version, changing the file path may disrupt Vimo's ability to access the video. This limitation will be addressed in future releases.
+
+## 3. Contribution
+
+We embrace the open-source spirit and welcome contributions from the community! Whether you're fixing bugs, adding features, improving documentation, or suggesting enhancements, your contributions help make Vimo better for everyone.
+
+🤗 Feel free to submit issues and pull requests!
+
+## 4. Acknowledgement
+
+We would like to express our gratitude to the following open-source projects that have inspired and contributed to Vimo's development:
+
+- **[nano-graphrag](https://github.com/gusye1234/nano-graphrag)**: For providing innovative algorithms and techniques that enhanced our video understanding capabilities.
+- **[uitars-desktop](https://github.com/bytedance/UI-TARS-desktop)**: For inspiring our frontend development approach and providing valuable insights into desktop application architecture.
+
+Thank you to these amazing projects and their contributors! 🙏
diff --git a/Vimo-desktop/electron.vite.config.ts b/Vimo-desktop/electron.vite.config.ts
new file mode 100644
index 0000000..b1430a4
--- /dev/null
+++ b/Vimo-desktop/electron.vite.config.ts
@@ -0,0 +1,55 @@
+import { resolve } from 'node:path';
+import react from '@vitejs/plugin-react';
+import { defineConfig, externalizeDepsPlugin } from 'electron-vite';
+
+export default defineConfig({
+ main: {
+ build: {
+ outDir: 'dist/main',
+ lib: {
+ entry: './src/main/main.ts'
+ }
+ },
+ plugins: [externalizeDepsPlugin()]
+ },
+ preload: {
+ build: {
+ outDir: 'dist/preload',
+ lib: {
+ entry: './src/preload/index.ts'
+ }
+ },
+ plugins: [externalizeDepsPlugin()]
+ },
+ renderer: {
+ build: {
+ outDir: 'dist/renderer',
+ rollupOptions: {
+ input: './src/renderer/index.html'
+ }
+ },
+ plugins: [react()],
+ define: {
+ APP_VERSION: JSON.stringify(process.env.npm_package_version || '0.1.0')
+ },
+ resolve: {
+ alias: {
+ '@': resolve(__dirname, 'src'),
+ '@renderer': resolve(__dirname, 'src/renderer/src'),
+ '@main': resolve(__dirname, 'src/main'),
+ '@preload': resolve(__dirname, 'src/preload')
+ }
+ },
+ server: {
+ watch: {
+ ignored: [
+ '**/python_backend/**',
+ '**/node_modules/**',
+ '**/dist/**',
+ '**/out/**',
+ '**/.git/**'
+ ]
+ }
+ }
+ }
+});
diff --git a/Vimo-desktop/figures/Vimo-logo.png b/Vimo-desktop/figures/Vimo-logo.png
new file mode 100644
index 0000000..3f7b7ef
Binary files /dev/null and b/Vimo-desktop/figures/Vimo-logo.png differ
diff --git a/Vimo-desktop/figures/table.png b/Vimo-desktop/figures/table.png
new file mode 100644
index 0000000..d0f947f
Binary files /dev/null and b/Vimo-desktop/figures/table.png differ
diff --git a/Vimo-desktop/package.json b/Vimo-desktop/package.json
new file mode 100644
index 0000000..c4b756d
--- /dev/null
+++ b/Vimo-desktop/package.json
@@ -0,0 +1,53 @@
+{
+ "main": "./dist/main/main.js",
+ "packageManager": "[email protected]",
+ "scripts": {
+ "format": "prettier --write .",
+ "lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix",
+ "dev": "electron-vite dev --watch"
+ },
+ "dependencies": {
+ "axios": "^1.10.0",
+ "electron-store": "^10.1.0"
+ },
+ "devDependencies": {
+ "@electron-toolkit/eslint-config-prettier": "^2.0.0",
+ "@electron-toolkit/eslint-config-ts": "^2.0.0",
+ "@electron-toolkit/preload": "^3.0.2",
+ "@electron-toolkit/tsconfig": "^1.0.1",
+ "@electron-toolkit/utils": "^3.0.0",
+ "@radix-ui/react-slot": "^1.2.3",
+ "@tailwindcss/postcss": "^4.1.11",
+ "@tailwindcss/vite": "^4.1.3",
+ "@types/node": "^20.19.2",
+ "@types/react": "^18.3.23",
+ "@types/react-dom": "^18.3.7",
+ "@typescript-eslint/eslint-plugin": "^5.62.0",
+ "@typescript-eslint/parser": "^5.62.0",
+ "@vitejs/plugin-react": "^4.6.0",
+ "autoprefixer": "^10.4.21",
+ "class-variance-authority": "^0.7.1",
+ "clsx": "^2.1.1",
+ "cross-env": "^7.0.3",
+ "electron": "^34.1.1",
+ "electron-builder": "^26.0.12",
+ "electron-vite": "^3.1.0",
+ "eslint": "^8.57.1",
+ "eslint-plugin-react": "^7.37.5",
+ "lucide-react": "^0.468.0",
+ "postcss": "^8.5.6",
+ "prettier": "^3.6.2",
+ "react": "^18.3.1",
+ "react-dom": "^18.3.1",
+ "react-router": "^7.6.3",
+ "rimraf": "^6.0.1",
+ "sonner": "^1.7.4",
+ "tailwind-merge": "^2.6.0",
+ "tailwindcss": "^4.1.11",
+ "typescript": "^5.8.3",
+ "vite": "^6.3.5"
+ },
+ "engines": {
+ "node": ">=20.x"
+ }
+}
\ No newline at end of file
diff --git a/Vimo-desktop/pnpm-lock.yaml b/Vimo-desktop/pnpm-lock.yaml
new file mode 100644
index 0000000..3d399d8
--- /dev/null
+++ b/Vimo-desktop/pnpm-lock.yaml
@@ -0,0 +1,6883 @@
+lockfileVersion: '9.0'
+
+settings:
+ autoInstallPeers: true
+ excludeLinksFromLockfile: false
+
+importers:
+
+ .:
+ dependencies:
+ axios:
+ specifier: ^1.6.0
+ version: 1.10.0
+ electron-store:
+ specifier: ^10.0.0
+ version: 10.1.0
+ devDependencies:
+ '@electron-toolkit/eslint-config-prettier':
+ specifier: ^2.0.0
+ '@electron-toolkit/eslint-config-ts':
+ specifier: ^2.0.0
+ '@electron-toolkit/preload':
+ specifier: ^3.0.1
+ version: 3.0.2([email protected])
+ '@electron-toolkit/tsconfig':
+ specifier: ^1.0.1
+ version: 1.0.1(@types/[email protected])
+ '@electron-toolkit/utils':
+ specifier: ^3.0.0
+ version: 3.0.0([email protected])
+ '@radix-ui/react-slot':
+ specifier: ^1.1.0
+ version: 1.2.3(@types/[email protected])([email protected])
+ '@tailwindcss/postcss':
+ specifier: ^4.1.11
+ version: 4.1.11
+ '@tailwindcss/vite':
+ specifier: 4.1.3
+ '@types/node':
+ specifier: ^20.14.8
+ version: 20.19.2
+ '@types/react':
+ specifier: ^18.3.12
+ version: 18.3.23
+ '@types/react-dom':
+ specifier: ^18.3.1
+ version: 18.3.7(@types/[email protected])
+ '@typescript-eslint/eslint-plugin':
+ specifier: ^5.0.0
+ '@typescript-eslint/parser':
+ specifier: ^5.0.0
+ '@vitejs/plugin-react':
+ specifier: ^4.3.4
+ autoprefixer:
+ specifier: ^10.4.21
+ version: 10.4.21([email protected])
+ class-variance-authority:
+ specifier: ^0.7.1
+ version: 0.7.1
+ clsx:
+ specifier: ^2.1.1
+ version: 2.1.1
+ cross-env:
+ specifier: ^7.0.3
+ version: 7.0.3
+ electron:
+ specifier: 34.1.1
+ version: 34.1.1
+ electron-builder:
+ specifier: ^26.0.12
+ electron-vite:
+ specifier: ^3.0.0
+ eslint:
+ specifier: ^8.57.0
+ version: 8.57.1
+ eslint-plugin-react:
+ specifier: ^7.34.3
+ version: 7.37.5([email protected])
+ lucide-react:
+ specifier: ^0.468.0
+ version: 0.468.0([email protected])
+ postcss:
+ specifier: ^8.5.6
+ version: 8.5.6
+ prettier:
+ specifier: ^3.3.2
+ version: 3.6.2
+ react:
+ specifier: ^18.3.1
+ version: 18.3.1
+ react-dom:
+ specifier: ^18.3.1
+ version: 18.3.1([email protected])
+ react-router:
+ specifier: ^7.1.1
+ rimraf:
+ specifier: ^6.0.1
+ version: 6.0.1
+ sonner:
+ specifier: ^1.7.1
+ tailwind-merge:
+ specifier: ^2.5.4
+ version: 2.6.0
+ tailwindcss:
+ specifier: ^4.1.11
+ version: 4.1.11
+ typescript:
+ specifier: ^5.7.2
+ version: 5.8.3
+ vite:
+ specifier: ^6.1.0
+
+packages:
+
+ resolution: {integrity: sha512-ukTPVhqG4jNzMro2qA9HSCSSVJN3aN7tlb+hfqYCt3ER0yWroeA2VR38MNrOHLQ/cVj+DaIMad0kFCtWWowh/A==}
+
+ '@alloc/[email protected]':
+ resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==}
+ engines: {node: '>=10'}
+
+ '@ampproject/[email protected]':
+ resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==}
+ engines: {node: '>=6.0.0'}
+
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==}
+ engines: {node: '>=6.9.0'}
+
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-xgu/ySj2mTiUFmdE9yCMfBxLp4DHd5DwmbbD05YAuICfodYT3VvRxbrh81LGQ/8UpSdtMdfKMn3KouYDX59DGQ==}
+ engines: {node: '>=6.9.0'}
+
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-BU2f9tlKQ5CAthiMIgpzAh4eDTLWo1mqi9jqE2OxMG0E/OM199VJt2q8BztTxpnSW0i1ymdwLXRJnYzvDM5r2w==}
+ engines: {node: '>=6.9.0'}
+
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-ZGhA37l0e/g2s1Cnzdix0O3aLYm66eF8aufiVteOgnwxgnRP8GoyMj7VWsgWnQbVKXyge7hqrFh2K2TQM6t1Hw==}
+ engines: {node: '>=6.9.0'}
+
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==}
+ engines: {node: '>=6.9.0'}
+
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==}
+ engines: {node: '>=6.9.0'}
+
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-dSOvYwvyLsWBeIRyOeHXp5vPj5l1I011r52FM1+r1jCERv+aFXYk4whgQccYEGYxK2H3ZAIA8nuPkQ0HaUo3qg==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0
+
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw==}
+ engines: {node: '>=6.9.0'}
+
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==}
+ engines: {node: '>=6.9.0'}
+
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==}
+ engines: {node: '>=6.9.0'}
+
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==}
+ engines: {node: '>=6.9.0'}
+
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-muE8Tt8M22638HU31A3CgfSUciwz1fhATfoVai05aPXGor//CdWDCbnlY1yvBPo07njuVOCNGCSp/GTt12lIug==}
+ engines: {node: '>=6.9.0'}
+
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-qnzXzDXdr/po3bOTbTIQZ7+TxNKxpkN5IifVLXS+r7qwynkZfPyjZfE7hCXbo7IoO9TNcSyibgONsf2HauUd3Q==}
+ engines: {node: '>=6.0.0'}
+ hasBin: true
+
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-8Z4TGic6xW70FKThA5HYEKKyBpOOsucTOD1DjU3fZxDg+K3zBJcXMFnt/4yQiZnf5+MiOMSXQ9PaEK/Ilh1DeA==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-6UzkCs+ejGdZ5mFFC/OCUrv028ab2fp1znZmCZjAOBKiBK2jXD1O+BPSfX8X2qjJ75fZBMSnQn3Rq2mrBJK2mw==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-zbwoTsBruTeKB9hSq73ha66iFeJHuaFkUbwvqElnygoNbj/jHRsSeokowZFN3CZ64IvEqcmmkVe89OPXc7ldAw==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==}
+ engines: {node: '>=6.9.0'}
+
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-X6ZlfR/O/s5EQ/SnUSLzr+6kGnkg8HXGMzpgsMsrJVcfDtH1vIp6ctCN4eZ1LS5c0+te5Cb6Y514fASjMRJ1nw==}
+ engines: {node: '>=6.9.0'}
+
+ '@babel/[email protected]':
+ resolution: {integrity: sha512-8OLQgDScAOHXnAz2cV+RfzzNMipuLVBz2biuAJFMV9bfkNf393je3VM8CLkjQodW5+iWsSJdSgSWT6rsZoXHPw==}
+ engines: {node: '>=6.9.0'}
+
+ '@develar/[email protected]':
+ resolution: {integrity: sha512-0cp4PsWQ/9avqTVMCtZ+GirikIA36ikvjtHweU4/j8yLtgObI0+JUPhYFScgwlteveGB1rt3Cm8UhN04XayDig==}
+ engines: {node: '>= 8.9.0'}
+
+ '@electron-toolkit/[email protected]':
+ resolution: {integrity: sha512-L+uG1FvJcAZkPZpSi6B1pmdpyJFyOxWDTjr1Vs47vSryxv/EX1Ch6o4HVsachlDq3fMEkDgojuP2F3ZvVZMoLw==}
+ peerDependencies:
+ eslint: '>= 8.0.0'
+ prettier: '>= 3.0.0'
+
+ '@electron-toolkit/[email protected]':
+ resolution: {integrity: sha512-NGXadMyWH9+ZsgYe/u5E0mqK2qTDq01kKKnyo7oiq/7v/dWoMoPhqSkn69NZvt7WmnFNOm57l71fv6128mAx3Q==}
+ peerDependencies:
+ eslint: '>=8.56.0'
+ typescript: '*'
+ peerDependenciesMeta:
+ typescript:
+ optional: true
+
+ '@electron-toolkit/[email protected]':
+ resolution: {integrity: sha512-TWWPToXd8qPRfSXwzf5KVhpXMfONaUuRAZJHsKthKgZR/+LqX1dZVSSClQ8OTAEduvLGdecljCsoT2jSshfoUg==}
+ peerDependencies:
+ electron: '>=13.0.0'
+
+ '@electron-toolkit/[email protected]':
+ resolution: {integrity: sha512-M0Mol3odspvtCuheyujLNAW7bXq7KFNYVMRtpjFa4ZfES4MuklXBC7Nli/omvc+PRKlrklgAGx3l4VakjNo8jg==}
+ peerDependencies:
+ '@types/node': '*'
+
+ '@electron-toolkit/[email protected]':
+ resolution: {integrity: sha512-GaXHDhiT7KCvMJjXdp/QqpYinq69T/Pdl49Z1XLf8mKGf63dnsODMWyrmIjEQ0z/vG7dO8qF3fvmI6Eb2lUNZA==}
+ peerDependencies:
+ electron: '>=13.0.0'
+
+ '@electron/[email protected]':
+ resolution: {integrity: sha512-2XyvMe3N3Nrs8cV39IKELRHTYUWFKrmqqSY1U+GMlc0jvqjIVnoxhNd2H4JolWQncbJi1DCvb5TNxZuI2fEjWg==}
+ engines: {node: '>=10.12.0'}
+ hasBin: true
+
+ '@electron/[email protected]':
+ resolution: {integrity: sha512-i4/rNPRS84t0vSRa2HorerGRXWyF4vThfHesw0dmcWHp+cspK743UanA0suA5Q5y8kzY2y6YKrvbIUn69BCAiA==}
+ engines: {node: '>=10.12.0'}
+ hasBin: true
+
+ '@electron/[email protected]':
+ resolution: {integrity: sha512-zx0EIq78WlY/lBb1uXlziZmDZI4ubcCXIMJ4uGjXzZW0nS19TjSPeXPAjzzTmKQlJUZm0SbmZhPKP7tuQ1SsEw==}
+ hasBin: true
+
+ '@electron/[email protected]':
+ resolution: {integrity: sha512-Qkzpg2s9GnVV2I2BjRksUi43U5e6+zaQMcjoJy0C+C5oxaKl+fmckGDQFtRpZpZV0NQekuZZ+tGz7EA9TVnQtQ==}
+ engines: {node: '>=12'}
+
+ '@electron/node-gyp@https://codeload.github.com/electron/node-gyp/tar.gz/06b29aafb7708acef8b3669835c8a7857ebc92d2':
+ resolution: {tarball: https://codeload.github.com/electron/node-gyp/tar.gz/06b29aafb7708acef8b3669835c8a7857ebc92d2}
+ version: 10.2.0-electron.1
+ engines: {node: '>=12.13.0'}
+ hasBin: true
+
+ '@electron/[email protected]':
+ resolution: {integrity: sha512-jNT8nwH1f9X5GEITXaQ8IF/KdskvIkOFfB2CvwumsveVidzpSc+mvhhTMdAGSYF3O+Nq49lJ7y+ssODRXu06+A==}
+ engines: {node: '>= 10.0.0'}
+
+ '@electron/[email protected]':
+ resolution: {integrity: sha512-BAfviURMHpmb1Yb50YbCxnOY0wfwaLXH5KJ4+80zS0gUkzDX3ec23naTlEqKsN+PwYn+a1cCzM7BJ4Wcd3sGzw==}
+ engines: {node: '>=12.0.0'}
+ hasBin: true
+
+ '@electron/[email protected]':
+ resolution: {integrity: sha512-VW++CNSlZwMYP7MyXEbrKjpzEwhB5kDNbzGtiPEjwYysqyTCF+YbNJ210Dj3AjWsGSV4iEEwNkmJN9yGZmVvmw==}
+ engines: {node: '>=12.13.0'}
+ hasBin: true
+
+ '@electron/[email protected]':
+ resolution: {integrity: sha512-fKpv9kg4SPmt+hY7SVBnIYULE9QJl8L3sCfcBsnqbJwwBwAeTLokJ9TRt9y7bK0JAzIW2y78TVVjvnQEms/yyA==}
+ engines: {node: '>=16.4'}
+
+ '@electron/[email protected]':
+ resolution: {integrity: sha512-dfZeox66AvdPtb2lD8OsIIQh12Tp0GNCRUDfBHIKGpbmopZto2/A8nSpYYLoedPIHpqkeblZ/k8OV0Gy7PYuyQ==}
+ engines: {node: '>=14.14'}
+ hasBin: true
+
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-9o3TMmpmftaCMepOdA5k/yDw8SfInyzWWTjYTFCX3kPSDJMROQTb8jg+h9Cnwnmm1vOzvxN7gIfB5V2ewpjtGA==}
+ engines: {node: '>=18'}
+ cpu: [ppc64]
+ os: [aix]
+
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-VGzGhj4lJO+TVGV1v8ntCZWJktV7SGCs3Pn1GRWI1SBFtRALoomm8k5E9Pmwg3HOAal2VDc2F9+PM/rEY6oIDg==}
+ engines: {node: '>=18'}
+ cpu: [arm64]
+ os: [android]
+
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-AdJKSPeEHgi7/ZhuIPtcQKr5RQdo6OO2IL87JkianiMYMPbCtot9fxPbrMiBADOWWm3T2si9stAiVsGbTQFkbA==}
+ engines: {node: '>=18'}
+ cpu: [arm]
+ os: [android]
+
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-D2GyJT1kjvO//drbRT3Hib9XPwQeWd9vZoBJn+bu/lVsOZ13cqNdDeqIF/xQ5/VmWvMduP6AmXvylO/PIc2isw==}
+ engines: {node: '>=18'}
+ cpu: [x64]
+ os: [android]
+
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-GtaBgammVvdF7aPIgH2jxMDdivezgFu6iKpmT+48+F8Hhg5J/sfnDieg0aeG/jfSvkYQU2/pceFPDKlqZzwnfQ==}
+ engines: {node: '>=18'}
+ cpu: [arm64]
+ os: [darwin]
+
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-1iT4FVL0dJ76/q1wd7XDsXrSW+oLoquptvh4CLR4kITDtqi2e/xwXwdCVH8hVHU43wgJdsq7Gxuzcs6Iq/7bxQ==}
+ engines: {node: '>=18'}
+ cpu: [x64]
+ os: [darwin]
+
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-nk4tGP3JThz4La38Uy/gzyXtpkPW8zSAmoUhK9xKKXdBCzKODMc2adkB2+8om9BDYugz+uGV7sLmpTYzvmz6Sw==}
+ engines: {node: '>=18'}
+ cpu: [arm64]
+ os: [freebsd]
+
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-PrikaNjiXdR2laW6OIjlbeuCPrPaAl0IwPIaRv+SMV8CiM8i2LqVUHFC1+8eORgWyY7yhQY+2U2fA55mBzReaw==}
+ engines: {node: '>=18'}
+ cpu: [x64]
+ os: [freebsd]
+
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-Z9kfb1v6ZlGbWj8EJk9T6czVEjjq2ntSYLY2cw6pAZl4oKtfgQuS4HOq41M/BcoLPzrUbNd+R4BXFyH//nHxVg==}
+ engines: {node: '>=18'}
+ cpu: [arm64]
+ os: [linux]
+
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-cPzojwW2okgh7ZlRpcBEtsX7WBuqbLrNXqLU89GxWbNt6uIg78ET82qifUy3W6OVww6ZWobWub5oqZOVtwolfw==}
+ engines: {node: '>=18'}
+ cpu: [arm]
+ os: [linux]
+
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-sQ7l00M8bSv36GLV95BVAdhJ2QsIbCuCjh/uYrWiMQSUuV+LpXwIqhgJDcvMTj+VsQmqAHL2yYaasENvJ7CDKA==}
+ engines: {node: '>=18'}
+ cpu: [ia32]
+ os: [linux]
+
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-0ur7ae16hDUC4OL5iEnDb0tZHDxYmuQyhKhsPBV8f99f6Z9KQM02g33f93rNH5A30agMS46u2HP6qTdEt6Q1kg==}
+ engines: {node: '>=18'}
+ cpu: [loong64]
+ os: [linux]
+
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-kB/66P1OsHO5zLz0i6X0RxlQ+3cu0mkxS3TKFvkb5lin6uwZ/ttOkP3Z8lfR9mJOBk14ZwZ9182SIIWFGNmqmg==}
+ engines: {node: '>=18'}
+ cpu: [mips64el]
+ os: [linux]
+
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-UZCmJ7r9X2fe2D6jBmkLBMQetXPXIsZjQJCjgwpVDz+YMcS6oFR27alkgGv3Oqkv07bxdvw7fyB71/olceJhkQ==}
+ engines: {node: '>=18'}
+ cpu: [ppc64]
+ os: [linux]
+
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-kTxwu4mLyeOlsVIFPfQo+fQJAV9mh24xL+y+Bm6ej067sYANjyEw1dNHmvoqxJUCMnkBdKpvOn0Ahql6+4VyeA==}
+ engines: {node: '>=18'}
+ cpu: [riscv64]
+ os: [linux]
+
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-K2dSKTKfmdh78uJ3NcWFiqyRrimfdinS5ErLSn3vluHNeHVnBAFWC8a4X5N+7FgVE1EjXS1QDZbpqZBjfrqMTQ==}
+ engines: {node: '>=18'}
+ cpu: [s390x]
+ os: [linux]
+
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-uhj8N2obKTE6pSZ+aMUbqq+1nXxNjZIIjCjGLfsWvVpy7gKCOL6rsY1MhRh9zLtUtAI7vpgLMK6DxjO8Qm9lJw==}
+ engines: {node: '>=18'}
+ cpu: [x64]
+ os: [linux]
+
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-pwHtMP9viAy1oHPvgxtOv+OkduK5ugofNTVDilIzBLpoWAM16r7b/mxBvfpuQDpRQFMfuVr5aLcn4yveGvBZvw==}
+ engines: {node: '>=18'}
+ cpu: [arm64]
+ os: [netbsd]
+
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-WOb5fKrvVTRMfWFNCroYWWklbnXH0Q5rZppjq0vQIdlsQKuw6mdSihwSo4RV/YdQ5UCKKvBy7/0ZZYLBZKIbwQ==}
+ engines: {node: '>=18'}
+ cpu: [x64]
+ os: [netbsd]
+
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-7A208+uQKgTxHd0G0uqZO8UjK2R0DDb4fDmERtARjSHWxqMTye4Erz4zZafx7Di9Cv+lNHYuncAkiGFySoD+Mw==}
+ engines: {node: '>=18'}
+ cpu: [arm64]
+ os: [openbsd]
+
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-G4hE405ErTWraiZ8UiSoesH8DaCsMm0Cay4fsFWOOUcz8b8rC6uCvnagr+gnioEjWn0wC+o1/TAHt+It+MpIMg==}
+ engines: {node: '>=18'}
+ cpu: [x64]
+ os: [openbsd]
+
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-l+azKShMy7FxzY0Rj4RCt5VD/q8mG/e+mDivgspo+yL8zW7qEwctQ6YqKX34DTEleFAvCIUviCFX1SDZRSyMQA==}
+ engines: {node: '>=18'}
+ cpu: [x64]
+ os: [sunos]
+
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-O2S7SNZzdcFG7eFKgvwUEZ2VG9D/sn/eIiz8XRZ1Q/DO5a3s76Xv0mdBzVM5j5R639lXQmPmSo0iRpHqUUrsxw==}
+ engines: {node: '>=18'}
+ cpu: [arm64]
+ os: [win32]
+
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-onOJ02pqs9h1iMJ1PQphR+VZv8qBMQ77Klcsqv9CNW2w6yLqoURLcgERAIurY6QE63bbLuqgP9ATqajFLK5AMQ==}
+ engines: {node: '>=18'}
+ cpu: [ia32]
+ os: [win32]
+
+ '@esbuild/[email protected]':
+ resolution: {integrity: sha512-TXv6YnJ8ZMVdX+SXWVBo/0p8LTcrUYngpWjvm91TMjjBQii7Oz11Lw5lbDV5Y0TzuhSJHwiH4hEtC1I42mMS0g==}
+ engines: {node: '>=18'}
+ cpu: [x64]
+ os: [win32]
+
+ '@eslint-community/[email protected]':
+ resolution: {integrity: sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ peerDependencies:
+ eslint: ^6.0.0 || ^7.0.0 || >=8.0.0
+
+ '@eslint-community/[email protected]':
+ resolution: {integrity: sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==}
+ engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0}
+
+ '@eslint/[email protected]':
+ resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+
+ '@eslint/[email protected]':
+ resolution: {integrity: sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+
+ resolution: {integrity: sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==}
+
+ '@humanwhocodes/[email protected]':
+ resolution: {integrity: sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==}
+ engines: {node: '>=10.10.0'}
+ deprecated: Use @eslint/config-array instead
+
+ '@humanwhocodes/[email protected]':
+ resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==}
+ engines: {node: '>=12.22'}
+
+ '@humanwhocodes/[email protected]':
+ resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==}
+ deprecated: Use @eslint/object-schema instead
+
+ '@isaacs/[email protected]':
+ resolution: {integrity: sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==}
+ engines: {node: 20 || >=22}
+
+ '@isaacs/[email protected]':
+ resolution: {integrity: sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA==}
+ engines: {node: 20 || >=22}
+
+ '@isaacs/[email protected]':
+ resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==}
+ engines: {node: '>=12'}
+
+ '@isaacs/[email protected]':
+ resolution: {integrity: sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==}
+ engines: {node: '>=18.0.0'}
+
+ '@jridgewell/[email protected]':
+ resolution: {integrity: sha512-HM2F4B9N4cA0RH2KQiIZOHAZqtP4xGS4IZ+SFe1SIbO4dyjf9MTY2Bo3vHYnm0hglWfXqBrzUBSa+cJfl3Xvrg==}
+
+ '@jridgewell/[email protected]':
+ resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==}
+ engines: {node: '>=6.0.0'}
+
+ '@jridgewell/[email protected]':
+ resolution: {integrity: sha512-gKYheCylLIedI+CSZoDtGkFV9YEBxRRVcfCH7OfAqh4TyUyRjEE6WVE/aXDXX0p8BIe/QgLcaAoI0220KRRFgg==}
+
+ '@jridgewell/[email protected]':
+ resolution: {integrity: sha512-VO95AxtSFMelbg3ouljAYnfvTEwSWVt/2YLf+U5Ejd8iT5mXE2Sa/1LGyvySMne2CGsepGLI7KpF3EzE3Aq9Mg==}
+
+ '@malept/[email protected]':
+ resolution: {integrity: sha512-1DpKU0Z5ThltBwjNySMC14g0CkbyhCaz9FkhxqNsZI6uAPJXFS8cMXlBKo26FJ8ZuW6S9GCMcR9IO5k2X5/9Fg==}
+ engines: {node: '>= 12.13.0'}
+
+ '@malept/[email protected]':
+ resolution: {integrity: sha512-9QOtNffcOF/c1seMCDnjckb3R9WHcG34tky+FHpNKKCW0wc/scYLwMtO+ptyGUfMW0/b/n4qRiALlaFHc9Oj7Q==}
+ engines: {node: '>= 10.0.0'}
+
+ '@nodelib/[email protected]':
+ resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==}
+ engines: {node: '>= 8'}
+
+ '@nodelib/[email protected]':
+ resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==}
+ engines: {node: '>= 8'}
+
+ '@nodelib/[email protected]':
+ resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==}
+ engines: {node: '>= 8'}
+
+ '@npmcli/[email protected]':
+ resolution: {integrity: sha512-yOJKRvohFOaLqipNtwYB9WugyZKhC/DZC4VYPmpaCzDBrA8YpK3qHZ8/HGscMnE4GqbkLNuVcCnxkeQEdGt6LQ==}
+ engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
+
+ '@npmcli/[email protected]':
+ resolution: {integrity: sha512-mJd2Z5TjYWq/ttPLLGqArdtnC74J6bOzg4rMDnN+p1xTacZ2yPRCk2y0oSWQtygLR9YVQXgOcONrwtnk3JupxQ==}
+ engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
+ deprecated: This functionality has been moved to @npmcli/fs
+
+ '@pkgjs/[email protected]':
+ resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==}
+ engines: {node: '>=14'}
+
+ resolution: {integrity: sha512-YLT9Zo3oNPJoBjBc4q8G2mjU4tqIbf5CEOORbUUr48dCD9q3umJ3IPlVqOqDakPfd2HuwccBaqlGhN4Gmr5OWg==}
+ engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0}
+
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-z4eqJvfiNnFMHIIvXP3CY57y2WJs5g2v3X0zm9mEJkrkNv4rDxu+sg9Jh8EkXyeqBkB7SOcboo9dMVqhyrACIg==}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-aeNmHnBxbi2St0au6VBVC7JXFlhLlOnvIIlePNniyUNAClzmtAUEY8/pBiK3iHjufOlwA+c20/8jngo7xcrg8A==}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+
+ '@rolldown/[email protected]':
+ resolution: {integrity: sha512-3FL3mnMbPu0muGOCaKAhhFEYmqv9eTfPSJRJmANrCwtgK8VuxpsZDGK+m0LYAGoyO8+0j5uRe4PeyPDK1yA/hA==}
+
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-JAcBr1+fgqx20m7Fwe1DxPUl/hPkee6jA6Pl7n1v2EFiktAHenTaXl5aIFjUIEsfn9w3HE4gK1lEgNGMzBDs1w==}
+ cpu: [arm]
+ os: [android]
+
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-RurZetXqTu4p+G0ChbnkwBuAtwAbIwJkycw1n6GvlGlBuS4u5qlr5opix8cBAYFJgaY05TWtM+LaoFggUmbZEQ==}
+ cpu: [arm64]
+ os: [android]
+
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-fM/xPesi7g2M7chk37LOnmnSTHLG/v2ggWqKj3CCA1rMA4mm5KVBT1fNoswbo1JhPuNNZrVwpTvlCVggv8A2zg==}
+ cpu: [arm64]
+ os: [darwin]
+
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-gDnWk57urJrkrHQ2WVx9TSVTH7lSlU7E3AFqiko+bgjlh78aJ88/3nycMax52VIVjIm3ObXnDL2H00e/xzoipw==}
+ cpu: [x64]
+ os: [darwin]
+
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-wnFQmJ/zPThM5zEGcnDcCJeYJgtSLjh1d//WuHzhf6zT3Md1BvvhJnWoy+HECKu2bMxaIcfWiu3bJgx6z4g2XA==}
+ cpu: [arm64]
+ os: [freebsd]
+
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-uBmIxoJ4493YATvU2c0upGz87f99e3wop7TJgOA/bXMFd2SvKCI7xkxY/5k50bv7J6dw1SXT4MQBQSLn8Bb/Uw==}
+ cpu: [x64]
+ os: [freebsd]
+
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-n0edDmSHlXFhrlmTK7XBuwKlG5MbS7yleS1cQ9nn4kIeW+dJH+ExqNgQ0RrFRew8Y+0V/x6C5IjsHrJmiHtkxQ==}
+ cpu: [arm]
+ os: [linux]
+
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-8WVUPy3FtAsKSpyk21kV52HCxB+me6YkbkFHATzC2Yd3yuqHwy2lbFL4alJOLXKljoRw08Zk8/xEj89cLQ/4Nw==}
+ cpu: [arm]
+ os: [linux]
+
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-yuktAOaeOgorWDeFJggjuCkMGeITfqvPgkIXhDqsfKX8J3jGyxdDZgBV/2kj/2DyPaLiX6bPdjJDTu9RB8lUPQ==}
+ cpu: [arm64]
+ os: [linux]
+
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-W+GBM4ifET1Plw8pdVaecwUgxmiH23CfAUj32u8knq0JPFyK4weRy6H7ooxYFD19YxBulL0Ktsflg5XS7+7u9g==}
+ cpu: [arm64]
+ os: [linux]
+
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-1zqnUEMWp9WrGVuVak6jWTl4fEtrVKfZY7CvcBmUUpxAJ7WcSowPSAWIKa/0o5mBL/Ij50SIf9tuirGx63Ovew==}
+ cpu: [loong64]
+ os: [linux]
+
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-Rl3JKaRu0LHIx7ExBAAnf0JcOQetQffaw34T8vLlg9b1IhzcBgaIdnvEbbsZq9uZp3uAH+JkHd20Nwn0h9zPjA==}
+ cpu: [ppc64]
+ os: [linux]
+
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-j5akelU3snyL6K3N/iX7otLBIl347fGwmd95U5gS/7z6T4ftK288jKq3A5lcFKcx7wwzb5rgNvAg3ZbV4BqUSw==}
+ cpu: [riscv64]
+ os: [linux]
+
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-ppn5llVGgrZw7yxbIm8TTvtj1EoPgYUAbfw0uDjIOzzoqlZlZrLJ/KuiE7uf5EpTpCTrNt1EdtzF0naMm0wGYg==}
+ cpu: [riscv64]
+ os: [linux]
+
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-Hu6hEdix0oxtUma99jSP7xbvjkUM/ycke/AQQ4EC5g7jNRLLIwjcNwaUy95ZKBJJwg1ZowsclNnjYqzN4zwkAw==}
+ cpu: [s390x]
+ os: [linux]
+
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-EtnsrmZGomz9WxK1bR5079zee3+7a+AdFlghyd6VbAjgRJDbTANJ9dcPIPAi76uG05micpEL+gPGmAKYTschQw==}
+ cpu: [x64]
+ os: [linux]
+
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-iAS4p+J1az6Usn0f8xhgL4PaU878KEtutP4hqw52I4IO6AGoyOkHCxcc4bqufv1tQLdDWFx8lR9YlwxKuv3/3g==}
+ cpu: [x64]
+ os: [linux]
+
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-NtSJVKcXwcqozOl+FwI41OH3OApDyLk3kqTJgx8+gp6On9ZEt5mYhIsKNPGuaZr3p9T6NWPKGU/03Vw4CNU9qg==}
+ cpu: [arm64]
+ os: [win32]
+
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-JYA3qvCOLXSsnTR3oiyGws1Dm0YTuxAAeaYGVlGpUsHqloPcFjPg+X0Fj2qODGLNwQOAcCiQmHub/V007kiH5A==}
+ cpu: [ia32]
+ os: [win32]
+
+ '@rollup/[email protected]':
+ resolution: {integrity: sha512-J8o22LuF0kTe7m+8PvW9wk3/bRq5+mRo5Dqo6+vXb7otCm3TPhYOJqOaQtGU9YMWQSL3krMnoOxMr0+9E6F3Ug==}
+ cpu: [x64]
+ os: [win32]
+
+ '@sindresorhus/[email protected]':
+ resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==}
+ engines: {node: '>=10'}
+
+ '@szmarczak/[email protected]':
+ resolution: {integrity: sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==}
+ engines: {node: '>=10'}
+
+ '@tailwindcss/[email protected]':
+ resolution: {integrity: sha512-yzhzuGRmv5QyU9qLNg4GTlYI6STedBWRE7NjxP45CsFYYq9taI0zJXZBMqIC/c8fViNLhmrbpSFS57EoxUmD6Q==}
+
+ '@tailwindcss/[email protected]':
+ resolution: {integrity: sha512-H/6r6IPFJkCfBJZ2dKZiPJ7Ueb2wbL592+9bQEl2r73qbX6yGnmQVIfiUvDRB2YI0a3PWDrzUwkvQx1XW1bNkA==}
+
+ '@tailwindcss/[email protected]':
+ resolution: {integrity: sha512-3IfFuATVRUMZZprEIx9OGDjG3Ou3jG4xQzNTvjDoKmU9JdmoCohQJ83MYd0GPnQIu89YoJqvMM0G3uqLRFtetg==}
+ engines: {node: '>= 10'}
+ cpu: [arm64]
+ os: [android]
+
+ '@tailwindcss/[email protected]':
+ resolution: {integrity: sha512-cxklKjtNLwFl3mDYw4XpEfBY+G8ssSg9ADL4Wm6//5woi3XGqlxFsnV5Zb6v07dxw1NvEX2uoqsxO/zWQsgR+g==}
+ engines: {node: '>= 10'}
+ cpu: [arm64]
+ os: [android]
+
+ '@tailwindcss/[email protected]':
+ resolution: {integrity: sha512-ESgStEOEsyg8J5YcMb1xl8WFOXfeBmrhAwGsFxxB2CxY9evy63+AtpbDLAyRkJnxLy2WsD1qF13E97uQyP1lfQ==}
+ engines: {node: '>= 10'}
+ cpu: [arm64]
+ os: [darwin]
+
+ '@tailwindcss/[email protected]':
+ resolution: {integrity: sha512-mqkf2tLR5VCrjBvuRDwzKNShRu99gCAVMkVsaEOFvv6cCjlEKXRecPu9DEnxp6STk5z+Vlbh1M5zY3nQCXMXhw==}
+ engines: {node: '>= 10'}
+ cpu: [arm64]
+ os: [darwin]
+
+ '@tailwindcss/[email protected]':
+ resolution: {integrity: sha512-EgnK8kRchgmgzG6jE10UQNaH9Mwi2n+yw1jWmof9Vyg2lpKNX2ioe7CJdf9M5f8V9uaQxInenZkOxnTVL3fhAw==}
+ engines: {node: '>= 10'}
+ cpu: [x64]
+ os: [darwin]
+
+ '@tailwindcss/[email protected]':
+ resolution: {integrity: sha512-7sGraGaWzXvCLyxrc7d+CCpUN3fYnkkcso3rCzwUmo/LteAl2ZGCDlGvDD8Y/1D3ngxT8KgDj1DSwOnNewKhmg==}
+ engines: {node: '>= 10'}
+ cpu: [x64]
+ os: [darwin]
+
+ '@tailwindcss/[email protected]':
+ resolution: {integrity: sha512-xdqKtbpHs7pQhIKmqVpxStnY1skuNh4CtbcyOHeX1YBE0hArj2romsFGb6yUmzkq/6M24nkxDqU8GYrKrz+UcA==}
+ engines: {node: '>= 10'}
+ cpu: [x64]
+ os: [freebsd]
+
+ '@tailwindcss/[email protected]':
+ resolution: {integrity: sha512-E2+PbcbzIReaAYZe997wb9rId246yDkCwAakllAWSGqe6VTg9hHle67hfH6ExjpV2LSK/siRzBUs5wVff3RW9w==}
+ engines: {node: '>= 10'}
+ cpu: [x64]
+ os: [freebsd]
+
+ '@tailwindcss/[email protected]':
+ resolution: {integrity: sha512-ryHQK2eyDYYMwB5wZL46uoxz2zzDZsFBwfjssgB7pzytAeCCa6glsiJGjhTEddq/4OsIjsLNMAiMlHNYnkEEeg==}
+ engines: {node: '>= 10'}
+ cpu: [arm]
+ os: [linux]
+
+ '@tailwindcss/[email protected]':
+ resolution: {integrity: sha512-GvfbJ8wjSSjbLFFE3UYz4Eh8i4L6GiEYqCtA8j2Zd2oXriPuom/Ah/64pg/szWycQpzRnbDiJozoxFU2oJZyfg==}
+ engines: {node: '>= 10'}
+ cpu: [arm]
+ os: [linux]
+
+ '@tailwindcss/[email protected]':
+ resolution: {integrity: sha512-mYwqheq4BXF83j/w75ewkPJmPZIqqP1nhoghS9D57CLjsh3Nfq0m4ftTotRYtGnZd3eCztgbSPJ9QhfC91gDZQ==}
+ engines: {node: '>= 10'}
+ cpu: [arm64]
+ os: [linux]
+
+ '@tailwindcss/[email protected]':
+ resolution: {integrity: sha512-35UkuCWQTeG9BHcBQXndDOrpsnt3Pj9NVIB4CgNiKmpG8GnCNXeMczkUpOoqcOhO6Cc/mM2W7kaQ/MTEENDDXg==}
+ engines: {node: '>= 10'}
+ cpu: [arm64]
+ os: [linux]
+
+ '@tailwindcss/[email protected]':
+ resolution: {integrity: sha512-m/NVRFNGlEHJrNVk3O6I9ggVuNjXHIPoD6bqay/pubtYC9QIdAMpS+cswZQPBLvVvEF6GtSNONbDkZrjWZXYNQ==}
+ engines: {node: '>= 10'}
+ cpu: [arm64]
+ os: [linux]
+
+ '@tailwindcss/[email protected]':
+ resolution: {integrity: sha512-dm18aQiML5QCj9DQo7wMbt1Z2tl3Giht54uVR87a84X8qRtuXxUqnKQkRDK5B4bCOmcZ580lF9YcoMkbDYTXHQ==}
+ engines: {node: '>= 10'}
+ cpu: [arm64]
+ os: [linux]
+
+ '@tailwindcss/[email protected]':
+ resolution: {integrity: sha512-YW6sblI7xukSD2TdbbaeQVDysIm/UPJtObHJHKxDEcW2exAtY47j52f8jZXkqE1krdnkhCMGqP3dbniu1Te2Fg==}
+ engines: {node: '>= 10'}
+ cpu: [x64]
+ os: [linux]
+
+ '@tailwindcss/[email protected]':
+ resolution: {integrity: sha512-LMdTmGe/NPtGOaOfV2HuO7w07jI3cflPrVq5CXl+2O93DCewADK0uW1ORNAcfu2YxDUS035eY2W38TxrsqngxA==}
+ engines: {node: '>= 10'}
+ cpu: [x64]
+ os: [linux]
+
+ '@tailwindcss/[email protected]':
+ resolution: {integrity: sha512-e3C/RRhGunWYNC3aSF7exsQkdXzQ/M+aYuZHKnw4U7KQwTJotnWsGOIVih0s2qQzmEzOFIJ3+xt7iq67K/p56Q==}
+ engines: {node: '>= 10'}
+ cpu: [x64]
+ os: [linux]
+
+ '@tailwindcss/[email protected]':
+ resolution: {integrity: sha512-aalNWwIi54bbFEizwl1/XpmdDrOaCjRFQRgtbv9slWjmNPuJJTIKPHf5/XXDARc9CneW9FkSTqTbyvNecYAEGw==}
+ engines: {node: '>= 10'}
+ cpu: [x64]
+ os: [linux]
+
+ '@tailwindcss/[email protected]':
+ resolution: {integrity: sha512-Xo1+/GU0JEN/C/dvcammKHzeM6NqKovG+6921MR6oadee5XPBaKOumrJCXvopJ/Qb5TH7LX/UAywbqrP4lax0g==}
+ engines: {node: '>=14.0.0'}
+ cpu: [wasm32]
+ bundledDependencies:
+ - '@napi-rs/wasm-runtime'
+ - '@emnapi/core'
+ - '@emnapi/runtime'
+ - '@tybys/wasm-util'
+ - '@emnapi/wasi-threads'
+ - tslib
+
+ '@tailwindcss/[email protected]':
+ resolution: {integrity: sha512-UgKYx5PwEKrac3GPNPf6HVMNhUIGuUh4wlDFR2jYYdkX6pL/rn73zTq/4pzUm8fOjAn5L8zDeHp9iXmUGOXZ+w==}
+ engines: {node: '>= 10'}
+ cpu: [arm64]
+ os: [win32]
+
+ '@tailwindcss/[email protected]':
+ resolution: {integrity: sha512-PEj7XR4OGTGoboTIAdXicKuWl4EQIjKHKuR+bFy9oYN7CFZo0eu74+70O4XuERX4yjqVZGAkCdglBODlgqcCXg==}
+ engines: {node: '>= 10'}
+ cpu: [arm64]
+ os: [win32]
+
+ '@tailwindcss/[email protected]':
+ resolution: {integrity: sha512-YfHoggn1j0LK7wR82TOucWc5LDCguHnoS879idHekmmiR7g9HUtMw9MI0NHatS28u/Xlkfi9w5RJWgz2Dl+5Qg==}
+ engines: {node: '>= 10'}
+ cpu: [x64]
+ os: [win32]
+
+ '@tailwindcss/[email protected]':
+ resolution: {integrity: sha512-T8gfxECWDBENotpw3HR9SmNiHC9AOJdxs+woasRZ8Q/J4VHN0OMs7F+4yVNZ9EVN26Wv6mZbK0jv7eHYuLJLwA==}
+ engines: {node: '>= 10'}
+ cpu: [x64]
+ os: [win32]
+
+ '@tailwindcss/[email protected]':
+ resolution: {integrity: sha512-Q69XzrtAhuyfHo+5/HMgr1lAiPP/G40OMFAnws7xcFEYqcypZmdW8eGXaOUIeOl1dzPJBPENXgbjsOyhg2nkrg==}
+ engines: {node: '>= 10'}
+
+ '@tailwindcss/[email protected]':
+ resolution: {integrity: sha512-t16lpHCU7LBxDe/8dCj9ntyNpXaSTAgxWm1u2XQP5NiIu4KGSyrDJJRlK9hJ4U9yJxx0UKCVI67MJWFNll5mOQ==}
+ engines: {node: '>= 10'}
+
+ '@tailwindcss/[email protected]':
+ resolution: {integrity: sha512-q/EAIIpF6WpLhKEuQSEVMZNMIY8KhWoAemZ9eylNAih9jxMGAYPPWBn3I9QL/2jZ+e7OEz/tZkX5HwbBR4HohA==}
+
+ '@tailwindcss/[email protected]':
+ resolution: {integrity: sha512-lUI/QaDxLtlV52Lho6pu07CG9pSnRYLOPmKGIQjyHdTBagemc6HmgZxyjGAQ/5HMPrNeWBfTVIpQl0/jLXvWHQ==}
+ peerDependencies:
+ vite: ^5.2.0 || ^6
+
+ '@tootallnate/[email protected]':
+ resolution: {integrity: sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==}
+ engines: {node: '>= 10'}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-dkO5fhS7+/oos4ciWxyEyjWe48zmG6wbCheo/G2ZnHx4fs3EU6YC6UM8rk56gAjNJ9P3MTH2jo5jb92/K6wbng==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-9pLGGwdzOUBDYi0GNjM97FIA+f92fqSke6joWeBjWXllfNxZBs7qeMF7tvtOIsbY45xkWkxrdwUfUf3MnQa9gA==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-E6OCaRmAe4WDmWNsL/9RMqdkkzDCY1etutkflWk4c+AcjDU07Pcz1fQwTX0TQz+Pxqn9i4L1TU3UFpjnrcDgxA==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==}
+ peerDependencies:
+ '@types/react': ^18.0.0
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-/LDXMQh55EzZQ0uVAZmKKhfENivEvWz6E+EYzh+/MCjMhNsotd+ZHhBGIjFDTi6+fz0OhQQQLbTgdQIxxCsC0w==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-k107IF4+Xr7UHjwDc7Cfd6PRQfbdkiRabXGRjo07b4WyPahFBZCZ1sE+BNxYIJPPg73UkfOsVOLwqVc/6ETrIA==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-RlDm9K7+o5stv0Co8i8ZRGxDbrTxhJtgjqjFyVh/tXQyl/rYtTKlnTvZ88oSTeYREWurwx20Js4kTuKCsFkUtg==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==}
+
+ '@typescript-eslint/[email protected]':
+ resolution: {integrity: sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ peerDependencies:
+ '@typescript-eslint/parser': ^5.0.0
+ eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
+ typescript: '*'
+ peerDependenciesMeta:
+ typescript:
+ optional: true
+
+ '@typescript-eslint/[email protected]':
+ resolution: {integrity: sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw==}
+ engines: {node: ^18.18.0 || >=20.0.0}
+ peerDependencies:
+ '@typescript-eslint/parser': ^7.0.0
+ eslint: ^8.56.0
+ typescript: '*'
+ peerDependenciesMeta:
+ typescript:
+ optional: true
+
+ '@typescript-eslint/[email protected]':
+ resolution: {integrity: sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ peerDependencies:
+ eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
+ typescript: '*'
+ peerDependenciesMeta:
+ typescript:
+ optional: true
+
+ '@typescript-eslint/[email protected]':
+ resolution: {integrity: sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg==}
+ engines: {node: ^18.18.0 || >=20.0.0}
+ peerDependencies:
+ eslint: ^8.56.0
+ typescript: '*'
+ peerDependenciesMeta:
+ typescript:
+ optional: true
+
+ '@typescript-eslint/[email protected]':
+ resolution: {integrity: sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+
+ '@typescript-eslint/[email protected]':
+ resolution: {integrity: sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==}
+ engines: {node: ^18.18.0 || >=20.0.0}
+
+ '@typescript-eslint/[email protected]':
+ resolution: {integrity: sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ peerDependencies:
+ eslint: '*'
+ typescript: '*'
+ peerDependenciesMeta:
+ typescript:
+ optional: true
+
+ '@typescript-eslint/[email protected]':
+ resolution: {integrity: sha512-XL0FJXuCLaDuX2sYqZUUSOJ2sG5/i1AAze+axqmLnSkNEVMVYLF+cbwlB2w8D1tinFuSikHmFta+P+HOofrLeA==}
+ engines: {node: ^18.18.0 || >=20.0.0}
+ peerDependencies:
+ eslint: ^8.56.0
+ typescript: '*'
+ peerDependenciesMeta:
+ typescript:
+ optional: true
+
+ '@typescript-eslint/[email protected]':
+ resolution: {integrity: sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+
+ '@typescript-eslint/[email protected]':
+ resolution: {integrity: sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==}
+ engines: {node: ^18.18.0 || >=20.0.0}
+
+ '@typescript-eslint/[email protected]':
+ resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ peerDependencies:
+ typescript: '*'
+ peerDependenciesMeta:
+ typescript:
+ optional: true
+
+ '@typescript-eslint/[email protected]':
+ resolution: {integrity: sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==}
+ engines: {node: ^18.18.0 || >=20.0.0}
+ peerDependencies:
+ typescript: '*'
+ peerDependenciesMeta:
+ typescript:
+ optional: true
+
+ '@typescript-eslint/[email protected]':
+ resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ peerDependencies:
+ eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
+
+ '@typescript-eslint/[email protected]':
+ resolution: {integrity: sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==}
+ engines: {node: ^18.18.0 || >=20.0.0}
+ peerDependencies:
+ eslint: ^8.56.0
+
+ '@typescript-eslint/[email protected]':
+ resolution: {integrity: sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+
+ '@typescript-eslint/[email protected]':
+ resolution: {integrity: sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==}
+ engines: {node: ^18.18.0 || >=20.0.0}
+
+ '@ungap/[email protected]':
+ resolution: {integrity: sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==}
+
+ '@vitejs/[email protected]':
+ resolution: {integrity: sha512-5Kgff+m8e2PB+9j51eGHEpn5kUzRKH2Ry0qGoe8ItJg7pqnkPrYPkDQZGgGmTa0EGarHrkjLvOdU3b1fzI8otQ==}
+ engines: {node: ^14.18.0 || >=16.0.0}
+ peerDependencies:
+ vite: ^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0-beta.0
+
+ '@xmldom/[email protected]':
+ resolution: {integrity: sha512-2WALfTl4xo2SkGCYRt6rDTFfk9R1czmBvUQy12gK2KuRKIpWEhcbbzy8EZXtz/jkRqHX8bFEc6FC1HjX4TUWYw==}
+ engines: {node: '>=10.0.0'}
+
+ resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==}
+
+ resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==}
+ peerDependencies:
+ acorn: ^6.0.0 || ^7.0.0 || ^8.0.0
+
+ resolution: {integrity: sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==}
+ engines: {node: '>=0.4.0'}
+ hasBin: true
+
+ resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==}
+ engines: {node: '>= 6.0.0'}
+
+ resolution: {integrity: sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==}
+ engines: {node: '>= 14'}
+
+ resolution: {integrity: sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ==}
+ engines: {node: '>= 8.0.0'}
+
+ resolution: {integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==}
+ peerDependencies:
+ ajv: ^8.0.0
+ peerDependenciesMeta:
+ ajv:
+ optional: true
+
+ resolution: {integrity: sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==}
+ peerDependencies:
+ ajv: ^6.9.1
+
+ resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==}
+
+ resolution: {integrity: sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==}
+
+ resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==}
+ engines: {node: '>=12'}
+
+ resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==}
+ engines: {node: '>=12'}
+
+ resolution: {integrity: sha512-j87o0j6LqPL3QRr8yid6c+Tt5gC7xNfYo6uQIQkorAC6MpeayVMZrEDzKmJJ/Hlv7EnOQpaRm53k6ktDYZyB6w==}
+
+ resolution: {integrity: sha512-+/CEPH1fVKf6HowBUs6LcAIoRcjeqgvAeoSE+cl7Y7LndyQ9ViGPYibNk7wmhMHzNgHIuIbw4nWADPO+4mjgWw==}
+ engines: {node: '>=14.0.0'}
+ peerDependencies:
+ dmg-builder: 26.0.12
+ electron-builder-squirrel-windows: 26.0.12
+
+ resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}
+
+ resolution: {integrity: sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-FmeCCAenzH0KH381SPT5FZmiA/TmpndpcaShhfgEN9eCVjnFBqq3l1xrI42y8+PPLI6hypzou4GXw00WHmPBLQ==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-CVvd6FHg1Z3POpBLxO6E6zr+rSKEQ9L6rZHAaY7lLfhKsWYUBBOuMs0e9o24oopj6H+geRCX0YJ+TJLBK2eHyQ==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-rwG/ja1neyLqCuGZ5YYrznA62D4mZXg0i1cIskIUKSiqF3Cje9/wXAls9B9s1Wa2fomMsIv8czB8jZcPmxCXFg==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-Y7Wt51eKJSyi80hFrJCePGGNo5ktJCslFuboqJsbf57CCPcm5zztluPlc4/aD8sWsKvlwatezpV4U1efk8kpjg==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-p6Fx8B7b7ZhL/gmUsAy0D15WhvDccw3mnGNbZpi3pmeJdxtWsj2jEaI4Y6oo3XiHfzuSgPwKc04MYt6KgvC/wA==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==}
+ engines: {node: '>=0.8'}
+
+ resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-NW2cX8m1Q7KPA7a5M2ULQeZ2wR5qI5PAbw5L0UOMxdioVk9PMZ0h1TmyZEkPYrCvYjDlFICusOu1dlEKAAeXBw==}
+ engines: {node: '>=0.12.0'}
+
+ resolution: {integrity: sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==}
+
+ resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==}
+
+ resolution: {integrity: sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==}
+ engines: {node: '>= 4.0.0'}
+
+ resolution: {integrity: sha512-kU6FmrwZ3Lx7/7y3hPS5QnbJfaohcIul5fGqf7ok+4KklIEk9tJ0C2IQPdacSbVUWv6zVHXEBWoWd6NrVMT7Cw==}
+
+ resolution: {integrity: sha512-O+A6LWV5LDHSJD3LjHYoNi4VLsj/Whi7k6zG12xTYaU4cQ8oxQGckXNX8cRHK5yOZ/ppVHe0ZBXGzSV9jXdVbQ==}
+ engines: {node: ^10 || ^12 || >=14}
+ hasBin: true
+ peerDependencies:
+ postcss: ^8.1.0
+
+ resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-/1xYAC4MP/HEG+3duIhFr4ZQXR4sQXOIe+o6sdqzeykGLx6Upp/1p8MHqhINOvGeP7xyNHe7tsiJByc4SSVUxw==}
+
+ resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
+
+ resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==}
+
+ resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==}
+
+ resolution: {integrity: sha512-d0II/GO9uf9lfUHH2BQsjxzRJZBdsjgsBiW4BvhWk/3qoKwQFjIDVN19PfX8F2D/r9PCMTtLWjYVCFrpeYUzsw==}
+ deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
+
+ resolution: {integrity: sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==}
+
+ resolution: {integrity: sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==}
+
+ resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-KGj0KoOMXLpSNkkEI6Z6mShmQy0bc1I+T7K9N81k4WWMrfz+6fQ6es80B/YLAeRoKvjYE1YSHHOW1qe9xIVzHw==}
+ engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
+ hasBin: true
+
+ resolution: {integrity: sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==}
+
+ resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==}
+
+ resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==}
+
+ resolution: {integrity: sha512-2/egrNDDnRaxVwK3A+cJq6UOlqOdedGA7JPqCeJjN2Zjk1/QB/6QUi3b714ScIGS7HafFXTyzJEOr5b44I3kvQ==}
+ engines: {node: '>=12.0.0'}
+
+ resolution: {integrity: sha512-xNjXfsldUEe153h1DraD0XvDOpqGR0L5eKFkdReB7eFW5HqysDZFfly4rckda6y9dF39N3pkPlOblcfHKGw+uA==}
+
+ resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-/+Emcj9DAXxX4cwlLmRI9c166RuL3w30zp4R7Joiv2cQTtTtA+jeuCAjH3ZlGnYS3tKENSrKhAzVVP9GVyzeYQ==}
+ engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
+
+ resolution: {integrity: sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==}
+ engines: {node: '>=10.6.0'}
+
+ resolution: {integrity: sha512-v+p6ongsrp0yTGbJXjgxPow2+DL93DASP4kXCDKb8/bwRtt9OEF3whggkkDkGNzgcWy2XaF4a8nZglC7uElscg==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==}
+ engines: {node: '>=6'}
+
+ resolution: {integrity: sha512-VQAUIUzBiZ/UnlM28fSp2CRF3ivUn1BWEvxMcVTNwpw91Py1pGbPIyIKtd+tzct9C3ouceCVdGAXxZOpZAsgdw==}
+
+ resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==}
+ engines: {node: '>=10'}
+
+ resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==}
+ engines: {node: '>=10'}
+
+ resolution: {integrity: sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==}
+ engines: {node: '>=18'}
+
+ resolution: {integrity: sha512-1R5Fho+jBq0DDydt+/vHWj5KJNJCKdARKOCwZUen84I5BreWoLqRLANH1U87eJy1tiASPtMnGqJJq0ZsLoRPOw==}
+
+ resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg==}
+
+ resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==}
+ engines: {node: '>=6'}
+
+ resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==}
+ engines: {node: '>=6'}
+
+ resolution: {integrity: sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==}
+ engines: {node: '>=12'}
+
+ resolution: {integrity: sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==}
+
+ resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==}
+ engines: {node: '>=0.8'}
+
+ resolution: {integrity: sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==}
+ engines: {node: '>=6'}
+
+ resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==}
+ engines: {node: '>=7.0.0'}
+
+ resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==}
+
+ resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==}
+ engines: {node: '>= 0.8'}
+
+ resolution: {integrity: sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==}
+ engines: {node: '>= 6'}
+
+ resolution: {integrity: sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==}
+ engines: {node: ^12.20.0 || >=14}
+
+ resolution: {integrity: sha512-pJDh5/4wrEnXX/VWRZvruAGHkzKdr46z11OlTPN+VrATlWWhSKewNCJ1futCO5C7eJB3nPMFZA1LeYtcFboZ2A==}
+ engines: {node: '>=0.10.0'}
+
+ resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
+
+ resolution: {integrity: sha512-L6BuueHTRuJHQvQVc6YXYZRtN5vJUtOdCTLn0tRYYV5azfbAFcPghB5zEE40mVrV6w7slMTqUfkDomutIK14fw==}
+ engines: {node: '>=20'}
+
+ resolution: {integrity: sha512-GtNECbVI82bT4RiDIzBSVuTKoSHufnU7Ce7/42bkWZJZFLjmDF2WBpVsvRkhKCfKBnTBb3qZrBwPpFBU/Myvhg==}
+
+ resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==}
+
+ resolution: {integrity: sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA==}
+ engines: {node: '>=18'}
+
+ resolution: {integrity: sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==}
+
+ resolution: {integrity: sha512-iX3mfgcTMIq3ZKLIsVFAbv7+Mc10kxabAGQb8HvjA1o3T1PIYprbakQ65d3I+2HGHt6nSKkM9PYjgoJO2KcFBQ==}
+
+ resolution: {integrity: sha512-+R08/oI0nl3vfPcqftZRpytksBXDzOUveBq/NBVx0sUp1axwzPQrKinNx5yd5sxPu8j1wIy8AfnVQ+5eFdha6Q==}
+
+ resolution: {integrity: sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==}
+ engines: {node: '>=10.14', npm: '>=6', yarn: '>=1'}
+ hasBin: true
+
+ resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==}
+ engines: {node: '>= 8'}
+
+ resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==}
+
+ resolution: {integrity: sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-rBMW+F2TXryBwB54Q0d8drNEI+TfoS9JpNTAoVpukbWEhjXQq4rySFYLaqXMFXwdv61Zb2OHtj5bviSoimqxRQ==}
+ engines: {node: '>=18'}
+
+ resolution: {integrity: sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==}
+ engines: {node: '>=6.0'}
+ peerDependencies:
+ supports-color: '*'
+ peerDependenciesMeta:
+ supports-color:
+ optional: true
+
+ resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==}
+ engines: {node: '>=10'}
+
+ resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==}
+
+ resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==}
+
+ resolution: {integrity: sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==}
+ engines: {node: '>=10'}
+
+ resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==}
+ engines: {node: '>=0.4.0'}
+
+ resolution: {integrity: sha512-3UDv+G9CsCKO1WKMGw9fwq/SWJYbI0c5Y7LU1AXYoDdbhE2AHQ6N6Nb34sG8Fj7T5APy8qXDCKuuIHd1BR0tVA==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==}
+
+ resolution: {integrity: sha512-2xMCmOoMrdQIPHdsTawECdNPwlVFB9zGcz3kuhmBO6U3oU+UQjsue0i8ayLKpgBcm+hcXPMVSGUN9d+pvJ6+VQ==}
+
+ resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-59CAAjAhTaIMCN8y9kD573vDkxbs1uhDcrFLHSgutYdPcGOU35Rf95725snvzEOy4BFB7+eLJ8djCNPmGwG67w==}
+
+ resolution: {integrity: sha512-ZdzmqwKmECOWJpqefloC5OJy1+WZBBse5+MR88z9g9Zn4VY+WYUkAyojmhzJckH5YbbZGcYIuGAkY5/Ys5OM2Q==}
+ engines: {node: '>=8'}
+ os: [darwin]
+ hasBin: true
+
+ resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==}
+ engines: {node: '>=0.10.0'}
+
+ resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==}
+ engines: {node: '>=6.0.0'}
+
+ resolution: {integrity: sha512-1gxPBJpI/pcjQhKgIU91II6Wkay+dLcN3M6rf2uwP8hRur3HtQXjVrdAK3sjC0piaEuxzMwjXChcETiJl47lAQ==}
+ engines: {node: '>=18'}
+
+ resolution: {integrity: sha512-zIHwmZPRshsCdpMDyVsqGmgyP0yT8GAgXUnkdAoJisxvf33k7yO6OuoKmcTGuXPWSsm8Oh88nZicRLA9Y0rUeA==}
+ engines: {node: '>=12'}
+
+ resolution: {integrity: sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==}
+ engines: {node: '>=12'}
+
+ resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==}
+
+ resolution: {integrity: sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==}
+ engines: {node: '>=0.10.0'}
+ hasBin: true
+
+ resolution: {integrity: sha512-kpwXM7c/ayRUbYVErQbsZ0nQZX4aLHQrPEG9C4h9vuJCXylwFH8a7Jgi2VpKIObzCXO7LKHiCw4KdioFLFOgqA==}
+
+ resolution: {integrity: sha512-cD1kz5g2sgPTMFHjLxfMjUK5JABq3//J4jPswi93tOPFz6btzXYtK5NrDt717NRbukCUDOrrvmYVOWERlqoiXA==}
+ engines: {node: '>=14.0.0'}
+ hasBin: true
+
+ resolution: {integrity: sha512-a8QRH0rAPIWH9WyyS5LbNvW9Ark6qe63/LqDB7vu2JXYpi0Gma5Q60Dh4tmTqhOBQt0xsrzD8qE7C+D7j+B24A==}
+
+ resolution: {integrity: sha512-oL8bRy7pVCLpwhmXy05Rh/L6O93+k9t6dqSw0+MckIc3OmCTZm6Mp04Q4f/J0rtu84Ky6ywkR8ivtGOmrq+16w==}
+ engines: {node: '>=20'}
+
+ resolution: {integrity: sha512-7EH2G59nLsEMj97fpDuvVcYi6lwTcM1xuWw3PssD8xzboAW7zj7iB3COEEEATUfjLHrs5uKBLQT03V/8URx06g==}
+
+ resolution: {integrity: sha512-M7aAzaRvSl5VO+6KN4neJCYLHLpF/iWo5ztchI/+wMxIieDZQqpbCYfaEHHHPH6eupEzfvZdLYdPdmvGqoVe0Q==}
+ engines: {node: ^18.0.0 || >=20.0.0}
+ hasBin: true
+ peerDependencies:
+ '@swc/core': ^1.0.0
+ vite: ^4.0.0 || ^5.0.0 || ^6.0.0
+ peerDependenciesMeta:
+ '@swc/core':
+ optional: true
+
+ resolution: {integrity: sha512-bO3y10YikuUwUuDUQRM4KfwNkKhnpVO7IPdbsrejwN9/AABJzzTQ4GeHwyzNSrVO+tEH3/Np255a3sVZpZDjvg==}
+ engines: {node: '>=8.0.0'}
+
+ resolution: {integrity: sha512-1aDYk9Gsv1/fFeClMrxWGoVMl7uCUgl1pe26BiTnLXmAoqEXCa3f3sCKFWV+cuDzUjQGAZcpkWhGYTgWUSQrLA==}
+ engines: {node: '>= 12.20.55'}
+ hasBin: true
+
+ resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==}
+
+ resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==}
+
+ resolution: {integrity: sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==}
+
+ resolution: {integrity: sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==}
+
+ resolution: {integrity: sha512-6Jw4sE1maoRJo3q8MsSIn2onJFbLTOjY9hlx4DZXmOKvLRd1Ok2kXmAGXaafL2+ijsJZ1ClYbl/pmqr9+k4iUQ==}
+ engines: {node: '>=10.13.0'}
+
+ resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==}
+ engines: {node: '>=6'}
+
+ resolution: {integrity: sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A==}
+ engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
+
+ resolution: {integrity: sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==}
+
+ resolution: {integrity: sha512-WSzPgsdLtTcQwm4CROfS5ju2Wa1QQcVeT37jFjYzdFz1r9ahadC8B8/a4qxJxM+09F18iumCdRmlr96ZYkQvEg==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-uDn+FE1yrDzyC0pCo961B2IHbdM8y/ACZsKD4dG6WqrjV53BADjwa7D+1aom2rsNVfLyDgU/eigvlJGJ08OQ4w==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-d9T8ucsEhh8Bi1woXCf+TIKDIROLG5WCkxg8geBCbvk22kzwC5G2OnXVMO6FUsvQlgUUXQ2itephWDLqDzbeCw==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==}
+
+ resolution: {integrity: sha512-P8OtKZRv/5J5hhz0cUAdu/cLuPIKXpQl1R9pZtvmHWQvrAUVd0UNIPT4IB4W3rNOqVO0rlqHmCIbSwxh/c9yUQ==}
+ engines: {node: '>=18'}
+ hasBin: true
+
+ resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==}
+ engines: {node: '>=6'}
+
+ resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==}
+ engines: {node: '>=10'}
+
+ resolution: {integrity: sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==}
+ hasBin: true
+ peerDependencies:
+ eslint: '>=7.0.0'
+
+ resolution: {integrity: sha512-dobTkHT6XaEVOo8IO90Q4DOSxnm3Y151QxPJlM/vKC0bVy+d6cVWQZLlFiuZPP0wS6vZwSKeJgKkcS+KfMBlRw==}
+ engines: {node: ^14.18.0 || >=16.0.0}
+ peerDependencies:
+ '@types/eslint': '>=8.0.0'
+ eslint: '>=8.0.0'
+ eslint-config-prettier: '>= 7.0.0 <10.0.0 || >=10.1.0'
+ prettier: '>=3.0.0'
+ peerDependenciesMeta:
+ '@types/eslint':
+ optional: true
+ eslint-config-prettier:
+ optional: true
+
+ resolution: {integrity: sha512-Qteup0SqU15kdocexFNAJMvCJEfa2xUKNV4CC1xsVMrIIqEy3SQ/rqyxCWNzfrd3/ldy6HMlD2e0JDVpDg2qIA==}
+ engines: {node: '>=4'}
+ peerDependencies:
+ eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7
+
+ resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==}
+ engines: {node: '>=8.0.0'}
+
+ resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+
+ resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+
+ resolution: {integrity: sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options.
+ hasBin: true
+
+ resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==}
+ engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+
+ resolution: {integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==}
+ engines: {node: '>=0.10'}
+
+ resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==}
+ engines: {node: '>=4.0'}
+
+ resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==}
+ engines: {node: '>=4.0'}
+
+ resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==}
+ engines: {node: '>=4.0'}
+
+ resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==}
+ engines: {node: '>=0.10.0'}
+
+ resolution: {integrity: sha512-8QxYTVXUkuy7fIIoitQkPwGonB8F3Zj8eEO8Sqg9Zv/bkI7RJAzowee4gr81Hak/dUTpA2Z7VfQgoijjPNlUZA==}
+
+ resolution: {integrity: sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==}
+ engines: {node: '>= 10.17.0'}
+ hasBin: true
+
+ resolution: {integrity: sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA==}
+ engines: {'0': node >=0.6.0}
+
+ resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==}
+
+ resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==}
+
+ resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==}
+ engines: {node: '>=8.6.0'}
+
+ resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==}
+
+ resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==}
+
+ resolution: {integrity: sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw==}
+
+ resolution: {integrity: sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==}
+
+ resolution: {integrity: sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==}
+
+ resolution: {integrity: sha512-hiFoqpyZcfNm1yc4u8oWCf9A2c4D3QjCrks3zmoVKVxpQRzmPNar1hUJcBG2RQHvEVGDN+Jm81ZheVLAQMK6+w==}
+ peerDependencies:
+ picomatch: ^3 || ^4
+ peerDependenciesMeta:
+ picomatch:
+ optional: true
+
+ resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==}
+ engines: {node: ^10.12.0 || >=12.0.0}
+
+ resolution: {integrity: sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==}
+
+ resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==}
+ engines: {node: '>=10'}
+
+ resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==}
+ engines: {node: ^10.12.0 || >=12.0.0}
+
+ resolution: {integrity: sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==}
+
+ resolution: {integrity: sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==}
+ engines: {node: '>=4.0'}
+ peerDependencies:
+ debug: '*'
+ peerDependenciesMeta:
+ debug:
+ optional: true
+
+ resolution: {integrity: sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==}
+ engines: {node: '>=14'}
+
+ resolution: {integrity: sha512-qsITQPfmvMOSAdeyZ+12I1c+CKSstAFAwu+97zrnWAbIr5u8wfsExUzCesVLC8NgHuRUqNN4Zy6UPWUTRGslcA==}
+ engines: {node: '>= 6'}
+
+ resolution: {integrity: sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==}
+
+ resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==}
+ engines: {node: '>=12'}
+
+ resolution: {integrity: sha512-Z4XaCL6dUDHfP/jT25jJKMmtxvuwbkrD1vNSMFlo9lNLY2c5FHYSQgHPRZUjAB26TpDEoW9HCOgplrdbaPV/ew==}
+ engines: {node: '>=14.14'}
+
+ resolution: {integrity: sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==}
+ engines: {node: '>=6 <7 || >=8'}
+
+ resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==}
+ engines: {node: '>=6 <7 || >=8'}
+
+ resolution: {integrity: sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==}
+ engines: {node: '>=10'}
+
+ resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==}
+ engines: {node: '>= 8'}
+
+ resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==}
+
+ resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==}
+ engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
+ os: [darwin]
+
+ resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==}
+
+ resolution: {integrity: sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==}
+
+ resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==}
+ engines: {node: '>=6.9.0'}
+
+ resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==}
+ engines: {node: 6.* || 8.* || >= 10.*}
+
+ resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==}
+ engines: {node: '>= 6'}
+
+ resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==}
+ engines: {node: '>=10.13.0'}
+
+ resolution: {integrity: sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==}
+ hasBin: true
+
+ resolution: {integrity: sha512-2Nim7dha1KVkaiF4q6Dj+ngPPMdfvLJEOpZk/jKiUAkqKebpGAWQXAq9z1xu9HKu5lWfqw/FASuccEjyznjPaA==}
+ engines: {node: 20 || >=22}
+ hasBin: true
+
+ resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==}
+ deprecated: Glob versions prior to v9 are no longer supported
+
+ resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==}
+ engines: {node: '>=12'}
+ deprecated: Glob versions prior to v9 are no longer supported
+
+ resolution: {integrity: sha512-PT6XReJ+D07JvGoxQMkT6qji/jVNfX/h364XHZOWeRzy64sSFr+xJ5OX7LI3b4MPQzdL4H8Y8M0xzPpsVMwA8Q==}
+ engines: {node: '>=10.0'}
+
+ resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==}
+ engines: {node: '>=4'}
+
+ resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==}
+ engines: {node: '>=10'}
+
+ resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g==}
+ engines: {node: '>=10.19.0'}
+
+ resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==}
+
+ resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==}
+
+ resolution: {integrity: sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==}
+
+ resolution: {integrity: sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==}
+ engines: {node: '>=10'}
+
+ resolution: {integrity: sha512-dTxcvPXqPvXBQpq5dUr6mEMJX4oIEFv6bwom3FDwKRDsuIjjJGANqhBuoAn9c1RQJIdAKav33ED65E2ys+87QQ==}
+
+ resolution: {integrity: sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==}
+ engines: {node: '>= 6'}
+
+ resolution: {integrity: sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==}
+ engines: {node: '>= 14'}
+
+ resolution: {integrity: sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==}
+ engines: {node: '>=10.19.0'}
+
+ resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==}
+ engines: {node: '>= 6'}
+
+ resolution: {integrity: sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==}
+ engines: {node: '>= 14'}
+
+ resolution: {integrity: sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==}
+
+ resolution: {integrity: sha512-T10qvkw0zz4wnm560lOEg0PovVqUXuOFhhHAkixw8/sycy7TJt7v/RrkEKEQnAw2viPSJu6iAkErxnzR0g8PpQ==}
+ engines: {node: ^8.11.2 || >=10}
+ os: [darwin]
+
+ resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==}
+ engines: {node: '>=0.10.0'}
+
+ resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==}
+
+ resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==}
+ engines: {node: '>= 4'}
+
+ resolution: {integrity: sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==}
+ engines: {node: '>=6'}
+
+ resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==}
+ engines: {node: '>=0.8.19'}
+
+ resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==}
+
+ resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==}
+ deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
+
+ resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==}
+
+ resolution: {integrity: sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==}
+ engines: {node: '>= 12'}
+
+ resolution: {integrity: sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==}
+ hasBin: true
+
+ resolution: {integrity: sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==}
+ engines: {node: '>=0.10.0'}
+
+ resolution: {integrity: sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==}
+ engines: {node: '>=0.10.0'}
+
+ resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==}
+
+ resolution: {integrity: sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==}
+ engines: {node: '>=0.12.0'}
+
+ resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==}
+ engines: {node: '>=10'}
+
+ resolution: {integrity: sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==}
+
+ resolution: {integrity: sha512-iHrqe5shvBUcFbmZq9zOQHBoeOhZJu6RQGrDpBgenUm/Am+F3JM2MgQj+rK3Z601fzrL5gLZWtAPH2OBaSVcyw==}
+ engines: {node: '>= 8.0.0'}
+
+ resolution: {integrity: sha512-YKBKVkKhty7s8rxddb40oOkuP0NbaeXrQvLin6QMHL7Ypiy2RW9LwOVrVgZRyOrhQlayMd9t+D8yDy8MKFTSDQ==}
+ engines: {node: '>= 18.0.0'}
+
+ resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==}
+
+ resolution: {integrity: sha512-H0dkQoCa3b2VEeKQBOxFph+JAbcrQdE7KC0UkqwpLmv2EC4P41QXP+rqo9wYodACiG5/WM5s9oDApTU8utwj9g==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==}
+
+ resolution: {integrity: sha512-zptv57P3GpL+O0I7VdMJNBZCu+BPHVQUk55Ft8/QCJjTVxrnJHuVuX/0Bl2A6/+2oyR/ZMEuFKwmzqqZ/U5nPQ==}
+ engines: {node: 20 || >=22}
+
+ resolution: {integrity: sha512-2P4SQ0HrLQ+fw6llpLnOaGAvN2Zu6778SJMrCUwns4fOoG9ayrTiZk3VV8sCPkVZF8ab0zksVpS8FDY5pRCNBA==}
+ engines: {node: '>=10'}
+ hasBin: true
+
+ resolution: {integrity: sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A==}
+ hasBin: true
+
+ resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}
+
+ resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==}
+ hasBin: true
+
+ resolution: {integrity: sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==}
+
+ resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==}
+ engines: {node: '>=6'}
+ hasBin: true
+
+ resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==}
+
+ resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==}
+
+ resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==}
+
+ resolution: {integrity: sha512-XQmWYj2Sm4kn4WeTYvmpKEbyPsL7nBsb647c7pMe6l02/yx2+Jfc4dT6UZkEXnIUb5LhD55r2HPsJ1milQ4rDg==}
+
+ resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==}
+
+ resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==}
+
+ resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==}
+ engines: {node: '>=6'}
+ hasBin: true
+
+ resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==}
+
+ resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==}
+
+ resolution: {integrity: sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==}
+ engines: {node: '>=4.0'}
+
+ resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==}
+
+ resolution: {integrity: sha512-0/BnGCCfyUMkBpeDgWihanIAF9JmZhHBgUhEqzvf+adhNGLoP6TaiI5oF8oyb3I45P+PcnrqihSf01M0l0G5+Q==}
+
+ resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==}
+ engines: {node: '>= 0.8.0'}
+
+ resolution: {integrity: sha512-cK/eMabSViKn/PG8U/a7aCorpeKLMlK0bQeNHmdb7qUnBkNPnL+oV5DjJUo0kqWsJUapZsM4jCfYItbqBDvlcA==}
+ engines: {node: '>= 12.0.0'}
+ cpu: [arm64]
+ os: [darwin]
+
+ resolution: {integrity: sha512-c8JK7hyE65X1MHMN+Viq9n11RRC7hgin3HhYKhrMyaXflk5GVplZ60IxyoVtzILeKr+xAJwg6zK6sjTBJ0FKYQ==}
+ engines: {node: '>= 12.0.0'}
+ cpu: [arm64]
+ os: [darwin]
+
+ resolution: {integrity: sha512-j5qYxamyQw4kDXX5hnnCKMf3mLlHvG44f24Qyi2965/Ycz829MYqjrVg2H8BidybHBp9kom4D7DR5VqCKDXS0w==}
+ engines: {node: '>= 12.0.0'}
+ cpu: [x64]
+ os: [darwin]
+
+ resolution: {integrity: sha512-k1EvjakfumAQoTfcXUcHQZhSpLlkAuEkdMBsI/ivWw9hL+7FtilQc0Cy3hrx0AAQrVtQAbMI7YjCgYgvn37PzA==}
+ engines: {node: '>= 12.0.0'}
+ cpu: [x64]
+ os: [darwin]
+
+ resolution: {integrity: sha512-wDk7M2tM78Ii8ek9YjnY8MjV5f5JN2qNVO+/0BAGZRvXKtQrBC4/cn4ssQIpKIPP44YXw6gFdpUF+Ps+RGsCwg==}
+ engines: {node: '>= 12.0.0'}
+ cpu: [x64]
+ os: [freebsd]
+
+ resolution: {integrity: sha512-kmW6UGCGg2PcyUE59K5r0kWfKPAVy4SltVeut+umLCFoJ53RdCUWxcRDzO1eTaxf/7Q2H7LTquFHPL5R+Gjyig==}
+ engines: {node: '>= 12.0.0'}
+ cpu: [x64]
+ os: [freebsd]
+
+ resolution: {integrity: sha512-IRUrOrAF2Z+KExdExe3Rz7NSTuuJ2HvCGlMKoquK5pjvo2JY4Rybr+NrKnq0U0hZnx5AnGsuFHjGnNT14w26sg==}
+ engines: {node: '>= 12.0.0'}
+ cpu: [arm]
+ os: [linux]
+
+ resolution: {integrity: sha512-MjxUShl1v8pit+6D/zSPq9S9dQ2NPFSQwGvxBCYaBYLPlCWuPh9/t1MRS8iUaR8i+a6w7aps+B4N0S1TYP/R+Q==}
+ engines: {node: '>= 12.0.0'}
+ cpu: [arm]
+ os: [linux]
+
+ resolution: {integrity: sha512-KKCpOlmhdjvUTX/mBuaKemp0oeDIBBLFiU5Fnqxh1/DZ4JPZi4evEH7TKoSBFOSOV3J7iEmmBaw/8dpiUvRKlQ==}
+ engines: {node: '>= 12.0.0'}
+ cpu: [arm64]
+ os: [linux]
+
+ resolution: {integrity: sha512-gB72maP8rmrKsnKYy8XUuXi/4OctJiuQjcuqWNlJQ6jZiWqtPvqFziskH3hnajfvKB27ynbVCucKSm2rkQp4Bw==}
+ engines: {node: '>= 12.0.0'}
+ cpu: [arm64]
+ os: [linux]
+
+ resolution: {integrity: sha512-Q64eM1bPlOOUgxFmoPUefqzY1yV3ctFPE6d/Vt7WzLW4rKTv7MyYNky+FWxRpLkNASTnKQUaiMJ87zNODIrrKQ==}
+ engines: {node: '>= 12.0.0'}
+ cpu: [arm64]
+ os: [linux]
+
+ resolution: {integrity: sha512-jmUQVx4331m6LIX+0wUhBbmMX7TCfjF5FoOH6SD1CttzuYlGNVpA7QnrmLxrsub43ClTINfGSYyHe2HWeLl5CQ==}
+ engines: {node: '>= 12.0.0'}
+ cpu: [arm64]
+ os: [linux]
+
+ resolution: {integrity: sha512-0v6idDCPG6epLXtBH/RPkHvYx74CVziHo6TMYga8O2EiQApnUPZsbR9nFNrg2cgBzk1AYqEd95TlrsL7nYABQg==}
+ engines: {node: '>= 12.0.0'}
+ cpu: [x64]
+ os: [linux]
+
+ resolution: {integrity: sha512-piWx3z4wN8J8z3+O5kO74+yr6ze/dKmPnI7vLqfSqI8bccaTGY5xiSGVIJBDd5K5BHlvVLpUB3S2YCfelyJ1bw==}
+ engines: {node: '>= 12.0.0'}
+ cpu: [x64]
+ os: [linux]
+
+ resolution: {integrity: sha512-rMpz2yawkgGT8RULc5S4WiZopVMOFWjiItBT7aSfDX4NQav6M44rhn5hjtkKzB+wMTRlLLqxkeYEtQ3dd9696w==}
+ engines: {node: '>= 12.0.0'}
+ cpu: [x64]
+ os: [linux]
+
+ resolution: {integrity: sha512-rRomAK7eIkL+tHY0YPxbc5Dra2gXlI63HL+v1Pdi1a3sC+tJTcFrHX+E86sulgAXeI7rSzDYhPSeHHjqFhqfeQ==}
+ engines: {node: '>= 12.0.0'}
+ cpu: [x64]
+ os: [linux]
+
+ resolution: {integrity: sha512-nL7zRW6evGQqYVu/bKGK+zShyz8OVzsCotFgc7judbt6wnB2KbiKKJwBE4SGoDBQ1O94RjW4asrCjQL4i8Fhbw==}
+ engines: {node: '>= 12.0.0'}
+ cpu: [arm64]
+ os: [win32]
+
+ resolution: {integrity: sha512-mSL4rqPi4iXq5YVqzSsJgMVFENoa4nGTT/GjO2c0Yl9OuQfPsIfncvLrEW6RbbB24WtZ3xP/2CCmI3tNkNV4oA==}
+ engines: {node: '>= 12.0.0'}
+ cpu: [arm64]
+ os: [win32]
+
+ resolution: {integrity: sha512-EdIUW3B2vLuHmv7urfzMI/h2fmlnOQBk1xlsDxkN1tCWKjNFjfLhGxYk8C8mzpSfr+A6jFFIi8fU6LbQGsRWjA==}
+ engines: {node: '>= 12.0.0'}
+ cpu: [x64]
+ os: [win32]
+
+ resolution: {integrity: sha512-PVqXh48wh4T53F/1CCu8PIPCxLzWyCnn/9T5W1Jpmdy5h9Cwd+0YQS6/LwhHXSafuc61/xg9Lv5OrCby6a++jg==}
+ engines: {node: '>= 12.0.0'}
+ cpu: [x64]
+ os: [win32]
+
+ resolution: {integrity: sha512-6b6gd/RUXKaw5keVdSEtqFVdzWnU5jMxTUjA2bVcMNPLwSQ08Sv/UodBVtETLCn7k4S1Ibxwh7k68IwLZPgKaA==}
+ engines: {node: '>= 12.0.0'}
+
+ resolution: {integrity: sha512-xi6IyHML+c9+Q3W0S4fCQJOym42pyurFiJUHEcEyHS0CeKzia4yZDEsLlqOFykxOdHpNy0NmvVO31vcSqAxJCg==}
+ engines: {node: '>= 12.0.0'}
+
+ resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==}
+ engines: {node: '>=10'}
+
+ resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==}
+
+ resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==}
+
+ resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==}
+ engines: {node: '>=10'}
+
+ resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==}
+ hasBin: true
+
+ resolution: {integrity: sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==}
+
+ resolution: {integrity: sha512-QIXZUBJUx+2zHUdQujWejBkcD9+cs94tLn0+YL8UrCh+D5sCXZ4c7LaEH48pNwRY3MLDgqUFyhlCyjJPf1WP0A==}
+ engines: {node: 20 || >=22}
+
+ resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==}
+
+ resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==}
+ engines: {node: '>=10'}
+
+ resolution: {integrity: sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==}
+ engines: {node: '>=12'}
+
+ resolution: {integrity: sha512-6koYRhnM2N0GGZIdXzSeiNwguv1gt/FAjZOiPl76roBi3xKEXa4WmfpxgQwTTL4KipXjefrnf3oV4IsYhi4JFA==}
+ peerDependencies:
+ react: ^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0-rc
+
+ resolution: {integrity: sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==}
+
+ resolution: {integrity: sha512-NgOPbRiaQM10DYXvN3/hhGVI2M5MtITFryzBGxHM5p4wnFxsVCbxkrBrDsk+EZ5OB4jEOT7AjDxtdF+KVEFT7w==}
+ engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
+
+ resolution: {integrity: sha512-OkeDaAZ/bQCxeFAozM55PKcKU0yJMPGifLwV4Qgjitu+5MoAfSQN4lsLJeXZ1b8w0x+/Emda6MZgXS1jvsapng==}
+ engines: {node: '>=10'}
+
+ resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==}
+ engines: {node: '>= 8'}
+
+ resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==}
+ engines: {node: '>=8.6'}
+
+ resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==}
+ engines: {node: '>= 0.6'}
+
+ resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==}
+ engines: {node: '>= 0.6'}
+
+ resolution: {integrity: sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==}
+ engines: {node: '>=4.0.0'}
+ hasBin: true
+
+ resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==}
+ engines: {node: '>=6'}
+
+ resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==}
+ engines: {node: '>=18'}
+
+ resolution: {integrity: sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==}
+ engines: {node: '>=4'}
+
+ resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==}
+ engines: {node: '>=10'}
+
+ resolution: {integrity: sha512-IPZ167aShDZZUMdRk66cyQAW3qr0WzbHkPdMYa8bzZhlHhO3jALbKdxcaak7W9FfT2rZNpQuUu4Od7ILEpXSaw==}
+ engines: {node: 20 || >=22}
+
+ resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==}
+
+ resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==}
+ engines: {node: '>=10'}
+
+ resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==}
+ engines: {node: '>=16 || 14 >=14.17'}
+
+ resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==}
+
+ resolution: {integrity: sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==}
+ engines: {node: '>= 8'}
+
+ resolution: {integrity: sha512-LT49Zi2/WMROHYoqGgdlQIZh8mLPZmOrN2NdJjMXxYe4nkN6FUyuPuOAOedNJDrx0IRGg9+4guZewtp8hE6TxA==}
+ engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
+
+ resolution: {integrity: sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==}
+ engines: {node: '>= 8'}
+
+ resolution: {integrity: sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==}
+ engines: {node: '>=16 || 14 >=14.17'}
+
+ resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==}
+ engines: {node: '>= 8'}
+
+ resolution: {integrity: sha512-oG62iEk+CYt5Xj2YqI5Xi9xWUeZhDI8jjQmC5oThVH5JGCTgIjr7ciJDzC7MBzYd//WvR1OTmP5Q38Q8ShQtVA==}
+ engines: {node: '>= 18'}
+
+ resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==}
+ hasBin: true
+
+ resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==}
+ engines: {node: '>=10'}
+ hasBin: true
+
+ resolution: {integrity: sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==}
+ engines: {node: '>=10'}
+ hasBin: true
+
+ resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==}
+
+ resolution: {integrity: sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==}
+ engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
+ hasBin: true
+
+ resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==}
+
+ resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==}
+
+ resolution: {integrity: sha512-myRT3DiWPHqho5PrJaIRyaMv2kgYf0mUVgBNOYMuCH5Ki1yEiQaf/ZJuQ62nvpc44wL5WDbTX7yGJi1Neevw8w==}
+ engines: {node: '>= 0.6'}
+
+ resolution: {integrity: sha512-OhYaY5sDsIka7H7AtijtI9jwGYLyl29eQn/W623DiN/MIv5sUqc4g7BIDThX+gb7di9f6xK02nkp8sdfFWZLTg==}
+ engines: {node: '>=10'}
+
+ resolution: {integrity: sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg==}
+
+ resolution: {integrity: sha512-2xP/IGGMmmSQpI1+O/k72jF/ykvZ89JeuKX3TLJAYPDVLUalrshrLHkeVcCCZqG/eEa635cr8IBYzgnDvM2O8Q==}
+
+ resolution: {integrity: sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==}
+
+ resolution: {integrity: sha512-ZwLpbTgdhuZUnZzjd7nb1ZV+4DoiC6/sfiVKok72ym/4Tlf+DFdlHYmT2JPmcNNWV6Pi3SDf1kT+A4r9RTuT9g==}
+ engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
+ hasBin: true
+
+ resolution: {integrity: sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==}
+ engines: {node: '>=0.10.0'}
+
+ resolution: {integrity: sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==}
+ engines: {node: '>=10'}
+
+ resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==}
+ engines: {node: '>=0.10.0'}
+
+ resolution: {integrity: sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-8u/hfXFRBD1O0hPUjioLhoWFHRmt6tKA4/vZPyckBr18l1KE9uHrFaFaUi8MDRTpi4uak2goyPTSNJLXX2k2Hw==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==}
+
+ resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==}
+ engines: {node: '>=6'}
+
+ resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==}
+ engines: {node: '>= 0.8.0'}
+
+ resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==}
+ engines: {node: '>=10'}
+
+ resolution: {integrity: sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==}
+ engines: {node: '>=10'}
+
+ resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==}
+ engines: {node: '>=10'}
+
+ resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==}
+ engines: {node: '>=10'}
+
+ resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==}
+
+ resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==}
+ engines: {node: '>=6'}
+
+ resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==}
+ engines: {node: '>=0.10.0'}
+
+ resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==}
+
+ resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==}
+ engines: {node: '>=16 || 14 >=14.18'}
+
+ resolution: {integrity: sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==}
+ engines: {node: 20 || >=22}
+
+ resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-eRWB5LBz7PpDu4PUlwT0PhnQfTQJlDDdPa35urV4Osrm0t0AqQFGn+UIkU3klZvwJ8KPO3VbBFsXquA6p6kqZw==}
+ engines: {node: '>=12', npm: '>=6'}
+
+ resolution: {integrity: sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==}
+
+ resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==}
+
+ resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==}
+ engines: {node: '>=8.6'}
+
+ resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==}
+ engines: {node: '>=12'}
+
+ resolution: {integrity: sha512-uysumyrvkUX0rX/dEVqt8gC3sTBzd4zoWfLeS29nb53imdaXVvLINYXTI2GNqzaMuvacNx4uJQ8+b3zXR0pkgQ==}
+ engines: {node: '>=10.4.0'}
+
+ resolution: {integrity: sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==}
+
+ resolution: {integrity: sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==}
+ engines: {node: ^10 || ^12 || >=14}
+
+ resolution: {integrity: sha512-b9Eb8h2eVqNE8edvKdwqkrY6O7kAwmI8kcnBv1NScolYJbo59XUF0noFq+lxbC1yN20bmC0WBEbDC5H/7ASb0A==}
+ engines: {node: '>=14.0.0'}
+ hasBin: true
+
+ resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==}
+ engines: {node: '>= 0.8.0'}
+
+ resolution: {integrity: sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==}
+ engines: {node: '>=6.0.0'}
+
+ resolution: {integrity: sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==}
+ engines: {node: '>=14'}
+ hasBin: true
+
+ resolution: {integrity: sha512-Kcmo2FhfDTXdcbfDH76N7uBYHINxc/8GW7UAVuVP9I+Va3uHSerrnKV6dLooga/gh7GlgzuCCr/eoldnL1muGw==}
+ engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
+
+ resolution: {integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==}
+ engines: {node: '>=0.4.0'}
+
+ resolution: {integrity: sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==}
+ peerDependencies:
+ bluebird: '*'
+ peerDependenciesMeta:
+ bluebird:
+ optional: true
+
+ resolution: {integrity: sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==}
+ engines: {node: '>=10'}
+
+ resolution: {integrity: sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==}
+
+ resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==}
+
+ resolution: {integrity: sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA==}
+
+ resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}
+ engines: {node: '>=6'}
+
+ resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==}
+
+ resolution: {integrity: sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==}
+ engines: {node: '>=10'}
+
+ resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==}
+ peerDependencies:
+ react: ^18.3.1
+
+ resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==}
+
+ resolution: {integrity: sha512-z6F7K9bV85EfseRCp2bzrpyQ0Gkw1uLoCel9XBVWPg/TjRj94SkJzUTGfOa4bs7iJvBWtQG0Wq7wnI0syw3EBQ==}
+ engines: {node: '>=0.10.0'}
+
+ resolution: {integrity: sha512-zf45LZp5skDC6I3jDLXQUu0u26jtuP4lEGbc7BbdyxenBN1vJSTA18czM2D+h5qyMBuMrD+9uB+mU37HIoKGRA==}
+ engines: {node: '>=20.0.0'}
+ peerDependencies:
+ react: '>=18'
+ react-dom: '>=18'
+ peerDependenciesMeta:
+ react-dom:
+ optional: true
+
+ resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==}
+ engines: {node: '>=0.10.0'}
+
+ resolution: {integrity: sha512-BNg9EN3DD3GsDXX7Aa8O4p92sryjkmzYYgmgTAc6CA4uGLEDzFfxOxugu21akOxpcXHiEgsYkC6nPsQvLLLmEg==}
+ hasBin: true
+
+ resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==}
+ engines: {node: '>= 6'}
+
+ resolution: {integrity: sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==}
+ engines: {node: '>=0.10.0'}
+
+ resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==}
+ engines: {node: '>=0.10.0'}
+
+ resolution: {integrity: sha512-vHjcY2MlAITJhC0eRD/Vv8Vlgmu9Sd3LX9zZvtGzU5ZImdTN3+d6e/4mnTyV8vEbyf1sgNIrWxhWlrys52OkEA==}
+ engines: {node: '>=12', npm: '>=6'}
+
+ resolution: {integrity: sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==}
+
+ resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==}
+ engines: {node: '>=4'}
+
+ resolution: {integrity: sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==}
+ hasBin: true
+
+ resolution: {integrity: sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==}
+
+ resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==}
+ engines: {node: '>= 4'}
+
+ resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==}
+ engines: {iojs: '>=1.0.0', node: '>=0.10.0'}
+
+ resolution: {integrity: sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==}
+ deprecated: Rimraf versions prior to v4 are no longer supported
+ hasBin: true
+
+ resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==}
+ deprecated: Rimraf versions prior to v4 are no longer supported
+ hasBin: true
+
+ resolution: {integrity: sha512-9dkvaxAsk/xNXSJzMgFqqMCuFgt2+KsOFek3TMLfo8NCPfWpBmqwyNn5Y+NX56QUYfCtsyhF3ayiboEoUmJk/A==}
+ engines: {node: 20 || >=22}
+ hasBin: true
+
+ resolution: {integrity: sha512-CHhPh+UNHD2GTXNYhPWLnU8ONHdI+5DI+4EYIAOaiD63rHeYlZvyh8P+in5999TTSFgUYuKUAjzRI4mdh/p+2A==}
+ engines: {node: '>=8.0'}
+
+ resolution: {integrity: sha512-x8H8aPvD+xbl0Do8oez5f5o8eMS3trfCghc4HhLAnCkj7Vl0d1JWGs0UF/D886zLW2rOj2QymV/JcSSsw+XDNg==}
+ engines: {node: '>=18.0.0', npm: '>=8.0.0'}
+ hasBin: true
+
+ resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==}
+
+ resolution: {integrity: sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==}
+ engines: {node: '>=0.4'}
+
+ resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==}
+
+ resolution: {integrity: sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}
+
+ resolution: {integrity: sha512-y/52Mcy7aw3gRm7IrcGDFx/bCk4AhRh2eI9luHOQM86nZsqwiRkkq2GekHXBBD+SmPidc8i2PqtYZl+pWJ8Oeg==}
+
+ resolution: {integrity: sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==}
+
+ resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==}
+
+ resolution: {integrity: sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==}
+
+ resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==}
+ hasBin: true
+
+ resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==}
+ hasBin: true
+
+ resolution: {integrity: sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==}
+ engines: {node: '>=10'}
+ hasBin: true
+
+ resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==}
+ engines: {node: '>=10'}
+
+ resolution: {integrity: sha512-IOc8uWeOZgnb3ptbCURJWNjWUPcO3ZnTTdzsurqERrP6nPyv+paC55vJM0LpOlT2ne+Ix+9+CRG1MNLlyZ4GjQ==}
+
+ resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==}
+
+ resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==}
+ engines: {node: '>=14'}
+
+ resolution: {integrity: sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==}
+ engines: {node: '>=10'}
+
+ resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==}
+ engines: {node: '>= 6.0.0', npm: '>= 3.0.0'}
+
+ resolution: {integrity: sha512-Fgl0YPZ902wEsAyiQ+idGd1A7rSFx/ayC1CQVMw5P+EQx2V0SgpGtf6OKFhVjPflPUl9YMmEOnmfjCdMUsygww==}
+ engines: {node: '>= 10'}
+
+ resolution: {integrity: sha512-iF+tNDQla22geJdTyJB1wM/qrX9DMRwWrciEPwWLPRWAUEM8sQiyxgckLxWT1f7+9VabJS0jTGGr4QgBuvi6Ww==}
+ engines: {node: '>= 10.0.0', npm: '>= 3.0.0'}
+
+ resolution: {integrity: sha512-DIS8z4PfJRbIyfVFDVnK9rO3eYDtse4Omcm6bt0oEr5/jtLgysmjuBl1frJ9E/EQZrFmKx2A8m/s5s9CRXIzhw==}
+ peerDependencies:
+ react: ^18.0.0 || ^19.0.0 || ^19.0.0-rc
+ react-dom: ^18.0.0 || ^19.0.0 || ^19.0.0-rc
+
+ resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==}
+ engines: {node: '>=0.10.0'}
+
+ resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==}
+
+ resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==}
+ engines: {node: '>=0.10.0'}
+
+ resolution: {integrity: sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==}
+
+ resolution: {integrity: sha512-o57Wcn66jMQvfHG1FlYbWeZWW/dHZhJXjpIcTfXldXEk5nz5lStPo3mK0OJQfGR3RbZUlbISexbljkJzuEj/8Q==}
+ engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
+
+ resolution: {integrity: sha512-jH9EhtKIjuXZ2cWxmXS8ZP80XyC3iasQxMDV8jzhNJpfDb7VbQLVW4Wvsxz9QZvzV+G4YoSfBUVKDOyxLzi/sg==}
+ engines: {node: '>= 6'}
+
+ resolution: {integrity: sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==}
+ engines: {node: '>=12'}
+
+ resolution: {integrity: sha512-6CC9uyBL+/48dYizRf7H7VAYCMCNTBeM78x/VTUe9bFEaxBepPJDa1Ow99LqI/1yF7kuy7Q3cQsYMrcjGUcskA==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-0u/TldDbKD8bFCQ/4f5+mNRrXwZ8hg2w7ZR8wa16e8z9XpePWl3eGEcUD0OXpEH/VJH/2G3gjUtR3ZOiBe2S/w==}
+
+ resolution: {integrity: sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==}
+
+ resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==}
+ engines: {node: '>=12'}
+
+ resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-H2N9c26eXjzL/S/K+i/RHHcFanE74dptvvjM8iwzwbVcWY/zjBbgRqF3K0DY4+OD+uTTASTBvDoxPDaPN02D7g==}
+
+ resolution: {integrity: sha512-MvjXzkz/BOfyVDkG0oFOtBxHX2u3gKbMHIF/dXblZsgD3BWOFLmHovIpZY7BykJdAjcqRCBi1WYBNdEC9yI7vg==}
+ engines: {node: '>= 8.0'}
+
+ resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==}
+ engines: {node: '>=8'}
+
+ resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-+XZ+r1XGIJGeQk3VvXhT6xx/VpbHsRzsTkGgF6E5RX9TTXD0118l87puaEBZ566FhqblC6U0d4XnubznJDm30A==}
+ engines: {node: ^14.18.0 || >=16.0.0}
+
+ resolution: {integrity: sha512-P+Vu1qXfzediirmHOC3xKGAYeZtPcV9g76X+xg2FD4tYgR71ewMA35Y3sCz3zhiN/dwefRpJX0yBcgwi1fXNQA==}
+
+ resolution: {integrity: sha512-2E9TBm6MDD/xKYe+dvJZAmg3yxIEDNRc0jwlNyDg/4Fil2QcSLjFKGVff0lAf1jjeaArlG/M75Ey/EYr/OJtBA==}
+
+ resolution: {integrity: sha512-2Q+rw9vy1WFXu5cIxlvsabCwhU2qUwodGq03ODhLJ0jW4ek5BUtoCsnLB0qG+m8AHgEsSJcJGDSDe06FXlP74g==}
+
+ resolution: {integrity: sha512-Re10+NauLTMCudc7T5WLFLAwDhQ0JWdrMK+9B2M8zR5hRExKmsRDCBA7/aV/pNJFltmBFO5BAMlQFi/vq3nKOg==}
+ engines: {node: '>=6'}
+
+ resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==}
+ engines: {node: '>=10'}
+
+ resolution: {integrity: sha512-5S7Va8hKfV7W5U6g3aYxXmlPoZVAwUMy9AOKyF2fVuZa2UD3qZjg578OrLRt8PcNN1PleVaL/5/yYATNL0ICUw==}
+ engines: {node: '>=18'}
+
+ resolution: {integrity: sha512-C5tjlC/HCtVUOi3KWVokd4vHVViOmGjtLwIh4MuzPo/nMYTV/p1urt3RnMz2IWXDdKEGJH3k5+KPxtqRsUYGtg==}
+
+ resolution: {integrity: sha512-yYrrsWnrXMcdsnu/7YMYAofM1ktpL5By7vZhf15CrXijWWrEYZks5AXBudalfSWJLlnen/QUJUB5aoB0kqZUGA==}
+ engines: {node: '>=6.0.0'}
+
+ resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==}
+
+ resolution: {integrity: sha512-01EAw5EDrcVrdgyCLgoSPvqznC0sVxDSVeiOz09FUpjh71G79VCqneOr+xvt7T1r76CF6ZZfPjHorN2+d+3mqA==}
+
+ resolution: {integrity: sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==}
+ engines: {node: '>=12.0.0'}
+
+ resolution: {integrity: sha512-RwM7MoPojPxsOBYnyd2hy0bxtIlVrihNs9pj5SUvY8Zz1sQcQG2tG1hSr8PDxfgEB8RNKDhqbIlroIarSNDNsQ==}
+
+ resolution: {integrity: sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==}
+ engines: {node: '>=14.14'}
+
+ resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==}
+ engines: {node: '>=8.0'}
+
+ resolution: {integrity: sha512-95Pu1QXQvruGEhv62XCMO3Mm90GscOCClvrIUwCM0PYOXK3kaF3l3sIHxx71ThJfcbM2O5Au6SO3AWCSEfW4mQ==}
+
+ resolution: {integrity: sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==}
+ engines: {node: '>=16'}
+ peerDependencies:
+ typescript: '>=4.2.0'
+
+ resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==}
+
+ resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==}
+ engines: {node: '>= 6'}
+ peerDependencies:
+ typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta'
+
+ resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==}
+ engines: {node: '>= 0.8.0'}
+
+ resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==}
+ engines: {node: '>=10'}
+
+ resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==}
+ engines: {node: '>=10'}
+
+ resolution: {integrity: sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==}
+ engines: {node: '>=16'}
+
+ resolution: {integrity: sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==}
+ engines: {node: '>=14.17'}
+ hasBin: true
+
+ resolution: {integrity: sha512-ZPtzy0hu4cZjv3z5NW9gfKnNLjoz4y6uv4HlelAjDK7sY/xOkKZv9xK/WQpcsBB3jEybChz9DPC2U/+cusjJVQ==}
+ engines: {node: '>=18'}
+
+ resolution: {integrity: sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==}
+
+ resolution: {integrity: sha512-ODWHtkkdx3IAR+veKxFV+VBkUMcN+FaqzUUd7IZzt+0zhDZFPFxhlqwPF3YQvMHx1TD0tdgYl+kuPnJ8E6ql7A==}
+ engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
+
+ resolution: {integrity: sha512-8EyMynh679x/0gqE9fT9oilG+qEt+ibFyqjuVTsZn1+CMxH+XLlpvr2UZx4nVcCwTpx81nICr2JQFkM+HPLq4w==}
+ engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
+
+ resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==}
+ engines: {node: '>= 4.0.0'}
+
+ resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==}
+ engines: {node: '>= 10.0.0'}
+
+ resolution: {integrity: sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==}
+ hasBin: true
+ peerDependencies:
+ browserslist: '>= 4.21.0'
+
+ resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
+
+ resolution: {integrity: sha512-Xn0w3MtiQ6zoz2vFyUVruaCL53O/DwUvkEeOvj+uulMm0BkUGYWmBYVyElqZaSLhY6ZD0ulfU3aBra2aVT4xfA==}
+
+ resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
+
+ resolution: {integrity: sha512-veufcmxri4e3XSrT0xwfUR7kguIkaxBeosDg00yDWhk49wdwkSUrvvsm7nc75e1PUyvIeZj6nS8VQRYz2/S4Xg==}
+ engines: {node: '>=0.6.0'}
+
+ resolution: {integrity: sha512-cZn6NDFE7wdTpINgs++ZJ4N49W2vRp8LCKrn3Ob1kYNtOo21vfDoaV5GzBfLU4MovSAB8uNRm4jgzVQZ+mBzPQ==}
+ engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0}
+ hasBin: true
+ peerDependencies:
+ '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0
+ jiti: '>=1.21.0'
+ less: '*'
+ lightningcss: ^1.21.0
+ sass: '*'
+ sass-embedded: '*'
+ stylus: '*'
+ sugarss: '*'
+ terser: ^5.16.0
+ tsx: ^4.8.1
+ yaml: ^2.4.2
+ peerDependenciesMeta:
+ '@types/node':
+ optional: true
+ jiti:
+ optional: true
+ less:
+ optional: true
+ lightningcss:
+ optional: true
+ sass:
+ optional: true
+ sass-embedded:
+ optional: true
+ stylus:
+ optional: true
+ sugarss:
+ optional: true
+ terser:
+ optional: true
+ tsx:
+ optional: true
+ yaml:
+ optional: true
+
+ resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==}
+
+ resolution: {integrity: sha512-4rnvd3A1t16PWzrBUcSDZqcAmsUIy4minDXT/CZ8F2mVDgd65i4Aalimgz1aQkRGU0iH5eT5+6Rx2TK8o443Pg==}
+
+ resolution: {integrity: sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==}
+ engines: {node: '>= 0.4'}
+
+ resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==}
+ engines: {node: '>= 8'}
+ hasBin: true
+
+ resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==}
+ engines: {node: '>=0.10.0'}
+
+ resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==}
+ engines: {node: '>=10'}
+
+ resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==}
+ engines: {node: '>=12'}
+
+ resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
+
+ resolution: {integrity: sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg==}
+ engines: {node: '>=8.0'}
+
+ resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==}
+ engines: {node: '>=10'}
+
+ resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==}
+
+ resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==}
+
+ resolution: {integrity: sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==}
+ engines: {node: '>=18'}
+
+ resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==}
+ engines: {node: '>=12'}
+
+ resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==}
+ engines: {node: '>=12'}
+
+ resolution: {integrity: sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==}
+
+ resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
+ engines: {node: '>=10'}
+
+snapshots:
+
+
+ '@alloc/[email protected]': {}
+
+ '@ampproject/[email protected]':
+ dependencies:
+ '@jridgewell/gen-mapping': 0.3.10
+ '@jridgewell/trace-mapping': 0.3.27
+
+ '@babel/[email protected]':
+ dependencies:
+ '@babel/helper-validator-identifier': 7.27.1
+ js-tokens: 4.0.0
+ picocolors: 1.1.1
+
+ '@babel/[email protected]': {}
+
+ '@babel/[email protected]':
+ dependencies:
+ '@ampproject/remapping': 2.3.0
+ '@babel/code-frame': 7.27.1
+ '@babel/generator': 7.27.5
+ '@babel/helper-compilation-targets': 7.27.2
+ '@babel/helper-module-transforms': 7.27.3(@babel/[email protected])
+ '@babel/helpers': 7.27.6
+ '@babel/parser': 7.27.7
+ '@babel/template': 7.27.2
+ '@babel/traverse': 7.27.7
+ '@babel/types': 7.27.7
+ convert-source-map: 2.0.0
+ debug: 4.4.1
+ gensync: 1.0.0-beta.2
+ json5: 2.2.3
+ semver: 6.3.1
+ transitivePeerDependencies:
+ - supports-color
+
+ '@babel/[email protected]':
+ dependencies:
+ '@babel/parser': 7.27.7
+ '@babel/types': 7.27.7
+ '@jridgewell/gen-mapping': 0.3.10
+ '@jridgewell/trace-mapping': 0.3.27
+ jsesc: 3.1.0
+
+ '@babel/[email protected]':
+ dependencies:
+ '@babel/compat-data': 7.27.7
+ '@babel/helper-validator-option': 7.27.1
+ browserslist: 4.25.1
+ lru-cache: 5.1.1
+ semver: 6.3.1
+
+ '@babel/[email protected]':
+ dependencies:
+ '@babel/traverse': 7.27.7
+ '@babel/types': 7.27.7
+ transitivePeerDependencies:
+ - supports-color
+
+ dependencies:
+ '@babel/core': 7.27.7
+ '@babel/helper-module-imports': 7.27.1
+ '@babel/helper-validator-identifier': 7.27.1
+ '@babel/traverse': 7.27.7
+ transitivePeerDependencies:
+ - supports-color
+
+ '@babel/[email protected]': {}
+
+ '@babel/[email protected]': {}
+
+ '@babel/[email protected]': {}
+
+ '@babel/[email protected]': {}
+
+ '@babel/[email protected]':
+ dependencies:
+ '@babel/template': 7.27.2
+ '@babel/types': 7.27.7
+
+ '@babel/[email protected]':
+ dependencies:
+ '@babel/types': 7.27.7
+
+ dependencies:
+ '@babel/core': 7.27.7
+ '@babel/helper-plugin-utils': 7.27.1
+
+ dependencies:
+ '@babel/core': 7.27.7
+ '@babel/helper-plugin-utils': 7.27.1
+
+ dependencies:
+ '@babel/core': 7.27.7
+ '@babel/helper-plugin-utils': 7.27.1
+
+ '@babel/[email protected]':
+ dependencies:
+ '@babel/code-frame': 7.27.1
+ '@babel/parser': 7.27.7
+ '@babel/types': 7.27.7
+
+ '@babel/[email protected]':
+ dependencies:
+ '@babel/code-frame': 7.27.1
+ '@babel/generator': 7.27.5
+ '@babel/parser': 7.27.7
+ '@babel/template': 7.27.2
+ '@babel/types': 7.27.7
+ debug: 4.4.1
+ globals: 11.12.0
+ transitivePeerDependencies:
+ - supports-color
+
+ '@babel/[email protected]':
+ dependencies:
+ '@babel/helper-string-parser': 7.27.1
+ '@babel/helper-validator-identifier': 7.27.1
+
+ '@develar/[email protected]':
+ dependencies:
+ ajv: 6.12.6
+ ajv-keywords: 3.5.2([email protected])
+
+ dependencies:
+ eslint: 8.57.1
+ eslint-config-prettier: 9.1.0([email protected])
+ prettier: 3.6.2
+ transitivePeerDependencies:
+ - '@types/eslint'
+
+ dependencies:
+ '@typescript-eslint/eslint-plugin': 7.18.0(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])
+ '@typescript-eslint/parser': 7.18.0([email protected])([email protected])
+ eslint: 8.57.1
+ optionalDependencies:
+ typescript: 5.8.3
+ transitivePeerDependencies:
+ - supports-color
+
+ '@electron-toolkit/[email protected]([email protected])':
+ dependencies:
+ electron: 34.1.1
+
+ '@electron-toolkit/[email protected](@types/[email protected])':
+ dependencies:
+ '@types/node': 20.19.2
+
+ '@electron-toolkit/[email protected]([email protected])':
+ dependencies:
+ electron: 34.1.1
+
+ '@electron/[email protected]':
+ dependencies:
+ commander: 5.1.0
+ glob: 7.2.3
+ minimatch: 3.1.2
+
+ '@electron/[email protected]':
+ dependencies:
+ commander: 5.1.0
+ glob: 7.2.3
+ minimatch: 3.1.2
+
+ '@electron/[email protected]':
+ dependencies:
+ chalk: 4.1.2
+ fs-extra: 9.1.0
+ minimist: 1.2.8
+
+ '@electron/[email protected]':
+ dependencies:
+ debug: 4.4.1
+ env-paths: 2.2.1
+ fs-extra: 8.1.0
+ got: 11.8.6
+ progress: 2.0.3
+ semver: 6.3.1
+ sumchecker: 3.0.1
+ optionalDependencies:
+ global-agent: 3.0.0
+ transitivePeerDependencies:
+ - supports-color
+
+ '@electron/node-gyp@https://codeload.github.com/electron/node-gyp/tar.gz/06b29aafb7708acef8b3669835c8a7857ebc92d2':
+ dependencies:
+ env-paths: 2.2.1
+ exponential-backoff: 3.1.2
+ glob: 8.1.0
+ graceful-fs: 4.2.11
+ make-fetch-happen: 10.2.1
+ nopt: 6.0.0
+ proc-log: 2.0.1
+ semver: 7.7.2
+ tar: 6.2.1
+ which: 2.0.2
+ transitivePeerDependencies:
+ - bluebird
+ - supports-color
+
+ '@electron/[email protected]':
+ dependencies:
+ debug: 4.4.1
+ fs-extra: 9.1.0
+ promise-retry: 2.0.1
+ transitivePeerDependencies:
+ - supports-color
+
+ '@electron/[email protected]':
+ dependencies:
+ compare-version: 0.1.2
+ debug: 4.4.1
+ fs-extra: 10.1.0
+ isbinaryfile: 4.0.10
+ minimist: 1.2.8
+ plist: 3.1.0
+ transitivePeerDependencies:
+ - supports-color
+
+ '@electron/[email protected]':
+ dependencies:
+ '@electron/node-gyp': https://codeload.github.com/electron/node-gyp/tar.gz/06b29aafb7708acef8b3669835c8a7857ebc92d2
+ '@malept/cross-spawn-promise': 2.0.0
+ chalk: 4.1.2
+ debug: 4.4.1
+ detect-libc: 2.0.4
+ fs-extra: 10.1.0
+ got: 11.8.6
+ node-abi: 3.75.0
+ node-api-version: 0.2.1
+ ora: 5.4.1
+ read-binary-file-arch: 1.0.6
+ semver: 7.7.2
+ tar: 6.2.1
+ yargs: 17.7.2
+ transitivePeerDependencies:
+ - bluebird
+ - supports-color
+
+ '@electron/[email protected]':
+ dependencies:
+ '@electron/asar': 3.4.1
+ '@malept/cross-spawn-promise': 2.0.0
+ debug: 4.4.1
+ dir-compare: 4.2.0
+ fs-extra: 11.3.0
+ minimatch: 9.0.5
+ plist: 3.1.0
+ transitivePeerDependencies:
+ - supports-color
+
+ '@electron/[email protected]':
+ dependencies:
+ cross-dirname: 0.1.0
+ debug: 4.4.1
+ fs-extra: 11.3.0
+ minimist: 1.2.8
+ postject: 1.0.0-alpha.6
+ transitivePeerDependencies:
+ - supports-color
+ optional: true
+
+ '@esbuild/[email protected]':
+ optional: true
+
+ '@esbuild/[email protected]':
+ optional: true
+
+ '@esbuild/[email protected]':
+ optional: true
+
+ '@esbuild/[email protected]':
+ optional: true
+
+ '@esbuild/[email protected]':
+ optional: true
+
+ '@esbuild/[email protected]':
+ optional: true
+
+ '@esbuild/[email protected]':
+ optional: true
+
+ '@esbuild/[email protected]':
+ optional: true
+
+ '@esbuild/[email protected]':
+ optional: true
+
+ '@esbuild/[email protected]':
+ optional: true
+
+ '@esbuild/[email protected]':
+ optional: true
+
+ '@esbuild/[email protected]':
+ optional: true
+
+ '@esbuild/[email protected]':
+ optional: true
+
+ '@esbuild/[email protected]':
+ optional: true
+
+ '@esbuild/[email protected]':
+ optional: true
+
+ '@esbuild/[email protected]':
+ optional: true
+
+ '@esbuild/[email protected]':
+ optional: true
+
+ '@esbuild/[email protected]':
+ optional: true
+
+ '@esbuild/[email protected]':
+ optional: true
+
+ '@esbuild/[email protected]':
+ optional: true
+
+ '@esbuild/[email protected]':
+ optional: true
+
+ '@esbuild/[email protected]':
+ optional: true
+
+ '@esbuild/[email protected]':
+ optional: true
+
+ '@esbuild/[email protected]':
+ optional: true
+
+ '@esbuild/[email protected]':
+ optional: true
+
+ '@eslint-community/[email protected]([email protected])':
+ dependencies:
+ eslint: 8.57.1
+ eslint-visitor-keys: 3.4.3
+
+ '@eslint-community/[email protected]': {}
+
+ '@eslint/[email protected]':
+ dependencies:
+ ajv: 6.12.6
+ debug: 4.4.1
+ espree: 9.6.1
+ globals: 13.24.0
+ ignore: 5.3.2
+ import-fresh: 3.3.1
+ js-yaml: 4.1.0
+ minimatch: 3.1.2
+ strip-json-comments: 3.1.1
+ transitivePeerDependencies:
+ - supports-color
+
+ '@eslint/[email protected]': {}
+
+ '@gar/[email protected]': {}
+
+ '@humanwhocodes/[email protected]':
+ dependencies:
+ '@humanwhocodes/object-schema': 2.0.3
+ debug: 4.4.1
+ minimatch: 3.1.2
+ transitivePeerDependencies:
+ - supports-color
+
+ '@humanwhocodes/[email protected]': {}
+
+ '@humanwhocodes/[email protected]': {}
+
+ '@isaacs/[email protected]': {}
+
+ '@isaacs/[email protected]':
+ dependencies:
+ '@isaacs/balanced-match': 4.0.1
+
+ '@isaacs/[email protected]':
+ dependencies:
+ string-width: 5.1.2
+ string-width-cjs: [email protected]
+ strip-ansi: 7.1.0
+ strip-ansi-cjs: [email protected]
+ wrap-ansi: 8.1.0
+ wrap-ansi-cjs: [email protected]
+
+ '@isaacs/[email protected]':
+ dependencies:
+ minipass: 7.1.2
+
+ '@jridgewell/[email protected]':
+ dependencies:
+ '@jridgewell/sourcemap-codec': 1.5.2
+ '@jridgewell/trace-mapping': 0.3.27
+
+ '@jridgewell/[email protected]': {}
+
+ '@jridgewell/[email protected]': {}
+
+ '@jridgewell/[email protected]':
+ dependencies:
+ '@jridgewell/resolve-uri': 3.1.2
+ '@jridgewell/sourcemap-codec': 1.5.2
+
+ '@malept/[email protected]':
+ dependencies:
+ cross-spawn: 7.0.6
+
+ '@malept/[email protected]':
+ dependencies:
+ debug: 4.4.1
+ fs-extra: 9.1.0
+ lodash: 4.17.21
+ tmp-promise: 3.0.3
+ transitivePeerDependencies:
+ - supports-color
+
+ '@nodelib/[email protected]':
+ dependencies:
+ '@nodelib/fs.stat': 2.0.5
+ run-parallel: 1.2.0
+
+ '@nodelib/[email protected]': {}
+
+ '@nodelib/[email protected]':
+ dependencies:
+ '@nodelib/fs.scandir': 2.1.5
+ fastq: 1.19.1
+
+ '@npmcli/[email protected]':
+ dependencies:
+ '@gar/promisify': 1.1.3
+ semver: 7.7.2
+
+ '@npmcli/[email protected]':
+ dependencies:
+ mkdirp: 1.0.4
+ rimraf: 3.0.2
+
+ '@pkgjs/[email protected]':
+ optional: true
+
+ '@pkgr/[email protected]': {}
+
+ dependencies:
+ react: 18.3.1
+ optionalDependencies:
+ '@types/react': 18.3.23
+
+ dependencies:
+ '@radix-ui/react-compose-refs': 1.1.2(@types/[email protected])([email protected])
+ react: 18.3.1
+ optionalDependencies:
+ '@types/react': 18.3.23
+
+ '@rolldown/[email protected]': {}
+
+ '@rollup/[email protected]':
+ optional: true
+
+ '@rollup/[email protected]':
+ optional: true
+
+ '@rollup/[email protected]':
+ optional: true
+
+ '@rollup/[email protected]':
+ optional: true
+
+ '@rollup/[email protected]':
+ optional: true
+
+ '@rollup/[email protected]':
+ optional: true
+
+ '@rollup/[email protected]':
+ optional: true
+
+ '@rollup/[email protected]':
+ optional: true
+
+ '@rollup/[email protected]':
+ optional: true
+
+ '@rollup/[email protected]':
+ optional: true
+
+ '@rollup/[email protected]':
+ optional: true
+
+ '@rollup/[email protected]':
+ optional: true
+
+ '@rollup/[email protected]':
+ optional: true
+
+ '@rollup/[email protected]':
+ optional: true
+
+ '@rollup/[email protected]':
+ optional: true
+
+ '@rollup/[email protected]':
+ optional: true
+
+ '@rollup/[email protected]':
+ optional: true
+
+ '@rollup/[email protected]':
+ optional: true
+
+ '@rollup/[email protected]':
+ optional: true
+
+ '@rollup/[email protected]':
+ optional: true
+
+ '@sindresorhus/[email protected]': {}
+
+ '@szmarczak/[email protected]':
+ dependencies:
+ defer-to-connect: 2.0.1
+
+ '@tailwindcss/[email protected]':
+ dependencies:
+ '@ampproject/remapping': 2.3.0
+ enhanced-resolve: 5.18.2
+ jiti: 2.4.2
+ lightningcss: 1.30.1
+ magic-string: 0.30.17
+ source-map-js: 1.2.1
+ tailwindcss: 4.1.11
+
+ '@tailwindcss/[email protected]':
+ dependencies:
+ enhanced-resolve: 5.18.2
+ jiti: 2.4.2
+ lightningcss: 1.29.2
+ tailwindcss: 4.1.3
+
+ '@tailwindcss/[email protected]':
+ optional: true
+
+ '@tailwindcss/[email protected]':
+ optional: true
+
+ '@tailwindcss/[email protected]':
+ optional: true
+
+ '@tailwindcss/[email protected]':
+ optional: true
+
+ '@tailwindcss/[email protected]':
+ optional: true
+
+ '@tailwindcss/[email protected]':
+ optional: true
+
+ '@tailwindcss/[email protected]':
+ optional: true
+
+ '@tailwindcss/[email protected]':
+ optional: true
+
+ '@tailwindcss/[email protected]':
+ optional: true
+
+ '@tailwindcss/[email protected]':
+ optional: true
+
+ '@tailwindcss/[email protected]':
+ optional: true
+
+ '@tailwindcss/[email protected]':
+ optional: true
+
+ '@tailwindcss/[email protected]':
+ optional: true
+
+ '@tailwindcss/[email protected]':
+ optional: true
+
+ '@tailwindcss/[email protected]':
+ optional: true
+
+ '@tailwindcss/[email protected]':
+ optional: true
+
+ '@tailwindcss/[email protected]':
+ optional: true
+
+ '@tailwindcss/[email protected]':
+ optional: true
+
+ '@tailwindcss/[email protected]':
+ optional: true
+
+ '@tailwindcss/[email protected]':
+ optional: true
+
+ '@tailwindcss/[email protected]':
+ optional: true
+
+ '@tailwindcss/[email protected]':
+ optional: true
+
+ '@tailwindcss/[email protected]':
+ optional: true
+
+ '@tailwindcss/[email protected]':
+ dependencies:
+ detect-libc: 2.0.4
+ tar: 7.4.3
+ optionalDependencies:
+ '@tailwindcss/oxide-android-arm64': 4.1.11
+ '@tailwindcss/oxide-darwin-arm64': 4.1.11
+ '@tailwindcss/oxide-darwin-x64': 4.1.11
+ '@tailwindcss/oxide-freebsd-x64': 4.1.11
+ '@tailwindcss/oxide-linux-arm-gnueabihf': 4.1.11
+ '@tailwindcss/oxide-linux-arm64-gnu': 4.1.11
+ '@tailwindcss/oxide-linux-arm64-musl': 4.1.11
+ '@tailwindcss/oxide-linux-x64-gnu': 4.1.11
+ '@tailwindcss/oxide-linux-x64-musl': 4.1.11
+ '@tailwindcss/oxide-wasm32-wasi': 4.1.11
+ '@tailwindcss/oxide-win32-arm64-msvc': 4.1.11
+ '@tailwindcss/oxide-win32-x64-msvc': 4.1.11
+
+ '@tailwindcss/[email protected]':
+ optionalDependencies:
+ '@tailwindcss/oxide-android-arm64': 4.1.3
+ '@tailwindcss/oxide-darwin-arm64': 4.1.3
+ '@tailwindcss/oxide-darwin-x64': 4.1.3
+ '@tailwindcss/oxide-freebsd-x64': 4.1.3
+ '@tailwindcss/oxide-linux-arm-gnueabihf': 4.1.3
+ '@tailwindcss/oxide-linux-arm64-gnu': 4.1.3
+ '@tailwindcss/oxide-linux-arm64-musl': 4.1.3
+ '@tailwindcss/oxide-linux-x64-gnu': 4.1.3
+ '@tailwindcss/oxide-linux-x64-musl': 4.1.3
+ '@tailwindcss/oxide-win32-arm64-msvc': 4.1.3
+ '@tailwindcss/oxide-win32-x64-msvc': 4.1.3
+
+ '@tailwindcss/[email protected]':
+ dependencies:
+ '@alloc/quick-lru': 5.2.0
+ '@tailwindcss/node': 4.1.11
+ '@tailwindcss/oxide': 4.1.11
+ postcss: 8.5.6
+ tailwindcss: 4.1.11
+
+ dependencies:
+ '@tailwindcss/node': 4.1.3
+ '@tailwindcss/oxide': 4.1.3
+ tailwindcss: 4.1.3
+
+ '@tootallnate/[email protected]': {}
+
+ '@types/[email protected]':
+ dependencies:
+ '@babel/parser': 7.27.7
+ '@babel/types': 7.27.7
+ '@types/babel__generator': 7.27.0
+ '@types/babel__template': 7.4.4
+ '@types/babel__traverse': 7.20.7
+
+ '@types/[email protected]':
+ dependencies:
+ '@babel/types': 7.27.7
+
+ '@types/[email protected]':
+ dependencies:
+ '@babel/parser': 7.27.7
+ '@babel/types': 7.27.7
+
+ '@types/[email protected]':
+ dependencies:
+ '@babel/types': 7.27.7
+
+ '@types/[email protected]':
+ dependencies:
+ '@types/http-cache-semantics': 4.0.4
+ '@types/keyv': 3.1.4
+ '@types/node': 20.19.2
+ '@types/responselike': 1.0.3
+
+ '@types/[email protected]':
+ dependencies:
+ '@types/ms': 2.1.0
+
+ '@types/[email protected]': {}
+
+ '@types/[email protected]':
+ dependencies:
+ '@types/node': 20.19.2
+
+ '@types/[email protected]': {}
+
+ '@types/[email protected]': {}
+
+ '@types/[email protected]':
+ dependencies:
+ '@types/node': 20.19.2
+
+ '@types/[email protected]': {}
+
+ '@types/[email protected]':
+ dependencies:
+ undici-types: 6.21.0
+
+ '@types/[email protected]':
+ dependencies:
+ '@types/node': 20.19.2
+ xmlbuilder: 15.1.1
+ optional: true
+
+ '@types/[email protected]': {}
+
+ dependencies:
+ '@types/react': 18.3.23
+
+ '@types/[email protected]':
+ dependencies:
+ '@types/prop-types': 15.7.15
+ csstype: 3.1.3
+
+ '@types/[email protected]':
+ dependencies:
+ '@types/node': 20.19.2
+
+ '@types/[email protected]': {}
+
+ '@types/[email protected]':
+ optional: true
+
+ '@types/[email protected]':
+ dependencies:
+ '@types/node': 20.19.2
+ optional: true
+
+ dependencies:
+ '@eslint-community/regexpp': 4.12.1
+ '@typescript-eslint/parser': 5.62.0([email protected])([email protected])
+ '@typescript-eslint/scope-manager': 5.62.0
+ '@typescript-eslint/type-utils': 5.62.0([email protected])([email protected])
+ '@typescript-eslint/utils': 5.62.0([email protected])([email protected])
+ debug: 4.4.1
+ eslint: 8.57.1
+ graphemer: 1.4.0
+ ignore: 5.3.2
+ natural-compare-lite: 1.4.0
+ semver: 7.7.2
+ tsutils: 3.21.0([email protected])
+ optionalDependencies:
+ typescript: 5.8.3
+ transitivePeerDependencies:
+ - supports-color
+
+ dependencies:
+ '@eslint-community/regexpp': 4.12.1
+ '@typescript-eslint/parser': 7.18.0([email protected])([email protected])
+ '@typescript-eslint/scope-manager': 7.18.0
+ '@typescript-eslint/type-utils': 7.18.0([email protected])([email protected])
+ '@typescript-eslint/utils': 7.18.0([email protected])([email protected])
+ '@typescript-eslint/visitor-keys': 7.18.0
+ eslint: 8.57.1
+ graphemer: 1.4.0
+ ignore: 5.3.2
+ natural-compare: 1.4.0
+ ts-api-utils: 1.4.3([email protected])
+ optionalDependencies:
+ typescript: 5.8.3
+ transitivePeerDependencies:
+ - supports-color
+
+ dependencies:
+ '@typescript-eslint/scope-manager': 5.62.0
+ '@typescript-eslint/types': 5.62.0
+ '@typescript-eslint/typescript-estree': 5.62.0([email protected])
+ debug: 4.4.1
+ eslint: 8.57.1
+ optionalDependencies:
+ typescript: 5.8.3
+ transitivePeerDependencies:
+ - supports-color
+
+ dependencies:
+ '@typescript-eslint/scope-manager': 7.18.0
+ '@typescript-eslint/types': 7.18.0
+ '@typescript-eslint/typescript-estree': 7.18.0([email protected])
+ '@typescript-eslint/visitor-keys': 7.18.0
+ debug: 4.4.1
+ eslint: 8.57.1
+ optionalDependencies:
+ typescript: 5.8.3
+ transitivePeerDependencies:
+ - supports-color
+
+ '@typescript-eslint/[email protected]':
+ dependencies:
+ '@typescript-eslint/types': 5.62.0
+ '@typescript-eslint/visitor-keys': 5.62.0
+
+ '@typescript-eslint/[email protected]':
+ dependencies:
+ '@typescript-eslint/types': 7.18.0
+ '@typescript-eslint/visitor-keys': 7.18.0
+
+ dependencies:
+ '@typescript-eslint/typescript-estree': 5.62.0([email protected])
+ '@typescript-eslint/utils': 5.62.0([email protected])([email protected])
+ debug: 4.4.1
+ eslint: 8.57.1
+ tsutils: 3.21.0([email protected])
+ optionalDependencies:
+ typescript: 5.8.3
+ transitivePeerDependencies:
+ - supports-color
+
+ dependencies:
+ '@typescript-eslint/typescript-estree': 7.18.0([email protected])
+ '@typescript-eslint/utils': 7.18.0([email protected])([email protected])
+ debug: 4.4.1
+ eslint: 8.57.1
+ ts-api-utils: 1.4.3([email protected])
+ optionalDependencies:
+ typescript: 5.8.3
+ transitivePeerDependencies:
+ - supports-color
+
+ '@typescript-eslint/[email protected]': {}
+
+ '@typescript-eslint/[email protected]': {}
+
+ '@typescript-eslint/[email protected]([email protected])':
+ dependencies:
+ '@typescript-eslint/types': 5.62.0
+ '@typescript-eslint/visitor-keys': 5.62.0
+ debug: 4.4.1
+ globby: 11.1.0
+ is-glob: 4.0.3
+ semver: 7.7.2
+ tsutils: 3.21.0([email protected])
+ optionalDependencies:
+ typescript: 5.8.3
+ transitivePeerDependencies:
+ - supports-color
+
+ '@typescript-eslint/[email protected]([email protected])':
+ dependencies:
+ '@typescript-eslint/types': 7.18.0
+ '@typescript-eslint/visitor-keys': 7.18.0
+ debug: 4.4.1
+ globby: 11.1.0
+ is-glob: 4.0.3
+ minimatch: 9.0.5
+ semver: 7.7.2
+ ts-api-utils: 1.4.3([email protected])
+ optionalDependencies:
+ typescript: 5.8.3
+ transitivePeerDependencies:
+ - supports-color
+
+ dependencies:
+ '@eslint-community/eslint-utils': 4.7.0([email protected])
+ '@types/json-schema': 7.0.15
+ '@types/semver': 7.7.0
+ '@typescript-eslint/scope-manager': 5.62.0
+ '@typescript-eslint/types': 5.62.0
+ '@typescript-eslint/typescript-estree': 5.62.0([email protected])
+ eslint: 8.57.1
+ eslint-scope: 5.1.1
+ semver: 7.7.2
+ transitivePeerDependencies:
+ - supports-color
+ - typescript
+
+ dependencies:
+ '@eslint-community/eslint-utils': 4.7.0([email protected])
+ '@typescript-eslint/scope-manager': 7.18.0
+ '@typescript-eslint/types': 7.18.0
+ '@typescript-eslint/typescript-estree': 7.18.0([email protected])
+ eslint: 8.57.1
+ transitivePeerDependencies:
+ - supports-color
+ - typescript
+
+ '@typescript-eslint/[email protected]':
+ dependencies:
+ '@typescript-eslint/types': 5.62.0
+ eslint-visitor-keys: 3.4.3
+
+ '@typescript-eslint/[email protected]':
+ dependencies:
+ '@typescript-eslint/types': 7.18.0
+ eslint-visitor-keys: 3.4.3
+
+ '@ungap/[email protected]': {}
+
+ dependencies:
+ '@babel/core': 7.27.7
+ '@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/[email protected])
+ '@babel/plugin-transform-react-jsx-source': 7.27.1(@babel/[email protected])
+ '@rolldown/pluginutils': 1.0.0-beta.19
+ '@types/babel__core': 7.20.5
+ react-refresh: 0.17.0
+ transitivePeerDependencies:
+ - supports-color
+
+ '@xmldom/[email protected]': {}
+
+
+ dependencies:
+ acorn: 8.15.0
+
+
+ dependencies:
+ debug: 4.4.1
+ transitivePeerDependencies:
+ - supports-color
+
+
+ dependencies:
+ humanize-ms: 1.2.1
+
+ dependencies:
+ clean-stack: 2.2.0
+ indent-string: 4.0.0
+
+ optionalDependencies:
+ ajv: 8.17.1
+
+ dependencies:
+ ajv: 6.12.6
+
+ dependencies:
+ fast-deep-equal: 3.1.3
+ fast-json-stable-stringify: 2.1.0
+ json-schema-traverse: 0.4.1
+ uri-js: 4.4.1
+
+ dependencies:
+ fast-deep-equal: 3.1.3
+ fast-uri: 3.0.6
+ json-schema-traverse: 1.0.0
+ require-from-string: 2.0.2
+
+
+
+ dependencies:
+ color-convert: 2.0.1
+
+
+
+ dependencies:
+ '@develar/schema-utils': 2.6.5
+ '@electron/asar': 3.2.18
+ '@electron/fuses': 1.8.0
+ '@electron/notarize': 2.5.0
+ '@electron/osx-sign': 1.3.1
+ '@electron/rebuild': 3.7.0
+ '@electron/universal': 2.0.1
+ '@malept/flatpak-bundler': 0.4.0
+ '@types/fs-extra': 9.0.13
+ async-exit-hook: 2.0.1
+ builder-util: 26.0.11
+ builder-util-runtime: 9.3.1
+ chromium-pickle-js: 0.2.0
+ config-file-ts: 0.2.8-rc1
+ debug: 4.4.1
+ dmg-builder: 26.0.12([email protected])
+ dotenv: 16.6.1
+ dotenv-expand: 11.0.7
+ ejs: 3.1.10
+ electron-builder-squirrel-windows: 26.0.12([email protected])
+ electron-publish: 26.0.11
+ fs-extra: 10.1.0
+ hosted-git-info: 4.1.0
+ is-ci: 3.0.1
+ isbinaryfile: 5.0.4
+ js-yaml: 4.1.0
+ json5: 2.2.3
+ lazy-val: 1.0.5
+ minimatch: 10.0.3
+ plist: 3.1.0
+ resedit: 1.7.2
+ semver: 7.7.2
+ tar: 6.2.1
+ temp-file: 3.4.0
+ tiny-async-pool: 1.3.0
+ transitivePeerDependencies:
+ - bluebird
+ - supports-color
+
+
+ dependencies:
+ call-bound: 1.0.4
+ is-array-buffer: 3.0.5
+
+ dependencies:
+ call-bind: 1.0.8
+ call-bound: 1.0.4
+ define-properties: 1.2.1
+ es-abstract: 1.24.0
+ es-object-atoms: 1.1.1
+ get-intrinsic: 1.3.0
+ is-string: 1.1.1
+ math-intrinsics: 1.1.0
+
+
+ dependencies:
+ call-bind: 1.0.8
+ define-properties: 1.2.1
+ es-abstract: 1.24.0
+ es-errors: 1.3.0
+ es-object-atoms: 1.1.1
+ es-shim-unscopables: 1.1.0
+
+ dependencies:
+ call-bind: 1.0.8
+ define-properties: 1.2.1
+ es-abstract: 1.24.0
+ es-shim-unscopables: 1.1.0
+
+ dependencies:
+ call-bind: 1.0.8
+ define-properties: 1.2.1
+ es-abstract: 1.24.0
+ es-shim-unscopables: 1.1.0
+
+ dependencies:
+ call-bind: 1.0.8
+ define-properties: 1.2.1
+ es-abstract: 1.24.0
+ es-errors: 1.3.0
+ es-shim-unscopables: 1.1.0
+
+ dependencies:
+ array-buffer-byte-length: 1.0.2
+ call-bind: 1.0.8
+ define-properties: 1.2.1
+ es-abstract: 1.24.0
+ es-errors: 1.3.0
+ get-intrinsic: 1.3.0
+ is-array-buffer: 3.0.5
+
+ optional: true
+
+ optional: true
+
+
+
+
+
+
+ dependencies:
+ stubborn-fs: 1.2.5
+ when-exit: 2.1.4
+
+ dependencies:
+ browserslist: 4.25.1
+ caniuse-lite: 1.0.30001726
+ fraction.js: 4.3.7
+ normalize-range: 0.1.2
+ picocolors: 1.1.1
+ postcss: 8.5.6
+ postcss-value-parser: 4.2.0
+
+ dependencies:
+ possible-typed-array-names: 1.1.0
+
+ dependencies:
+ follow-redirects: 1.15.9
+ form-data: 4.0.3
+ proxy-from-env: 1.1.0
+ transitivePeerDependencies:
+ - debug
+
+
+
+ dependencies:
+ buffer: 5.7.1
+ inherits: 2.0.4
+ readable-stream: 3.6.2
+
+ optional: true
+
+ dependencies:
+ balanced-match: 1.0.2
+ concat-map: 0.0.1
+
+ dependencies:
+ balanced-match: 1.0.2
+
+ dependencies:
+ fill-range: 7.1.1
+
+ dependencies:
+ caniuse-lite: 1.0.30001726
+ electron-to-chromium: 1.5.177
+ node-releases: 2.0.19
+ update-browserslist-db: 1.1.3([email protected])
+
+
+
+ dependencies:
+ base64-js: 1.5.1
+ ieee754: 1.2.1
+
+ dependencies:
+ debug: 4.4.1
+ sax: 1.4.1
+ transitivePeerDependencies:
+ - supports-color
+
+ dependencies:
+ 7zip-bin: 5.2.0
+ '@types/debug': 4.1.12
+ app-builder-bin: 5.0.0-alpha.12
+ builder-util-runtime: 9.3.1
+ chalk: 4.1.2
+ cross-spawn: 7.0.6
+ debug: 4.4.1
+ fs-extra: 10.1.0
+ http-proxy-agent: 7.0.2
+ https-proxy-agent: 7.0.6
+ is-ci: 3.0.1
+ js-yaml: 4.1.0
+ sanitize-filename: 1.6.3
+ source-map-support: 0.5.21
+ stat-mode: 1.0.0
+ temp-file: 3.4.0
+ tiny-async-pool: 1.3.0
+ transitivePeerDependencies:
+ - supports-color
+
+
+ dependencies:
+ '@npmcli/fs': 2.1.2
+ '@npmcli/move-file': 2.0.1
+ chownr: 2.0.0
+ fs-minipass: 2.1.0
+ glob: 8.1.0
+ infer-owner: 1.0.4
+ lru-cache: 7.18.3
+ minipass: 3.3.6
+ minipass-collect: 1.0.2
+ minipass-flush: 1.0.5
+ minipass-pipeline: 1.2.4
+ mkdirp: 1.0.4
+ p-map: 4.0.0
+ promise-inflight: 1.0.1
+ rimraf: 3.0.2
+ ssri: 9.0.1
+ tar: 6.2.1
+ unique-filename: 2.0.1
+ transitivePeerDependencies:
+ - bluebird
+
+
+ dependencies:
+ clone-response: 1.0.3
+ get-stream: 5.2.0
+ http-cache-semantics: 4.2.0
+ keyv: 4.5.4
+ lowercase-keys: 2.0.0
+ normalize-url: 6.1.0
+ responselike: 2.0.1
+
+ dependencies:
+ es-errors: 1.3.0
+ function-bind: 1.1.2
+
+ dependencies:
+ call-bind-apply-helpers: 1.0.2
+ es-define-property: 1.0.1
+ get-intrinsic: 1.3.0
+ set-function-length: 1.2.2
+
+ dependencies:
+ call-bind-apply-helpers: 1.0.2
+ get-intrinsic: 1.3.0
+
+
+
+ dependencies:
+ ansi-styles: 4.3.0
+ supports-color: 7.2.0
+
+
+
+
+
+ dependencies:
+ clsx: 2.1.1
+
+
+ dependencies:
+ restore-cursor: 3.1.0
+
+
+ dependencies:
+ slice-ansi: 3.0.0
+ string-width: 4.2.3
+ optional: true
+
+ dependencies:
+ string-width: 4.2.3
+ strip-ansi: 6.0.1
+ wrap-ansi: 7.0.0
+
+ dependencies:
+ mimic-response: 1.0.1
+
+
+
+ dependencies:
+ color-name: 1.1.4
+
+
+ dependencies:
+ delayed-stream: 1.0.0
+
+
+ optional: true
+
+
+
+ dependencies:
+ ajv: 8.17.1
+ ajv-formats: 3.0.1([email protected])
+ atomically: 2.0.3
+ debounce-fn: 6.0.0
+ dot-prop: 9.0.0
+ env-paths: 3.0.0
+ json-schema-typed: 8.0.1
+ semver: 7.7.2
+ uint8array-extras: 1.4.0
+
+ dependencies:
+ glob: 10.4.5
+ typescript: 5.8.3
+
+
+
+ optional: true
+
+ dependencies:
+ buffer: 5.7.1
+ optional: true
+
+ optional: true
+
+ dependencies:
+ cross-spawn: 7.0.6
+
+ dependencies:
+ path-key: 3.1.1
+ shebang-command: 2.0.0
+ which: 2.0.2
+
+
+ dependencies:
+ call-bound: 1.0.4
+ es-errors: 1.3.0
+ is-data-view: 1.0.2
+
+ dependencies:
+ call-bound: 1.0.4
+ es-errors: 1.3.0
+ is-data-view: 1.0.2
+
+ dependencies:
+ call-bound: 1.0.4
+ es-errors: 1.3.0
+ is-data-view: 1.0.2
+
+ dependencies:
+ mimic-function: 5.0.1
+
+ dependencies:
+ ms: 2.1.3
+
+ dependencies:
+ mimic-response: 3.1.0
+
+
+ dependencies:
+ clone: 1.0.4
+
+
+ dependencies:
+ es-define-property: 1.0.1
+ es-errors: 1.3.0
+ gopd: 1.2.0
+
+ dependencies:
+ define-data-property: 1.1.4
+ has-property-descriptors: 1.0.2
+ object-keys: 1.1.1
+
+
+
+ optional: true
+
+ dependencies:
+ minimatch: 3.1.2
+ p-limit: 3.1.0
+
+ dependencies:
+ path-type: 4.0.0
+
+ dependencies:
+ builder-util: 26.0.11
+ builder-util-runtime: 9.3.1
+ fs-extra: 10.1.0
+ iconv-lite: 0.6.3
+ js-yaml: 4.1.0
+ optionalDependencies:
+ dmg-license: 1.0.11
+ transitivePeerDependencies:
+ - bluebird
+ - electron-builder-squirrel-windows
+ - supports-color
+
+ dependencies:
+ '@types/plist': 3.0.5
+ '@types/verror': 1.10.11
+ ajv: 6.12.6
+ crc: 3.8.0
+ iconv-corefoundation: 1.1.7
+ plist: 3.1.0
+ smart-buffer: 4.2.0
+ verror: 1.10.1
+ optional: true
+
+ dependencies:
+ esutils: 2.0.3
+
+ dependencies:
+ esutils: 2.0.3
+
+ dependencies:
+ type-fest: 4.41.0
+
+ dependencies:
+ dotenv: 16.6.1
+
+
+ dependencies:
+ call-bind-apply-helpers: 1.0.2
+ es-errors: 1.3.0
+ gopd: 1.2.0
+
+
+ dependencies:
+ jake: 10.9.2
+
+ dependencies:
+ builder-util: 26.0.11
+ electron-winstaller: 5.4.0
+ transitivePeerDependencies:
+ - bluebird
+ - dmg-builder
+ - supports-color
+
+ dependencies:
+ builder-util: 26.0.11
+ builder-util-runtime: 9.3.1
+ chalk: 4.1.2
+ dmg-builder: 26.0.12([email protected])
+ fs-extra: 10.1.0
+ is-ci: 3.0.1
+ lazy-val: 1.0.5
+ simple-update-notifier: 2.0.0
+ yargs: 17.7.2
+ transitivePeerDependencies:
+ - bluebird
+ - electron-builder-squirrel-windows
+ - supports-color
+
+ dependencies:
+ '@types/fs-extra': 9.0.13
+ builder-util: 26.0.11
+ builder-util-runtime: 9.3.1
+ chalk: 4.1.2
+ form-data: 4.0.3
+ fs-extra: 10.1.0
+ lazy-val: 1.0.5
+ mime: 2.6.0
+ transitivePeerDependencies:
+ - supports-color
+
+ dependencies:
+ conf: 14.0.0
+ type-fest: 4.41.0
+
+
+ dependencies:
+ '@babel/core': 7.27.7
+ '@babel/plugin-transform-arrow-functions': 7.27.1(@babel/[email protected])
+ cac: 6.7.14
+ esbuild: 0.25.5
+ magic-string: 0.30.17
+ picocolors: 1.1.1
+ transitivePeerDependencies:
+ - supports-color
+
+ dependencies:
+ '@electron/asar': 3.4.1
+ debug: 4.4.1
+ fs-extra: 7.0.1
+ lodash: 4.17.21
+ temp: 0.9.4
+ optionalDependencies:
+ '@electron/windows-sign': 1.2.2
+ transitivePeerDependencies:
+ - supports-color
+
+ dependencies:
+ '@electron/get': 2.0.3
+ '@types/node': 20.19.2
+ extract-zip: 2.0.1
+ transitivePeerDependencies:
+ - supports-color
+
+
+
+ dependencies:
+ iconv-lite: 0.6.3
+ optional: true
+
+ dependencies:
+ once: 1.4.0
+
+ dependencies:
+ graceful-fs: 4.2.11
+ tapable: 2.2.2
+
+
+
+
+ dependencies:
+ array-buffer-byte-length: 1.0.2
+ arraybuffer.prototype.slice: 1.0.4
+ available-typed-arrays: 1.0.7
+ call-bind: 1.0.8
+ call-bound: 1.0.4
+ data-view-buffer: 1.0.2
+ data-view-byte-length: 1.0.2
+ data-view-byte-offset: 1.0.1
+ es-define-property: 1.0.1
+ es-errors: 1.3.0
+ es-object-atoms: 1.1.1
+ es-set-tostringtag: 2.1.0
+ es-to-primitive: 1.3.0
+ function.prototype.name: 1.1.8
+ get-intrinsic: 1.3.0
+ get-proto: 1.0.1
+ get-symbol-description: 1.1.0
+ globalthis: 1.0.4
+ gopd: 1.2.0
+ has-property-descriptors: 1.0.2
+ has-proto: 1.2.0
+ has-symbols: 1.1.0
+ hasown: 2.0.2
+ internal-slot: 1.1.0
+ is-array-buffer: 3.0.5
+ is-callable: 1.2.7
+ is-data-view: 1.0.2
+ is-negative-zero: 2.0.3
+ is-regex: 1.2.1
+ is-set: 2.0.3
+ is-shared-array-buffer: 1.0.4
+ is-string: 1.1.1
+ is-typed-array: 1.1.15
+ is-weakref: 1.1.1
+ math-intrinsics: 1.1.0
+ object-inspect: 1.13.4
+ object-keys: 1.1.1
+ object.assign: 4.1.7
+ own-keys: 1.0.1
+ regexp.prototype.flags: 1.5.4
+ safe-array-concat: 1.1.3
+ safe-push-apply: 1.0.0
+ safe-regex-test: 1.1.0
+ set-proto: 1.0.0
+ stop-iteration-iterator: 1.1.0
+ string.prototype.trim: 1.2.10
+ string.prototype.trimend: 1.0.9
+ string.prototype.trimstart: 1.0.8
+ typed-array-buffer: 1.0.3
+ typed-array-byte-length: 1.0.3
+ typed-array-byte-offset: 1.0.4
+ typed-array-length: 1.0.7
+ unbox-primitive: 1.1.0
+ which-typed-array: 1.1.19
+
+
+
+ dependencies:
+ call-bind: 1.0.8
+ call-bound: 1.0.4
+ define-properties: 1.2.1
+ es-abstract: 1.24.0
+ es-errors: 1.3.0
+ es-set-tostringtag: 2.1.0
+ function-bind: 1.1.2
+ get-intrinsic: 1.3.0
+ globalthis: 1.0.4
+ gopd: 1.2.0
+ has-property-descriptors: 1.0.2
+ has-proto: 1.2.0
+ has-symbols: 1.1.0
+ internal-slot: 1.1.0
+ iterator.prototype: 1.1.5
+ safe-array-concat: 1.1.3
+
+ dependencies:
+ es-errors: 1.3.0
+
+ dependencies:
+ es-errors: 1.3.0
+ get-intrinsic: 1.3.0
+ has-tostringtag: 1.0.2
+ hasown: 2.0.2
+
+ dependencies:
+ hasown: 2.0.2
+
+ dependencies:
+ is-callable: 1.2.7
+ is-date-object: 1.1.0
+ is-symbol: 1.1.1
+
+ optional: true
+
+ optionalDependencies:
+ '@esbuild/aix-ppc64': 0.25.5
+ '@esbuild/android-arm': 0.25.5
+ '@esbuild/android-arm64': 0.25.5
+ '@esbuild/android-x64': 0.25.5
+ '@esbuild/darwin-arm64': 0.25.5
+ '@esbuild/darwin-x64': 0.25.5
+ '@esbuild/freebsd-arm64': 0.25.5
+ '@esbuild/freebsd-x64': 0.25.5
+ '@esbuild/linux-arm': 0.25.5
+ '@esbuild/linux-arm64': 0.25.5
+ '@esbuild/linux-ia32': 0.25.5
+ '@esbuild/linux-loong64': 0.25.5
+ '@esbuild/linux-mips64el': 0.25.5
+ '@esbuild/linux-ppc64': 0.25.5
+ '@esbuild/linux-riscv64': 0.25.5
+ '@esbuild/linux-s390x': 0.25.5
+ '@esbuild/linux-x64': 0.25.5
+ '@esbuild/netbsd-arm64': 0.25.5
+ '@esbuild/netbsd-x64': 0.25.5
+ '@esbuild/openbsd-arm64': 0.25.5
+ '@esbuild/openbsd-x64': 0.25.5
+ '@esbuild/sunos-x64': 0.25.5
+ '@esbuild/win32-arm64': 0.25.5
+ '@esbuild/win32-ia32': 0.25.5
+ '@esbuild/win32-x64': 0.25.5
+
+
+
+ dependencies:
+ eslint: 8.57.1
+
+ dependencies:
+ eslint: 8.57.1
+ prettier: 3.6.2
+ prettier-linter-helpers: 1.0.0
+ synckit: 0.11.8
+ optionalDependencies:
+ eslint-config-prettier: 9.1.0([email protected])
+
+ dependencies:
+ array-includes: 3.1.9
+ array.prototype.findlast: 1.2.5
+ array.prototype.flatmap: 1.3.3
+ array.prototype.tosorted: 1.1.4
+ doctrine: 2.1.0
+ es-iterator-helpers: 1.2.1
+ eslint: 8.57.1
+ estraverse: 5.3.0
+ hasown: 2.0.2
+ jsx-ast-utils: 3.3.5
+ minimatch: 3.1.2
+ object.entries: 1.1.9
+ object.fromentries: 2.0.8
+ object.values: 1.2.1
+ prop-types: 15.8.1
+ resolve: 2.0.0-next.5
+ semver: 6.3.1
+ string.prototype.matchall: 4.0.12
+ string.prototype.repeat: 1.0.0
+
+ dependencies:
+ esrecurse: 4.3.0
+ estraverse: 4.3.0
+
+ dependencies:
+ esrecurse: 4.3.0
+ estraverse: 5.3.0
+
+
+ dependencies:
+ '@eslint-community/eslint-utils': 4.7.0([email protected])
+ '@eslint-community/regexpp': 4.12.1
+ '@eslint/eslintrc': 2.1.4
+ '@eslint/js': 8.57.1
+ '@humanwhocodes/config-array': 0.13.0
+ '@humanwhocodes/module-importer': 1.0.1
+ '@nodelib/fs.walk': 1.2.8
+ '@ungap/structured-clone': 1.3.0
+ ajv: 6.12.6
+ chalk: 4.1.2
+ cross-spawn: 7.0.6
+ debug: 4.4.1
+ doctrine: 3.0.0
+ escape-string-regexp: 4.0.0
+ eslint-scope: 7.2.2
+ eslint-visitor-keys: 3.4.3
+ espree: 9.6.1
+ esquery: 1.6.0
+ esutils: 2.0.3
+ fast-deep-equal: 3.1.3
+ file-entry-cache: 6.0.1
+ find-up: 5.0.0
+ glob-parent: 6.0.2
+ globals: 13.24.0
+ graphemer: 1.4.0
+ ignore: 5.3.2
+ imurmurhash: 0.1.4
+ is-glob: 4.0.3
+ is-path-inside: 3.0.3
+ js-yaml: 4.1.0
+ json-stable-stringify-without-jsonify: 1.0.1
+ levn: 0.4.1
+ lodash.merge: 4.6.2
+ minimatch: 3.1.2
+ natural-compare: 1.4.0
+ optionator: 0.9.4
+ strip-ansi: 6.0.1
+ text-table: 0.2.0
+ transitivePeerDependencies:
+ - supports-color
+
+ dependencies:
+ acorn: 8.15.0
+ acorn-jsx: 5.3.2([email protected])
+ eslint-visitor-keys: 3.4.3
+
+ dependencies:
+ estraverse: 5.3.0
+
+ dependencies:
+ estraverse: 5.3.0
+
+
+
+
+
+ dependencies:
+ debug: 4.4.1
+ get-stream: 5.2.0
+ yauzl: 2.10.0
+ optionalDependencies:
+ '@types/yauzl': 2.10.3
+ transitivePeerDependencies:
+ - supports-color
+
+ optional: true
+
+
+
+ dependencies:
+ '@nodelib/fs.stat': 2.0.5
+ '@nodelib/fs.walk': 1.2.8
+ glob-parent: 5.1.2
+ merge2: 1.4.1
+ micromatch: 4.0.8
+
+
+
+
+ dependencies:
+ reusify: 1.1.0
+
+ dependencies:
+ pend: 1.2.0
+
+ optionalDependencies:
+ picomatch: 4.0.2
+
+ dependencies:
+ flat-cache: 3.2.0
+
+ dependencies:
+ minimatch: 5.1.6
+
+ dependencies:
+ to-regex-range: 5.0.1
+
+ dependencies:
+ locate-path: 6.0.0
+ path-exists: 4.0.0
+
+ dependencies:
+ flatted: 3.3.3
+ keyv: 4.5.4
+ rimraf: 3.0.2
+
+
+
+ dependencies:
+ is-callable: 1.2.7
+
+ dependencies:
+ cross-spawn: 7.0.6
+ signal-exit: 4.1.0
+
+ dependencies:
+ asynckit: 0.4.0
+ combined-stream: 1.0.8
+ es-set-tostringtag: 2.1.0
+ hasown: 2.0.2
+ mime-types: 2.1.35
+
+
+ dependencies:
+ graceful-fs: 4.2.11
+ jsonfile: 6.1.0
+ universalify: 2.0.1
+
+ dependencies:
+ graceful-fs: 4.2.11
+ jsonfile: 6.1.0
+ universalify: 2.0.1
+
+ dependencies:
+ graceful-fs: 4.2.11
+ jsonfile: 4.0.0
+ universalify: 0.1.2
+
+ dependencies:
+ graceful-fs: 4.2.11
+ jsonfile: 4.0.0
+ universalify: 0.1.2
+
+ dependencies:
+ at-least-node: 1.0.0
+ graceful-fs: 4.2.11
+ jsonfile: 6.1.0
+ universalify: 2.0.1
+
+ dependencies:
+ minipass: 3.3.6
+
+
+ optional: true
+
+
+ dependencies:
+ call-bind: 1.0.8
+ call-bound: 1.0.4
+ define-properties: 1.2.1
+ functions-have-names: 1.2.3
+ hasown: 2.0.2
+ is-callable: 1.2.7
+
+
+
+
+ dependencies:
+ call-bind-apply-helpers: 1.0.2
+ es-define-property: 1.0.1
+ es-errors: 1.3.0
+ es-object-atoms: 1.1.1
+ function-bind: 1.1.2
+ get-proto: 1.0.1
+ gopd: 1.2.0
+ has-symbols: 1.1.0
+ hasown: 2.0.2
+ math-intrinsics: 1.1.0
+
+ dependencies:
+ dunder-proto: 1.0.1
+ es-object-atoms: 1.1.1
+
+ dependencies:
+ pump: 3.0.3
+
+ dependencies:
+ call-bound: 1.0.4
+ es-errors: 1.3.0
+ get-intrinsic: 1.3.0
+
+ dependencies:
+ is-glob: 4.0.3
+
+ dependencies:
+ is-glob: 4.0.3
+
+ dependencies:
+ foreground-child: 3.3.1
+ jackspeak: 3.4.3
+ minimatch: 9.0.5
+ minipass: 7.1.2
+ package-json-from-dist: 1.0.1
+ path-scurry: 1.11.1
+
+ dependencies:
+ foreground-child: 3.3.1
+ jackspeak: 4.1.1
+ minimatch: 10.0.3
+ minipass: 7.1.2
+ package-json-from-dist: 1.0.1
+ path-scurry: 2.0.0
+
+ dependencies:
+ fs.realpath: 1.0.0
+ inflight: 1.0.6
+ inherits: 2.0.4
+ minimatch: 3.1.2
+ once: 1.4.0
+ path-is-absolute: 1.0.1
+
+ dependencies:
+ fs.realpath: 1.0.0
+ inflight: 1.0.6
+ inherits: 2.0.4
+ minimatch: 5.1.6
+ once: 1.4.0
+
+ dependencies:
+ boolean: 3.2.0
+ es6-error: 4.1.1
+ matcher: 3.0.0
+ roarr: 2.15.4
+ semver: 7.7.2
+ serialize-error: 7.0.1
+ optional: true
+
+
+ dependencies:
+ type-fest: 0.20.2
+
+ dependencies:
+ define-properties: 1.2.1
+ gopd: 1.2.0
+
+ dependencies:
+ array-union: 2.1.0
+ dir-glob: 3.0.1
+ fast-glob: 3.3.3
+ ignore: 5.3.2
+ merge2: 1.4.1
+ slash: 3.0.0
+
+
+ dependencies:
+ '@sindresorhus/is': 4.6.0
+ '@szmarczak/http-timer': 4.0.6
+ '@types/cacheable-request': 6.0.3
+ '@types/responselike': 1.0.3
+ cacheable-lookup: 5.0.4
+ cacheable-request: 7.0.4
+ decompress-response: 6.0.0
+ http2-wrapper: 1.0.3
+ lowercase-keys: 2.0.0
+ p-cancelable: 2.1.1
+ responselike: 2.0.1
+
+
+
+
+
+ dependencies:
+ es-define-property: 1.0.1
+
+ dependencies:
+ dunder-proto: 1.0.1
+
+
+ dependencies:
+ has-symbols: 1.1.0
+
+ dependencies:
+ function-bind: 1.1.2
+
+ dependencies:
+ lru-cache: 6.0.0
+
+
+ dependencies:
+ '@tootallnate/once': 2.0.0
+ agent-base: 6.0.2
+ debug: 4.4.1
+ transitivePeerDependencies:
+ - supports-color
+
+ dependencies:
+ agent-base: 7.1.4
+ debug: 4.4.1
+ transitivePeerDependencies:
+ - supports-color
+
+ dependencies:
+ quick-lru: 5.1.1
+ resolve-alpn: 1.2.1
+
+ dependencies:
+ agent-base: 6.0.2
+ debug: 4.4.1
+ transitivePeerDependencies:
+ - supports-color
+
+ dependencies:
+ agent-base: 7.1.4
+ debug: 4.4.1
+ transitivePeerDependencies:
+ - supports-color
+
+ dependencies:
+ ms: 2.1.3
+
+ dependencies:
+ cli-truncate: 2.1.0
+ node-addon-api: 1.7.2
+ optional: true
+
+ dependencies:
+ safer-buffer: 2.1.2
+
+
+
+ dependencies:
+ parent-module: 1.0.1
+ resolve-from: 4.0.0
+
+
+
+
+ dependencies:
+ once: 1.4.0
+ wrappy: 1.0.2
+
+
+ dependencies:
+ es-errors: 1.3.0
+ hasown: 2.0.2
+ side-channel: 1.1.0
+
+ dependencies:
+ jsbn: 1.1.0
+ sprintf-js: 1.1.3
+
+ dependencies:
+ call-bind: 1.0.8
+ call-bound: 1.0.4
+ get-intrinsic: 1.3.0
+
+ dependencies:
+ async-function: 1.0.0
+ call-bound: 1.0.4
+ get-proto: 1.0.1
+ has-tostringtag: 1.0.2
+ safe-regex-test: 1.1.0
+
+ dependencies:
+ has-bigints: 1.1.0
+
+ dependencies:
+ call-bound: 1.0.4
+ has-tostringtag: 1.0.2
+
+
+ dependencies:
+ ci-info: 3.9.0
+
+ dependencies:
+ hasown: 2.0.2
+
+ dependencies:
+ call-bound: 1.0.4
+ get-intrinsic: 1.3.0
+ is-typed-array: 1.1.15
+
+ dependencies:
+ call-bound: 1.0.4
+ has-tostringtag: 1.0.2
+
+
+ dependencies:
+ call-bound: 1.0.4
+
+
+ dependencies:
+ call-bound: 1.0.4
+ get-proto: 1.0.1
+ has-tostringtag: 1.0.2
+ safe-regex-test: 1.1.0
+
+ dependencies:
+ is-extglob: 2.1.1
+
+
+
+
+
+ dependencies:
+ call-bound: 1.0.4
+ has-tostringtag: 1.0.2
+
+
+
+ dependencies:
+ call-bound: 1.0.4
+ gopd: 1.2.0
+ has-tostringtag: 1.0.2
+ hasown: 2.0.2
+
+
+ dependencies:
+ call-bound: 1.0.4
+
+ dependencies:
+ call-bound: 1.0.4
+ has-tostringtag: 1.0.2
+
+ dependencies:
+ call-bound: 1.0.4
+ has-symbols: 1.1.0
+ safe-regex-test: 1.1.0
+
+ dependencies:
+ which-typed-array: 1.1.19
+
+
+
+ dependencies:
+ call-bound: 1.0.4
+
+ dependencies:
+ call-bound: 1.0.4
+ get-intrinsic: 1.3.0
+
+
+
+
+
+ dependencies:
+ define-data-property: 1.1.4
+ es-object-atoms: 1.1.1
+ get-intrinsic: 1.3.0
+ get-proto: 1.0.1
+ has-symbols: 1.1.0
+ set-function-name: 2.0.2
+
+ dependencies:
+ '@isaacs/cliui': 8.0.2
+ optionalDependencies:
+ '@pkgjs/parseargs': 0.11.0
+
+ dependencies:
+ '@isaacs/cliui': 8.0.2
+
+ dependencies:
+ async: 3.2.6
+ chalk: 4.1.2
+ filelist: 1.0.4
+ minimatch: 3.1.2
+
+
+
+ dependencies:
+ argparse: 2.0.1
+
+
+
+
+
+
+
+
+ optional: true
+
+
+ optionalDependencies:
+ graceful-fs: 4.2.11
+
+ dependencies:
+ universalify: 2.0.1
+ optionalDependencies:
+ graceful-fs: 4.2.11
+
+ dependencies:
+ array-includes: 3.1.9
+ array.prototype.flat: 1.3.3
+ object.assign: 4.1.7
+ object.values: 1.2.1
+
+ dependencies:
+ json-buffer: 3.0.1
+
+
+ dependencies:
+ prelude-ls: 1.2.1
+ type-check: 0.4.0
+
+ optional: true
+
+ optional: true
+
+ optional: true
+
+ optional: true
+
+ optional: true
+
+ optional: true
+
+ optional: true
+
+ optional: true
+
+ optional: true
+
+ optional: true
+
+ optional: true
+
+ optional: true
+
+ optional: true
+
+ optional: true
+
+ optional: true
+
+ optional: true
+
+ optional: true
+
+ optional: true
+
+ optional: true
+
+ optional: true
+
+ dependencies:
+ detect-libc: 2.0.4
+ optionalDependencies:
+ lightningcss-darwin-arm64: 1.29.2
+ lightningcss-darwin-x64: 1.29.2
+ lightningcss-freebsd-x64: 1.29.2
+ lightningcss-linux-arm-gnueabihf: 1.29.2
+ lightningcss-linux-arm64-gnu: 1.29.2
+ lightningcss-linux-arm64-musl: 1.29.2
+ lightningcss-linux-x64-gnu: 1.29.2
+ lightningcss-linux-x64-musl: 1.29.2
+ lightningcss-win32-arm64-msvc: 1.29.2
+ lightningcss-win32-x64-msvc: 1.29.2
+
+ dependencies:
+ detect-libc: 2.0.4
+ optionalDependencies:
+ lightningcss-darwin-arm64: 1.30.1
+ lightningcss-darwin-x64: 1.30.1
+ lightningcss-freebsd-x64: 1.30.1
+ lightningcss-linux-arm-gnueabihf: 1.30.1
+ lightningcss-linux-arm64-gnu: 1.30.1
+ lightningcss-linux-arm64-musl: 1.30.1
+ lightningcss-linux-x64-gnu: 1.30.1
+ lightningcss-linux-x64-musl: 1.30.1
+ lightningcss-win32-arm64-msvc: 1.30.1
+ lightningcss-win32-x64-msvc: 1.30.1
+
+ dependencies:
+ p-locate: 5.0.0
+
+
+
+ dependencies:
+ chalk: 4.1.2
+ is-unicode-supported: 0.1.0
+
+ dependencies:
+ js-tokens: 4.0.0
+
+
+
+
+ dependencies:
+ yallist: 3.1.1
+
+ dependencies:
+ yallist: 4.0.0
+
+
+ dependencies:
+ react: 18.3.1
+
+ dependencies:
+ '@jridgewell/sourcemap-codec': 1.5.2
+
+ dependencies:
+ agentkeepalive: 4.6.0
+ cacache: 16.1.3
+ http-cache-semantics: 4.2.0
+ http-proxy-agent: 5.0.0
+ https-proxy-agent: 5.0.1
+ is-lambda: 1.0.1
+ lru-cache: 7.18.3
+ minipass: 3.3.6
+ minipass-collect: 1.0.2
+ minipass-fetch: 2.1.2
+ minipass-flush: 1.0.5
+ minipass-pipeline: 1.2.4
+ negotiator: 0.6.4
+ promise-retry: 2.0.1
+ socks-proxy-agent: 7.0.0
+ ssri: 9.0.1
+ transitivePeerDependencies:
+ - bluebird
+ - supports-color
+
+ dependencies:
+ escape-string-regexp: 4.0.0
+ optional: true
+
+
+
+ dependencies:
+ braces: 3.0.3
+ picomatch: 2.3.1
+
+
+ dependencies:
+ mime-db: 1.52.0
+
+
+
+
+
+
+ dependencies:
+ '@isaacs/brace-expansion': 5.0.0
+
+ dependencies:
+ brace-expansion: 1.1.12
+
+ dependencies:
+ brace-expansion: 2.0.2
+
+ dependencies:
+ brace-expansion: 2.0.2
+
+
+ dependencies:
+ minipass: 3.3.6
+
+ dependencies:
+ minipass: 3.3.6
+ minipass-sized: 1.0.3
+ minizlib: 2.1.2
+ optionalDependencies:
+ encoding: 0.1.13
+
+ dependencies:
+ minipass: 3.3.6
+
+ dependencies:
+ minipass: 3.3.6
+
+ dependencies:
+ minipass: 3.3.6
+
+ dependencies:
+ yallist: 4.0.0
+
+
+
+ dependencies:
+ minipass: 3.3.6
+ yallist: 4.0.0
+
+ dependencies:
+ minipass: 7.1.2
+
+ dependencies:
+ minimist: 1.2.8
+
+
+
+
+
+
+
+
+ dependencies:
+ semver: 7.7.2
+
+ optional: true
+
+ dependencies:
+ semver: 7.7.2
+
+
+ dependencies:
+ abbrev: 1.1.1
+
+
+
+
+
+
+ dependencies:
+ call-bind: 1.0.8
+ call-bound: 1.0.4
+ define-properties: 1.2.1
+ es-object-atoms: 1.1.1
+ has-symbols: 1.1.0
+ object-keys: 1.1.1
+
+ dependencies:
+ call-bind: 1.0.8
+ call-bound: 1.0.4
+ define-properties: 1.2.1
+ es-object-atoms: 1.1.1
+
+ dependencies:
+ call-bind: 1.0.8
+ define-properties: 1.2.1
+ es-abstract: 1.24.0
+ es-object-atoms: 1.1.1
+
+ dependencies:
+ call-bind: 1.0.8
+ call-bound: 1.0.4
+ define-properties: 1.2.1
+ es-object-atoms: 1.1.1
+
+ dependencies:
+ wrappy: 1.0.2
+
+ dependencies:
+ mimic-fn: 2.1.0
+
+ dependencies:
+ deep-is: 0.1.4
+ fast-levenshtein: 2.0.6
+ levn: 0.4.1
+ prelude-ls: 1.2.1
+ type-check: 0.4.0
+ word-wrap: 1.2.5
+
+ dependencies:
+ bl: 4.1.0
+ chalk: 4.1.2
+ cli-cursor: 3.1.0
+ cli-spinners: 2.9.2
+ is-interactive: 1.0.0
+ is-unicode-supported: 0.1.0
+ log-symbols: 4.1.0
+ strip-ansi: 6.0.1
+ wcwidth: 1.0.1
+
+ dependencies:
+ get-intrinsic: 1.3.0
+ object-keys: 1.1.1
+ safe-push-apply: 1.0.0
+
+
+ dependencies:
+ yocto-queue: 0.1.0
+
+ dependencies:
+ p-limit: 3.1.0
+
+ dependencies:
+ aggregate-error: 3.1.0
+
+
+ dependencies:
+ callsites: 3.1.0
+
+
+
+
+
+ dependencies:
+ lru-cache: 10.4.3
+ minipass: 7.1.2
+
+ dependencies:
+ lru-cache: 11.1.0
+ minipass: 7.1.2
+
+
+
+
+
+
+
+ dependencies:
+ '@xmldom/xmldom': 0.8.10
+ base64-js: 1.5.1
+ xmlbuilder: 15.1.1
+
+
+
+ dependencies:
+ nanoid: 3.3.11
+ picocolors: 1.1.1
+ source-map-js: 1.2.1
+
+ dependencies:
+ commander: 9.5.0
+ optional: true
+
+
+ dependencies:
+ fast-diff: 1.3.0
+
+
+
+
+
+ dependencies:
+ err-code: 2.0.3
+ retry: 0.12.0
+
+ dependencies:
+ loose-envify: 1.4.0
+ object-assign: 4.1.1
+ react-is: 16.13.1
+
+
+ dependencies:
+ end-of-stream: 1.4.5
+ once: 1.4.0
+
+
+
+
+ dependencies:
+ loose-envify: 1.4.0
+ react: 18.3.1
+ scheduler: 0.23.2
+
+
+
+ dependencies:
+ cookie: 1.0.2
+ react: 18.3.1
+ set-cookie-parser: 2.7.1
+ optionalDependencies:
+ react-dom: 18.3.1([email protected])
+
+ dependencies:
+ loose-envify: 1.4.0
+
+ dependencies:
+ debug: 4.4.1
+ transitivePeerDependencies:
+ - supports-color
+
+ dependencies:
+ inherits: 2.0.4
+ string_decoder: 1.3.0
+ util-deprecate: 1.0.2
+
+ dependencies:
+ call-bind: 1.0.8
+ define-properties: 1.2.1
+ es-abstract: 1.24.0
+ es-errors: 1.3.0
+ es-object-atoms: 1.1.1
+ get-intrinsic: 1.3.0
+ get-proto: 1.0.1
+ which-builtin-type: 1.2.1
+
+ dependencies:
+ call-bind: 1.0.8
+ define-properties: 1.2.1
+ es-errors: 1.3.0
+ get-proto: 1.0.1
+ gopd: 1.2.0
+ set-function-name: 2.0.2
+
+
+
+ dependencies:
+ pe-library: 0.4.1
+
+
+
+ dependencies:
+ is-core-module: 2.16.1
+ path-parse: 1.0.7
+ supports-preserve-symlinks-flag: 1.0.0
+
+ dependencies:
+ lowercase-keys: 2.0.0
+
+ dependencies:
+ onetime: 5.1.2
+ signal-exit: 3.0.7
+
+
+
+ dependencies:
+ glob: 7.2.3
+
+ dependencies:
+ glob: 7.2.3
+
+ dependencies:
+ glob: 11.0.3
+ package-json-from-dist: 1.0.1
+
+ dependencies:
+ boolean: 3.2.0
+ detect-node: 2.1.0
+ globalthis: 1.0.4
+ json-stringify-safe: 5.0.1
+ semver-compare: 1.0.0
+ sprintf-js: 1.1.3
+ optional: true
+
+ dependencies:
+ '@types/estree': 1.0.8
+ optionalDependencies:
+ '@rollup/rollup-android-arm-eabi': 4.44.1
+ '@rollup/rollup-android-arm64': 4.44.1
+ '@rollup/rollup-darwin-arm64': 4.44.1
+ '@rollup/rollup-darwin-x64': 4.44.1
+ '@rollup/rollup-freebsd-arm64': 4.44.1
+ '@rollup/rollup-freebsd-x64': 4.44.1
+ '@rollup/rollup-linux-arm-gnueabihf': 4.44.1
+ '@rollup/rollup-linux-arm-musleabihf': 4.44.1
+ '@rollup/rollup-linux-arm64-gnu': 4.44.1
+ '@rollup/rollup-linux-arm64-musl': 4.44.1
+ '@rollup/rollup-linux-loongarch64-gnu': 4.44.1
+ '@rollup/rollup-linux-powerpc64le-gnu': 4.44.1
+ '@rollup/rollup-linux-riscv64-gnu': 4.44.1
+ '@rollup/rollup-linux-riscv64-musl': 4.44.1
+ '@rollup/rollup-linux-s390x-gnu': 4.44.1
+ '@rollup/rollup-linux-x64-gnu': 4.44.1
+ '@rollup/rollup-linux-x64-musl': 4.44.1
+ '@rollup/rollup-win32-arm64-msvc': 4.44.1
+ '@rollup/rollup-win32-ia32-msvc': 4.44.1
+ '@rollup/rollup-win32-x64-msvc': 4.44.1
+ fsevents: 2.3.3
+
+ dependencies:
+ queue-microtask: 1.2.3
+
+ dependencies:
+ call-bind: 1.0.8
+ call-bound: 1.0.4
+ get-intrinsic: 1.3.0
+ has-symbols: 1.1.0
+ isarray: 2.0.5
+
+
+ dependencies:
+ es-errors: 1.3.0
+ isarray: 2.0.5
+
+ dependencies:
+ call-bound: 1.0.4
+ es-errors: 1.3.0
+ is-regex: 1.2.1
+
+
+ dependencies:
+ truncate-utf8-bytes: 1.0.2
+
+
+ dependencies:
+ loose-envify: 1.4.0
+
+ optional: true
+
+
+
+
+ dependencies:
+ type-fest: 0.13.1
+ optional: true
+
+
+ dependencies:
+ define-data-property: 1.1.4
+ es-errors: 1.3.0
+ function-bind: 1.1.2
+ get-intrinsic: 1.3.0
+ gopd: 1.2.0
+ has-property-descriptors: 1.0.2
+
+ dependencies:
+ define-data-property: 1.1.4
+ es-errors: 1.3.0
+ functions-have-names: 1.2.3
+ has-property-descriptors: 1.0.2
+
+ dependencies:
+ dunder-proto: 1.0.1
+ es-errors: 1.3.0
+ es-object-atoms: 1.1.1
+
+ dependencies:
+ shebang-regex: 3.0.0
+
+
+ dependencies:
+ es-errors: 1.3.0
+ object-inspect: 1.13.4
+
+ dependencies:
+ call-bound: 1.0.4
+ es-errors: 1.3.0
+ get-intrinsic: 1.3.0
+ object-inspect: 1.13.4
+
+ dependencies:
+ call-bound: 1.0.4
+ es-errors: 1.3.0
+ get-intrinsic: 1.3.0
+ object-inspect: 1.13.4
+ side-channel-map: 1.0.1
+
+ dependencies:
+ es-errors: 1.3.0
+ object-inspect: 1.13.4
+ side-channel-list: 1.0.0
+ side-channel-map: 1.0.1
+ side-channel-weakmap: 1.0.2
+
+
+
+ dependencies:
+ semver: 7.7.2
+
+
+ dependencies:
+ ansi-styles: 4.3.0
+ astral-regex: 2.0.0
+ is-fullwidth-code-point: 3.0.0
+ optional: true
+
+
+ dependencies:
+ agent-base: 6.0.2
+ debug: 4.4.1
+ socks: 2.8.5
+ transitivePeerDependencies:
+ - supports-color
+
+ dependencies:
+ ip-address: 9.0.5
+ smart-buffer: 4.2.0
+
+ dependencies:
+ react: 18.3.1
+ react-dom: 18.3.1([email protected])
+
+
+ dependencies:
+ buffer-from: 1.1.2
+ source-map: 0.6.1
+
+
+
+ dependencies:
+ minipass: 3.3.6
+
+
+ dependencies:
+ es-errors: 1.3.0
+ internal-slot: 1.1.0
+
+ dependencies:
+ emoji-regex: 8.0.0
+ is-fullwidth-code-point: 3.0.0
+ strip-ansi: 6.0.1
+
+ dependencies:
+ eastasianwidth: 0.2.0
+ emoji-regex: 9.2.2
+ strip-ansi: 7.1.0
+
+ dependencies:
+ call-bind: 1.0.8
+ call-bound: 1.0.4
+ define-properties: 1.2.1
+ es-abstract: 1.24.0
+ es-errors: 1.3.0
+ es-object-atoms: 1.1.1
+ get-intrinsic: 1.3.0
+ gopd: 1.2.0
+ has-symbols: 1.1.0
+ internal-slot: 1.1.0
+ regexp.prototype.flags: 1.5.4
+ set-function-name: 2.0.2
+ side-channel: 1.1.0
+
+ dependencies:
+ define-properties: 1.2.1
+ es-abstract: 1.24.0
+
+ dependencies:
+ call-bind: 1.0.8
+ call-bound: 1.0.4
+ define-data-property: 1.1.4
+ define-properties: 1.2.1
+ es-abstract: 1.24.0
+ es-object-atoms: 1.1.1
+ has-property-descriptors: 1.0.2
+
+ dependencies:
+ call-bind: 1.0.8
+ call-bound: 1.0.4
+ define-properties: 1.2.1
+ es-object-atoms: 1.1.1
+
+ dependencies:
+ call-bind: 1.0.8
+ define-properties: 1.2.1
+ es-object-atoms: 1.1.1
+
+ dependencies:
+ safe-buffer: 5.2.1
+
+ dependencies:
+ ansi-regex: 5.0.1
+
+ dependencies:
+ ansi-regex: 6.1.0
+
+
+
+ dependencies:
+ debug: 4.4.1
+ transitivePeerDependencies:
+ - supports-color
+
+ dependencies:
+ has-flag: 4.0.0
+
+
+ dependencies:
+ '@pkgr/core': 0.2.7
+
+
+
+
+
+ dependencies:
+ chownr: 2.0.0
+ fs-minipass: 2.1.0
+ minipass: 5.0.0
+ minizlib: 2.1.2
+ mkdirp: 1.0.4
+ yallist: 4.0.0
+
+ dependencies:
+ '@isaacs/fs-minipass': 4.0.1
+ chownr: 3.0.0
+ minipass: 7.1.2
+ minizlib: 3.0.2
+ mkdirp: 3.0.1
+ yallist: 5.0.0
+
+ dependencies:
+ async-exit-hook: 2.0.1
+ fs-extra: 10.1.0
+
+ dependencies:
+ mkdirp: 0.5.6
+ rimraf: 2.6.3
+
+
+ dependencies:
+ semver: 5.7.2
+
+ dependencies:
+ fdir: 6.4.6([email protected])
+ picomatch: 4.0.2
+
+ dependencies:
+ tmp: 0.2.3
+
+
+ dependencies:
+ is-number: 7.0.0
+
+ dependencies:
+ utf8-byte-length: 1.0.5
+
+ dependencies:
+ typescript: 5.8.3
+
+
+ dependencies:
+ tslib: 1.14.1
+ typescript: 5.8.3
+
+ dependencies:
+ prelude-ls: 1.2.1
+
+ optional: true
+
+
+
+ dependencies:
+ call-bound: 1.0.4
+ es-errors: 1.3.0
+ is-typed-array: 1.1.15
+
+ dependencies:
+ call-bind: 1.0.8
+ for-each: 0.3.5
+ gopd: 1.2.0
+ has-proto: 1.2.0
+ is-typed-array: 1.1.15
+
+ dependencies:
+ available-typed-arrays: 1.0.7
+ call-bind: 1.0.8
+ for-each: 0.3.5
+ gopd: 1.2.0
+ has-proto: 1.2.0
+ is-typed-array: 1.1.15
+ reflect.getprototypeof: 1.0.10
+
+ dependencies:
+ call-bind: 1.0.8
+ for-each: 0.3.5
+ gopd: 1.2.0
+ is-typed-array: 1.1.15
+ possible-typed-array-names: 1.1.0
+ reflect.getprototypeof: 1.0.10
+
+
+
+ dependencies:
+ call-bound: 1.0.4
+ has-bigints: 1.1.0
+ has-symbols: 1.1.0
+ which-boxed-primitive: 1.1.1
+
+
+ dependencies:
+ unique-slug: 3.0.0
+
+ dependencies:
+ imurmurhash: 0.1.4
+
+
+
+ dependencies:
+ browserslist: 4.25.1
+ escalade: 3.2.0
+ picocolors: 1.1.1
+
+ dependencies:
+ punycode: 2.3.1
+
+
+
+ dependencies:
+ assert-plus: 1.0.0
+ core-util-is: 1.0.2
+ extsprintf: 1.4.1
+ optional: true
+
+ dependencies:
+ esbuild: 0.25.5
+ fdir: 6.4.6([email protected])
+ picomatch: 4.0.2
+ postcss: 8.5.6
+ rollup: 4.44.1
+ tinyglobby: 0.2.14
+ optionalDependencies:
+ '@types/node': 20.19.2
+ fsevents: 2.3.3
+ jiti: 2.4.2
+ lightningcss: 1.30.1
+
+ dependencies:
+ defaults: 1.0.4
+
+
+ dependencies:
+ is-bigint: 1.1.0
+ is-boolean-object: 1.2.2
+ is-number-object: 1.1.1
+ is-string: 1.1.1
+ is-symbol: 1.1.1
+
+ dependencies:
+ call-bound: 1.0.4
+ function.prototype.name: 1.1.8
+ has-tostringtag: 1.0.2
+ is-async-function: 2.1.1
+ is-date-object: 1.1.0
+ is-finalizationregistry: 1.1.1
+ is-generator-function: 1.1.0
+ is-regex: 1.2.1
+ is-weakref: 1.1.1
+ isarray: 2.0.5
+ which-boxed-primitive: 1.1.1
+ which-collection: 1.0.2
+ which-typed-array: 1.1.19
+
+ dependencies:
+ is-map: 2.0.3
+ is-set: 2.0.3
+ is-weakmap: 2.0.2
+ is-weakset: 2.0.4
+
+ dependencies:
+ available-typed-arrays: 1.0.7
+ call-bind: 1.0.8
+ call-bound: 1.0.4
+ for-each: 0.3.5
+ get-proto: 1.0.1
+ gopd: 1.2.0
+ has-tostringtag: 1.0.2
+
+ dependencies:
+ isexe: 2.0.0
+
+
+ dependencies:
+ ansi-styles: 4.3.0
+ string-width: 4.2.3
+ strip-ansi: 6.0.1
+
+ dependencies:
+ ansi-styles: 6.2.1
+ string-width: 5.1.2
+ strip-ansi: 7.1.0
+
+
+
+
+
+
+
+
+ dependencies:
+ cliui: 8.0.1
+ escalade: 3.2.0
+ get-caller-file: 2.0.5
+ require-directory: 2.1.1
+ string-width: 4.2.3
+ y18n: 5.0.8
+ yargs-parser: 21.1.1
+
+ dependencies:
+ buffer-crc32: 0.2.13
+ fd-slicer: 1.1.0
+
diff --git a/Vimo-desktop/postcss.config.js b/Vimo-desktop/postcss.config.js
new file mode 100644
index 0000000..2ce651a
--- /dev/null
+++ b/Vimo-desktop/postcss.config.js
@@ -0,0 +1,6 @@
+module.exports = {
+ plugins: {
+ '@tailwindcss/postcss': {},
+ autoprefixer: {},
+ },
+ }
\ No newline at end of file
diff --git a/Vimo-desktop/python_backend/videorag/__init__.py b/Vimo-desktop/python_backend/videorag/__init__.py
new file mode 100755
index 0000000..d0de5bf
--- /dev/null
+++ b/Vimo-desktop/python_backend/videorag/__init__.py
@@ -0,0 +1 @@
+from .videorag import VideoRAG, QueryParam
\ No newline at end of file
diff --git a/Vimo-desktop/python_backend/videorag/_llm.py b/Vimo-desktop/python_backend/videorag/_llm.py
new file mode 100755
index 0000000..cd4cc48
--- /dev/null
+++ b/Vimo-desktop/python_backend/videorag/_llm.py
@@ -0,0 +1,205 @@
+# type: ignore
+import numpy as np
+from openai import AsyncOpenAI, AsyncAzureOpenAI, APIConnectionError, RateLimitError
+from dataclasses import asdict, dataclass, field
+
+from tenacity import (
+ retry,
+ stop_after_attempt,
+ wait_exponential,
+ retry_if_exception_type,
+)
+import os
+
+from ._utils import compute_args_hash, wrap_embedding_func_with_attrs
+from .base import BaseKVStorage
+from ._utils import EmbeddingFunc
+
+global_openai_async_client = None
+global_dashscope_async_client = None
+
+def get_openai_async_client_instance(global_config):
+ global global_openai_async_client
+ if global_openai_async_client is None:
+ global_openai_async_client = AsyncOpenAI(
+ api_key=global_config["openai_api_key"],
+ base_url=global_config["openai_base_url"],
+ )
+ return global_openai_async_client
+
+def get_dashscope_async_client_instance(global_config):
+ global global_dashscope_async_client
+ if global_dashscope_async_client is None:
+ global_dashscope_async_client = AsyncOpenAI(
+ api_key=global_config["ali_dashscope_api_key"],
+ base_url=global_config["ali_dashscope_base_url"],
+ )
+ return global_dashscope_async_client
+
+# Setup LLM Configuration.
+@dataclass
+class LLMConfig:
+ # To be set
+ embedding_func_raw: callable
+ embedding_model_name: str
+ embedding_dim: int
+ embedding_max_token_size: int
+ embedding_batch_num: int
+ embedding_func_max_async: int
+ query_better_than_threshold: float
+
+ best_model_func_raw: callable
+ best_model_name: str
+ best_model_max_token_size: int
+ best_model_max_async: int
+
+ cheap_model_func_raw: callable
+ cheap_model_name: str
+ cheap_model_max_token_size: int
+ cheap_model_max_async: int
+
+ # Caption model configuration
+ caption_model_func_raw: callable
+ caption_model_name: str
+ caption_model_max_async: int
+
+ # Assigned in post init
+ embedding_func: EmbeddingFunc = None
+ best_model_func: callable = None
+ cheap_model_func: callable = None
+ caption_model_func: callable = None
+
+
+ def __post_init__(self):
+ embedding_wrapper = wrap_embedding_func_with_attrs(
+ embedding_dim = self.embedding_dim,
+ max_token_size = self.embedding_max_token_size,
+ model_name = self.embedding_model_name)
+ self.embedding_func = embedding_wrapper(self.embedding_func_raw)
+
+ self.best_model_func = lambda prompt, *args, **kwargs: self.best_model_func_raw(
+ self.best_model_name, prompt, *args, **kwargs
+ )
+
+ self.cheap_model_func = lambda prompt, *args, **kwargs: self.cheap_model_func_raw(
+ self.cheap_model_name, prompt, *args, **kwargs
+ )
+
+ self.caption_model_func = lambda content_list, *args, **kwargs: self.caption_model_func_raw(
+ self.caption_model_name, content_list, *args, **kwargs
+ )
+
+##### OpenAI Configuration
+@retry(
+ stop=stop_after_attempt(5),
+ wait=wait_exponential(multiplier=1, min=4, max=10),
+ retry=retry_if_exception_type((RateLimitError, APIConnectionError)),
+)
+async def openai_complete_if_cache(
+ model, prompt, system_prompt=None, history_messages=[], **kwargs
+) -> str:
+ openai_async_client = get_openai_async_client_instance(kwargs["global_config"])
+ hashing_kv: BaseKVStorage = kwargs.pop("hashing_kv", None)
+ # Remove global_config from kwargs as it's not needed for OpenAI API call
+ kwargs.pop("global_config", None)
+
+ messages = []
+ if system_prompt:
+ messages.append({"role": "system", "content": system_prompt})
+ messages.extend(history_messages)
+ messages.append({"role": "user", "content": prompt})
+ if hashing_kv is not None:
+ args_hash = compute_args_hash(model, messages)
+ if_cache_return = await hashing_kv.get_by_id(args_hash)
+ # NOTE: I update here to avoid the if_cache_return["return"] is None
+ if if_cache_return is not None and if_cache_return["return"] is not None:
+ return if_cache_return["return"]
+
+ response = await openai_async_client.chat.completions.create(
+ model=model, messages=messages, **kwargs
+ )
+
+ if hashing_kv is not None:
+ await hashing_kv.upsert(
+ {args_hash: {"return": response.choices[0].message.content, "model": model}}
+ )
+ await hashing_kv.index_done_callback()
+ return response.choices[0].message.content
+
+async def gpt_complete(
+ model_name, prompt, system_prompt=None, history_messages=[], **kwargs
+) -> str:
+ return await openai_complete_if_cache(
+ model_name,
+ prompt,
+ system_prompt=system_prompt,
+ history_messages=history_messages,
+ **kwargs,
+ )
+
+@retry(
+ stop=stop_after_attempt(5),
+ wait=wait_exponential(multiplier=1, min=4, max=10),
+ retry=retry_if_exception_type((RateLimitError, APIConnectionError)),
+)
+async def openai_embedding(model_name: str, texts: list[str], **kwargs) -> np.ndarray:
+ openai_async_client = get_openai_async_client_instance(kwargs["global_config"])
+ # Remove global_config from kwargs as it's not needed for OpenAI API call
+ kwargs.pop("global_config", None)
+
+ response = await openai_async_client.embeddings.create(
+ model=model_name, input=texts, encoding_format="float", **kwargs
+ )
+ return np.array([dp.embedding for dp in response.data])
+
+@retry(
+ stop=stop_after_attempt(5),
+ wait=wait_exponential(multiplier=1, min=4, max=10),
+ retry=retry_if_exception_type((RateLimitError, APIConnectionError)),
+)
+async def dashscope_caption_complete(
+ model_name, content_list, **kwargs
+) -> str:
+ """
+ DashScope vision model completion for video caption
+ content_list: list of {"type": "image_url", "image_url": {"url": "..."}} and {"type": "text", "text": "..."}
+ """
+ dashscope_async_client = get_dashscope_async_client_instance(kwargs["global_config"])
+
+ messages = [
+ {"role": "system", "content": "You are a helpful assistant."},
+ {"role": "user", "content": content_list}
+ ]
+
+ response = await dashscope_async_client.chat.completions.create(
+ model=model_name,
+ messages=messages,
+ )
+
+ return response.choices[0].message.content
+
+openai_4o_mini_config = LLMConfig(
+ embedding_func_raw = openai_embedding,
+ embedding_model_name = "text-embedding-3-small",
+ embedding_dim = 1536,
+ embedding_max_token_size = 8192,
+ embedding_batch_num = 32,
+ embedding_func_max_async = 16,
+ query_better_than_threshold = 0.2,
+
+ # LLM
+ best_model_func_raw = gpt_complete,
+ best_model_name = "gpt-4o-mini",
+ best_model_max_token_size = 32768,
+ best_model_max_async = 16,
+
+ cheap_model_func_raw = gpt_complete,
+ cheap_model_name = "gpt-4o-mini",
+ cheap_model_max_token_size = 32768,
+ cheap_model_max_async = 16,
+
+ # Caption model
+ caption_model_func_raw = dashscope_caption_complete,
+ caption_model_name = "qwen-vl-plus-latest",
+ caption_model_max_async = 3
+)
\ No newline at end of file
diff --git a/Vimo-desktop/python_backend/videorag/_op.py b/Vimo-desktop/python_backend/videorag/_op.py
new file mode 100755
index 0000000..55b5ea3
--- /dev/null
+++ b/Vimo-desktop/python_backend/videorag/_op.py
@@ -0,0 +1,907 @@
+#type: ignore
+import re
+import json
+import openai
+import asyncio
+import tiktoken
+from typing import Union
+from collections import Counter, defaultdict
+from ._splitter import SeparatorSplitter
+from ._utils import (
+ logger,
+ clean_str,
+ compute_mdhash_id,
+ decode_tokens_by_tiktoken,
+ encode_string_by_tiktoken,
+ is_float_regex,
+ list_of_list_to_csv,
+ pack_user_ass_to_openai_messages,
+ split_string_by_multi_markers,
+ truncate_list_by_token_size,
+)
+from .base import (
+ BaseGraphStorage,
+ BaseKVStorage,
+ BaseVectorStorage,
+ SingleCommunitySchema,
+ CommunitySchema,
+ TextChunkSchema,
+ QueryParam,
+)
+from .prompt import GRAPH_FIELD_SEP, PROMPTS
+from ._videoutil import (
+ retrieved_segment_caption_async,
+)
+
+def chunking_by_token_size(
+ tokens_list: list[list[int]],
+ doc_keys,
+ tiktoken_model,
+ overlap_token_size=128,
+ max_token_size=1024,
+):
+
+ results = []
+ for index, tokens in enumerate(tokens_list):
+ chunk_token = []
+ lengths = []
+ for start in range(0, len(tokens), max_token_size - overlap_token_size):
+
+ chunk_token.append(tokens[start : start + max_token_size])
+ lengths.append(min(max_token_size, len(tokens) - start))
+
+ # here somehow tricky, since the whole chunk tokens is list[list[list[int]]] for corpus(doc(chunk)),so it can't be decode entirely
+ chunk_token = tiktoken_model.decode_batch(chunk_token)
+ for i, chunk in enumerate(chunk_token):
+
+ results.append(
+ {
+ "tokens": lengths[i],
+ "content": chunk.strip(),
+ "chunk_order_index": i,
+ "full_doc_id": doc_keys[index],
+ }
+ )
+
+ return results
+
+
+def chunking_by_video_segments(
+ tokens_list: list[list[int]],
+ doc_keys,
+ tiktoken_model,
+ max_token_size=1024,
+):
+ # make sure each segment is not larger than max_token_size
+ for index in range(len(tokens_list)):
+ if len(tokens_list[index]) > max_token_size:
+ tokens_list[index] = tokens_list[index][:max_token_size]
+
+ results = []
+ chunk_token = []
+ chunk_segment_ids = []
+ chunk_order_index = 0
+ for index, tokens in enumerate(tokens_list):
+
+ if len(chunk_token) + len(tokens) <= max_token_size:
+ # add new segment
+ chunk_token += tokens.copy()
+ chunk_segment_ids.append(doc_keys[index])
+ else:
+ # save the current chunk
+ chunk = tiktoken_model.decode(chunk_token)
+ results.append(
+ {
+ "tokens": len(chunk_token),
+ "content": chunk.strip(),
+ "chunk_order_index": chunk_order_index,
+ "video_segment_id": chunk_segment_ids,
+ }
+ )
+ # new chunk with current segment as begin
+ chunk_token = []
+ chunk_segment_ids = []
+ chunk_token += tokens.copy()
+ chunk_segment_ids.append(doc_keys[index])
+ chunk_order_index += 1
+
+ # save the last chunk
+ if len(chunk_token) > 0:
+ chunk = tiktoken_model.decode(chunk_token)
+ results.append(
+ {
+ "tokens": len(chunk_token),
+ "content": chunk.strip(),
+ "chunk_order_index": chunk_order_index,
+ "video_segment_id": chunk_segment_ids,
+ }
+ )
+
+ return results
+
+
+def chunking_by_seperators(
+ tokens_list: list[list[int]],
+ doc_keys,
+ tiktoken_model,
+ overlap_token_size=128,
+ max_token_size=1024,
+):
+
+ splitter = SeparatorSplitter(
+ separators=[
+ tiktoken_model.encode(s) for s in PROMPTS["default_text_separator"]
+ ],
+ chunk_size=max_token_size,
+ chunk_overlap=overlap_token_size,
+ )
+ results = []
+ for index, tokens in enumerate(tokens_list):
+ chunk_token = splitter.split_tokens(tokens)
+ lengths = [len(c) for c in chunk_token]
+
+ # here somehow tricky, since the whole chunk tokens is list[list[list[int]]] for corpus(doc(chunk)),so it can't be decode entirely
+ chunk_token = tiktoken_model.decode_batch(chunk_token)
+ for i, chunk in enumerate(chunk_token):
+
+ results.append(
+ {
+ "tokens": lengths[i],
+ "content": chunk.strip(),
+ "chunk_order_index": i,
+ "full_doc_id": doc_keys[index],
+ }
+ )
+
+ return results
+
+
+def get_chunks(new_videos, chunk_func=chunking_by_video_segments, **chunk_func_params):
+ inserting_chunks = {}
+
+ new_videos_list = list(new_videos.keys())
+ for video_name in new_videos_list:
+ segment_id_list = list(new_videos[video_name].keys())
+ docs = [new_videos[video_name][index]["content"] for index in segment_id_list]
+ doc_keys = [f'{video_name}_{index}' for index in segment_id_list]
+
+ ENCODER = tiktoken.encoding_for_model("gpt-4o")
+ tokens = ENCODER.encode_batch(docs, num_threads=16)
+ chunks = chunk_func(
+ tokens, doc_keys=doc_keys, tiktoken_model=ENCODER, **chunk_func_params
+ )
+
+ for chunk in chunks:
+ inserting_chunks.update(
+ {compute_mdhash_id(chunk["content"], prefix="chunk-"): chunk}
+ )
+
+ return inserting_chunks
+
+
+async def _handle_entity_relation_summary(
+ entity_or_relation_name: str,
+ description: str,
+ global_config: dict,
+) -> str:
+ use_llm_func: callable = global_config["llm"]["cheap_model_func"]
+ llm_max_tokens = global_config["llm"]["cheap_model_max_token_size"]
+ tiktoken_model_name = global_config["tiktoken_model_name"]
+ summary_max_tokens = global_config["entity_summary_to_max_tokens"]
+
+ tokens = encode_string_by_tiktoken(description, model_name=tiktoken_model_name)
+ if len(tokens) < summary_max_tokens: # No need for summary
+ return description
+ prompt_template = PROMPTS["summarize_entity_descriptions"]
+ use_description = decode_tokens_by_tiktoken(
+ tokens[:llm_max_tokens], model_name=tiktoken_model_name
+ )
+ context_base = dict(
+ entity_name=entity_or_relation_name,
+ description_list=use_description.split(GRAPH_FIELD_SEP),
+ )
+ use_prompt = prompt_template.format(**context_base)
+ logger.debug(f"Trigger summary: {entity_or_relation_name}")
+ summary = await use_llm_func(use_prompt, max_tokens=summary_max_tokens)
+ return summary
+
+
+async def _handle_single_entity_extraction(
+ record_attributes: list[str],
+ chunk_key: str,
+):
+ if len(record_attributes) < 4 or record_attributes[0] != '"entity"':
+ return None
+ # add this record as a node in the G
+ entity_name = clean_str(record_attributes[1].upper())
+ if not entity_name.strip():
+ return None
+ entity_type = clean_str(record_attributes[2].upper())
+ entity_description = clean_str(record_attributes[3])
+ entity_source_id = chunk_key
+ return dict(
+ entity_name=entity_name,
+ entity_type=entity_type,
+ description=entity_description,
+ source_id=entity_source_id,
+ )
+
+
+async def _handle_single_relationship_extraction(
+ record_attributes: list[str],
+ chunk_key: str,
+):
+ if len(record_attributes) < 5 or record_attributes[0] != '"relationship"':
+ return None
+ # add this record as edge
+ source = clean_str(record_attributes[1].upper())
+ target = clean_str(record_attributes[2].upper())
+ edge_description = clean_str(record_attributes[3])
+ edge_source_id = chunk_key
+ weight = (
+ float(record_attributes[-1]) if is_float_regex(record_attributes[-1]) else 1.0
+ )
+ return dict(
+ src_id=source,
+ tgt_id=target,
+ weight=weight,
+ description=edge_description,
+ source_id=edge_source_id,
+ )
+
+
+async def _merge_nodes_then_upsert(
+ entity_name: str,
+ nodes_data: list[dict],
+ knowledge_graph_inst: BaseGraphStorage,
+ global_config: dict,
+):
+ already_entitiy_types = []
+ already_source_ids = []
+ already_description = []
+
+ already_node = await knowledge_graph_inst.get_node(entity_name)
+ if already_node is not None:
+ already_entitiy_types.append(already_node["entity_type"])
+ already_source_ids.extend(
+ split_string_by_multi_markers(already_node["source_id"], [GRAPH_FIELD_SEP])
+ )
+ already_description.append(already_node["description"])
+
+ entity_type = sorted(
+ Counter(
+ [dp["entity_type"] for dp in nodes_data] + already_entitiy_types
+ ).items(),
+ key=lambda x: x[1],
+ reverse=True,
+ )[0][0]
+ description = GRAPH_FIELD_SEP.join(
+ sorted(set([dp["description"] for dp in nodes_data] + already_description))
+ )
+ source_id = GRAPH_FIELD_SEP.join(
+ set([dp["source_id"] for dp in nodes_data] + already_source_ids)
+ )
+ description = await _handle_entity_relation_summary(
+ entity_name, description, global_config
+ )
+ node_data = dict(
+ entity_type=entity_type,
+ description=description,
+ source_id=source_id,
+ )
+ await knowledge_graph_inst.upsert_node(
+ entity_name,
+ node_data=node_data,
+ )
+ node_data["entity_name"] = entity_name
+ return node_data
+
+
+async def _merge_edges_then_upsert(
+ src_id: str,
+ tgt_id: str,
+ edges_data: list[dict],
+ knowledge_graph_inst: BaseGraphStorage,
+ global_config: dict,
+):
+ already_weights = []
+ already_source_ids = []
+ already_description = []
+ already_order = []
+ if await knowledge_graph_inst.has_edge(src_id, tgt_id):
+ already_edge = await knowledge_graph_inst.get_edge(src_id, tgt_id)
+ already_weights.append(already_edge["weight"])
+ already_source_ids.extend(
+ split_string_by_multi_markers(already_edge["source_id"], [GRAPH_FIELD_SEP])
+ )
+ already_description.append(already_edge["description"])
+ already_order.append(already_edge.get("order", 1))
+
+ # [numberchiffre]: `Relationship.order` is only returned from DSPy's predictions
+ order = min([dp.get("order", 1) for dp in edges_data] + already_order)
+ weight = sum([dp["weight"] for dp in edges_data] + already_weights)
+ description = GRAPH_FIELD_SEP.join(
+ sorted(set([dp["description"] for dp in edges_data] + already_description))
+ )
+ source_id = GRAPH_FIELD_SEP.join(
+ set([dp["source_id"] for dp in edges_data] + already_source_ids)
+ )
+ for need_insert_id in [src_id, tgt_id]:
+ if not (await knowledge_graph_inst.has_node(need_insert_id)):
+ await knowledge_graph_inst.upsert_node(
+ need_insert_id,
+ node_data={
+ "source_id": source_id,
+ "description": description,
+ "entity_type": '"UNKNOWN"',
+ },
+ )
+ description = await _handle_entity_relation_summary(
+ (src_id, tgt_id), description, global_config
+ )
+ await knowledge_graph_inst.upsert_edge(
+ src_id,
+ tgt_id,
+ edge_data=dict(
+ weight=weight, description=description, source_id=source_id, order=order
+ ),
+ )
+ return_edge_data = dict(
+ src_tgt=(src_id, tgt_id),
+ description=description,
+ weight=weight
+ )
+ return return_edge_data
+
+
+async def extract_entities(
+ chunks: dict[str, TextChunkSchema],
+ knowledge_graph_inst: BaseGraphStorage,
+ entity_vdb: BaseVectorStorage,
+ global_config: dict,
+) -> Union[BaseGraphStorage, None]:
+ use_llm_func: callable = global_config["llm"]["best_model_func"]
+ entity_extract_max_gleaning = global_config["entity_extract_max_gleaning"]
+
+ ordered_chunks = list(chunks.items())
+
+ entity_extract_prompt = PROMPTS["entity_extraction"]
+ context_base = dict(
+ tuple_delimiter=PROMPTS["DEFAULT_TUPLE_DELIMITER"],
+ record_delimiter=PROMPTS["DEFAULT_RECORD_DELIMITER"],
+ completion_delimiter=PROMPTS["DEFAULT_COMPLETION_DELIMITER"],
+ entity_types=",".join(PROMPTS["DEFAULT_ENTITY_TYPES"]),
+ )
+ continue_prompt = PROMPTS["entiti_continue_extraction"]
+ if_loop_prompt = PROMPTS["entiti_if_loop_extraction"]
+
+ already_processed = 0
+ already_entities = 0
+ already_relations = 0
+
+ async def _process_single_content(chunk_key_dp: tuple[str, TextChunkSchema]):
+ nonlocal already_processed, already_entities, already_relations
+ chunk_key = chunk_key_dp[0]
+ chunk_dp = chunk_key_dp[1]
+ content = chunk_dp["content"]
+ hint_prompt = entity_extract_prompt.format(**context_base, input_text=content)
+ final_result = await use_llm_func(hint_prompt)
+
+ history = pack_user_ass_to_openai_messages(hint_prompt, final_result)
+ for now_glean_index in range(entity_extract_max_gleaning):
+ glean_result = await use_llm_func(continue_prompt, history_messages=history)
+
+ history += pack_user_ass_to_openai_messages(continue_prompt, glean_result)
+ final_result += glean_result
+ if now_glean_index == entity_extract_max_gleaning - 1:
+ break
+
+ if_loop_result: str = await use_llm_func(if_loop_prompt, history_messages=history)
+ if_loop_result = if_loop_result.strip().strip('"').strip("'").lower()
+ if if_loop_result != "yes":
+ break
+
+ records = split_string_by_multi_markers(
+ final_result,
+ [context_base["record_delimiter"], context_base["completion_delimiter"]],
+ )
+
+ maybe_nodes = defaultdict(list)
+ maybe_edges = defaultdict(list)
+ for record in records:
+ record = re.search(r"\((.*)\)", record)
+ if record is None:
+ continue
+ record = record.group(1)
+ record_attributes = split_string_by_multi_markers(
+ record, [context_base["tuple_delimiter"]]
+ )
+ if_entities = await _handle_single_entity_extraction(
+ record_attributes, chunk_key
+ )
+ if if_entities is not None:
+ maybe_nodes[if_entities["entity_name"]].append(if_entities)
+ continue
+
+ if_relation = await _handle_single_relationship_extraction(
+ record_attributes, chunk_key
+ )
+ if if_relation is not None:
+ maybe_edges[(if_relation["src_id"], if_relation["tgt_id"])].append(
+ if_relation
+ )
+ already_processed += 1
+ already_entities += len(maybe_nodes)
+ already_relations += len(maybe_edges)
+ now_ticks = PROMPTS["process_tickers"][
+ already_processed % len(PROMPTS["process_tickers"])
+ ]
+ logger.info(f"{now_ticks} Processed {already_processed} chunks, {already_entities} entities(duplicated), {already_relations} relations(duplicated)\r")
+ return dict(maybe_nodes), dict(maybe_edges)
+
+ # use_llm_func is wrapped in ascynio.Semaphore, limiting max_async callings
+ results = await asyncio.gather(
+ *[_process_single_content(c) for c in ordered_chunks]
+ )
+ maybe_nodes = defaultdict(list)
+ maybe_edges = defaultdict(list)
+ for m_nodes, m_edges in results:
+ for k, v in m_nodes.items():
+ maybe_nodes[k].extend(v)
+ for k, v in m_edges.items():
+ # it's undirected graph
+ maybe_edges[tuple(sorted(k))].extend(v)
+ all_entities_data = await asyncio.gather(
+ *[
+ _merge_nodes_then_upsert(k, v, knowledge_graph_inst, global_config)
+ for k, v in maybe_nodes.items()
+ ]
+ )
+ all_edges_data = await asyncio.gather(
+ *[
+ _merge_edges_then_upsert(k[0], k[1], v, knowledge_graph_inst, global_config)
+ for k, v in maybe_edges.items()
+ ]
+ )
+ if not len(all_entities_data):
+ logger.warning("Didn't extract any entities, maybe your LLM is not working")
+ return None
+ if entity_vdb is not None:
+ data_for_vdb = {
+ compute_mdhash_id(dp["entity_name"], prefix="ent-"): {
+ "content": dp["entity_name"] + dp["description"],
+ "entity_name": dp["entity_name"],
+ }
+ for dp in all_entities_data
+ }
+ await entity_vdb.upsert(data_for_vdb)
+ return knowledge_graph_inst, all_entities_data, all_edges_data
+
+
+async def _find_most_related_segments_from_entities(
+ topk_chunks: int,
+ node_datas: list[dict],
+ text_chunks_db: BaseKVStorage[TextChunkSchema],
+ knowledge_graph_inst: BaseGraphStorage,
+):
+ text_units = [
+ split_string_by_multi_markers(dp["source_id"], [GRAPH_FIELD_SEP])
+ for dp in node_datas
+ ]
+ edges = await asyncio.gather(
+ *[knowledge_graph_inst.get_node_edges(dp["entity_name"]) for dp in node_datas]
+ )
+ all_one_hop_nodes = set()
+ for this_edges in edges:
+ if not this_edges:
+ continue
+ all_one_hop_nodes.update([e[1] for e in this_edges])
+ all_one_hop_nodes = list(all_one_hop_nodes)
+ all_one_hop_nodes_data = await asyncio.gather(
+ *[knowledge_graph_inst.get_node(e) for e in all_one_hop_nodes]
+ )
+ all_one_hop_text_units_lookup = {
+ k: set(split_string_by_multi_markers(v["source_id"], [GRAPH_FIELD_SEP]))
+ for k, v in zip(all_one_hop_nodes, all_one_hop_nodes_data)
+ if v is not None
+ }
+ all_text_units_lookup = {}
+ for index, (this_text_units, this_edges) in enumerate(zip(text_units, edges)):
+ for c_id in this_text_units:
+ if c_id in all_text_units_lookup:
+ continue
+ relation_counts = 0
+ for e in this_edges:
+ if (
+ e[1] in all_one_hop_text_units_lookup
+ and c_id in all_one_hop_text_units_lookup[e[1]]
+ ):
+ relation_counts += 1
+ all_text_units_lookup[c_id] = {
+ "data": await text_chunks_db.get_by_id(c_id),
+ "order": index,
+ "relation_counts": relation_counts,
+ }
+ if any([v is None for v in all_text_units_lookup.values()]):
+ logger.warning("Text chunks are missing, maybe the storage is damaged")
+ all_text_units = [
+ {"id": k, **v} for k, v in all_text_units_lookup.items() if v is not None
+ ]
+ sorted_text_units = sorted(
+ all_text_units, key=lambda x: -x["relation_counts"]
+ )[:topk_chunks]
+
+ chunk_related_segments = set()
+ for _chunk_data in sorted_text_units:
+ for s_id in _chunk_data['data']['video_segment_id']:
+ chunk_related_segments.add(s_id)
+
+ return chunk_related_segments
+
+async def _refine_entity_retrieval_query(
+ query,
+ query_param: QueryParam,
+ global_config: dict,
+):
+ use_llm_func: callable = global_config["llm"]["cheap_model_func"]
+ query_rewrite_prompt = PROMPTS["query_rewrite_for_entity_retrieval"]
+ query_rewrite_prompt = query_rewrite_prompt.format(input_text=query)
+ final_result = await use_llm_func(query_rewrite_prompt)
+ return final_result
+
+async def _refine_visual_retrieval_query(
+ query,
+ query_param: QueryParam,
+ global_config: dict,
+):
+ use_llm_func: callable = global_config["llm"]["cheap_model_func"]
+ query_rewrite_prompt = PROMPTS["query_rewrite_for_visual_retrieval"]
+ query_rewrite_prompt = query_rewrite_prompt.format(input_text=query)
+ final_result = await use_llm_func(query_rewrite_prompt)
+ return final_result
+
+async def _extract_keywords_query(
+ query,
+ query_param: QueryParam,
+ global_config: dict,
+):
+ use_llm_func: callable = global_config["llm"]["cheap_model_func"]
+ keywords_prompt = PROMPTS["keywords_extraction"]
+ keywords_prompt = keywords_prompt.format(input_text=query)
+ final_result = await use_llm_func(keywords_prompt)
+ return final_result
+
+async def videorag_query(
+ query,
+ entities_vdb,
+ text_chunks_db,
+ chunks_vdb,
+ video_path_db,
+ video_segments,
+ video_segment_feature_vdb,
+ knowledge_graph_inst,
+ query_param: QueryParam,
+ global_config: dict,
+) -> str:
+ use_model_func = global_config["llm"]["best_model_func"]
+ query = query
+
+ # naive chunks
+ results = await chunks_vdb.query(query, top_k=query_param.top_k)
+ if not len(results):
+ return PROMPTS["fail_response"]
+ chunks_ids = [r["id"] for r in results]
+ chunks = await text_chunks_db.get_by_ids(chunks_ids)
+
+ maybe_trun_chunks = truncate_list_by_token_size(
+ chunks,
+ key=lambda x: x["content"],
+ max_token_size=query_param.naive_max_token_for_text_unit,
+ )
+ logger.info(f"Truncate {len(chunks)} to {len(maybe_trun_chunks)} chunks")
+ section = "-----New Chunk-----\n".join([c["content"] for c in maybe_trun_chunks])
+ retreived_chunk_context = section
+
+ # visual retrieval
+ query_for_entity_retrieval = await _refine_entity_retrieval_query(
+ query,
+ query_param,
+ global_config,
+ )
+ entity_results = await entities_vdb.query(query_for_entity_retrieval, top_k=query_param.top_k)
+ entity_retrieved_segments = set()
+ if len(entity_results):
+ node_datas = await asyncio.gather(
+ *[knowledge_graph_inst.get_node(r["entity_name"]) for r in entity_results]
+ )
+ if not all([n is not None for n in node_datas]):
+ logger.warning("Some nodes are missing, maybe the storage is damaged")
+ node_degrees = await asyncio.gather(
+ *[knowledge_graph_inst.node_degree(r["entity_name"]) for r in entity_results]
+ )
+ node_datas = [
+ {**n, "entity_name": k["entity_name"], "rank": d}
+ for k, n, d in zip(entity_results, node_datas, node_degrees)
+ if n is not None
+ ]
+ entity_retrieved_segments = entity_retrieved_segments.union(await _find_most_related_segments_from_entities(
+ global_config["retrieval_topk_chunks"], node_datas, text_chunks_db, knowledge_graph_inst
+ ))
+
+ # visual retrieval
+ query_for_visual_retrieval = await _refine_visual_retrieval_query(
+ query,
+ query_param,
+ global_config,
+ )
+ segment_results = await video_segment_feature_vdb.query(query_for_visual_retrieval)
+ visual_retrieved_segments = set()
+ if len(segment_results):
+ for n in segment_results:
+ visual_retrieved_segments.add(n['__id__'])
+
+ # caption
+ retrieved_segments = list(entity_retrieved_segments.union(visual_retrieved_segments))
+ retrieved_segments = sorted(
+ retrieved_segments,
+ key=lambda x: (
+ '_'.join(x.split('_')[:-1]), # video_name
+ eval(x.split('_')[-1]) # index
+ )
+ )
+ logger.info(query_for_entity_retrieval)
+ logger.info(f"Retrieved Text Segments {entity_retrieved_segments}")
+ logger.info(query_for_visual_retrieval)
+ logger.info(f"Retrieved Visual Segments {visual_retrieved_segments}")
+
+ already_processed = 0
+ async def _filter_single_segment(knowledge: str, segment_key_dp: tuple[str, str]):
+ nonlocal use_model_func, already_processed
+ segment_key = segment_key_dp[0]
+ segment_content = segment_key_dp[1]
+ filter_prompt = PROMPTS["filtering_segment"]
+ filter_prompt = filter_prompt.format(caption=segment_content, knowledge=knowledge)
+ result = await use_model_func(filter_prompt, global_config=global_config)
+ already_processed += 1
+ now_ticks = PROMPTS["process_tickers"][
+ already_processed % len(PROMPTS["process_tickers"])
+ ]
+ logger.info(f"{now_ticks} Checked {already_processed} segments\r")
+ return (segment_key, result)
+
+ rough_captions = {}
+ for s_id in retrieved_segments:
+ video_name = '_'.join(s_id.split('_')[:-1])
+ index = s_id.split('_')[-1]
+ rough_captions[s_id] = video_segments._data[video_name][index]["content"]
+ results = await asyncio.gather(
+ *[_filter_single_segment(query, (s_id, rough_captions[s_id])) for s_id in rough_captions]
+ )
+ remain_segments = [x[0] for x in results if 'yes' in x[1].lower()]
+ logger.info(f"{len(remain_segments)} Video Segments remain after filtering")
+ if len(remain_segments) == 0:
+ logger.info("Since no segments remain after filtering, we utilized all the retrieved segments.")
+ remain_segments = retrieved_segments
+ logger.info(f"Remain segments {remain_segments}")
+
+ # visual retrieval
+ keywords_for_caption = await _extract_keywords_query(
+ query,
+ query_param,
+ global_config,
+ )
+ logger.info(f"Keywords: {keywords_for_caption}")
+ caption_results = await retrieved_segment_caption_async(
+ keywords_for_caption,
+ remain_segments,
+ video_path_db,
+ video_segments,
+ num_sampled_frames=global_config['fine_num_frames_per_segment'],
+ global_config=global_config,
+ )
+
+ ## data table
+ text_units_section_list = [["video_name", "start_time", "end_time", "content"]]
+ for s_id in caption_results:
+ video_name = '_'.join(s_id.split('_')[:-1])
+ index = s_id.split('_')[-1]
+ start_time = eval(video_segments._data[video_name][index]["time"].split('-')[0])
+ end_time = eval(video_segments._data[video_name][index]["time"].split('-')[1])
+ start_time = f"{start_time // 3600}:{(start_time % 3600) // 60}:{start_time % 60}"
+ end_time = f"{end_time // 3600}:{(end_time % 3600) // 60}:{end_time % 60}"
+ text_units_section_list.append([video_name, start_time, end_time, caption_results[s_id]])
+ text_units_context = list_of_list_to_csv(text_units_section_list)
+
+ retreived_video_context = f"\n-----Retrieved Knowledge From Videos-----\n```csv\n{text_units_context}\n```\n"
+
+ if query_param.wo_reference:
+ sys_prompt_temp = PROMPTS["videorag_response_wo_reference"]
+ else:
+ sys_prompt_temp = PROMPTS["videorag_response"]
+
+ sys_prompt = sys_prompt_temp.format(
+ video_data=retreived_video_context,
+ chunk_data=retreived_chunk_context,
+ response_type=query_param.response_type
+ )
+ response = await use_model_func(
+ query,
+ system_prompt=sys_prompt,
+ global_config=global_config,
+ )
+ return response
+
+async def videorag_query_multiple_choice(
+ query,
+ entities_vdb,
+ text_chunks_db,
+ chunks_vdb,
+ video_path_db,
+ video_segments,
+ video_segment_feature_vdb,
+ knowledge_graph_inst,
+ query_param: QueryParam,
+ global_config: dict,
+) -> str:
+ """_summary_
+ A copy of the videorag_query function with several updates for handling multiple-choice queries.
+ """
+ use_model_func = global_config["llm"]["best_model_func"]
+ query = query
+
+ # naive chunks
+ results = await chunks_vdb.query(query, top_k=query_param.top_k)
+ # NOTE: I update here, not len results can also process
+ if len(results):
+ chunks_ids = [r["id"] for r in results]
+ chunks = await text_chunks_db.get_by_ids(chunks_ids)
+
+ maybe_trun_chunks = truncate_list_by_token_size(
+ chunks,
+ key=lambda x: x["content"],
+ max_token_size=query_param.naive_max_token_for_text_unit,
+ )
+ logger.info(f"Truncate {len(chunks)} to {len(maybe_trun_chunks)} chunks")
+ section = "-----New Chunk-----\n".join([c["content"] for c in maybe_trun_chunks])
+ retreived_chunk_context = section
+ else:
+ retreived_chunk_context = "No Content"
+
+ # visual retrieval
+ query_for_entity_retrieval = await _refine_entity_retrieval_query(
+ query,
+ query_param,
+ global_config,
+ )
+ entity_results = await entities_vdb.query(query_for_entity_retrieval, top_k=query_param.top_k)
+ entity_retrieved_segments = set()
+ if len(entity_results):
+ node_datas = await asyncio.gather(
+ *[knowledge_graph_inst.get_node(r["entity_name"]) for r in entity_results]
+ )
+ if not all([n is not None for n in node_datas]):
+ logger.warning("Some nodes are missing, maybe the storage is damaged")
+ node_degrees = await asyncio.gather(
+ *[knowledge_graph_inst.node_degree(r["entity_name"]) for r in entity_results]
+ )
+ node_datas = [
+ {**n, "entity_name": k["entity_name"], "rank": d}
+ for k, n, d in zip(entity_results, node_datas, node_degrees)
+ if n is not None
+ ]
+ entity_retrieved_segments = entity_retrieved_segments.union(await _find_most_related_segments_from_entities(
+ global_config["retrieval_topk_chunks"], node_datas, text_chunks_db, knowledge_graph_inst
+ ))
+
+ # visual retrieval
+ query_for_visual_retrieval = await _refine_visual_retrieval_query(
+ query,
+ query_param,
+ global_config,
+ )
+ segment_results = await video_segment_feature_vdb.query(query_for_visual_retrieval)
+ visual_retrieved_segments = set()
+ if len(segment_results):
+ for n in segment_results:
+ visual_retrieved_segments.add(n['__id__'])
+
+ # caption
+ retrieved_segments = list(entity_retrieved_segments.union(visual_retrieved_segments))
+ retrieved_segments = sorted(
+ retrieved_segments,
+ key=lambda x: (
+ '_'.join(x.split('_')[:-1]), # video_name
+ eval(x.split('_')[-1]) # index
+ )
+ )
+ logger.info(query_for_entity_retrieval)
+ logger.info(f"Retrieved Text Segments {entity_retrieved_segments}")
+ logger.info(query_for_visual_retrieval)
+ logger.info(f"Retrieved Visual Segments {visual_retrieved_segments}")
+
+ already_processed = 0
+ async def _filter_single_segment(knowledge: str, segment_key_dp: tuple[str, str]):
+ nonlocal use_model_func, already_processed
+ segment_key = segment_key_dp[0]
+ segment_content = segment_key_dp[1]
+ filter_prompt = PROMPTS["filtering_segment"]
+ filter_prompt = filter_prompt.format(caption=segment_content, knowledge=knowledge)
+ result = await use_model_func(filter_prompt, global_config=global_config)
+ already_processed += 1
+ now_ticks = PROMPTS["process_tickers"][
+ already_processed % len(PROMPTS["process_tickers"])
+ ]
+ logger.info(f"{now_ticks} Checked {already_processed} segments\r")
+ return (segment_key, result)
+
+ rough_captions = {}
+ for s_id in retrieved_segments:
+ video_name = '_'.join(s_id.split('_')[:-1])
+ index = s_id.split('_')[-1]
+ rough_captions[s_id] = video_segments._data[video_name][index]["content"]
+ results = await asyncio.gather(
+ *[_filter_single_segment(query, (s_id, rough_captions[s_id])) for s_id in rough_captions]
+ )
+ remain_segments = [x[0] for x in results if 'yes' in x[1].lower()]
+ logger.info(f"{len(remain_segments)} Video Segments remain after filtering")
+ if len(remain_segments) == 0:
+ logger.info("Since no segments remain after filtering, we utilized all the retrieved segments.")
+ remain_segments = retrieved_segments
+ logger.info(f"Remain segments {remain_segments}")
+
+ # visual retrieval
+ keywords_for_caption = await _extract_keywords_query(
+ query,
+ query_param,
+ global_config,
+ )
+ logger.info(f"Keywords: {keywords_for_caption}")
+ caption_results = await retrieved_segment_caption_async(
+ keywords_for_caption,
+ remain_segments,
+ video_path_db,
+ video_segments,
+ num_sampled_frames=global_config['fine_num_frames_per_segment'],
+ global_config=global_config,
+ )
+
+ ## data table
+ text_units_section_list = [["video_name", "start_time", "end_time", "content"]]
+ for s_id in caption_results:
+ video_name = '_'.join(s_id.split('_')[:-1])
+ index = s_id.split('_')[-1]
+ start_time = eval(video_segments._data[video_name][index]["time"].split('-')[0])
+ end_time = eval(video_segments._data[video_name][index]["time"].split('-')[1])
+ start_time = f"{start_time // 3600}:{(start_time % 3600) // 60}:{start_time % 60}"
+ end_time = f"{end_time // 3600}:{(end_time % 3600) // 60}:{end_time % 60}"
+ text_units_section_list.append([video_name, start_time, end_time, caption_results[s_id]])
+ text_units_context = list_of_list_to_csv(text_units_section_list)
+
+ retreived_video_context = f"\n-----Retrieved Knowledge From Videos-----\n```csv\n{text_units_context}\n```\n"
+
+ # NOTE: I update here to use a different prompt
+ sys_prompt_temp = PROMPTS["videorag_response_for_multiple_choice_question"]
+
+ sys_prompt = sys_prompt_temp.format(
+ video_data=retreived_video_context,
+ chunk_data=retreived_chunk_context,
+ response_type=query_param.response_type
+ )
+ response = await use_model_func(
+ query,
+ system_prompt=sys_prompt,
+ use_cache=False,
+ )
+ while True:
+ try:
+ json_response = json.loads(response)
+ assert "Answer" in json_response and "Explanation" in json_response
+ return json_response
+ except Exception as e:
+ logger.info(f"Response is not valid JSON for query {query}. Found {e}. Retrying...")
+ response = await use_model_func(
+ query,
+ system_prompt=sys_prompt,
+ use_cache=False,
+ )
+
\ No newline at end of file
diff --git a/Vimo-desktop/python_backend/videorag/_splitter.py b/Vimo-desktop/python_backend/videorag/_splitter.py
new file mode 100755
index 0000000..2039369
--- /dev/null
+++ b/Vimo-desktop/python_backend/videorag/_splitter.py
@@ -0,0 +1,94 @@
+from typing import List, Optional, Union, Literal
+
+class SeparatorSplitter:
+ def __init__(
+ self,
+ separators: Optional[List[List[int]]] = None,
+ keep_separator: Union[bool, Literal["start", "end"]] = "end",
+ chunk_size: int = 4000,
+ chunk_overlap: int = 200,
+ length_function: callable = len,
+ ):
+ self._separators = separators or []
+ self._keep_separator = keep_separator
+ self._chunk_size = chunk_size
+ self._chunk_overlap = chunk_overlap
+ self._length_function = length_function
+
+ def split_tokens(self, tokens: List[int]) -> List[List[int]]:
+ splits = self._split_tokens_with_separators(tokens)
+ return self._merge_splits(splits)
+
+ def _split_tokens_with_separators(self, tokens: List[int]) -> List[List[int]]:
+ splits = []
+ current_split = []
+ i = 0
+ while i < len(tokens):
+ separator_found = False
+ for separator in self._separators:
+ if tokens[i:i+len(separator)] == separator:
+ if self._keep_separator in [True, "end"]:
+ current_split.extend(separator)
+ if current_split:
+ splits.append(current_split)
+ current_split = []
+ if self._keep_separator == "start":
+ current_split.extend(separator)
+ i += len(separator)
+ separator_found = True
+ break
+ if not separator_found:
+ current_split.append(tokens[i])
+ i += 1
+ if current_split:
+ splits.append(current_split)
+ return [s for s in splits if s]
+
+ def _merge_splits(self, splits: List[List[int]]) -> List[List[int]]:
+ if not splits:
+ return []
+
+ merged_splits = []
+ current_chunk = []
+
+ for split in splits:
+ if not current_chunk:
+ current_chunk = split
+ elif self._length_function(current_chunk) + self._length_function(split) <= self._chunk_size:
+ current_chunk.extend(split)
+ else:
+ merged_splits.append(current_chunk)
+ current_chunk = split
+
+ if current_chunk:
+ merged_splits.append(current_chunk)
+
+ if len(merged_splits) == 1 and self._length_function(merged_splits[0]) > self._chunk_size:
+ return self._split_chunk(merged_splits[0])
+
+ if self._chunk_overlap > 0:
+ return self._enforce_overlap(merged_splits)
+
+ return merged_splits
+
+ def _split_chunk(self, chunk: List[int]) -> List[List[int]]:
+ result = []
+ for i in range(0, len(chunk), self._chunk_size - self._chunk_overlap):
+ new_chunk = chunk[i:i + self._chunk_size]
+ if len(new_chunk) > self._chunk_overlap: # Only add chunk when its length is greater than overlap
+ result.append(new_chunk)
+ return result
+
+ def _enforce_overlap(self, chunks: List[List[int]]) -> List[List[int]]:
+ result = []
+ for i, chunk in enumerate(chunks):
+ if i == 0:
+ result.append(chunk)
+ else:
+ overlap = chunks[i-1][-self._chunk_overlap:]
+ new_chunk = overlap + chunk
+ if self._length_function(new_chunk) > self._chunk_size:
+ new_chunk = new_chunk[:self._chunk_size]
+ result.append(new_chunk)
+ return result
+
diff --git a/Vimo-desktop/python_backend/videorag/_storage/__init__.py b/Vimo-desktop/python_backend/videorag/_storage/__init__.py
new file mode 100755
index 0000000..99adae6
--- /dev/null
+++ b/Vimo-desktop/python_backend/videorag/_storage/__init__.py
@@ -0,0 +1,5 @@
+from .gdb_networkx import NetworkXStorage
+from .gdb_neo4j import Neo4jStorage
+from .vdb_hnswlib import HNSWVectorStorage
+from .vdb_nanovectordb import NanoVectorDBStorage, NanoVectorDBVideoSegmentStorage
+from .kv_json import JsonKVStorage
diff --git a/Vimo-desktop/python_backend/videorag/_storage/gdb_neo4j.py b/Vimo-desktop/python_backend/videorag/_storage/gdb_neo4j.py
new file mode 100755
index 0000000..e45634a
--- /dev/null
+++ b/Vimo-desktop/python_backend/videorag/_storage/gdb_neo4j.py
@@ -0,0 +1,330 @@
+import json
+import asyncio
+from collections import defaultdict
+from neo4j import AsyncGraphDatabase
+from dataclasses import dataclass
+from typing import Union
+from ..base import BaseGraphStorage, SingleCommunitySchema
+from .._utils import logger
+from ..prompt import GRAPH_FIELD_SEP
+
+neo4j_lock = asyncio.Lock()
+
+
+def make_path_idable(path):
+ return path.replace(".", "_").replace("/", "__").replace("-", "_")
+
+
+@dataclass
+class Neo4jStorage(BaseGraphStorage):
+ def __post_init__(self):
+ self.neo4j_url = self.global_config["addon_params"].get("neo4j_url", None)
+ self.neo4j_auth = self.global_config["addon_params"].get("neo4j_auth", None)
+ self.namespace = (
+ f"{make_path_idable(self.global_config['working_dir'])}__{self.namespace}"
+ )
+ logger.info(f"Using the label {self.namespace} for Neo4j as identifier")
+ if self.neo4j_url is None or self.neo4j_auth is None:
+ raise ValueError("Missing neo4j_url or neo4j_auth in addon_params")
+ self.async_driver = AsyncGraphDatabase.driver(
+ self.neo4j_url, auth=self.neo4j_auth
+ )
+
+ # async def create_database(self):
+ # async with self.async_driver.session() as session:
+ # try:
+ # constraints = await session.run("SHOW CONSTRAINTS")
+ # # TODO I don't know why CREATE CONSTRAINT IF NOT EXISTS still trigger error
+ # # so have to check if the constrain exists
+ # constrain_exists = False
+
+ # async for record in constraints:
+ # if (
+ # self.namespace in record["labelsOrTypes"]
+ # and "id" in record["properties"]
+ # and record["type"] == "UNIQUENESS"
+ # ):
+ # constrain_exists = True
+ # break
+ # if not constrain_exists:
+ # await session.run(
+ # f"CREATE CONSTRAINT FOR (n:{self.namespace}) REQUIRE n.id IS UNIQUE"
+ # )
+ # logger.info(f"Add constraint for namespace: {self.namespace}")
+
+ # except Exception as e:
+ # logger.error(f"Error accessing or setting up the database: {str(e)}")
+ # raise
+
+ async def _init_workspace(self):
+ await self.async_driver.verify_authentication()
+ await self.async_driver.verify_connectivity()
+ # TODOLater: create database if not exists always cause an error when async
+ # await self.create_database()
+
+ async def index_start_callback(self):
+ logger.info("Init Neo4j workspace")
+ await self._init_workspace()
+
+ async def has_node(self, node_id: str) -> bool:
+ async with self.async_driver.session() as session:
+ result = await session.run(
+ f"MATCH (n:{self.namespace}) WHERE n.id = $node_id RETURN COUNT(n) > 0 AS exists",
+ node_id=node_id,
+ )
+ record = await result.single()
+ return record["exists"] if record else False
+
+ async def has_edge(self, source_node_id: str, target_node_id: str) -> bool:
+ async with self.async_driver.session() as session:
+ result = await session.run(
+ f"MATCH (s:{self.namespace})-[r]->(t:{self.namespace}) "
+ "WHERE s.id = $source_id AND t.id = $target_id "
+ "RETURN COUNT(r) > 0 AS exists",
+ source_id=source_node_id,
+ target_id=target_node_id,
+ )
+ record = await result.single()
+ return record["exists"] if record else False
+
+ async def node_degree(self, node_id: str) -> int:
+ async with self.async_driver.session() as session:
+ result = await session.run(
+ f"MATCH (n:{self.namespace}) WHERE n.id = $node_id "
+ f"RETURN COUNT {{(n)-[]-(:{self.namespace})}} AS degree",
+ node_id=node_id,
+ )
+ record = await result.single()
+ return record["degree"] if record else 0
+
+ async def edge_degree(self, src_id: str, tgt_id: str) -> int:
+ async with self.async_driver.session() as session:
+ result = await session.run(
+ f"MATCH (s:{self.namespace}), (t:{self.namespace}) "
+ "WHERE s.id = $src_id AND t.id = $tgt_id "
+ f"RETURN COUNT {{(s)-[]-(:{self.namespace})}} + COUNT {{(t)-[]-(:{self.namespace})}} AS degree",
+ src_id=src_id,
+ tgt_id=tgt_id,
+ )
+ record = await result.single()
+ return record["degree"] if record else 0
+
+ async def get_node(self, node_id: str) -> Union[dict, None]:
+ async with self.async_driver.session() as session:
+ result = await session.run(
+ f"MATCH (n:{self.namespace}) WHERE n.id = $node_id RETURN properties(n) AS node_data",
+ node_id=node_id,
+ )
+ record = await result.single()
+ raw_node_data = record["node_data"] if record else None
+ if raw_node_data is None:
+ return None
+ raw_node_data["clusters"] = json.dumps(
+ [
+ {
+ "level": index,
+ "cluster": cluster_id,
+ }
+ for index, cluster_id in enumerate(
+ raw_node_data.get("communityIds", [])
+ )
+ ]
+ )
+ return raw_node_data
+
+ async def get_edge(
+ self, source_node_id: str, target_node_id: str
+ ) -> Union[dict, None]:
+ async with self.async_driver.session() as session:
+ result = await session.run(
+ f"MATCH (s:{self.namespace})-[r]->(t:{self.namespace}) "
+ "WHERE s.id = $source_id AND t.id = $target_id "
+ "RETURN properties(r) AS edge_data",
+ source_id=source_node_id,
+ target_id=target_node_id,
+ )
+ record = await result.single()
+ return record["edge_data"] if record else None
+
+ async def get_node_edges(
+ self, source_node_id: str
+ ) -> Union[list[tuple[str, str]], None]:
+ async with self.async_driver.session() as session:
+ result = await session.run(
+ f"MATCH (s:{self.namespace})-[r]->(t:{self.namespace}) WHERE s.id = $source_id "
+ "RETURN s.id AS source, t.id AS target",
+ source_id=source_node_id,
+ )
+ edges = []
+ async for record in result:
+ edges.append((record["source"], record["target"]))
+ return edges
+
+ async def upsert_node(self, node_id: str, node_data: dict[str, str]):
+ node_type = node_data.get("entity_type", "UNKNOWN").strip('"')
+ async with self.async_driver.session() as session:
+ await session.run(
+ f"MERGE (n:{self.namespace}:{node_type} {{id: $node_id}}) "
+ "SET n += $node_data",
+ node_id=node_id,
+ node_data=node_data,
+ )
+
+ async def upsert_edge(
+ self, source_node_id: str, target_node_id: str, edge_data: dict[str, str]
+ ):
+ edge_data.setdefault("weight", 0.0)
+ async with self.async_driver.session() as session:
+ await session.run(
+ f"MATCH (s:{self.namespace}), (t:{self.namespace}) "
+ "WHERE s.id = $source_id AND t.id = $target_id "
+ "MERGE (s)-[r:RELATED]->(t) " # Added relationship type 'RELATED'
+ "SET r += $edge_data",
+ source_id=source_node_id,
+ target_id=target_node_id,
+ edge_data=edge_data,
+ )
+
+ async def clustering(self, algorithm: str):
+ if algorithm != "leiden":
+ raise ValueError(
+ f"Clustering algorithm {algorithm} not supported in Neo4j implementation"
+ )
+
+ random_seed = self.global_config["graph_cluster_seed"]
+ max_level = self.global_config["max_graph_cluster_size"]
+ async with self.async_driver.session() as session:
+ try:
+ # Project the graph with undirected relationships
+ await session.run(
+ f"""
+ CALL gds.graph.project(
+ 'graph_{self.namespace}',
+ ['{self.namespace}'],
+ {{
+ RELATED: {{
+ orientation: 'UNDIRECTED',
+ properties: ['weight']
+ }}
+ }}
+ )
+ """
+ )
+
+ # Run Leiden algorithm
+ result = await session.run(
+ f"""
+ CALL gds.leiden.write(
+ 'graph_{self.namespace}',
+ {{
+ writeProperty: 'communityIds',
+ includeIntermediateCommunities: True,
+ relationshipWeightProperty: "weight",
+ maxLevels: {max_level},
+ tolerance: 0.0001,
+ gamma: 1.0,
+ theta: 0.01,
+ randomSeed: {random_seed}
+ }}
+ )
+ YIELD communityCount, modularities;
+ """
+ )
+ result = await result.single()
+ community_count: int = result["communityCount"]
+ modularities = result["modularities"]
+ logger.info(
+ f"Performed graph clustering with {community_count} communities and modularities {modularities}"
+ )
+ finally:
+ # Drop the projected graph
+ await session.run(f"CALL gds.graph.drop('graph_{self.namespace}')")
+
+ async def community_schema(self) -> dict[str, SingleCommunitySchema]:
+ results = defaultdict(
+ lambda: dict(
+ level=None,
+ title=None,
+ edges=set(),
+ nodes=set(),
+ chunk_ids=set(),
+ occurrence=0.0,
+ sub_communities=[],
+ )
+ )
+
+ async with self.async_driver.session() as session:
+ # Fetch community data
+ result = await session.run(
+ f"""
+ MATCH (n:{self.namespace})
+ WITH n, n.communityIds AS communityIds, [(n)-[]-(m:{self.namespace}) | m.id] AS connected_nodes
+ RETURN n.id AS node_id, n.source_id AS source_id,
+ communityIds AS cluster_key,
+ connected_nodes
+ """
+ )
+
+ # records = await result.fetch()
+
+ max_num_ids = 0
+ async for record in result:
+ for index, c_id in enumerate(record["cluster_key"]):
+ node_id = str(record["node_id"])
+ source_id = record["source_id"]
+ level = index
+ cluster_key = str(c_id)
+ connected_nodes = record["connected_nodes"]
+
+ results[cluster_key]["level"] = level
+ results[cluster_key]["title"] = f"Cluster {cluster_key}"
+ results[cluster_key]["nodes"].add(node_id)
+ results[cluster_key]["edges"].update(
+ [
+ tuple(sorted([node_id, str(connected)]))
+ for connected in connected_nodes
+ if connected != node_id
+ ]
+ )
+ chunk_ids = source_id.split(GRAPH_FIELD_SEP)
+ results[cluster_key]["chunk_ids"].update(chunk_ids)
+ max_num_ids = max(
+ max_num_ids, len(results[cluster_key]["chunk_ids"])
+ )
+
+ # Process results
+ for k, v in results.items():
+ v["edges"] = [list(e) for e in v["edges"]]
+ v["nodes"] = list(v["nodes"])
+ v["chunk_ids"] = list(v["chunk_ids"])
+ v["occurrence"] = len(v["chunk_ids"]) / max_num_ids
+
+ # Compute sub-communities (this is a simplified approach)
+ for cluster in results.values():
+ cluster["sub_communities"] = [
+ sub_key
+ for sub_key, sub_cluster in results.items()
+ if sub_cluster["level"] > cluster["level"]
+ and set(sub_cluster["nodes"]).issubset(set(cluster["nodes"]))
+ ]
+
+ return dict(results)
+
+ async def index_done_callback(self):
+ await self.async_driver.close()
+
+ async def _debug_delete_all_node_edges(self):
+ async with self.async_driver.session() as session:
+ try:
+ # Delete all relationships in the namespace
+ await session.run(f"MATCH (n:{self.namespace})-[r]-() DELETE r")
+
+ # Delete all nodes in the namespace
+ await session.run(f"MATCH (n:{self.namespace}) DELETE n")
+
+ logger.info(
+ f"All nodes and edges in namespace '{self.namespace}' have been deleted."
+ )
+ except Exception as e:
+ logger.error(f"Error deleting nodes and edges: {str(e)}")
+ raise
diff --git a/Vimo-desktop/python_backend/videorag/_storage/gdb_networkx.py b/Vimo-desktop/python_backend/videorag/_storage/gdb_networkx.py
new file mode 100755
index 0000000..e29bf3e
--- /dev/null
+++ b/Vimo-desktop/python_backend/videorag/_storage/gdb_networkx.py
@@ -0,0 +1,238 @@
+import html
+import json
+import os
+from collections import defaultdict
+from dataclasses import dataclass
+from typing import Any, Union, cast
+import networkx as nx
+import numpy as np
+
+from .._utils import logger
+from ..base import (
+ BaseGraphStorage,
+ SingleCommunitySchema,
+)
+from ..prompt import GRAPH_FIELD_SEP
+
+
+@dataclass
+class NetworkXStorage(BaseGraphStorage):
+ @staticmethod
+ def load_nx_graph(file_name) -> nx.Graph:
+ if os.path.exists(file_name):
+ return nx.read_graphml(file_name)
+ return None
+
+ @staticmethod
+ def write_nx_graph(graph: nx.Graph, file_name):
+ logger.info(
+ f"Writing graph with {graph.number_of_nodes()} nodes, {graph.number_of_edges()} edges"
+ )
+ nx.write_graphml(graph, file_name)
+
+ @staticmethod
+ def stable_largest_connected_component(graph: nx.Graph) -> nx.Graph:
+ """Refer to https://github.com/microsoft/graphrag/index/graph/utils/stable_lcc.py
+ Return the largest connected component of the graph, with nodes and edges sorted in a stable way.
+ """
+ from graspologic.utils import largest_connected_component
+
+ graph = graph.copy()
+ graph = cast(nx.Graph, largest_connected_component(graph))
+ node_mapping = {node: html.unescape(node.upper().strip()) for node in graph.nodes()} # type: ignore
+ graph = nx.relabel_nodes(graph, node_mapping)
+ return NetworkXStorage._stabilize_graph(graph)
+
+ @staticmethod
+ def _stabilize_graph(graph: nx.Graph) -> nx.Graph:
+ """Refer to https://github.com/microsoft/graphrag/index/graph/utils/stable_lcc.py
+ Ensure an undirected graph with the same relationships will always be read the same way.
+ """
+ fixed_graph = nx.DiGraph() if graph.is_directed() else nx.Graph()
+
+ sorted_nodes = graph.nodes(data=True)
+ sorted_nodes = sorted(sorted_nodes, key=lambda x: x[0])
+
+ fixed_graph.add_nodes_from(sorted_nodes)
+ edges = list(graph.edges(data=True))
+
+ if not graph.is_directed():
+
+ def _sort_source_target(edge):
+ source, target, edge_data = edge
+ if source > target:
+ temp = source
+ source = target
+ target = temp
+ return source, target, edge_data
+
+ edges = [_sort_source_target(edge) for edge in edges]
+
+ def _get_edge_key(source: Any, target: Any) -> str:
+ return f"{source} -> {target}"
+
+ edges = sorted(edges, key=lambda x: _get_edge_key(x[0], x[1]))
+
+ fixed_graph.add_edges_from(edges)
+ return fixed_graph
+
+ def __post_init__(self):
+ self._graphml_xml_file = os.path.join(
+ self.global_config["working_dir"], f"graph_{self.namespace}.graphml"
+ )
+ preloaded_graph = NetworkXStorage.load_nx_graph(self._graphml_xml_file)
+ if preloaded_graph is not None:
+ logger.info(
+ f"Loaded graph from {self._graphml_xml_file} with {preloaded_graph.number_of_nodes()} nodes, {preloaded_graph.number_of_edges()} edges"
+ )
+ self._graph = preloaded_graph or nx.Graph()
+ self._clustering_algorithms = {
+ "leiden": self._leiden_clustering,
+ }
+ self._node_embed_algorithms = {
+ "node2vec": self._node2vec_embed,
+ }
+
+ async def index_done_callback(self):
+ NetworkXStorage.write_nx_graph(self._graph, self._graphml_xml_file)
+
+ async def has_node(self, node_id: str) -> bool:
+ return self._graph.has_node(node_id)
+
+ async def has_edge(self, source_node_id: str, target_node_id: str) -> bool:
+ return self._graph.has_edge(source_node_id, target_node_id)
+
+ async def get_node(self, node_id: str) -> Union[dict, None]:
+ return self._graph.nodes.get(node_id)
+
+ async def node_degree(self, node_id: str) -> int:
+ # [numberchiffre]: node_id not part of graph returns `DegreeView({})` instead of 0
+ return self._graph.degree(node_id) if self._graph.has_node(node_id) else 0
+
+ async def edge_degree(self, src_id: str, tgt_id: str) -> int:
+ return (self._graph.degree(src_id) if self._graph.has_node(src_id) else 0) + (
+ self._graph.degree(tgt_id) if self._graph.has_node(tgt_id) else 0
+ )
+
+ async def get_edge(
+ self, source_node_id: str, target_node_id: str
+ ) -> Union[dict, None]:
+ return self._graph.edges.get((source_node_id, target_node_id))
+
+ async def get_node_edges(self, source_node_id: str):
+ if self._graph.has_node(source_node_id):
+ return list(self._graph.edges(source_node_id))
+ return None
+
+ async def upsert_node(self, node_id: str, node_data: dict[str, str]):
+ self._graph.add_node(node_id, **node_data)
+
+ async def upsert_edge(
+ self, source_node_id: str, target_node_id: str, edge_data: dict[str, str]
+ ):
+ self._graph.add_edge(source_node_id, target_node_id, **edge_data)
+
+ async def clustering(self, algorithm: str):
+ if algorithm not in self._clustering_algorithms:
+ raise ValueError(f"Clustering algorithm {algorithm} not supported")
+ await self._clustering_algorithms[algorithm]()
+
+ async def community_schema(self) -> dict[str, SingleCommunitySchema]:
+ results = defaultdict(
+ lambda: dict(
+ level=None,
+ title=None,
+ edges=set(),
+ nodes=set(),
+ chunk_ids=set(),
+ occurrence=0.0,
+ sub_communities=[],
+ )
+ )
+ max_num_ids = 0
+ levels = defaultdict(set)
+ for node_id, node_data in self._graph.nodes(data=True):
+ if "clusters" not in node_data:
+ continue
+ clusters = json.loads(node_data["clusters"])
+ this_node_edges = self._graph.edges(node_id)
+
+ for cluster in clusters:
+ level = cluster["level"]
+ cluster_key = str(cluster["cluster"])
+ levels[level].add(cluster_key)
+ results[cluster_key]["level"] = level
+ results[cluster_key]["title"] = f"Cluster {cluster_key}"
+ results[cluster_key]["nodes"].add(node_id)
+ results[cluster_key]["edges"].update(
+ [tuple(sorted(e)) for e in this_node_edges]
+ )
+ results[cluster_key]["chunk_ids"].update(
+ node_data["source_id"].split(GRAPH_FIELD_SEP)
+ )
+ max_num_ids = max(max_num_ids, len(results[cluster_key]["chunk_ids"]))
+
+ ordered_levels = sorted(levels.keys())
+ for i, curr_level in enumerate(ordered_levels[:-1]):
+ next_level = ordered_levels[i + 1]
+ this_level_comms = levels[curr_level]
+ next_level_comms = levels[next_level]
+ # compute the sub-communities by nodes intersection
+ for comm in this_level_comms:
+ results[comm]["sub_communities"] = [
+ c
+ for c in next_level_comms
+ if results[c]["nodes"].issubset(results[comm]["nodes"])
+ ]
+
+ for k, v in results.items():
+ v["edges"] = list(v["edges"])
+ v["edges"] = [list(e) for e in v["edges"]]
+ v["nodes"] = list(v["nodes"])
+ v["chunk_ids"] = list(v["chunk_ids"])
+ v["occurrence"] = len(v["chunk_ids"]) / max_num_ids
+ return dict(results)
+
+ def _cluster_data_to_subgraphs(self, cluster_data: dict[str, list[dict[str, str]]]):
+ for node_id, clusters in cluster_data.items():
+ self._graph.nodes[node_id]["clusters"] = json.dumps(clusters)
+
+ async def _leiden_clustering(self):
+ from graspologic.partition import hierarchical_leiden
+
+ graph = NetworkXStorage.stable_largest_connected_component(self._graph)
+ community_mapping = hierarchical_leiden(
+ graph,
+ max_cluster_size=self.global_config["max_graph_cluster_size"],
+ random_seed=self.global_config["graph_cluster_seed"],
+ )
+
+ node_communities: dict[str, list[dict[str, str]]] = defaultdict(list)
+ __levels = defaultdict(set)
+ for partition in community_mapping:
+ level_key = partition.level
+ cluster_id = partition.cluster
+ node_communities[partition.node].append(
+ {"level": level_key, "cluster": cluster_id}
+ )
+ __levels[level_key].add(cluster_id)
+ node_communities = dict(node_communities)
+ __levels = {k: len(v) for k, v in __levels.items()}
+ logger.info(f"Each level has communities: {dict(__levels)}")
+ self._cluster_data_to_subgraphs(node_communities)
+
+ async def embed_nodes(self, algorithm: str) -> tuple[np.ndarray, list[str]]:
+ if algorithm not in self._node_embed_algorithms:
+ raise ValueError(f"Node embedding algorithm {algorithm} not supported")
+ return await self._node_embed_algorithms[algorithm]()
+
+ async def _node2vec_embed(self):
+ from graspologic import embed
+
+ embeddings, nodes = embed.node2vec_embed(
+ self._graph,
+ **self.global_config["node2vec_params"],
+ )
+
+ nodes_ids = [self._graph.nodes[node_id]["id"] for node_id in nodes]
+ return embeddings, nodes_ids
diff --git a/Vimo-desktop/python_backend/videorag/_storage/kv_json.py b/Vimo-desktop/python_backend/videorag/_storage/kv_json.py
new file mode 100755
index 0000000..b802f26
--- /dev/null
+++ b/Vimo-desktop/python_backend/videorag/_storage/kv_json.py
@@ -0,0 +1,46 @@
+import os
+from dataclasses import dataclass
+
+from .._utils import load_json, logger, write_json
+from ..base import (
+ BaseKVStorage,
+)
+
+
+@dataclass
+class JsonKVStorage(BaseKVStorage):
+ def __post_init__(self):
+ working_dir = self.global_config["working_dir"]
+ self._file_name = os.path.join(working_dir, f"kv_store_{self.namespace}.json")
+ self._data = load_json(self._file_name) or {}
+ logger.info(f"Load KV {self.namespace} with {len(self._data)} data")
+
+ async def all_keys(self) -> list[str]:
+ return list(self._data.keys())
+
+ async def index_done_callback(self):
+ write_json(self._data, self._file_name)
+
+ async def get_by_id(self, id):
+ return self._data.get(id, None)
+
+ async def get_by_ids(self, ids, fields=None):
+ if fields is None:
+ return [self._data.get(id, None) for id in ids]
+ return [
+ (
+ {k: v for k, v in self._data[id].items() if k in fields}
+ if self._data.get(id, None)
+ else None
+ )
+ for id in ids
+ ]
+
+ async def filter_keys(self, data: list[str]) -> set[str]:
+ return set([s for s in data if s not in self._data])
+
+ async def upsert(self, data: dict[str, dict]):
+ self._data.update(data)
+
+ async def drop(self):
+ self._data = {}
diff --git a/Vimo-desktop/python_backend/videorag/_storage/vdb_hnswlib.py b/Vimo-desktop/python_backend/videorag/_storage/vdb_hnswlib.py
new file mode 100755
index 0000000..3e98c95
--- /dev/null
+++ b/Vimo-desktop/python_backend/videorag/_storage/vdb_hnswlib.py
@@ -0,0 +1,141 @@
+import asyncio
+import os
+from dataclasses import dataclass, field
+from typing import Any
+import pickle
+import hnswlib
+import numpy as np
+import xxhash
+
+from .._utils import logger
+from ..base import BaseVectorStorage
+
+
+@dataclass
+class HNSWVectorStorage(BaseVectorStorage):
+ ef_construction: int = 100
+ M: int = 16
+ max_elements: int = 1000000
+ ef_search: int = 50
+ num_threads: int = -1
+ _index: Any = field(init=False)
+ _metadata: dict[str, dict] = field(default_factory=dict)
+ _current_elements: int = 0
+
+ def __post_init__(self):
+ self._index_file_name = os.path.join(
+ self.global_config["working_dir"], f"{self.namespace}_hnsw.index"
+ )
+ self._metadata_file_name = os.path.join(
+ self.global_config["working_dir"], f"{self.namespace}_hnsw_metadata.pkl"
+ )
+ self._embedding_batch_num = self.global_config.get("embedding_batch_num", 100)
+
+ hnsw_params = self.global_config.get("vector_db_storage_cls_kwargs", {})
+ self.ef_construction = hnsw_params.get("ef_construction", self.ef_construction)
+ self.M = hnsw_params.get("M", self.M)
+ self.max_elements = hnsw_params.get("max_elements", self.max_elements)
+ self.ef_search = hnsw_params.get("ef_search", self.ef_search)
+ self.num_threads = hnsw_params.get("num_threads", self.num_threads)
+ self._index = hnswlib.Index(
+ space="cosine", dim=self.embedding_func.embedding_dim
+ )
+
+ if os.path.exists(self._index_file_name) and os.path.exists(
+ self._metadata_file_name
+ ):
+ self._index.load_index(
+ self._index_file_name, max_elements=self.max_elements
+ )
+ with open(self._metadata_file_name, "rb") as f:
+ self._metadata, self._current_elements = pickle.load(f)
+ logger.info(
+ f"Loaded existing index for {self.namespace} with {self._current_elements} elements"
+ )
+ else:
+ self._index.init_index(
+ max_elements=self.max_elements,
+ ef_construction=self.ef_construction,
+ M=self.M,
+ )
+ self._index.set_ef(self.ef_search)
+ self._metadata = {}
+ self._current_elements = 0
+ logger.info(f"Created new index for {self.namespace}")
+
+ async def upsert(self, data: dict[str, dict]) -> np.ndarray:
+ logger.info(f"Inserting {len(data)} vectors to {self.namespace}")
+ if not data:
+ logger.warning("You insert an empty data to vector DB")
+ return []
+
+ if self._current_elements + len(data) > self.max_elements:
+ raise ValueError(
+ f"Cannot insert {len(data)} elements. Current: {self._current_elements}, Max: {self.max_elements}"
+ )
+
+ list_data = [
+ {
+ "id": k,
+ **{k1: v1 for k1, v1 in v.items() if k1 in self.meta_fields},
+ }
+ for k, v in data.items()
+ ]
+ contents = [v["content"] for v in data.values()]
+ batch_size = min(self._embedding_batch_num, len(contents))
+ embeddings = np.concatenate(
+ await asyncio.gather(
+ *[
+ self.embedding_func(contents[i : i + batch_size])
+ for i in range(0, len(contents), batch_size)
+ ]
+ )
+ )
+
+ ids = np.fromiter(
+ (xxhash.xxh32_intdigest(d["id"].encode()) for d in list_data),
+ dtype=np.uint32,
+ count=len(list_data),
+ )
+ self._metadata.update(
+ {
+ id_int: {
+ k: v for k, v in d.items() if k in self.meta_fields or k == "id"
+ }
+ for id_int, d in zip(ids, list_data)
+ }
+ )
+ self._index.add_items(data=embeddings, ids=ids, num_threads=self.num_threads)
+ self._current_elements = self._index.get_current_count()
+ return ids
+
+ async def query(self, query: str, top_k: int = 5) -> list[dict]:
+ if self._current_elements == 0:
+ return []
+
+ top_k = min(top_k, self._current_elements)
+
+ if top_k > self.ef_search:
+ logger.warning(
+ f"Setting ef_search to {top_k} because top_k is larger than ef_search"
+ )
+ self._index.set_ef(top_k)
+
+ embedding = await self.embedding_func([query])
+ labels, distances = self._index.knn_query(
+ data=embedding[0], k=top_k, num_threads=self.num_threads
+ )
+
+ return [
+ {
+ **self._metadata.get(label, {}),
+ "distance": distance,
+ "similarity": 1 - distance,
+ }
+ for label, distance in zip(labels[0], distances[0])
+ ]
+
+ async def index_done_callback(self):
+ self._index.save_index(self._index_file_name)
+ with open(self._metadata_file_name, "wb") as f:
+ pickle.dump((self._metadata, self._current_elements), f)
diff --git a/Vimo-desktop/python_backend/videorag/_storage/vdb_nanovectordb.py b/Vimo-desktop/python_backend/videorag/_storage/vdb_nanovectordb.py
new file mode 100755
index 0000000..705125b
--- /dev/null
+++ b/Vimo-desktop/python_backend/videorag/_storage/vdb_nanovectordb.py
@@ -0,0 +1,142 @@
+#type: ignore
+import asyncio
+import os
+import torch
+from dataclasses import dataclass
+import numpy as np
+from nano_vectordb import NanoVectorDB
+from tqdm import tqdm
+from imagebind.models.imagebind_model import ImageBindModel
+from imagebind.models import imagebind_model
+
+from .._utils import logger, get_best_device, get_imagebind_device
+from ..base import BaseVectorStorage
+from .._videoutil import encode_video_segments, encode_string_query
+
+
+@dataclass
+class NanoVectorDBStorage(BaseVectorStorage):
+ cosine_better_than_threshold: float = 0.2
+
+ def __post_init__(self):
+
+ self._client_file_name = os.path.join(
+ self.global_config["working_dir"], f"vdb_{self.namespace}.json"
+ )
+ self._max_batch_size = self.global_config["llm"]["embedding_batch_num"]
+ self._client = NanoVectorDB(
+ self.embedding_func.embedding_dim, storage_file=self._client_file_name
+ )
+ self.cosine_better_than_threshold = self.global_config.get(
+ "query_better_than_threshold", self.cosine_better_than_threshold
+ )
+
+ async def upsert(self, data: dict[str, dict]):
+ logger.info(f"Inserting {len(data)} vectors to {self.namespace}")
+ if not len(data):
+ logger.warning("You insert an empty data to vector DB")
+ return []
+ list_data = [
+ {
+ "__id__": k,
+ **{k1: v1 for k1, v1 in v.items() if k1 in self.meta_fields},
+ }
+ for k, v in data.items()
+ ]
+ contents = [v["content"] for v in data.values()]
+ batches = [
+ contents[i : i + self._max_batch_size]
+ for i in range(0, len(contents), self._max_batch_size)
+ ]
+ embeddings_list = await asyncio.gather(
+ *[self.embedding_func(batch) for batch in batches]
+ )
+ embeddings = np.concatenate(embeddings_list)
+ for i, d in enumerate(list_data):
+ d["__vector__"] = embeddings[i]
+ results = self._client.upsert(datas=list_data)
+ return results
+
+ async def query(self, query: str, top_k=5):
+ embedding = await self.embedding_func([query])
+ embedding = embedding[0]
+ results = self._client.query(
+ query=embedding,
+ top_k=top_k,
+ better_than_threshold=self.cosine_better_than_threshold,
+ )
+ results = [
+ {**dp, "id": dp["__id__"], "distance": dp["__metrics__"]} for dp in results
+ ]
+ return results
+
+ async def index_done_callback(self):
+ self._client.save()
+
+
+@dataclass
+class NanoVectorDBVideoSegmentStorage(BaseVectorStorage):
+ embedding_func: object = None
+ segment_retrieval_top_k: float = 2
+ embedder_client: object = None
+
+ def __post_init__(self):
+
+ self._client_file_name = os.path.join(
+ self.global_config["working_dir"], f"vdb_{self.namespace}.json"
+ )
+ self._max_batch_size = self.global_config["video_embedding_batch_num"]
+ self._client = NanoVectorDB(
+ self.global_config["video_embedding_dim"], storage_file=self._client_file_name
+ )
+ self.top_k = self.global_config.get(
+ "segment_retrieval_top_k", self.segment_retrieval_top_k
+ )
+
+ async def upsert(self, video_name, segment_index2name, video_output_format):
+ logger.info(f"Inserting {len(segment_index2name)} segments to {self.namespace}")
+ if not len(segment_index2name):
+ logger.warning("You insert an empty data to vector DB")
+ return []
+ list_data, video_paths = [], []
+ cache_path = os.path.join(self.global_config["working_dir"], '_cache', video_name)
+ index_list = list(segment_index2name.keys())
+ for index in index_list:
+ list_data.append({
+ "__id__": f"{video_name}_{index}",
+ "__video_name__": video_name,
+ "__index__": index,
+ })
+ segment_name = segment_index2name[index]
+ video_file = os.path.join(cache_path, f"{segment_name}.{video_output_format}")
+ video_paths.append(video_file)
+ batches = [
+ video_paths[i: i + self._max_batch_size]
+ for i in range(0, len(video_paths), self._max_batch_size)
+ ]
+ embeddings = []
+ for _batch in tqdm(batches, desc=f"Encoding Video Segments {video_name}"):
+ batch_embeddings = self.embedder_client.encode_video_segments(_batch)
+ embeddings.append(batch_embeddings)
+ embeddings = np.concatenate(embeddings, axis=0)
+ for i, d in enumerate(list_data):
+ d["__vector__"] = embeddings[i]
+ results = self._client.upsert(datas=list_data)
+ return results
+
+ async def query(self, query: str):
+ embedding = self.embedder_client.encode_string_query(query)
+ embedding = embedding[0]
+
+ results = self._client.query(
+ query=embedding,
+ top_k=self.top_k,
+ better_than_threshold=-1,
+ )
+ results = [
+ {**dp, "id": dp["__id__"], "distance": dp["__metrics__"]} for dp in results
+ ]
+ return results
+
+ async def index_done_callback(self):
+ self._client.save()
diff --git a/Vimo-desktop/python_backend/videorag/_utils.py b/Vimo-desktop/python_backend/videorag/_utils.py
new file mode 100755
index 0000000..f5df5e9
--- /dev/null
+++ b/Vimo-desktop/python_backend/videorag/_utils.py
@@ -0,0 +1,274 @@
+import asyncio
+import html
+import json
+import logging
+import os
+import re
+import numbers
+from dataclasses import dataclass
+from functools import wraps
+from hashlib import md5
+from typing import Any, Union
+
+import numpy as np
+import tiktoken
+import torch
+
+logger = logging.getLogger("nano-graphrag")
+ENCODER = None
+
+
+def always_get_an_event_loop() -> asyncio.AbstractEventLoop:
+ try:
+ # If there is already an event loop, use it.
+ loop = asyncio.get_event_loop()
+ except RuntimeError:
+ # If in a sub-thread, create a new event loop.
+ logger.info("Creating a new event loop in a sub-thread.")
+ loop = asyncio.new_event_loop()
+ asyncio.set_event_loop(loop)
+ return loop
+
+
+def locate_json_string_body_from_string(content: str) -> Union[str, None]:
+ """Locate the JSON string body from a string"""
+ maybe_json_str = re.search(r"{.*}", content, re.DOTALL)
+ if maybe_json_str is not None:
+ return maybe_json_str.group(0)
+ else:
+ return None
+
+
+def convert_response_to_json(response: str) -> dict:
+ json_str = locate_json_string_body_from_string(response)
+ assert json_str is not None, f"Unable to parse JSON from response: {response}"
+ try:
+ data = json.loads(json_str)
+ return data
+ except json.JSONDecodeError as e:
+ logger.error(f"Failed to parse JSON: {json_str}")
+ raise e from None
+
+
+def encode_string_by_tiktoken(content: str, model_name: str = "gpt-4o"):
+ global ENCODER
+ if ENCODER is None:
+ ENCODER = tiktoken.encoding_for_model(model_name)
+ tokens = ENCODER.encode(content)
+ return tokens
+
+
+def decode_tokens_by_tiktoken(tokens: list[int], model_name: str = "gpt-4o"):
+ global ENCODER
+ if ENCODER is None:
+ ENCODER = tiktoken.encoding_for_model(model_name)
+ content = ENCODER.decode(tokens)
+ return content
+
+
+def truncate_list_by_token_size(list_data: list, key: callable, max_token_size: int):
+ """Truncate a list of data by token size"""
+ if max_token_size <= 0:
+ return []
+ tokens = 0
+ for i, data in enumerate(list_data):
+ tokens += len(encode_string_by_tiktoken(key(data)))
+ if tokens > max_token_size:
+ return list_data[:i]
+ return list_data
+
+
+def compute_mdhash_id(content, prefix: str = ""):
+ return prefix + md5(content.encode()).hexdigest()
+
+
+def write_json(json_obj, file_name):
+ with open(file_name, "w", encoding="utf-8") as f:
+ json.dump(json_obj, f, indent=2, ensure_ascii=False)
+
+
+def load_json(file_name):
+ if not os.path.exists(file_name):
+ return None
+ with open(file_name, encoding="utf-8") as f:
+ return json.load(f)
+
+
+# it's dirty to type, so it's a good way to have fun
+def pack_user_ass_to_openai_messages(*args: str):
+ roles = ["user", "assistant"]
+ return [
+ {"role": roles[i % 2], "content": content} for i, content in enumerate(args)
+ ]
+
+
+def is_float_regex(value):
+ return bool(re.match(r"^[-+]?[0-9]*\.?[0-9]+$", value))
+
+
+def compute_args_hash(*args):
+ return md5(str(args).encode()).hexdigest()
+
+
+def split_string_by_multi_markers(content: str, markers: list[str]) -> list[str]:
+ """Split a string by multiple markers"""
+ if not markers:
+ return [content]
+ results = re.split("|".join(re.escape(marker) for marker in markers), content)
+ return [r.strip() for r in results if r.strip()]
+
+
+def enclose_string_with_quotes(content: Any) -> str:
+ """Enclose a string with quotes"""
+ if isinstance(content, numbers.Number):
+ return str(content)
+ content = str(content)
+ content = content.strip().strip("'").strip('"')
+ return f'"{content}"'
+
+
+def list_of_list_to_csv(data: list[list]):
+ return "\n".join(
+ [
+ ",\t".join([f"{enclose_string_with_quotes(data_dd)}" for data_dd in data_d])
+ for data_d in data
+ ]
+ )
+
+
+# -----------------------------------------------------------------------------------
+# Refer the utils functions of the official GraphRAG implementation:
+# https://github.com/microsoft/graphrag
+def clean_str(input: Any) -> str:
+ """Clean an input string by removing HTML escapes, control characters, and other unwanted characters."""
+ # If we get non-string input, just give it back
+ if not isinstance(input, str):
+ return input
+
+ result = html.unescape(input.strip())
+ # https://stackoverflow.com/questions/4324790/removing-control-characters-from-a-string-in-python
+ return re.sub(r"[\x00-\x1f\x7f-\x9f]", "", result)
+
+
+# Utils types -----------------------------------------------------------------------
+@dataclass
+class EmbeddingFunc:
+ embedding_dim: int
+ max_token_size: int
+ model_name: str
+ func: callable
+
+ async def __call__(self, *args, **kwargs) -> np.ndarray:
+ # Had to fix this as the embedding function took only one named argument put it's passed in
+ # positionally, now we need to pass both
+ kwargs['model_name'] = self.model_name
+
+ # If there are positional arguments, convert them to keyword arguments
+ if args:
+ # Assuming the first positional argument is always 'texts'
+ if len(args) == 1 and isinstance(args[0], list):
+ kwargs['texts'] = args[0]
+ else:
+ raise ValueError("Unexpected positional arguments. Expected a single list of texts")
+ # Call the function with the updated keyword arguments
+ return await self.func(**kwargs)
+
+
+# Decorators ------------------------------------------------------------------------
+def limit_async_func_call(max_size: int, waitting_time: float = 0.0001):
+ """Add restriction of maximum async calling times for a async func"""
+
+ def final_decro(func):
+ """Not using async.Semaphore to aovid use nest-asyncio"""
+ __current_size = 0
+
+ @wraps(func)
+ async def wait_func(*args, **kwargs):
+ nonlocal __current_size
+ while __current_size >= max_size:
+ await asyncio.sleep(waitting_time)
+ __current_size += 1
+ result = await func(*args, **kwargs)
+ __current_size -= 1
+ return result
+
+ return wait_func
+
+ return final_decro
+
+
+def wrap_embedding_func_with_attrs(**kwargs):
+ """Wrap a function with attributes"""
+
+ def final_decro(func) -> EmbeddingFunc:
+ new_func = EmbeddingFunc(**kwargs, func=func)
+ return new_func
+
+ return final_decro
+
+
+def get_best_device():
+ """
+ Get the best available device
+ Priority: CUDA > MPS (Mac) > CPU
+ """
+ if torch.cuda.is_available():
+ return torch.device("cuda")
+ elif hasattr(torch.backends, 'mps') and torch.backends.mps.is_available():
+ return torch.device("mps")
+ else:
+ return torch.device("cpu")
+
+
+def get_imagebind_device():
+ """
+ Get the best device for ImageBind models
+ ImageBind uses Conv3D which is not supported on MPS, so fall back to CPU on Mac
+ Priority: CUDA > CPU (MPS not supported)
+ """
+ if torch.cuda.is_available():
+ return torch.device("cuda")
+ else:
+ # Force CPU even if MPS is available because ImageBind uses Conv3D
+ return torch.device("cpu")
+
+
+class SerializableEmbeddingWrapper:
+ """
+ Serializable embedding function wrapper
+ Solve pickle issues in multiprocessing
+ """
+ def __init__(self, embedding_func, global_config):
+ self.embedding_func = embedding_func
+ self.global_config = global_config
+
+ # Copy attributes from EmbeddingFunc if available
+ if hasattr(embedding_func, 'embedding_dim'):
+ self.embedding_dim = embedding_func.embedding_dim
+ if hasattr(embedding_func, 'max_token_size'):
+ self.max_token_size = embedding_func.max_token_size
+ if hasattr(embedding_func, 'model_name'):
+ self.model_name = embedding_func.model_name
+
+ async def __call__(self, *args, **kwargs):
+ # Automatically add global_config
+ kwargs['global_config'] = self.global_config
+ return await self.embedding_func(*args, **kwargs)
+
+
+class SerializableLLMWrapper:
+ """
+ Serializable LLM function wrapper
+ Solve pickle issues in multiprocessing
+ """
+ def __init__(self, llm_func, global_config, hashing_kv=None):
+ self.llm_func = llm_func
+ self.global_config = global_config
+ self.hashing_kv = hashing_kv
+
+ async def __call__(self, *args, **kwargs):
+ # Automatically add global_config and hashing_kv
+ kwargs['global_config'] = self.global_config
+ if self.hashing_kv is not None:
+ kwargs['hashing_kv'] = self.hashing_kv
+ return await self.llm_func(*args, **kwargs)
diff --git a/Vimo-desktop/python_backend/videorag/_videoutil/__init__.py b/Vimo-desktop/python_backend/videorag/_videoutil/__init__.py
new file mode 100755
index 0000000..4e1acf9
--- /dev/null
+++ b/Vimo-desktop/python_backend/videorag/_videoutil/__init__.py
@@ -0,0 +1,4 @@
+from .split import split_video, saving_video_segments
+from .asr import speech_to_text
+from .caption import segment_caption, merge_segment_information, retrieved_segment_caption_async
+from .feature import encode_video_segments, encode_string_query
\ No newline at end of file
diff --git a/Vimo-desktop/python_backend/videorag/_videoutil/asr.py b/Vimo-desktop/python_backend/videorag/_videoutil/asr.py
new file mode 100755
index 0000000..b2de87e
--- /dev/null
+++ b/Vimo-desktop/python_backend/videorag/_videoutil/asr.py
@@ -0,0 +1,143 @@
+import os
+import asyncio
+from tqdm import tqdm
+import dashscope
+from dashscope.audio.asr import Recognition
+from .._utils import logger
+
+async def process_single_segment(semaphore, index, segment_name, audio_file, model, audio_output_format, sample_rate):
+ """
+ Process a single audio segment with ASR
+ """
+ async with semaphore: # Limit concurrent requests
+ try:
+ logger.info(f"Processing segment {segment_name} with model {model}")
+ # Create recognition instance
+ recognition = Recognition(
+ model=model,
+ format=audio_output_format,
+ sample_rate=sample_rate,
+ language_hints=['zh', 'en', 'ja'],
+ callback=None # type: ignore # SDK type annotation issue
+ )
+
+ # Call the API - Note: this might need to be wrapped in asyncio.to_thread for sync API
+ loop = asyncio.get_event_loop()
+ result = await loop.run_in_executor(None, recognition.call, audio_file)
+
+ # logger.info(f"ASR result: {result}")
+ # Extract text from result
+ if result and "output" in result and "sentence" in result["output"]:
+ sentences = result["output"]["sentence"]
+ asr_result = ""
+ for sentence in sentences:
+ asr_result += sentence.get('text', '') + "\n"
+ return index, asr_result.strip()
+ else:
+ logger.warning(f"No transcription result for segment {segment_name}")
+ return index, ""
+
+ except Exception as e:
+ logger.error(f"ASR failed for segment {segment_name}: {str(e)}")
+ raise e
+
+async def speech_to_text_online(video_name, working_dir, segment_index2name, audio_output_format, global_config, max_concurrent=5):
+ """
+ Online ASR using Alibaba Cloud DashScope API with async concurrent processing
+ """
+ # Get API key and sample rate from global config
+ api_key = global_config.get('ali_dashscope_api_key')
+ sample_rate = global_config.get('audio_sample_rate', 16000)
+
+ # Set the API key
+ dashscope.api_key = api_key
+
+ cache_path = os.path.join(working_dir, '_cache', video_name)
+
+ # Create semaphore to limit concurrent requests
+ semaphore = asyncio.Semaphore(max_concurrent)
+
+ # Create tasks for all segments
+ tasks = []
+ for index in segment_index2name:
+ segment_name = segment_index2name[index]
+ audio_file = os.path.join(cache_path, f"{segment_name}.{audio_output_format}")
+
+ task = process_single_segment(
+ semaphore, index, segment_name, audio_file,
+ global_config.get('asr_model'), audio_output_format, sample_rate
+ )
+ tasks.append(task)
+
+ # Execute all tasks concurrently with real-time progress
+ total_tasks = len(tasks)
+ logger.info(f"🎤 Starting ASR for {total_tasks} audio segments (max {max_concurrent} concurrent)...")
+
+ transcripts = {}
+ completed = 0
+
+ # Use asyncio.as_completed for real-time progress updates
+ for completed_task in asyncio.as_completed(tasks):
+ try:
+ result = await completed_task
+ if isinstance(result, tuple) and len(result) == 2:
+ index, text = result
+ transcripts[index] = text
+ completed += 1
+ logger.info(f"✅ Completed {completed}/{total_tasks} segments (Progress: {completed/total_tasks*100:.1f}%)")
+ else:
+ # Handle unexpected result format
+ completed += 1
+ logger.info(f"⚠️ Unexpected result format for segment {completed}")
+
+ except Exception as e:
+ completed += 1
+ logger.error(f"❌ Task failed: {e}")
+ logger.info(f"❌ Failed {completed}/{total_tasks} segments (Progress: {completed/total_tasks*100:.1f}%)")
+
+ logger.info(f"🎉 ASR processing completed! Processed {len(transcripts)} segments successfully.")
+
+ return transcripts
+
+
+async def speech_to_text_async(video_name, working_dir, segment_index2name, audio_output_format, global_config):
+ """
+ Async speech-to-text function using Alibaba Cloud DashScope online ASR
+
+ Args:
+ video_name: Name of the video
+ working_dir: Working directory
+ segment_index2name: Mapping of segment indices to names
+ audio_output_format: Audio file format
+ global_config: Global configuration dictionary containing API keys and settings
+ """
+ api_key = global_config.get('ali_dashscope_api_key')
+
+ if not api_key:
+ raise ValueError("ali_dashscope_api_key must be provided in global_config for online ASR")
+
+ return await speech_to_text_online(
+ video_name, working_dir, segment_index2name, audio_output_format, global_config
+ )
+
+def speech_to_text(video_name, working_dir, segment_index2name, audio_output_format, global_config):
+ """
+ Synchronous wrapper for async speech-to-text function
+
+ Args:
+ video_name: Name of the video
+ working_dir: Working directory
+ segment_index2name: Mapping of segment indices to names
+ audio_output_format: Audio file format
+ global_config: Global configuration dictionary containing API keys and settings
+ """
+ # Run the async function in an event loop
+ try:
+ loop = asyncio.get_event_loop()
+ except RuntimeError:
+ loop = asyncio.new_event_loop()
+ asyncio.set_event_loop(loop)
+
+ return loop.run_until_complete(
+ speech_to_text_async(video_name, working_dir, segment_index2name, audio_output_format, global_config)
+ )
\ No newline at end of file
diff --git a/Vimo-desktop/python_backend/videorag/_videoutil/caption.py b/Vimo-desktop/python_backend/videorag/_videoutil/caption.py
new file mode 100755
index 0000000..3cbacf1
--- /dev/null
+++ b/Vimo-desktop/python_backend/videorag/_videoutil/caption.py
@@ -0,0 +1,146 @@
+import os
+import asyncio
+import torch
+import numpy as np
+from PIL import Image
+from tqdm import tqdm
+from moviepy.video.io.VideoFileClip import VideoFileClip
+from io import BytesIO
+import base64
+from openai import OpenAI, AsyncOpenAI
+from .._utils import logger
+
+def encode_pil_image(pil_image):
+ buffer = BytesIO()
+ pil_image.save(buffer, format='JPEG')
+ buffer.seek(0)
+ return base64.b64encode(buffer.read()).decode("utf-8")
+
+def encode_video(video, frame_times):
+ frames = []
+ for t in frame_times:
+ frames.append(video.get_frame(t))
+ frames = np.stack(frames, axis=0)
+ frames = [Image.fromarray(v.astype('uint8')).resize((1280, 720)) for v in frames]
+ base64_images = []
+ for frame in frames:
+ base64_image = encode_pil_image(frame)
+ base64_images.append(base64_image)
+ return base64_images
+
+async def _process_single_caption(caption_model_func, index, video_frames, segment_transcript, global_config):
+ """Process a single video segment caption using LLM config's caption model function"""
+ try:
+ content = []
+ query = f"The transcript of the current video:\n{segment_transcript}.\nNow provide a description (caption) of the video in English."
+ for frame in video_frames:
+ content.append({"type": "image_url", "image_url": {"url": f"data:image/jpeg;base64,{frame}"}})
+ content.append({"type": "text", "text": query})
+
+ segment_caption = await caption_model_func(content, global_config=global_config)
+ result = segment_caption.replace("\n", "").replace("<|endoftext|>", "") if segment_caption else ""
+ return index, result
+ except Exception as e:
+ logger.info(f"❌ Caption failed for segment {index}: {str(e)}")
+ return index, ""
+
+async def segment_caption_async(video_name, video_path, segment_index2name, transcripts, segment_times_info, global_config):
+ """Async caption generation with concurrent processing"""
+ caption_model_func = global_config["llm"]["caption_model_func"]
+
+ logger.info(f"🎬 Extracting frames for {len(segment_index2name)} segments...")
+ with VideoFileClip(video_path) as video:
+ segment_data = {
+ index: {
+ 'frames': encode_video(video, segment_times_info[index]["frame_times"]),
+ 'transcript': transcripts[index]
+ }
+ for index in segment_index2name
+ }
+
+ logger.info(f"🎨 Starting caption generation for {len(segment_index2name)} segments...")
+
+ # Use asyncio.gather() - concurrent control is handled by limit_async_func_call wrapper
+ results = await asyncio.gather(
+ *[_process_single_caption(caption_model_func, index,
+ segment_data[index]['frames'],
+ segment_data[index]['transcript'],
+ global_config)
+ for index in segment_index2name]
+ )
+
+ caption_result = {index: caption for index, caption in results}
+ logger.info(f"🎉 Caption generation completed! Generated {len(caption_result)} captions successfully.")
+ return caption_result
+
+def segment_caption(video_name, video_path, segment_index2name, transcripts, segment_times_info, caption_result, global_config):
+ """Worker function for multiprocessing"""
+ try:
+ result = asyncio.run(
+ segment_caption_async(video_name, video_path, segment_index2name, transcripts, segment_times_info, global_config)
+ )
+ for index, caption in result.items():
+ caption_result[index] = caption
+ except Exception as e:
+ logger.error(f"Error in segment_caption:\n {str(e)}")
+ raise RuntimeError
+
+def merge_segment_information(segment_index2name, segment_times_info, transcripts, captions):
+ inserting_segments = {}
+ for index in segment_index2name:
+ inserting_segments[index] = {"content": None, "time": None}
+ segment_name = segment_index2name[index]
+ inserting_segments[index]["time"] = '-'.join(segment_name.split('-')[-2:])
+ inserting_segments[index]["content"] = f"Caption:\n{captions[index]}\nTranscript:\n{transcripts[index]}\n\n"
+ inserting_segments[index]["transcript"] = transcripts[index]
+ inserting_segments[index]["frame_times"] = segment_times_info[index]["frame_times"].tolist()
+ return inserting_segments
+
+async def _process_retrieved_segment_caption(caption_model_func, this_segment, refine_knowledge, video_path_db, video_segments, num_sampled_frames, global_config):
+ """Process a single retrieved segment caption using LLM config's caption model function"""
+ video_name = '_'.join(this_segment.split('_')[:-1])
+ index = this_segment.split('_')[-1]
+ segment_transcript = video_segments._data[video_name][index]["transcript"]
+
+ try:
+ video_path = video_path_db._data[video_name]
+ timestamp = video_segments._data[video_name][index]["time"].split('-')
+ start, end = eval(timestamp[0]), eval(timestamp[1])
+
+ with VideoFileClip(video_path) as video:
+ frame_times = np.linspace(start, end, num_sampled_frames, endpoint=False)
+ video_frames = encode_video(video, frame_times)
+
+ query = f"The transcript of the current video:\n{segment_transcript}.\nNow provide a very detailed description (caption) of the video in English and extract relevant information about: {refine_knowledge}'"
+
+ content = []
+ for frame in video_frames:
+ content.append({"type": "image_url", "image_url": {"url": f"data:image/jpeg;base64,{frame}"}})
+ content.append({"type": "text", "text": query})
+
+ segment_caption = await caption_model_func(content, global_config=global_config)
+ this_caption = segment_caption.replace("\n", "").replace("<|endoftext|>", "") if segment_caption else ""
+
+ result = f"Caption:\n{this_caption}\nTranscript:\n{segment_transcript}\n\n"
+ return this_segment, result
+
+ except Exception as e:
+ logger.info(f"❌ Retrieved caption failed for segment {this_segment}: {str(e)}")
+ return this_segment, f"Caption:\nError generating caption\nTranscript:\n{segment_transcript}\n\n"
+
+async def retrieved_segment_caption_async(refine_knowledge, retrieved_segments, video_path_db, video_segments, num_sampled_frames, global_config):
+ """Async retrieved segment caption generation"""
+ caption_model_func = global_config["llm"]["caption_model_func"]
+
+ logger.info(f"🔍 Starting detailed caption for {len(retrieved_segments)} retrieved segments...")
+
+ # Use asyncio.gather() - concurrent control is handled by limit_async_func_call wrapper
+ results = await asyncio.gather(
+ *[_process_retrieved_segment_caption(caption_model_func, this_segment, refine_knowledge,
+ video_path_db, video_segments, num_sampled_frames, global_config)
+ for this_segment in retrieved_segments]
+ )
+
+ caption_result = {segment_id: caption for segment_id, caption in results}
+ logger.info(f"🎉 Retrieved caption generation completed! Generated {len(caption_result)} captions successfully.")
+ return caption_result
diff --git a/Vimo-desktop/python_backend/videorag/_videoutil/feature.py b/Vimo-desktop/python_backend/videorag/_videoutil/feature.py
new file mode 100755
index 0000000..ad259d4
--- /dev/null
+++ b/Vimo-desktop/python_backend/videorag/_videoutil/feature.py
@@ -0,0 +1,30 @@
+import os
+import torch
+import pickle
+from tqdm import tqdm
+from imagebind import data
+from imagebind.models import imagebind_model
+from imagebind.models.imagebind_model import ImageBindModel, ModalityType
+
+
+def encode_video_segments(video_paths, embedder: ImageBindModel):
+ device = next(embedder.parameters()).device
+ inputs = {
+ ModalityType.VISION: data.load_and_transform_video_data(video_paths, device),
+ }
+ with torch.no_grad():
+ embeddings = embedder(inputs)[ModalityType.VISION]
+ if isinstance(embeddings, torch.Tensor):
+ embeddings = embeddings.cpu()
+ return embeddings
+
+def encode_string_query(query:str, embedder: ImageBindModel):
+ device = next(embedder.parameters()).device
+ inputs = {
+ ModalityType.TEXT: data.load_and_transform_text([query], device),
+ }
+ with torch.no_grad():
+ embeddings = embedder(inputs)[ModalityType.TEXT]
+ if isinstance(embeddings, torch.Tensor):
+ embeddings = embeddings.cpu()
+ return embeddings
\ No newline at end of file
diff --git a/Vimo-desktop/python_backend/videorag/_videoutil/split.py b/Vimo-desktop/python_backend/videorag/_videoutil/split.py
new file mode 100755
index 0000000..728ec70
--- /dev/null
+++ b/Vimo-desktop/python_backend/videorag/_videoutil/split.py
@@ -0,0 +1,85 @@
+import os
+import time
+import shutil
+import numpy as np
+from tqdm import tqdm
+from moviepy.video import fx as vfx
+from moviepy.video.io.VideoFileClip import VideoFileClip
+from .._utils import logger
+
+def split_video(
+ video_path,
+ working_dir,
+ segment_length,
+ num_frames_per_segment,
+ audio_output_format='mp3',
+ audio_sample_rate=16000, # Default 16kHz for speech recognition
+):
+ unique_timestamp = str(int(time.time() * 1000))
+ video_name = os.path.basename(video_path).split('.')[0]
+ video_segment_cache_path = os.path.join(working_dir, '_cache', video_name)
+ if os.path.exists(video_segment_cache_path):
+ shutil.rmtree(video_segment_cache_path)
+ os.makedirs(video_segment_cache_path, exist_ok=False)
+
+ segment_index = 0
+ segment_index2name, segment_times_info = {}, {}
+ with VideoFileClip(video_path) as video:
+
+ total_video_length = int(video.duration)
+ start_times = list(range(0, total_video_length, segment_length))
+ # if the last segment is shorter than 5 seconds, we merged it to the last segment
+ if len(start_times) > 1 and (total_video_length - start_times[-1]) < 5:
+ start_times = start_times[:-1]
+
+ for start in tqdm(start_times, desc=f"Spliting Video {video_name}"):
+ if start != start_times[-1]:
+ end = min(start + segment_length, total_video_length)
+ else:
+ end = total_video_length
+
+ subvideo = video.subclip(start, end)
+ subvideo_length = subvideo.duration
+ frame_times = np.linspace(0, subvideo_length, num_frames_per_segment, endpoint=False)
+ frame_times += start
+
+ segment_index2name[f"{segment_index}"] = f"{unique_timestamp}-{segment_index}-{start}-{end}"
+ segment_times_info[f"{segment_index}"] = {"frame_times": frame_times, "timestamp": (start, end)}
+
+ # save audio
+ audio_file_base_name = segment_index2name[f"{segment_index}"]
+ audio_file = f'{audio_file_base_name}.{audio_output_format}'
+ subaudio = subvideo.audio
+ # Convert to mono and set sample rate using ffmpeg parameters
+ subaudio.write_audiofile(
+ os.path.join(video_segment_cache_path, audio_file),
+ codec='mp3',
+ fps=audio_sample_rate, # Set sample rate
+ ffmpeg_params=['-ac', '1'], # Force mono (1 audio channel)
+ verbose=False,
+ logger=None
+ )
+
+ segment_index += 1
+
+ return segment_index2name, segment_times_info
+
+def saving_video_segments(
+ video_name,
+ video_path,
+ working_dir,
+ segment_index2name,
+ segment_times_info,
+ video_output_format='mp4',
+):
+ try:
+ with VideoFileClip(video_path) as video:
+ video_segment_cache_path = os.path.join(working_dir, '_cache', video_name)
+ for index in tqdm(segment_index2name, desc=f"Saving Video Segments {video_name}"):
+ start, end = segment_times_info[index]["timestamp"][0], segment_times_info[index]["timestamp"][1]
+ video_file = f'{segment_index2name[index]}.{video_output_format}'
+ subvideo = video.subclip(start, end)
+ subvideo.write_videofile(os.path.join(video_segment_cache_path, video_file), codec='libx264', verbose=False, logger=None)
+ except Exception as e:
+ logger.error(f"Error in saving_video_segments:\n {str(e)}")
+ raise RuntimeError
\ No newline at end of file
diff --git a/Vimo-desktop/python_backend/videorag/base.py b/Vimo-desktop/python_backend/videorag/base.py
new file mode 100755
index 0000000..122801e
--- /dev/null
+++ b/Vimo-desktop/python_backend/videorag/base.py
@@ -0,0 +1,149 @@
+from dataclasses import dataclass, field
+from typing import TypedDict, Union, Literal, Generic, TypeVar
+
+import numpy as np
+
+from ._utils import EmbeddingFunc
+
+
+@dataclass
+class QueryParam:
+ mode: Literal["local", "global", "naive"] = "global"
+ only_need_context: bool = False
+ response_type: str = "Multiple Paragraphs"
+ level: int = 2
+ top_k: int = 20
+ # naive search
+ naive_max_token_for_text_unit = 12000
+ # videorag search
+ only_need_context: bool = False
+
+
+TextChunkSchema = TypedDict(
+ "TextChunkSchema",
+ {"tokens": int, "content": str, "video_segment_id": str, "chunk_order_index": int},
+)
+
+SingleCommunitySchema = TypedDict(
+ "SingleCommunitySchema",
+ {
+ "level": int,
+ "title": str,
+ "edges": list[list[str, str]],
+ "nodes": list[str],
+ "chunk_ids": list[str],
+ "occurrence": float,
+ "sub_communities": list[str],
+ },
+)
+
+
+class CommunitySchema(SingleCommunitySchema):
+ report_string: str
+ report_json: dict
+
+
+T = TypeVar("T")
+
+
+@dataclass
+class StorageNameSpace:
+ namespace: str
+ global_config: dict
+
+ async def index_start_callback(self):
+ """commit the storage operations after indexing"""
+ pass
+
+ async def index_done_callback(self):
+ """commit the storage operations after indexing"""
+ pass
+
+ async def query_done_callback(self):
+ """commit the storage operations after querying"""
+ pass
+
+
+@dataclass
+class BaseVectorStorage(StorageNameSpace):
+ embedding_func: EmbeddingFunc
+ meta_fields: set = field(default_factory=set)
+
+ async def query(self, query: str, top_k: int) -> list[dict]:
+ raise NotImplementedError
+
+ async def upsert(self, data: dict[str, dict]):
+ """Use 'content' field from value for embedding, use key as id.
+ If embedding_func is None, use 'embedding' field from value
+ """
+ raise NotImplementedError
+
+
+@dataclass
+class BaseKVStorage(Generic[T], StorageNameSpace):
+ async def all_keys(self) -> list[str]:
+ raise NotImplementedError
+
+ async def get_by_id(self, id: str) -> Union[T, None]:
+ raise NotImplementedError
+
+ async def get_by_ids(
+ self, ids: list[str], fields: Union[set[str], None] = None
+ ) -> list[Union[T, None]]:
+ raise NotImplementedError
+
+ async def filter_keys(self, data: list[str]) -> set[str]:
+ """return un-exist keys"""
+ raise NotImplementedError
+
+ async def upsert(self, data: dict[str, T]):
+ raise NotImplementedError
+
+ async def drop(self):
+ raise NotImplementedError
+
+
+@dataclass
+class BaseGraphStorage(StorageNameSpace):
+ async def has_node(self, node_id: str) -> bool:
+ raise NotImplementedError
+
+ async def has_edge(self, source_node_id: str, target_node_id: str) -> bool:
+ raise NotImplementedError
+
+ async def node_degree(self, node_id: str) -> int:
+ raise NotImplementedError
+
+ async def edge_degree(self, src_id: str, tgt_id: str) -> int:
+ raise NotImplementedError
+
+ async def get_node(self, node_id: str) -> Union[dict, None]:
+ raise NotImplementedError
+
+ async def get_edge(
+ self, source_node_id: str, target_node_id: str
+ ) -> Union[dict, None]:
+ raise NotImplementedError
+
+ async def get_node_edges(
+ self, source_node_id: str
+ ) -> Union[list[tuple[str, str]], None]:
+ raise NotImplementedError
+
+ async def upsert_node(self, node_id: str, node_data: dict[str, str]):
+ raise NotImplementedError
+
+ async def upsert_edge(
+ self, source_node_id: str, target_node_id: str, edge_data: dict[str, str]
+ ):
+ raise NotImplementedError
+
+ async def clustering(self, algorithm: str):
+ raise NotImplementedError
+
+ async def community_schema(self) -> dict[str, SingleCommunitySchema]:
+ """Return the community representation with report and nodes"""
+ raise NotImplementedError
+
+ async def embed_nodes(self, algorithm: str) -> tuple[np.ndarray, list[str]]:
+ raise NotImplementedError("Node embedding is not used in nano-graphrag.")
diff --git a/Vimo-desktop/python_backend/videorag/prompt.py b/Vimo-desktop/python_backend/videorag/prompt.py
new file mode 100755
index 0000000..283c440
--- /dev/null
+++ b/Vimo-desktop/python_backend/videorag/prompt.py
@@ -0,0 +1,442 @@
+"""
+Reference:
+ - Prompts are from [graphrag](https://github.com/microsoft/graphrag)
+"""
+
+GRAPH_FIELD_SEP = "<SEP>"
+PROMPTS = {}
+
+PROMPTS[
+ "entity_extraction"
+] = """-Goal-
+Given a text document that is potentially relevant to this activity and a list of entity types, identify all entities of those types from the text and all relationships among the identified entities.
+
+-Steps-
+1. Identify all entities. For each identified entity, extract the following information:
+- entity_name: Name of the entity, capitalized
+- entity_type: One of the following types: [{entity_types}]
+- entity_description: Comprehensive description of the entity's attributes and activities
+Format each entity as ("entity"{tuple_delimiter}<entity_name>{tuple_delimiter}<entity_type>{tuple_delimiter}<entity_description>
+
+2. From the entities identified in step 1, identify all pairs of (source_entity, target_entity) that are *clearly related* to each other.
+For each pair of related entities, extract the following information:
+- source_entity: name of the source entity, as identified in step 1
+- target_entity: name of the target entity, as identified in step 1
+- relationship_description: explanation as to why you think the source entity and the target entity are related to each other
+- relationship_strength: a numeric score indicating strength of the relationship between the source entity and target entity
+ Format each relationship as ("relationship"{tuple_delimiter}<source_entity>{tuple_delimiter}<target_entity>{tuple_delimiter}<relationship_description>{tuple_delimiter}<relationship_strength>)
+
+3. Return output in English as a single list of all the entities and relationships identified in steps 1 and 2. Use **{record_delimiter}** as the list delimiter.
+
+4. When finished, output {completion_delimiter}
+
+######################
+-Examples-
+######################
+Example 1:
+
+Entity_types: [person, technology, mission, organization, location]
+Text:
+while Alex clenched his jaw, the buzz of frustration dull against the backdrop of Taylor's authoritarian certainty. It was this competitive undercurrent that kept him alert, the sense that his and Jordan's shared commitment to discovery was an unspoken rebellion against Cruz's narrowing vision of control and order.
+
+Then Taylor did something unexpected. They paused beside Jordan and, for a moment, observed the device with something akin to reverence. "If this tech can be understood..." Taylor said, their voice quieter, "It could change the game for us. For all of us."
+
+The underlying dismissal earlier seemed to falter, replaced by a glimpse of reluctant respect for the gravity of what lay in their hands. Jordan looked up, and for a fleeting heartbeat, their eyes locked with Taylor's, a wordless clash of wills softening into an uneasy truce.
+
+It was a small transformation, barely perceptible, but one that Alex noted with an inward nod. They had all been brought here by different paths
+################
+Output:
+("entity"{tuple_delimiter}"Alex"{tuple_delimiter}"person"{tuple_delimiter}"Alex is a character who experiences frustration and is observant of the dynamics among other characters."){record_delimiter}
+("entity"{tuple_delimiter}"Taylor"{tuple_delimiter}"person"{tuple_delimiter}"Taylor is portrayed with authoritarian certainty and shows a moment of reverence towards a device, indicating a change in perspective."){record_delimiter}
+("entity"{tuple_delimiter}"Jordan"{tuple_delimiter}"person"{tuple_delimiter}"Jordan shares a commitment to discovery and has a significant interaction with Taylor regarding a device."){record_delimiter}
+("entity"{tuple_delimiter}"Cruz"{tuple_delimiter}"person"{tuple_delimiter}"Cruz is associated with a vision of control and order, influencing the dynamics among other characters."){record_delimiter}
+("entity"{tuple_delimiter}"The Device"{tuple_delimiter}"technology"{tuple_delimiter}"The Device is central to the story, with potential game-changing implications, and is revered by Taylor."){record_delimiter}
+("relationship"{tuple_delimiter}"Alex"{tuple_delimiter}"Taylor"{tuple_delimiter}"Alex is affected by Taylor's authoritarian certainty and observes changes in Taylor's attitude towards the device."{tuple_delimiter}7){record_delimiter}
+("relationship"{tuple_delimiter}"Alex"{tuple_delimiter}"Jordan"{tuple_delimiter}"Alex and Jordan share a commitment to discovery, which contrasts with Cruz's vision."{tuple_delimiter}6){record_delimiter}
+("relationship"{tuple_delimiter}"Taylor"{tuple_delimiter}"Jordan"{tuple_delimiter}"Taylor and Jordan interact directly regarding the device, leading to a moment of mutual respect and an uneasy truce."{tuple_delimiter}8){record_delimiter}
+("relationship"{tuple_delimiter}"Jordan"{tuple_delimiter}"Cruz"{tuple_delimiter}"Jordan's commitment to discovery is in rebellion against Cruz's vision of control and order."{tuple_delimiter}5){record_delimiter}
+("relationship"{tuple_delimiter}"Taylor"{tuple_delimiter}"The Device"{tuple_delimiter}"Taylor shows reverence towards the device, indicating its importance and potential impact."{tuple_delimiter}9){completion_delimiter}
+#############################
+Example 2:
+
+Entity_types: [person, technology, mission, organization, location]
+Text:
+They were no longer mere operatives; they had become guardians of a threshold, keepers of a message from a realm beyond stars and stripes. This elevation in their mission could not be shackled by regulations and established protocols—it demanded a new perspective, a new resolve.
+
+Tension threaded through the dialogue of beeps and static as communications with Washington buzzed in the background. The team stood, a portentous air enveloping them. It was clear that the decisions they made in the ensuing hours could redefine humanity's place in the cosmos or condemn them to ignorance and potential peril.
+
+Their connection to the stars solidified, the group moved to address the crystallizing warning, shifting from passive recipients to active participants. Mercer's latter instincts gained precedence— the team's mandate had evolved, no longer solely to observe and report but to interact and prepare. A metamorphosis had begun, and Operation: Dulce hummed with the newfound frequency of their daring, a tone set not by the earthly
+#############
+Output:
+("entity"{tuple_delimiter}"Washington"{tuple_delimiter}"location"{tuple_delimiter}"Washington is a location where communications are being received, indicating its importance in the decision-making process."){record_delimiter}
+("entity"{tuple_delimiter}"Operation: Dulce"{tuple_delimiter}"mission"{tuple_delimiter}"Operation: Dulce is described as a mission that has evolved to interact and prepare, indicating a significant shift in objectives and activities."){record_delimiter}
+("entity"{tuple_delimiter}"The team"{tuple_delimiter}"organization"{tuple_delimiter}"The team is portrayed as a group of individuals who have transitioned from passive observers to active participants in a mission, showing a dynamic change in their role."){record_delimiter}
+("relationship"{tuple_delimiter}"The team"{tuple_delimiter}"Washington"{tuple_delimiter}"The team receives communications from Washington, which influences their decision-making process."{tuple_delimiter}7){record_delimiter}
+("relationship"{tuple_delimiter}"The team"{tuple_delimiter}"Operation: Dulce"{tuple_delimiter}"The team is directly involved in Operation: Dulce, executing its evolved objectives and activities."{tuple_delimiter}9){completion_delimiter}
+#############################
+Example 3:
+
+Entity_types: [person, role, technology, organization, event, location, concept]
+Text:
+their voice slicing through the buzz of activity. "Control may be an illusion when facing an intelligence that literally writes its own rules," they stated stoically, casting a watchful eye over the flurry of data.
+
+"It's like it's learning to communicate," offered Sam Rivera from a nearby interface, their youthful energy boding a mix of awe and anxiety. "This gives talking to strangers' a whole new meaning."
+
+Alex surveyed his team—each face a study in concentration, determination, and not a small measure of trepidation. "This might well be our first contact," he acknowledged, "And we need to be ready for whatever answers back."
+
+Together, they stood on the edge of the unknown, forging humanity's response to a message from the heavens. The ensuing silence was palpable—a collective introspection about their role in this grand cosmic play, one that could rewrite human history.
+
+The encrypted dialogue continued to unfold, its intricate patterns showing an almost uncanny anticipation
+#############
+Output:
+("entity"{tuple_delimiter}"Sam Rivera"{tuple_delimiter}"person"{tuple_delimiter}"Sam Rivera is a member of a team working on communicating with an unknown intelligence, showing a mix of awe and anxiety."){record_delimiter}
+("entity"{tuple_delimiter}"Alex"{tuple_delimiter}"person"{tuple_delimiter}"Alex is the leader of a team attempting first contact with an unknown intelligence, acknowledging the significance of their task."){record_delimiter}
+("entity"{tuple_delimiter}"Control"{tuple_delimiter}"concept"{tuple_delimiter}"Control refers to the ability to manage or govern, which is challenged by an intelligence that writes its own rules."){record_delimiter}
+("entity"{tuple_delimiter}"Intelligence"{tuple_delimiter}"concept"{tuple_delimiter}"Intelligence here refers to an unknown entity capable of writing its own rules and learning to communicate."){record_delimiter}
+("entity"{tuple_delimiter}"First Contact"{tuple_delimiter}"event"{tuple_delimiter}"First Contact is the potential initial communication between humanity and an unknown intelligence."){record_delimiter}
+("entity"{tuple_delimiter}"Humanity's Response"{tuple_delimiter}"event"{tuple_delimiter}"Humanity's Response is the collective action taken by Alex's team in response to a message from an unknown intelligence."){record_delimiter}
+("relationship"{tuple_delimiter}"Sam Rivera"{tuple_delimiter}"Intelligence"{tuple_delimiter}"Sam Rivera is directly involved in the process of learning to communicate with the unknown intelligence."{tuple_delimiter}9){record_delimiter}
+("relationship"{tuple_delimiter}"Alex"{tuple_delimiter}"First Contact"{tuple_delimiter}"Alex leads the team that might be making the First Contact with the unknown intelligence."{tuple_delimiter}10){record_delimiter}
+("relationship"{tuple_delimiter}"Alex"{tuple_delimiter}"Humanity's Response"{tuple_delimiter}"Alex and his team are the key figures in Humanity's Response to the unknown intelligence."{tuple_delimiter}8){record_delimiter}
+("relationship"{tuple_delimiter}"Control"{tuple_delimiter}"Intelligence"{tuple_delimiter}"The concept of Control is challenged by the Intelligence that writes its own rules."{tuple_delimiter}7){completion_delimiter}
+#############################
+-Real Data-
+######################
+Entity_types: {entity_types}
+Text: {input_text}
+######################
+Output:
+"""
+
+PROMPTS[
+ "summarize_entity_descriptions"
+] = """You are a helpful assistant responsible for generating a comprehensive summary of the data provided below.
+Given one or two entities, and a list of descriptions, all related to the same entity or group of entities.
+Please concatenate all of these into a single, comprehensive description. Make sure to include information collected from all the descriptions.
+If the provided descriptions are contradictory, please resolve the contradictions and provide a single, coherent summary.
+Make sure it is written in third person, and include the entity names so we the have full context.
+
+#######
+-Data-
+Entities: {entity_name}
+Description List: {description_list}
+#######
+Output:
+"""
+
+PROMPTS[
+ "entiti_continue_extraction"
+] = """MANY entities were missed in the last extraction. Add them below using the same format:
+"""
+
+PROMPTS[
+ "entiti_if_loop_extraction"
+] = """It appears some entities may have still been missed. Answer YES | NO if there are still entities that need to be added.
+"""
+
+PROMPTS["DEFAULT_ENTITY_TYPES"] = ["organization", "person", "geo", "event"]
+PROMPTS["DEFAULT_TUPLE_DELIMITER"] = "<|>"
+PROMPTS["DEFAULT_RECORD_DELIMITER"] = "##"
+PROMPTS["DEFAULT_COMPLETION_DELIMITER"] = "<|COMPLETE|>"
+PROMPTS["fail_response"] = "Sorry, I'm not able to provide an answer to that question."
+PROMPTS["process_tickers"] = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"]
+PROMPTS["default_text_separator"] = [
+ # Paragraph separators
+ "\n\n",
+ "\r\n\r\n",
+ # Line breaks
+ "\n",
+ "\r\n",
+ # Sentence ending punctuation
+ "。", # Chinese period
+ ".", # Full-width dot
+ ".", # English period
+ "!", # Chinese exclamation mark
+ "!", # English exclamation mark
+ "?", # Chinese question mark
+ "?", # English question mark
+ # Whitespace characters
+ " ", # Space
+ "\t", # Tab
+ "\u3000", # Full-width space
+ # Special characters
+ "\u200b", # Zero-width space (used in some Asian languages)
+]
+
+
+PROMPTS[
+ "naive_rag_response"
+] = """---Role---
+
+You are a helpful assistant responding to a query with retrieved knowledge.
+
+---Goal---
+
+Generate a response of the target length and format that responds to the user's question with relevant general knowledge.
+Summarize useful and relevant information from the input data tables, suitable for the specified response length and format.
+If you don't know the answer or if the provided knowledge do not contain sufficient information to provide an answer, just say so. Do not make anything up.
+Do not include information where the supporting evidence for it is not provided.
+
+---Target response length and format---
+
+{response_type}
+
+---Data tables---
+
+{content_data}
+
+---Goal---
+
+Generate a response of the target length and format that responds to the user's question with relevant general knowledge.
+Summarize useful and relevant information from the input data tables appropriate for the response length and format.
+If you don't know the answer or if the provided knowledge do not contain sufficient information to provide an answer, just say so. Do not make anything up.
+Do not include information where the supporting evidence for it is not provided.
+
+---Notice---
+Please add sections and commentary as appropriate for the length and format if necessary. Format the response in Markdown.
+"""
+
+
+PROMPTS[
+ "query_rewrite_for_entity_retrieval"
+] = """-Goal-
+For a given query, generate a declarative sentence to serve as a query for retrieving relevant knowledge.
+
+######################
+-Examples-
+######################
+
+Question: What are the main characters? \n(A) Alice\n(B) Bob\n(C) Charlie\n(D) Dana
+################
+Output:
+The main characters. (Maybe Alice, Bob, Charlie or Dana)
+
+Question: What locations are shown in the video?
+################
+Output:
+The locations shown in the video.
+
+Question: Which animals appear in the wildlife footage? \n(A) Lions\n(B) Elephants\n(C) Zebras
+################
+Output:
+The animals that appear in the wildlife footage. (Maybe Lions, Elephants or Zebras)
+
+#############################
+-Real Data-
+######################
+Question: {input_text}
+######################
+Output:
+"""
+
+
+
+PROMPTS[
+ "query_rewrite_for_visual_retrieval"
+] = """-Goal-
+Given a question that may include scene-related information, generate a declarative sentence to serve as a query for retrieving relevant video segments.
+
+######################
+-Examples-
+######################
+
+Question: Which animal does the protagonist encounter in the forest scene?
+################
+Output:
+The protagonist encounters an animal in the forest.
+
+Question: In the movie, what color is the car that chases the main character through the city?
+################
+Output:
+A city chase scene where the main character is pursued by a car.
+
+Question: What is the weather like during the opening scene of the film?\n(A) Sunny\n(B) Rainy\n(C) Snowy\n(D) Windy
+################
+Output:
+The opening scene of the film featuring specific weather conditions. (Maybe Sunny, Rainy, Snowy or Windy)
+
+#############################
+-Real Data-
+######################
+Question: {input_text}
+######################
+Output:
+"""
+
+
+
+PROMPTS[
+ "keywords_extraction"
+] = """- Goal -
+Given a query, extract the relevant keywords that can help answer the query. Please list the keywords separated by commas.
+
+######################
+- Examples -
+######################
+
+Question: Which animal does the protagonist encounter in the forest scene?
+################
+Output:
+animal, protagonist, forest, scene
+
+Question: In the movie, what color is the car that chases the main character through the city?
+################
+Output:
+color, car, chases, main character, city
+
+Question: What is the weather like during the opening scene of the film?\n(A) Sunny\n(B) Rainy\n(C) Snowy\n(D) Windy
+################
+Output:
+weather, opening scene, film, Sunny, Rainy, Snowy, Windy
+
+#############################
+- Real Data -
+######################
+Question: {input_text}
+######################
+Output:
+"""
+
+
+
+PROMPTS[
+ "filtering_segment"
+] = """---Role---
+
+You are a helpful assistant to determine whether the video may contain information relevant to the knowledge based on its rough caption.
+Please note that this is a rough caption of the video segments, which means it may not directly contain the answer but may indicate that the video segment is likely to contain information relevant to answering the question.
+
+---Video Caption---
+
+{caption}
+
+---Knowledge We Need---
+
+{knowledge}
+
+---Answer---
+Please provide an answer that begins with "yes" or "no," followed by a brief step-by-step explanation.
+Answer:
+"""
+
+
+
+PROMPTS[
+ "videorag_response"
+] = """---Role---
+
+You are a helpful assistant responding to a query with retrieved knowledge.
+
+---Goal---
+
+Generate a response of the target length and format that responds to the user's question with relevant general knowledge.
+Summarize useful and relevant information from the retrieved text chunks and the information retrieved from videos, suitable for the specified response length and format.
+If you don't know the answer or if the input data tables do not contain sufficient information to provide an answer, just say so. Do not make anything up.
+Do not include information where the supporting evidence for it is not provided.
+
+---Target response length and format---
+
+{response_type}
+
+---Retrieved Information From Videos---
+
+{video_data}
+
+---Retrieved Text Chunks---
+
+{chunk_data}
+
+---Goal---
+
+Generate a response of the target length and format that responds to the user's question with relevant general knowledge.
+Summarize useful and relevant information from the retrieved text chunks and the information retrieved from videos, suitable for the specified response length and format.
+If you don't know the answer or if the input data tables do not contain sufficient information to provide an answer, just say so. Do not make anything up.
+Do not include information where the supporting evidence for it is not provided.
+Reference relevant video segments within the answers, specifying the video name and start & end timestamps. Use the following reference format:
+
+---Example of Reference---
+
+In one segment, the film highlights the devastating effects of deforestation on wildlife habitats [1]. Another part illustrates successful conservation efforts that have helped endangered species recover [2].
+
+#### Reference:
+[1] video_name_1, 05:30, 08:00
+[2] video_name_2, 25:00, 28:00
+
+---Notice---
+Please add sections and commentary as appropriate for the length and format if necessary. Format the response in Markdown.
+"""
+
+PROMPTS[
+ "videorag_response_wo_reference"
+] = """---Role---
+
+You are a helpful assistant responding to a query with retrieved knowledge.
+
+---Goal---
+
+Generate a response of the target length and format that responds to the user's question with relevant general knowledge.
+Summarize useful and relevant information from the retrieved text chunks and the information retrieved from videos, suitable for the specified response length and format.
+If you don't know the answer or if the input data tables do not contain sufficient information to provide an answer, just say so. Do not make anything up.
+Do not include information where the supporting evidence for it is not provided.
+
+---Target response length and format---
+
+{response_type}
+
+---Retrieved Information From Videos---
+
+{video_data}
+
+---Retrieved Text Chunks---
+
+{chunk_data}
+
+---Goal---
+
+Generate a response of the target length and format that responds to the user's question with relevant general knowledge.
+Summarize useful and relevant information from the retrieved text chunks and the information retrieved from videos, suitable for the specified response length and format.
+If you don't know the answer or if the input data tables do not contain sufficient information to provide an answer, just say so. Do not make anything up.
+Do not include information where the supporting evidence for it is not provided.
+
+---Notice---
+Please add sections and commentary as appropriate for the length and format if necessary. Format the response in Markdown.
+"""
+
+PROMPTS[
+ "videorag_response_for_multiple_choice_question"
+] = """---Role---
+
+You are a helpful assistant responding to a multiple-choice question with retrieved knowledge.
+
+---Goal---
+
+Generate a concise response that addresses the user's question by summarizing relevant information derived from the retrieved text and video content. Ensure the response aligns with the specified format and length.
+Please note that there is only one choice is correct.
+
+---Target response length and format---
+
+{response_type}
+
+---Retrieved Information From Videos---
+
+{video_data}
+
+---Retrieved Text Chunks---
+
+{chunk_data}
+
+---Goal---
+
+Generate a concise response that addresses the user's question by summarizing relevant information derived from the retrieved text and video content. Ensure the response aligns with the specified format and length.
+Please note that there is only one choice is correct.
+
+---Notice---
+Please provide your answer in JSON format as follows:
+{{
+ "Answer": "The label of the answer, like A/B/C/D or 1/2/3/4 or others, depending on the given query"
+ "Explanation": "Provide explanations for your choice. Use sections and commentary as needed to ensure clarity and depth. Format the response in Markdown."
+}}
+Key points:
+1. Ensure that the "Answer" reflects the correct label format.
+2. Structure the "Explanation" for clarity, using Markdown for any necessary formatting.
+"""
\ No newline at end of file
diff --git a/Vimo-desktop/python_backend/videorag/videorag.py b/Vimo-desktop/python_backend/videorag/videorag.py
new file mode 100755
index 0000000..e36eb81
--- /dev/null
+++ b/Vimo-desktop/python_backend/videorag/videorag.py
@@ -0,0 +1,537 @@
+# type: ignore
+import os
+import shutil
+import asyncio
+from dataclasses import asdict, dataclass, field
+from datetime import datetime
+from typing import Callable, Dict, List, Optional, Type, Union, cast
+import tiktoken
+import logging
+
+
+from ._llm import (
+ LLMConfig,
+ openai_4o_mini_config,
+)
+from ._op import (
+ chunking_by_video_segments,
+ extract_entities,
+ get_chunks,
+ videorag_query,
+ videorag_query_multiple_choice,
+)
+from ._storage import (
+ JsonKVStorage,
+ NanoVectorDBStorage,
+ NanoVectorDBVideoSegmentStorage,
+ NetworkXStorage,
+)
+from ._utils import (
+ EmbeddingFunc,
+ compute_mdhash_id,
+ limit_async_func_call,
+ wrap_embedding_func_with_attrs,
+ convert_response_to_json,
+ always_get_an_event_loop,
+ logger,
+ SerializableEmbeddingWrapper,
+ SerializableLLMWrapper,
+)
+from .base import (
+ BaseGraphStorage,
+ BaseKVStorage,
+ BaseVectorStorage,
+ StorageNameSpace,
+ QueryParam,
+)
+from ._videoutil import(
+ split_video,
+ speech_to_text,
+ segment_caption,
+ merge_segment_information,
+ saving_video_segments,
+)
+
+
+@dataclass
+class VideoRAG:
+ working_dir: str = field(
+ default_factory=lambda: f"./videorag_cache_{datetime.now().strftime('%Y-%m-%d-%H:%M:%S')}"
+ )
+
+ # video
+ threads_for_split: int = 10
+ video_segment_length: int = 30 # seconds
+ rough_num_frames_per_segment: int = 5 # frames
+ fine_num_frames_per_segment: int = 15 # frames
+ video_output_format: str = "mp4"
+ audio_output_format: str = "mp3"
+ audio_sample_rate: int = 16000 # 16kHz
+ video_embedding_batch_num: int = 2
+ segment_retrieval_top_k: int = 4
+ video_embedding_dim: int = 1024
+
+ # query
+ retrieval_topk_chunks: int = 2
+ query_better_than_threshold: float = 0.2
+
+ # graph mode
+ enable_local: bool = True
+ enable_naive_rag: bool = True
+
+ # api key
+ ali_dashscope_api_key: str = None
+ ali_dashscope_base_url: str = None
+ caption_model: str = None
+ asr_model: str = None
+
+ openai_api_key: str = None
+ openai_base_url: str = None
+
+ # text chunking
+ chunk_func: Callable[
+ [
+ list[list[int]],
+ List[str],
+ tiktoken.Encoding,
+ Optional[int],
+ ],
+ List[Dict[str, Union[str, int]]],
+ ] = chunking_by_video_segments
+ chunk_token_size: int = 1200
+ # chunk_overlap_token_size: int = 100
+ tiktoken_model_name: str = "gpt-4o"
+
+ # entity extraction
+ entity_extract_max_gleaning: int = 1
+ entity_summary_to_max_tokens: int = 500
+
+ # Change to your LLM provider
+ llm: LLMConfig = field(default_factory=openai_4o_mini_config)
+
+ # entity extraction
+ entity_extraction_func: callable = extract_entities
+
+ # storage
+ key_string_value_json_storage_cls: Type[BaseKVStorage] = JsonKVStorage
+ vector_db_storage_cls: Type[BaseVectorStorage] = NanoVectorDBStorage
+ vs_vector_db_storage_cls: Type[BaseVectorStorage] = NanoVectorDBVideoSegmentStorage
+ vector_db_storage_cls_kwargs: dict = field(default_factory=dict)
+ graph_storage_cls: Type[BaseGraphStorage] = NetworkXStorage
+ enable_llm_cache: bool = True
+
+ # extension
+ always_create_working_dir: bool = True
+ addon_params: dict = field(default_factory=dict)
+ convert_response_to_json_func: callable = convert_response_to_json
+
+ # Shared ImageBind Client
+ imagebind_client: object = None
+
+ def __post_init__(self):
+ # Configure logger to write to file
+ log_file = os.path.join(self.working_dir, "log.txt")
+
+ assert self.ali_dashscope_api_key is not None, "ali_dashscope_api_key is required"
+ assert self.ali_dashscope_base_url is not None, "ali_dashscope_base_url is required"
+ assert self.caption_model is not None, "caption_model is required"
+ assert self.asr_model is not None, "asr_model is required"
+ assert self.openai_api_key is not None, "openai_api_key is required"
+ assert self.openai_base_url is not None, "openai_base_url is required"
+
+ # Create working directory if it doesn't exist
+ if not os.path.exists(self.working_dir) and self.always_create_working_dir:
+ os.makedirs(self.working_dir)
+
+ # Configure logger
+ logger.setLevel(logging.INFO)
+
+ # Remove existing handlers to avoid duplicate logs
+ for handler in logger.handlers[:]:
+ logger.removeHandler(handler)
+
+ # Create file handler
+ file_handler = logging.FileHandler(log_file, mode='a', encoding='utf-8')
+ file_handler.setLevel(logging.INFO)
+
+ # Create formatter
+ formatter = logging.Formatter('[%(asctime)s] %(levelname)s: %(message)s')
+ file_handler.setFormatter(formatter)
+
+ # Add handler to logger
+ logger.addHandler(file_handler)
+
+ # Also keep console output (optional)
+ console_handler = logging.StreamHandler()
+ console_handler.setLevel(logging.INFO)
+ console_handler.setFormatter(formatter)
+ logger.addHandler(console_handler)
+
+ self.safe_config = {
+ "working_dir": self.working_dir,
+ "threads_for_split": self.threads_for_split,
+ "video_segment_length": self.video_segment_length,
+ "rough_num_frames_per_segment": self.rough_num_frames_per_segment,
+ "fine_num_frames_per_segment": self.fine_num_frames_per_segment,
+ "video_output_format": self.video_output_format,
+ "audio_output_format": self.audio_output_format,
+ "audio_sample_rate": self.audio_sample_rate,
+ "video_embedding_batch_num": self.video_embedding_batch_num,
+ "segment_retrieval_top_k": self.segment_retrieval_top_k,
+ "video_embedding_dim": self.video_embedding_dim,
+ "retrieval_topk_chunks": self.retrieval_topk_chunks,
+ "query_better_than_threshold": self.query_better_than_threshold,
+ "enable_local": self.enable_local,
+ "enable_naive_rag": self.enable_naive_rag,
+ "ali_dashscope_api_key": self.ali_dashscope_api_key,
+ "ali_dashscope_base_url": self.ali_dashscope_base_url,
+ "caption_model": self.caption_model,
+ "asr_model": self.asr_model,
+ "openai_api_key": self.openai_api_key,
+ "openai_base_url": self.openai_base_url,
+ "chunk_func": self.chunk_func,
+ "chunk_token_size": self.chunk_token_size,
+ "tiktoken_model_name": self.tiktoken_model_name,
+ "entity_extract_max_gleaning": self.entity_extract_max_gleaning,
+ "entity_summary_to_max_tokens": self.entity_summary_to_max_tokens,
+ "llm": asdict(self.llm),
+ "entity_extraction_func": self.entity_extraction_func,
+ "key_string_value_json_storage_cls": self.key_string_value_json_storage_cls,
+ "vector_db_storage_cls": self.vector_db_storage_cls,
+ "vs_vector_db_storage_cls": self.vs_vector_db_storage_cls,
+ "vector_db_storage_cls_kwargs": self.vector_db_storage_cls_kwargs,
+ "graph_storage_cls": self.graph_storage_cls,
+ "enable_llm_cache": self.enable_llm_cache,
+ "always_create_working_dir": self.always_create_working_dir,
+ "addon_params": self.addon_params,
+ "convert_response_to_json_func": self.convert_response_to_json_func,
+
+ }
+
+ self.video_path_db = self.key_string_value_json_storage_cls(
+ namespace="video_path", global_config=self.safe_config
+ )
+ self.safe_config["video_path_db"] = self.video_path_db
+
+ self.video_segments = self.key_string_value_json_storage_cls(
+ namespace="video_segments", global_config=self.safe_config
+ )
+ self.safe_config["video_segments"] = self.video_segments
+
+ self.text_chunks = self.key_string_value_json_storage_cls(
+ namespace="text_chunks", global_config=self.safe_config
+ )
+ self.safe_config["text_chunks"] = self.text_chunks
+
+ self.llm_response_cache = (
+ self.key_string_value_json_storage_cls(
+ namespace="llm_response_cache", global_config=self.safe_config
+ )
+ if self.enable_llm_cache
+ else None
+ )
+ self.safe_config["llm_response_cache"] = self.llm_response_cache
+
+ self.chunk_entity_relation_graph = self.graph_storage_cls(
+ namespace="chunk_entity_relation", global_config=self.safe_config
+ )
+ self.safe_config["chunk_entity_relation_graph"] = self.chunk_entity_relation_graph
+
+ # Use serializable wrapper to avoid pickle errors
+ wrapped_embedding_func = wrap_embedding_func_with_attrs(
+ embedding_dim = self.llm.embedding_dim,
+ max_token_size = self.llm.embedding_max_token_size,
+ model_name = self.llm.embedding_model_name)(self.llm.embedding_func)
+ limited_embedding_func = limit_async_func_call(self.llm.embedding_func_max_async)(wrapped_embedding_func)
+
+ self.embedding_func = SerializableEmbeddingWrapper(limited_embedding_func, self.safe_config)
+ self.embedding_func.embedding_dim = wrapped_embedding_func.embedding_dim
+ self.embedding_func.max_token_size = wrapped_embedding_func.max_token_size
+ self.embedding_func.model_name = wrapped_embedding_func.model_name
+ self.safe_config["embedding_func"] = self.embedding_func
+
+ self.entities_vdb = (
+ self.vector_db_storage_cls(
+ namespace="entities",
+ global_config=self.safe_config,
+ embedding_func=self.embedding_func,
+ meta_fields={"entity_name"},
+ )
+ if self.enable_local
+ else None
+ )
+ self.safe_config["entities_vdb"] = self.entities_vdb
+
+ self.chunks_vdb = (
+ self.vector_db_storage_cls(
+ namespace="chunks",
+ global_config=self.safe_config,
+ embedding_func=self.embedding_func,
+ )
+ if self.enable_naive_rag
+ else None
+ )
+ self.safe_config["chunks_vdb"] = self.chunks_vdb
+
+ self.video_segment_feature_vdb = (
+ self.vs_vector_db_storage_cls(
+ namespace="video_segment_feature",
+ global_config=self.safe_config,
+ embedding_func=None,
+ embedder_client=self.imagebind_client,
+ )
+ )
+ self.safe_config["video_segment_feature_vdb"] = self.video_segment_feature_vdb
+
+ # Use serializable wrapper to avoid pickle errors
+ self.llm.best_model_func = limit_async_func_call(self.llm.best_model_max_async)(
+ SerializableLLMWrapper(self.llm.best_model_func, self.safe_config, self.llm_response_cache)
+ )
+ self.llm.cheap_model_func = limit_async_func_call(self.llm.cheap_model_max_async)(
+ SerializableLLMWrapper(self.llm.cheap_model_func, self.safe_config, self.llm_response_cache)
+ )
+ self.llm.caption_model_func = limit_async_func_call(self.llm.caption_model_max_async)(
+ SerializableLLMWrapper(self.llm.caption_model_func, self.safe_config, self.llm_response_cache)
+ )
+ self.safe_config["llm"] = asdict(self.llm)
+
+ def insert_video(self, video_path_list=None, progress_callback=None):
+ """
+ Insert videos and build index
+
+ Args:
+ video_path_list: 视频文件路径列表
+ progress_callback: 进度回调函数,接收 (step_name, message) 参数
+ """
+ if video_path_list is None:
+ video_path_list = []
+
+ loop = always_get_an_event_loop()
+
+ for video_path in video_path_list:
+ # Step0: check the existence
+ video_name = os.path.basename(video_path).split('.')[0]
+ if video_name in self.video_segments._data:
+ logger.info(f"Find the video named {os.path.basename(video_path)} in storage and skip it.")
+ continue
+
+ loop.run_until_complete(self.video_path_db.upsert(
+ {video_name: video_path}
+ ))
+
+ # Step1: split the videos
+ if progress_callback:
+ progress_callback("Video Splitting", f"Splitting video into clips for {video_name}...")
+
+ segment_index2name, segment_times_info = split_video(
+ video_path,
+ self.working_dir,
+ self.video_segment_length,
+ self.rough_num_frames_per_segment,
+ self.audio_output_format,
+ self.audio_sample_rate, # Pass the sample rate
+ )
+
+ # Step2: obtain transcript with ASR (online)
+ if progress_callback:
+ progress_callback("Audio Processing", f"Performing speech recognition for {video_name}...")
+
+ transcripts = speech_to_text(
+ video_name,
+ self.working_dir,
+ segment_index2name,
+ self.audio_output_format,
+ self.safe_config, # Pass global config dict
+ )
+
+ # Step3: saving video segments **as well as** obtain caption with vision language model
+ if progress_callback:
+ progress_callback("Visual Analyzing", f"Analyzing video content for {video_name}...")
+
+
+ saving_video_segments(
+ video_name,
+ video_path,
+ self.working_dir,
+ segment_index2name,
+ segment_times_info,
+ self.video_output_format,
+ )
+
+ # Pass the complete safe_config to segment_caption for LLM configuration
+ captions = {}
+ segment_caption(
+ video_name,
+ video_path,
+ segment_index2name,
+ transcripts,
+ segment_times_info,
+ captions,
+ self.safe_config,
+ )
+
+ segments_information = merge_segment_information(
+ segment_index2name,
+ segment_times_info,
+ transcripts,
+ captions,
+ )
+
+ loop.run_until_complete(self.video_segments.upsert(
+ {video_name: segments_information}
+ ))
+
+ # Step4: encode video segment features
+ if progress_callback:
+ progress_callback("Feature Encoding", f"Encoding video features for {video_name}...")
+
+ loop.run_until_complete(self.video_segment_feature_vdb.upsert(
+ video_name,
+ segment_index2name,
+ self.video_output_format,
+ ))
+
+ video_segment_cache_path = os.path.join(self.working_dir, '_cache', video_name)
+ if os.path.exists(video_segment_cache_path):
+ shutil.rmtree(video_segment_cache_path)
+
+ # Step 5: saving current video information
+ if progress_callback:
+ progress_callback("Saving Video Information", f"Saving video information for {video_name}...")
+ loop.run_until_complete(self._save_video_segments())
+
+ if progress_callback:
+ progress_callback("Creating Knowledge Graph", f"Creating knowledge graph for all videos...")
+ # start graph-based indexing
+ loop.run_until_complete(self.ainsert(self.video_segments._data))
+
+ # 🔄 Progress: 完成
+ if progress_callback:
+ progress_callback("Completed", f"Video processing completed for all videos")
+
+ def query(self, query: str, param: QueryParam = QueryParam()):
+ loop = always_get_an_event_loop()
+ return loop.run_until_complete(self.aquery(query, param))
+
+ async def aquery(self, query: str, param: QueryParam = QueryParam()):
+ if param.mode == "videorag":
+ response = await videorag_query(
+ query,
+ self.entities_vdb,
+ self.text_chunks,
+ self.chunks_vdb,
+ self.video_path_db,
+ self.video_segments,
+ self.video_segment_feature_vdb,
+ self.chunk_entity_relation_graph,
+ param,
+ self.safe_config,
+ )
+ # NOTE: update here
+ elif param.mode == "videorag_multiple_choice":
+ response = await videorag_query_multiple_choice(
+ query,
+ self.entities_vdb,
+ self.text_chunks,
+ self.chunks_vdb,
+ self.video_path_db,
+ self.video_segments,
+ self.video_segment_feature_vdb,
+ self.chunk_entity_relation_graph,
+ param,
+ self.safe_config,
+ )
+ else:
+ raise ValueError(f"Unknown mode {param.mode}")
+ await self._query_done()
+ return response
+
+ async def ainsert(self, new_video_segment):
+ await self._insert_start()
+ try:
+ # ---------- chunking
+ inserting_chunks = get_chunks(
+ new_videos=new_video_segment,
+ chunk_func=self.chunk_func,
+ max_token_size=self.chunk_token_size,
+ )
+ _add_chunk_keys = await self.text_chunks.filter_keys(
+ list(inserting_chunks.keys())
+ )
+ inserting_chunks = {
+ k: v for k, v in inserting_chunks.items() if k in _add_chunk_keys
+ }
+ if not len(inserting_chunks):
+ logger.warning(f"All chunks are already in the storage")
+ return
+ logger.info(f"[New Chunks] inserting {len(inserting_chunks)} chunks")
+ if self.enable_naive_rag:
+ logger.info("Insert chunks for naive RAG")
+ await self.chunks_vdb.upsert(inserting_chunks)
+
+ # TODO: no incremental update for communities now, so just drop all
+ # await self.community_reports.drop()
+
+ # ---------- extract/summary entity and upsert to graph
+ logger.info("[Entity Extraction]...")
+ maybe_new_kg, _, _ = await self.entity_extraction_func(
+ inserting_chunks,
+ knowledge_graph_inst=self.chunk_entity_relation_graph,
+ entity_vdb=self.entities_vdb,
+ global_config=self.safe_config,
+ )
+ if maybe_new_kg is None:
+ logger.warning("No new entities found")
+ return
+ self.chunk_entity_relation_graph = maybe_new_kg
+ # ---------- commit upsertings and indexing
+ await self.text_chunks.upsert(inserting_chunks)
+ finally:
+ await self._insert_done()
+
+ async def _insert_start(self):
+ tasks = []
+ for storage_inst in [
+ self.chunk_entity_relation_graph,
+ ]:
+ if storage_inst is None:
+ continue
+ tasks.append(cast(StorageNameSpace, storage_inst).index_start_callback())
+ await asyncio.gather(*tasks)
+
+ async def _save_video_segments(self):
+ tasks = []
+ for storage_inst in [
+ self.video_segment_feature_vdb,
+ self.video_segments,
+ self.video_path_db,
+ ]:
+ if storage_inst is None:
+ continue
+ tasks.append(cast(StorageNameSpace, storage_inst).index_done_callback())
+ await asyncio.gather(*tasks)
+
+ async def _insert_done(self):
+ tasks = []
+ for storage_inst in [
+ self.text_chunks,
+ self.llm_response_cache,
+ self.entities_vdb,
+ self.chunks_vdb,
+ self.chunk_entity_relation_graph,
+ self.video_segment_feature_vdb,
+ self.video_segments,
+ self.video_path_db,
+ ]:
+ if storage_inst is None:
+ continue
+ tasks.append(cast(StorageNameSpace, storage_inst).index_done_callback())
+ await asyncio.gather(*tasks)
+
+ async def _query_done(self):
+ tasks = []
+ for storage_inst in [self.llm_response_cache]:
+ if storage_inst is None:
+ continue
+ tasks.append(cast(StorageNameSpace, storage_inst).index_done_callback())
+ await asyncio.gather(*tasks)
diff --git a/Vimo-desktop/python_backend/videorag_api.py b/Vimo-desktop/python_backend/videorag_api.py
new file mode 100644
index 0000000..3581025
--- /dev/null
+++ b/Vimo-desktop/python_backend/videorag_api.py
@@ -0,0 +1,1442 @@
+# type: ignore
+import os
+import certifi
+os.environ['SSL_CERT_FILE'] = certifi.where()
+os.environ['REQUESTS_CA_BUNDLE'] = certifi.where()
+import time
+import threading
+import multiprocessing
+import base64
+import pickle
+import requests
+import numpy as np
+from typing import List
+import socket
+import datetime
+import json
+import signal
+import atexit
+import psutil
+from flask import Flask, request, jsonify
+from flask_cors import CORS
+from moviepy.editor import VideoFileClip
+import logging
+import warnings
+
+warnings.filterwarnings("ignore")
+logging.getLogger("httpx").setLevel(logging.WARNING)
+
+from videorag._llm import LLMConfig, openai_embedding, gpt_complete, dashscope_caption_complete
+from videorag import VideoRAG, QueryParam
+
+# Log recording function
+def log_to_file(message, log_file="log.txt"):
+ """Log messages to file"""
+ timestamp = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
+
+ # Ensure the log file is created in the script's directory
+ script_dir = os.path.dirname(os.path.abspath(__file__))
+ log_path = os.path.join(script_dir, log_file)
+
+ try:
+ with open(log_path, "a", encoding="utf-8") as f:
+ f.write(f"[{timestamp}] {message}\n")
+ print(f"[LOG] {message}") # Add prefix to distinguish
+ except Exception as e:
+ print(f"[ERROR] Failed to write to log: {e}")
+ print(f"[LOG] {message}") # At least output to console
+
+# New: JSON status management tool function
+def write_status_json(file_path: str, status_data: dict):
+ """Atomic write status JSON file"""
+ temp_file = file_path + ".tmp"
+ try:
+ with open(temp_file, 'w', encoding='utf-8') as f:
+ json.dump(status_data, f, ensure_ascii=False, indent=2)
+ # Atomic rename
+ os.rename(temp_file, file_path)
+ except Exception as e:
+ if os.path.exists(temp_file):
+ os.remove(temp_file)
+ raise e
+
+def read_status_json(file_path: str) -> dict:
+ """Read status JSON file"""
+ try:
+ if not os.path.exists(file_path):
+ return {}
+ with open(file_path, 'r', encoding='utf-8') as f:
+ return json.load(f)
+ except Exception as e:
+ log_to_file(f"⚠️ Failed to read status file {file_path}: {str(e)}")
+ return {}
+
+def get_session_status_file(chat_id: str, base_storage_path: str) -> str:
+ """Get session status file path"""
+ session_dir = os.path.join(base_storage_path, f"chat-{chat_id}")
+ os.makedirs(session_dir, exist_ok=True)
+ return os.path.join(session_dir, "status.json")
+
+def update_session_status(chat_id: str, base_storage_path: str, status_type: str, status_data: dict):
+ """Update session status"""
+ status_file = get_session_status_file(chat_id, base_storage_path)
+
+ # Read existing status
+ current_status = read_status_json(status_file)
+
+ # Update status data
+ if status_type not in current_status:
+ current_status[status_type] = {}
+
+ current_status[status_type].update(status_data)
+ current_status["last_updated"] = time.time()
+
+ # Write updated status
+ write_status_json(status_file, current_status)
+ log_to_file(f"📝 Updated {status_type} status for {chat_id}")
+
+class GlobalImageBindManager:
+ """Global ImageBind manager, providing HTTP API interface, supporting concurrent access control"""
+
+ def __init__(self):
+ self.embedder = None
+ self.is_initialized = False
+ self.is_loaded = False
+ self.usage_count = 0
+ self.model_config = None
+ self.model_path = None
+
+ # Simple thread lock to prevent concurrent access
+ self._lock = threading.Lock()
+
+ def initialize(self, model_path: str):
+ """Initialize configuration but do not load model"""
+ with self._lock:
+ self.model_path = model_path
+ self.model_config = {
+ "model_path": model_path,
+ "configured_at": time.time()
+ }
+ self.is_initialized = True
+ log_to_file(f"✅ ImageBind manager configured with model path: {model_path}")
+ return True
+
+ def ensure_imagebind_loaded(self):
+ """Ensure ImageBind model is loaded"""
+ with self._lock:
+ if self.is_loaded:
+ log_to_file("⚠️ ImageBind already loaded")
+ return True
+
+ if not self.is_initialized or not self.model_path:
+ raise RuntimeError("ImageBind not initialized with model path")
+
+ try:
+ log_to_file("🔄 Loading ImageBind model...")
+
+ import torch
+ from imagebind.models.imagebind_model import ImageBindModel
+ from videorag._utils import get_imagebind_device
+
+ device = get_imagebind_device()
+ log_to_file(f"📍 Using device for ImageBind: {device}")
+
+ self.embedder = ImageBindModel(
+ vision_embed_dim=1280,
+ vision_num_blocks=32,
+ vision_num_heads=16,
+ text_embed_dim=1024,
+ text_num_blocks=24,
+ text_num_heads=16,
+ out_embed_dim=1024,
+ audio_drop_path=0.1,
+ imu_drop_path=0.7,
+ )
+
+ if not self.model_path or not os.path.exists(self.model_path):
+ raise FileNotFoundError(f"ImageBind model not found at: {self.model_path}")
+
+ self.embedder.load_state_dict(torch.load(self.model_path, map_location=device))
+ self.embedder = self.embedder.to(device)
+ self.embedder.eval()
+
+ self.model_config.update({
+ "device": str(device),
+ "loaded_at": time.time()
+ })
+
+ self.is_loaded = True
+ log_to_file("✅ ImageBind model loaded successfully")
+ return True
+
+ except Exception as e:
+ log_to_file(f"❌ Failed to load ImageBind: {str(e)}")
+ raise
+
+ def release_imagebind(self):
+ """Release ImageBind model memory"""
+ with self._lock:
+ if not self.is_loaded:
+ log_to_file("⚠️ ImageBind not loaded, nothing to release")
+ return True
+
+ try:
+ if self.embedder:
+ # Clean up GPU memory
+ if hasattr(self.embedder, 'to'):
+ self.embedder.to('cpu')
+ del self.embedder
+ import torch
+ if torch.cuda.is_available():
+ torch.cuda.empty_cache()
+
+ self.embedder = None
+ self.is_loaded = False
+ log_to_file("🧹 ImageBind model released successfully")
+ return True
+
+ except Exception as e:
+ log_to_file(f"❌ Failed to release ImageBind: {str(e)}")
+ raise
+
+ def encode_video_segments(self, video_batch: List[str]) -> np.ndarray:
+ """Encode video segments"""
+ with self._lock:
+ if not self.is_loaded:
+ raise RuntimeError("ImageBind not loaded")
+
+ self.usage_count += 1
+
+ from videorag._videoutil import encode_video_segments
+ result = encode_video_segments(video_batch, self.embedder)
+ log_to_file(f"🎬 Encoded {len(video_batch)} video segments")
+ return result
+
+ def encode_string_query(self, query: str) -> np.ndarray:
+ """Encode string query"""
+ with self._lock:
+ if not self.is_loaded:
+ raise RuntimeError("ImageBind not loaded")
+
+ self.usage_count += 1
+
+ try:
+ from videorag._videoutil import encode_string_query
+ result = encode_string_query(query, self.embedder)
+ log_to_file(f"🔍 Encoded query: {query[:50]}...")
+ return result
+ except Exception as e:
+ log_to_file(f"❌ Query encoding failed: {str(e)}")
+ raise
+
+ def get_status(self) -> dict:
+ """Get status information"""
+ with self._lock:
+ return {
+ "initialized": self.is_initialized,
+ "loaded": self.is_loaded,
+ "total_usage_count": self.usage_count,
+ "model_config": self.model_config,
+ "device": str(next(self.embedder.parameters()).device) if self.embedder else None
+ }
+
+ def cleanup(self):
+ """Clean up resources"""
+ self.release_imagebind()
+ with self._lock:
+ self.is_initialized = False
+ self.model_path = None
+ self.model_config = None
+ log_to_file("🧹 ImageBind manager cleaned up")
+
+class HTTPImageBindClient:
+ """HTTP client, used for subprocess access to ImageBind service"""
+
+ def __init__(self, base_url: str = "http://localhost:64451"):
+ self.base_url = base_url.rstrip('/')
+ self.session = requests.Session()
+ self.session.headers.update({'Content-Type': 'application/json'})
+
+ def encode_video_segments(self, video_batch: List[str]) -> np.ndarray:
+ """Encode video segments"""
+ try:
+ response = self.session.post(
+ f"{self.base_url}/api/imagebind/encode/video",
+ json={"video_batch": video_batch},
+ timeout=1800 # 30min timeout
+ )
+
+ if response.status_code != 200:
+ raise RuntimeError(f"HTTP {response.status_code}: {response.text}")
+
+ result = response.json()
+ if not result.get("success"):
+ raise RuntimeError(f"API error: {result.get('error')}")
+
+ # Decode base64 string back to numpy array
+ result_b64 = result["result"]
+ result_bytes = base64.b64decode(result_b64)
+ embeddings = pickle.loads(result_bytes)
+ log_to_file(f"Received embeddings: {embeddings}")
+
+ return embeddings
+
+ except Exception as e:
+ log_to_file(f"❌ HTTP client video encoding error: {str(e)}")
+ raise
+
+ def encode_string_query(self, query: str) -> np.ndarray:
+ """Encode string query"""
+ try:
+ response = self.session.post(
+ f"{self.base_url}/api/imagebind/encode/query",
+ json={"query": query},
+ timeout=1800 # 30min timeout
+ )
+
+ if response.status_code != 200:
+ raise RuntimeError(f"HTTP {response.status_code}: {response.text}")
+
+ result = response.json()
+ if not result.get("success"):
+ raise RuntimeError(f"API error: {result.get('error')}")
+
+ # Decode base64 string back to numpy array
+ result_b64 = result["result"]
+ result_bytes = base64.b64decode(result_b64)
+ embeddings = pickle.loads(result_bytes)
+
+ return embeddings
+
+ except Exception as e:
+ log_to_file(f"❌ HTTP client query encoding error: {str(e)}")
+ raise
+
+ def get_status(self) -> dict:
+ """Get ImageBind service status"""
+ try:
+ response = self.session.get(
+ f"{self.base_url}/api/imagebind/status",
+ timeout=30
+ )
+
+ if response.status_code != 200:
+ raise RuntimeError(f"HTTP {response.status_code}: {response.text}")
+
+ result = response.json()
+ if not result.get("success"):
+ raise RuntimeError(f"API error: {result.get('error')}")
+
+ return result["status"]
+
+ except Exception as e:
+ log_to_file(f"❌ HTTP client status check error: {str(e)}")
+ raise
+
+class VideoRAGProcessManager:
+ """VideoRAG process manager - using JSON file to store state, removing Manager and Queue"""
+
+ def __init__(self):
+ self.global_config = None
+ self.running_processes = {}
+
+ def set_global_config(self, config):
+ """Set global configuration"""
+ log_to_file(f"🔄 Global config set: {config}")
+ self.global_config = config
+ return True
+
+ def start_video_indexing(self, chat_id, video_path_list):
+ """Start video indexing process - using JSON status file"""
+ try:
+ # Initialize status file
+ base_storage_path = self.global_config.get("base_storage_path")
+ initial_status = {
+ "indexing_status": {
+ "status": "processing",
+ "message": "Initializing AI Assistant...",
+ "current_step": "Initializing",
+ "total_videos": len(video_path_list),
+ "processed_videos": 0
+ },
+ "indexed_videos": [],
+ "created_at": time.time()
+ }
+
+ status_file = get_session_status_file(chat_id, base_storage_path)
+ write_status_json(status_file, initial_status)
+
+ # Get current server URL
+ server_url = f"http://localhost:{globals().get('SERVER_PORT', 64451)}"
+
+ # Create video indexing process
+ process = multiprocessing.Process(
+ target=index_video_worker_process,
+ args=(chat_id, video_path_list, self.global_config, server_url)
+ )
+ process.start()
+
+ # Record process
+ self.running_processes[chat_id] = {
+ "process": process,
+ "type": "video_indexing",
+ "chat_id": chat_id,
+ "started_at": time.time()
+ }
+
+ return True
+
+ except Exception as e:
+ log_to_file(f"❌ Video indexing failed: {str(e)}")
+ raise
+
+ def start_query_processing(self, chat_id, query):
+ """Start query processing process - using JSON status file"""
+ try:
+ # Initialize query status
+ base_storage_path = self.global_config.get("base_storage_path")
+ update_session_status(chat_id, base_storage_path, "query_status", {
+ "status": "processing",
+ "message": "Starting query processing...",
+ "current_step": "Initializing",
+ "query": query,
+ "answer": None,
+ "started_at": time.time()
+ })
+
+ server_url = f"http://localhost:{globals().get('SERVER_PORT', 64451)}"
+
+ # Create query processing process
+ process = multiprocessing.Process(
+ target=query_worker_process,
+ args=(chat_id, query, self.global_config, server_url)
+ )
+ process.start()
+
+ # Record process
+ process_key = f"{chat_id}_query"
+ self.running_processes[process_key] = {
+ "process": process,
+ "type": "query_processing",
+ "chat_id": chat_id,
+ "started_at": time.time()
+ }
+
+ return True
+
+ except Exception as e:
+ log_to_file(f"❌ Query processing failed: {str(e)}")
+ raise
+
+ def terminate_process(self, chat_id):
+ """Terminate process"""
+ terminated = []
+
+ if chat_id in self.running_processes:
+ try:
+ process_info = self.running_processes[chat_id]
+ if process_info["process"].is_alive():
+ log_to_file(f"🔥 Terminating process: {chat_id}")
+ process_info["process"].terminate()
+ process_info["process"].join(timeout=5)
+
+ if process_info["process"].is_alive():
+ log_to_file(f"💀 Force killing process: {chat_id}")
+ process_info["process"].kill()
+ process_info["process"].join()
+
+ terminated.append(chat_id)
+ del self.running_processes[chat_id]
+ except Exception as e:
+ log_to_file(f"⚠️ Process termination failed {chat_id}: {str(e)}")
+
+ # Update status file
+ if self.global_config:
+ base_storage_path = self.global_config.get("base_storage_path")
+ update_session_status(chat_id, base_storage_path, "indexing_status", {
+ "status": "terminated",
+ "message": "Process terminated by user",
+ "current_step": "Terminated"
+ })
+
+ return terminated
+
+ def delete_session(self, chat_id):
+ """Delete session and its processes"""
+ try:
+ log_to_file(f"🗑️ Deleting session {chat_id}")
+ terminated = self.terminate_process(chat_id)
+ log_to_file(f"🗑️ Deleted session {chat_id}, terminated processes: {terminated}")
+ return True
+ except Exception as e:
+ log_to_file(f"❌ Failed to delete session {chat_id}: {str(e)}")
+ return False
+
+ def get_session_status(self, chat_id, status_type="indexing"):
+ """Get session status from JSON file"""
+ if not self.global_config:
+ return None
+
+ try:
+ base_storage_path = self.global_config.get("base_storage_path")
+ status_file = get_session_status_file(chat_id, base_storage_path)
+ status_data = read_status_json(status_file)
+
+ if status_type == "query":
+ return status_data.get("query_status")
+ else:
+ return status_data.get("indexing_status")
+
+ except Exception as e:
+ log_to_file(f"❌ Failed to get session status: {str(e)}")
+ return None
+
+ def get_indexed_videos(self, chat_id):
+ """Get indexed video list"""
+ if not self.global_config:
+ return []
+
+ try:
+ base_storage_path = self.global_config.get("base_storage_path")
+ status_file = get_session_status_file(chat_id, base_storage_path)
+ status_data = read_status_json(status_file)
+ return status_data.get("indexed_videos", [])
+ except Exception as e:
+ log_to_file(f"❌ Failed to get indexed videos: {str(e)}")
+ return []
+
+ def get_process_status(self):
+ """Get all process status"""
+ status = {}
+ for key, process_info in self.running_processes.items():
+ status[key] = {
+ "type": process_info["type"],
+ "is_alive": process_info["process"].is_alive(),
+ "pid": process_info["process"].pid,
+ "started_at": process_info.get("started_at")
+ }
+ return status
+
+ def cleanup(self):
+ """Clean up resources - force terminate all subprocesses"""
+ log_to_file("🧹 Starting process cleanup...")
+
+ # First try to gracefully terminate processes
+ for key, process_info in list(self.running_processes.items()):
+ try:
+ process = process_info["process"]
+ if process.is_alive():
+ log_to_file(f"🔥 Terminating process: {key} (PID: {process.pid})")
+ process.terminate()
+ except Exception as e:
+ log_to_file(f"⚠️ Error terminating process {key}: {str(e)}")
+
+ # Wait for processes to end
+ time.sleep(2)
+
+ # Force kill still alive processes
+ for key, process_info in list(self.running_processes.items()):
+ try:
+ process = process_info["process"]
+ if process.is_alive():
+ log_to_file(f"💀 Force killing process: {key} (PID: {process.pid})")
+ process.kill()
+ process.join(timeout=3)
+ except Exception as e:
+ log_to_file(f"⚠️ Error killing process {key}: {str(e)}")
+
+ # Extra insurance: find and kill all related processes through psutil
+ try:
+ current_pid = os.getpid()
+ for proc in psutil.process_iter(['pid', 'name', 'cmdline']):
+ try:
+ proc_info = proc.info
+ cmdline = proc_info.get('cmdline', [])
+ if cmdline and len(cmdline) > 0:
+ proc_name = cmdline[0]
+ # Find videorag related processes (but exclude current main process)
+ if (proc_info['pid'] != current_pid and
+ ('videorag-index-' in proc_name or 'videorag-query-' in proc_name)):
+ log_to_file(f"💀 Force killing orphan process: {proc_info['pid']} - {proc_name}")
+ proc.kill()
+ except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
+ continue
+ except Exception as e:
+ log_to_file(f"⚠️ Error during psutil cleanup: {str(e)}")
+
+ self.running_processes.clear()
+ log_to_file("🧹 Process manager cleanup completed")
+
+global_imagebind_manager = None
+process_manager = None
+
+def get_imagebind_manager():
+ """Get ImageBind manager, delayed initialization"""
+ global global_imagebind_manager
+ if global_imagebind_manager is None:
+ global_imagebind_manager = GlobalImageBindManager()
+ return global_imagebind_manager
+
+def get_process_manager():
+ """Get process manager, delayed initialization"""
+ global process_manager
+ if process_manager is None:
+ process_manager = VideoRAGProcessManager()
+ return process_manager
+
+# Process worker function
+def index_video_worker_process(chat_id, video_path_list, global_config, server_url):
+ """Process version of video indexing worker - using JSON status file, removing Queue"""
+ # IMMEDIATELY set process name before any other operations
+ process_name = f'videorag-index-{chat_id}'
+ try:
+ import setproctitle
+ setproctitle.setproctitle(process_name)
+ # Force set the argv[0] as backup
+ import sys
+ if hasattr(sys, 'argv'):
+ sys.argv[0] = process_name
+ except ImportError:
+ import sys
+ if hasattr(sys, 'argv'):
+ sys.argv[0] = process_name
+
+ # Log the process name setting for index worker
+ import os
+ log_to_file(f"🔧 Index worker process {os.getpid()} set name to: {process_name}")
+
+ try:
+ base_storage_path = global_config.get("base_storage_path")
+
+ # Define status update function
+ def update_status(status_data):
+ update_session_status(chat_id, base_storage_path, "indexing_status", status_data)
+
+ # Update video list function
+ def add_indexed_video(video_path):
+ status_file = get_session_status_file(chat_id, base_storage_path)
+ current_status = read_status_json(status_file)
+ if "indexed_videos" not in current_status:
+ current_status["indexed_videos"] = []
+ current_status["indexed_videos"].append(video_path)
+ current_status["last_updated"] = time.time()
+ write_status_json(status_file, current_status)
+
+ update_status({
+ "status": "processing",
+ "message": "Initializing AI Assistant...",
+ "current_step": "Initializing"
+ })
+
+ # Create HTTP ImageBind client
+ imagebind_client = HTTPImageBindClient(server_url)
+
+ # Verify ImageBind service availability
+ try:
+ status = imagebind_client.get_status()
+ if not status["initialized"]:
+ raise RuntimeError("ImageBind not initialized in main process")
+ except Exception as e:
+ raise RuntimeError(f"Failed to connect to ImageBind service: {str(e)}")
+
+ # Create VideoRAG instance
+ session_working_dir = os.path.join(base_storage_path, f"chat-{chat_id}")
+ os.makedirs(session_working_dir, exist_ok=True)
+
+ videorag_llm_config = LLMConfig(
+ embedding_func_raw=openai_embedding,
+ embedding_model_name="text-embedding-3-small",
+ embedding_dim=1536,
+ embedding_max_token_size=8192,
+ embedding_batch_num=32,
+ embedding_func_max_async=16,
+ query_better_than_threshold=0.2,
+ best_model_func_raw=gpt_complete,
+ best_model_name=global_config.get("analysisModel"),
+ best_model_max_token_size=32768,
+ best_model_max_async=16,
+ cheap_model_func_raw=gpt_complete,
+ cheap_model_name=global_config.get("processingModel"),
+ cheap_model_max_token_size=32768,
+ cheap_model_max_async=16,
+ caption_model_func_raw=dashscope_caption_complete,
+ caption_model_name=global_config.get("caption_model"),
+ caption_model_max_async=3
+ )
+
+ videorag_instance = VideoRAG(
+ llm=videorag_llm_config,
+ working_dir=session_working_dir,
+ ali_dashscope_api_key=global_config.get("ali_dashscope_api_key"),
+ ali_dashscope_base_url=global_config.get("ali_dashscope_base_url"),
+ caption_model=global_config.get("caption_model"),
+ asr_model=global_config.get("asr_model"),
+ openai_api_key=global_config.get("openai_api_key"),
+ openai_base_url=global_config.get("openai_base_url"),
+ imagebind_client=imagebind_client, # Pass HTTP client
+ )
+
+ # Define progress callback - directly write to JSON file
+ def progress_callback(step_name, message, indexed_video_path=None):
+ status_data = {
+ "status": "processing" if step_name != "Completed" else "completed",
+ "message": message,
+ "current_step": step_name
+ }
+ update_status(status_data)
+
+ # If a video is completed, add it to the indexed list
+ if indexed_video_path and step_name == "One Video Completed":
+ add_indexed_video(indexed_video_path)
+
+ # Call insert_video
+ videorag_instance.insert_video(
+ video_path_list=video_path_list,
+ progress_callback=progress_callback
+ )
+
+ update_status({
+ "status": "completed",
+ "message": "All videos processed successfully",
+ "current_step": "Completed"
+ })
+
+ log_to_file(f"✅ Process-based video indexing completed: {chat_id}")
+
+ except Exception as e:
+ base_storage_path = global_config.get("base_storage_path")
+ update_session_status(chat_id, base_storage_path, "indexing_status", {
+ "status": "error",
+ "message": f"Video indexing failed: {str(e)}",
+ "current_step": "Error"
+ })
+ log_to_file(f"❌ Process-based video indexing failed: {str(e)}")
+
+def query_worker_process(chat_id, query, global_config, server_url):
+ """Query processing worker process - using JSON status file, removing Queue"""
+ # IMMEDIATELY set process name before any other operations
+ process_name = f'videorag-query-{chat_id}'
+ try:
+ import setproctitle
+ setproctitle.setproctitle(process_name)
+ # Force set the argv[0] as backup
+ import sys
+ if hasattr(sys, 'argv'):
+ sys.argv[0] = process_name
+ except ImportError:
+ import sys
+ if hasattr(sys, 'argv'):
+ sys.argv[0] = process_name
+
+ # Log the process name setting for query worker
+ import os
+ log_to_file(f"🔧 Query worker process {os.getpid()} set name to: {process_name}")
+
+ try:
+ base_storage_path = global_config.get("base_storage_path")
+
+ # Define status update function
+ def update_query_status(status_data):
+ update_session_status(chat_id, base_storage_path, "query_status", status_data)
+
+ log_to_file(f"🔄 Starting query processing for chat {chat_id}: {query}")
+
+ # Step 1: Initializing
+ update_query_status({
+ "status": "processing",
+ "message": "Initializing query processing...",
+ "current_step": "Initializing",
+ "query": query
+ })
+
+ # Create HTTP ImageBind client
+ imagebind_client = HTTPImageBindClient(server_url)
+
+ # Verify ImageBind service availability
+ try:
+ status = imagebind_client.get_status()
+ if not status["initialized"]:
+ raise RuntimeError("ImageBind not initialized in main process")
+ except Exception as e:
+ raise RuntimeError(f"Failed to connect to ImageBind service: {str(e)}")
+
+ # Create VideoRAG instance
+ session_working_dir = os.path.join(base_storage_path, f"chat-{chat_id}")
+ assert os.path.exists(session_working_dir), f"Session working directory does not exist: {session_working_dir}"
+
+ videorag_llm_config = LLMConfig(
+ embedding_func_raw=openai_embedding,
+ embedding_model_name="text-embedding-3-small",
+ embedding_dim=1536,
+ embedding_max_token_size=8192,
+ embedding_batch_num=32,
+ embedding_func_max_async=16,
+ query_better_than_threshold=0.2,
+ best_model_func_raw=gpt_complete,
+ best_model_name=global_config.get("analysisModel"),
+ best_model_max_token_size=32768,
+ best_model_max_async=16,
+ cheap_model_func_raw=gpt_complete,
+ cheap_model_name=global_config.get("processingModel"),
+ cheap_model_max_token_size=32768,
+ cheap_model_max_async=16,
+ caption_model_func_raw=dashscope_caption_complete,
+ caption_model_name=global_config.get("caption_model"),
+ caption_model_max_async=3
+ )
+
+ videorag_instance = VideoRAG(
+ llm=videorag_llm_config,
+ working_dir=session_working_dir,
+ ali_dashscope_api_key=global_config.get("ali_dashscope_api_key"),
+ ali_dashscope_base_url=global_config.get("ali_dashscope_base_url"),
+ caption_model=global_config.get("caption_model"),
+ asr_model=global_config.get("asr_model"),
+ openai_api_key=global_config.get("openai_api_key"),
+ openai_base_url=global_config.get("openai_base_url"),
+ imagebind_client=imagebind_client, # Pass HTTP client
+ )
+
+ # Step 2: Processing
+ update_query_status({
+ "status": "processing",
+ "message": "Processing your query...",
+ "current_step": "Processing",
+ "query": query
+ })
+
+ param = QueryParam(mode="videorag")
+ param.wo_reference = True
+ response = videorag_instance.query(query=query, param=param)
+
+ # Step 3: Completed
+ update_query_status({
+ "status": "completed",
+ "message": "Query processing completed",
+ "current_step": "Completed",
+ "query": query,
+ "answer": response,
+ })
+
+ log_to_file(f"✅ Query processing completed for chat {chat_id}")
+
+ except Exception as e:
+ base_storage_path = global_config.get("base_storage_path")
+ update_session_status(chat_id, base_storage_path, "query_status", {
+ "status": "error",
+ "message": f"Query processing failed: {str(e)}",
+ "current_step": "Error",
+ "query": query
+ })
+ log_to_file(f"❌ Query processing failed: {str(e)}")
+
+# Flask application factory function
+def create_app():
+ """Create Flask application instance"""
+ app = Flask(__name__)
+ CORS(app)
+
+ # Register all routes
+ register_routes(app)
+
+ return app
+
+def register_routes(app):
+ """Register all routes to Flask application"""
+
+ @app.route('/api/health', methods=['GET'])
+ def health_check():
+ """Health check"""
+ return jsonify({"status": "ok", "message": "VideoRAG API is running"})
+
+ @app.route('/api/video/duration', methods=['POST'])
+ def get_video_duration():
+ """Get video duration information"""
+ try:
+ data = request.json
+ video_path = data.get('video_path')
+ with VideoFileClip(video_path) as clip:
+ duration = clip.duration
+ fps = clip.fps
+ size = clip.size
+ result = {
+ "success": True,
+ "duration": duration,
+ "fps": fps,
+ "width": size[0],
+ "height": size[1],
+ "video_path": video_path
+ }
+ log_to_file(f"🔍 Video duration: {result}")
+ return jsonify(result)
+ except Exception as e:
+ log_to_file(f"❌ Video duration extraction error: {str(e)}")
+ return jsonify({
+ "success": False,
+ "error": f"Duration extraction error: {str(e)}"
+ }), 500
+
+ @app.route('/api/initialize', methods=['POST'])
+ def initialize_system():
+ """初始化系统配置但不加载ImageBind模型"""
+ try:
+ config = request.json
+ get_process_manager().set_global_config(config)
+
+ # 只初始化ImageBind管理器配置,不加载模型
+ model_path = config.get("image_bind_model_path")
+ if model_path:
+ get_imagebind_manager().initialize(model_path)
+
+ return jsonify({
+ "success": True,
+ "message": "VideoRAG system configuration set successfully",
+ "imagebind_status": get_imagebind_manager().get_status()
+ })
+
+ except Exception as e:
+ log_to_file(f"❌ Configuration error: {str(e)}")
+ return jsonify({
+ "success": False,
+ "error": f"Configuration error: {str(e)}"
+ }), 500
+
+
+ @app.route('/api/imagebind/status', methods=['GET'])
+ def get_imagebind_status():
+ """获取ImageBind状态"""
+ try:
+ status = get_imagebind_manager().get_status()
+ return jsonify({
+ "success": True,
+ "status": status
+ })
+ except Exception as e:
+ return jsonify({
+ "success": False,
+ "error": f"Status check error: {str(e)}"
+ }), 500
+
+ @app.route('/api/imagebind/encode/video', methods=['POST'])
+ def encode_video_segments_api():
+ """编码视频段的API接口"""
+ try:
+ data = request.json
+ video_batch = data.get('video_batch', [])
+
+ if not video_batch:
+ return jsonify({
+ "success": False,
+ "error": "video_batch is required"
+ }), 400
+
+ # Verify file existence
+ for video_path in video_batch:
+ if not os.path.exists(video_path):
+ return jsonify({
+ "success": False,
+ "error": f"Video file not found: {video_path}"
+ }), 400
+
+ # Encode video
+ log_to_file(f"🎬 Encoding {video_batch} video segments")
+ result = get_imagebind_manager().encode_video_segments(video_batch).numpy()
+ # Convert numpy array to base64 string for transmission
+ result_bytes = pickle.dumps(result)
+ result_b64 = base64.b64encode(result_bytes).decode('utf-8')
+
+ return jsonify({
+ "success": True,
+ "result": result_b64,
+ "shape": result.shape,
+ "dtype": str(result.dtype),
+ "batch_size": len(video_batch)
+ })
+
+ except Exception as e:
+ log_to_file(f"❌ Video encoding API error: {str(e)}")
+ return jsonify({
+ "success": False,
+ "error": f"Video encoding error: {str(e)}"
+ }), 500
+
+ @app.route('/api/imagebind/encode/query', methods=['POST'])
+ def encode_string_query_api():
+ """Encode string query API interface"""
+ try:
+ data = request.json
+ query = data.get('query', '').strip()
+
+ if not query:
+ return jsonify({
+ "success": False,
+ "error": "query is required"
+ }), 400
+
+ # Encode query
+ result = get_imagebind_manager().encode_string_query(query).numpy()
+
+ # Convert numpy array to base64 string for transmission
+ result_bytes = pickle.dumps(result)
+ result_b64 = base64.b64encode(result_bytes).decode('utf-8')
+
+ return jsonify({
+ "success": True,
+ "result": result_b64,
+ "shape": result.shape,
+ "dtype": str(result.dtype),
+ "query": query
+ })
+
+ except Exception as e:
+ log_to_file(f"❌ Query encoding API error: {str(e)}")
+ return jsonify({
+ "success": False,
+ "error": f"Query encoding error: {str(e)}"
+ }), 500
+
+ @app.route('/api/sessions/<chat_id>/videos/upload', methods=['POST'])
+ def upload_video(chat_id):
+ """Upload video for specific chat session and start indexing - asynchronous operation"""
+ log_to_file(f"📝 API: Starting async video upload for chat_id: {chat_id}")
+
+ try:
+ data = request.json
+ video_path_list = data.get('video_path_list', [])
+
+ if not video_path_list:
+ return jsonify({
+ "success": False,
+ "error": "video_path_list is required"
+ }), 400
+
+ log_to_file(f"📹 Videos to process: {len(video_path_list)}")
+
+ for path in video_path_list:
+ if not path or not os.path.exists(path):
+ return jsonify({
+ "success": False,
+ "error": f"Invalid video path: {path}"
+ }), 400
+
+ # Get video name list
+ video_names = [os.path.basename(path).split('.')[0] for path in video_path_list]
+
+ log_to_file(f"🚀 Starting background video processing for {chat_id}")
+
+ # Start background indexing process
+ get_process_manager().start_video_indexing(chat_id, video_path_list)
+
+ # Immediately return success response
+ return jsonify({
+ "success": True,
+ "message": "Video processing started",
+ "video_names": video_names,
+ "video_count": len(video_path_list),
+ "chat_id": chat_id,
+ "status": "started"
+ })
+
+ except Exception as e:
+ error_msg = f"Failed to start video processing: {str(e)}"
+ log_to_file(f"❌ {error_msg}")
+ return jsonify({
+ "success": False,
+ "error": error_msg
+ }), 500
+
+ @app.route('/api/sessions/<chat_id>/status', methods=['GET'])
+ def get_indexing_status(chat_id):
+ """Get indexing status for specific session"""
+ try:
+ # Check if this is a query status request
+ query_type = request.args.get('type', 'indexing')
+
+ if query_type == 'query':
+ # Return query processing status
+ status_info = get_process_manager().get_session_status(chat_id, "query")
+ if not status_info:
+ return jsonify({
+ "success": False,
+ "error": "Query status not found",
+ "status": "not_found"
+ }), 404
+
+ log_to_file(f"🔍 Query status: {status_info}")
+
+ return jsonify({
+ "success": True,
+ "chat_id": chat_id,
+ "status": status_info.get("status"),
+ "message": status_info.get("message"),
+ "current_step": status_info.get("current_step"),
+ "query": status_info.get("query"),
+ "answer": status_info.get("answer")
+ })
+ else:
+ # Return indexing status (default)
+ status_info = get_process_manager().get_session_status(chat_id, "indexing")
+ if not status_info:
+ return jsonify({
+ "success": False,
+ "error": "Session not found",
+ "status": "not_found"
+ }), 404
+
+ log_to_file(f"🔍 Session status: {status_info}")
+
+ return jsonify({
+ "success": True,
+ "chat_id": chat_id,
+ "status": status_info.get("status"),
+ "message": status_info.get("message"),
+ "current_step": status_info.get("current_step")
+ })
+
+ except Exception as e:
+ log_to_file(f"❌ Session status error: {str(e)}")
+ return jsonify({
+ "success": False,
+ "error": f"Status check error: {str(e)}"
+ }), 500
+
+ @app.route('/api/sessions/<chat_id>/videos/indexed', methods=['GET'])
+ def list_indexed_videos(chat_id):
+ """Get list of indexed videos for specific session"""
+ try:
+ indexed_videos = get_process_manager().get_indexed_videos(chat_id)
+
+ return jsonify({
+ "success": True,
+ "indexed_videos": indexed_videos,
+ "total_count": len(indexed_videos),
+ "chat_id": chat_id
+ })
+
+ except Exception as e:
+ return jsonify({
+ "success": False,
+ "error": f"List error: {str(e)}"
+ }), 500
+
+ @app.route('/api/sessions/<chat_id>/terminate', methods=['POST'])
+ def terminate_session_processes(chat_id):
+ """终止特定session的进程"""
+ try:
+ terminated = get_process_manager().terminate_process(chat_id)
+
+ return jsonify({
+ "success": True,
+ "message": f"Terminated processes for {chat_id}",
+ "terminated_processes": terminated
+ })
+
+ except Exception as e:
+ return jsonify({
+ "success": False,
+ "error": f"Termination failed: {str(e)}"
+ }), 500
+
+ @app.route('/api/sessions/<chat_id>/delete', methods=['DELETE'])
+ def delete_session(chat_id):
+ """删除session及其进程"""
+ try:
+ get_process_manager().delete_session(chat_id)
+ return jsonify({
+ "success": True,
+ "message": f"Session {chat_id} deleted successfully",
+ "chat_id": chat_id
+ })
+
+ except Exception as e:
+ return jsonify({
+ "success": False,
+ "error": f"Delete failed: {str(e)}"
+ }), 500
+
+ @app.route('/api/sessions/<chat_id>/query', methods=['POST'])
+ def query_video(chat_id):
+ """Query video content for specific session - start async processing"""
+ try:
+ data = request.json
+ log_to_file(f"🔍 Query data: {data}")
+ if not data:
+ return jsonify({
+ "success": False,
+ "error": "No JSON data provided"
+ }), 400
+
+ query = data.get('query', '').strip()
+
+ # Start async query processing
+ log_to_file(f"🚀 Starting query processing for chat {chat_id}: {query}")
+ success = get_process_manager().start_query_processing(chat_id, query)
+
+ if not success:
+ return jsonify({
+ "success": False,
+ "error": "Failed to start query processing"
+ }), 500
+
+ return jsonify({
+ "success": True,
+ "query": query,
+ "message": "Query processing started",
+ "chat_id": chat_id,
+ "status": "started"
+ })
+
+ except Exception as e:
+ return jsonify({
+ "success": False,
+ "error": f"Query error: {str(e)}"
+ }), 500
+
+ @app.route('/api/system/status', methods=['GET'])
+ def get_system_status():
+ """Get overall system status"""
+ try:
+ pm = get_process_manager()
+ im = get_imagebind_manager()
+
+ # Calculate active sessions (extract unique chat_id from running processes)
+ active_sessions = set()
+ for key in pm.running_processes.keys():
+ if key.endswith('_query'):
+ chat_id = key.rsplit('_query', 1)[0]
+ else:
+ chat_id = key
+ active_sessions.add(chat_id)
+
+ total_sessions = len(active_sessions)
+
+ # Calculate total indexed video count
+ total_videos = 0
+ if pm.global_config:
+ for chat_id in active_sessions:
+ try:
+ videos = pm.get_indexed_videos(chat_id)
+ total_videos += len(videos)
+ except:
+ continue
+
+ return jsonify({
+ "success": True,
+ "global_config_set": pm.global_config is not None,
+ "imagebind_initialized": im.is_initialized,
+ "imagebind_loaded": im.is_loaded,
+ "total_sessions": total_sessions,
+ "total_indexed_videos": total_videos,
+ "running_processes": pm.get_process_status(),
+ "sessions": list(active_sessions)
+ })
+
+ except Exception as e:
+ return jsonify({
+ "success": False,
+ "error": f"System status error: {str(e)}"
+ }), 500
+
+ @app.route('/api/system/processes', methods=['GET'])
+ def get_all_processes():
+ """Get all running process status"""
+ try:
+ return jsonify({
+ "success": True,
+ "processes": get_process_manager().get_process_status()
+ })
+
+ except Exception as e:
+ return jsonify({
+ "success": False,
+ "error": f"Process status error: {str(e)}"
+ }), 500
+
+ # New: ImageBind model management endpoint
+ @app.route('/api/imagebind/load', methods=['POST'])
+ def load_imagebind():
+ """Load ImageBind model"""
+ try:
+ im = get_imagebind_manager()
+ success = im.ensure_imagebind_loaded()
+
+ if success:
+ return jsonify({
+ "success": True,
+ "message": "ImageBind model loaded successfully",
+ "status": im.get_status()
+ })
+ else:
+ return jsonify({
+ "success": False,
+ "error": "Failed to load ImageBind model"
+ }), 500
+
+ except Exception as e:
+ return jsonify({
+ "success": False,
+ "error": f"Error loading ImageBind: {str(e)}"
+ }), 500
+
+ @app.route('/api/imagebind/release', methods=['POST'])
+ def release_imagebind():
+ """Release ImageBind model memory"""
+ try:
+ im = get_imagebind_manager()
+ im.release_imagebind()
+
+ return jsonify({
+ "success": True,
+ "message": "ImageBind model released successfully",
+ "status": im.get_status()
+ })
+
+ except Exception as e:
+ return jsonify({
+ "success": False,
+ "error": f"Error releasing ImageBind: {str(e)}"
+ }), 500
+
+ @app.route('/api/imagebind/status', methods=['GET'])
+ def imagebind_status():
+ """Get ImageBind model status"""
+ try:
+ status = get_imagebind_manager().get_status()
+
+ return jsonify({
+ "success": True,
+ "data": {
+ "loaded": status.get("loaded", False),
+ "model_type": status.get("model_type"),
+ "device": status.get("device"),
+ "memory_usage": status.get("memory_usage")
+ }
+ })
+
+ except Exception as e:
+ return jsonify({
+ "success": False,
+ "error": f"Error getting ImageBind status: {str(e)}"
+ }), 500
+
+def check_port_available(port):
+ """Check if port is available"""
+ try:
+ with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
+ sock.settimeout(1)
+ result = sock.connect_ex(('localhost', port))
+ return result != 0
+ except Exception:
+ return False
+
+def find_available_port(start_port, end_port):
+ """Find an available port within specified range"""
+ for port in range(start_port, end_port + 1):
+ if check_port_available(port):
+ return port
+ return None
+
+def get_system_free_port():
+ """Get system-assigned free port (backup solution)"""
+ with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
+ s.bind(('', 0))
+ s.listen(1)
+ port = s.getsockname()[1]
+ return port
+
+# Global cleanup flag to avoid repeated cleanup
+_cleanup_called = False
+
+def cleanup_on_exit():
+ """Cleanup function when program exits"""
+ global _cleanup_called
+ if _cleanup_called:
+ return
+ _cleanup_called = True
+
+ try:
+ log_to_file("🔔 VideoRAG API server is shutting down...")
+ if process_manager:
+ process_manager.cleanup()
+ if global_imagebind_manager:
+ global_imagebind_manager.cleanup()
+ log_to_file("✅ Cleanup completed")
+ except Exception as e:
+ log_to_file(f"❌ Error during cleanup: {str(e)}")
+
+def signal_handler(signum, frame):
+ """Signal handler"""
+ log_to_file(f"🔔 Received signal {signum}, initiating shutdown...")
+ cleanup_on_exit()
+ exit(0)
+
+if __name__ == '__main__':
+ # Must call freeze_support() at the beginning to support multiprocessing after packaging
+ multiprocessing.freeze_support()
+
+ # Register cleanup function and signal handler
+ atexit.register(cleanup_on_exit)
+ signal.signal(signal.SIGINT, signal_handler) # Ctrl+C
+ signal.signal(signal.SIGTERM, signal_handler) # Termination signal
+
+ # Windows special handling
+ if os.name == 'nt': # Windows
+ try:
+ import win32api
+ def win32_handler(dwCtrlType):
+ log_to_file(f"🔔 Windows signal received: {dwCtrlType}")
+ cleanup_on_exit()
+ return True
+ win32api.SetConsoleCtrlHandler(win32_handler, True)
+ except ImportError:
+ log_to_file("⚠️ win32api not available, using basic signal handling")
+ pass
+
+ # Set process name only in main process
+ try:
+ import setproctitle
+ setproctitle.setproctitle('videorag-api-server')
+ except ImportError:
+ import sys
+ if hasattr(sys, 'argv'):
+ sys.argv[0] = 'videorag-api-server'
+
+ # Port configuration - centralized in main
+ DEFAULT_PORT = 64451
+ PORT_RANGE_START = 64451
+ PORT_RANGE_END = 64470
+
+ # Note: Do not initialize manager instance here directly, but use get_ function for delayed initialization
+
+ try:
+ SERVER_PORT = None
+
+ if check_port_available(DEFAULT_PORT):
+ SERVER_PORT = DEFAULT_PORT
+ else:
+ SERVER_PORT = find_available_port(PORT_RANGE_START, PORT_RANGE_END)
+ if not SERVER_PORT:
+ SERVER_PORT = get_system_free_port()
+
+ # Set port as global variable for other functions
+ globals()['SERVER_PORT'] = SERVER_PORT
+
+ # Now it is safe to set multiprocessing start method
+ multiprocessing.set_start_method('spawn')
+
+ log_to_file(f"🚀 Starting VideoRAG API with global ImageBind on port {SERVER_PORT}")
+ log_to_file(f"📝 Main process PID: {os.getpid()}")
+
+ # Use factory function to create Flask app
+ app = create_app()
+ app.run(host='0.0.0.0', port=SERVER_PORT, debug=False, threaded=True)
+
+ except KeyboardInterrupt:
+ log_to_file("🔔 Received keyboard interrupt")
+ cleanup_on_exit()
+ except Exception as e:
+ log_to_file(f"❌ Failed to start server: {e}")
+ cleanup_on_exit()
+ exit(1)
+ finally:
+ cleanup_on_exit()
\ No newline at end of file
diff --git a/Vimo-desktop/src/main/handlers/chat-session-handlers.ts b/Vimo-desktop/src/main/handlers/chat-session-handlers.ts
new file mode 100644
index 0000000..c0e48cd
--- /dev/null
+++ b/Vimo-desktop/src/main/handlers/chat-session-handlers.ts
@@ -0,0 +1,298 @@
+import { ipcMain } from 'electron';
+import { readFile, writeFile, access, mkdir, readdir } from 'node:fs/promises';
+import { join } from 'node:path';
+import { homedir } from 'node:os';
+
+// Bootstrap configuration file path
+const BOOTSTRAP_CONFIG_FILE = join(homedir(), '.videorag-bootstrap.json');
+
+// Helper function to get the storage directory path
+async function getStorageDirectory(): Promise<string | null> {
+ try {
+ await access(BOOTSTRAP_CONFIG_FILE);
+ const content = await readFile(BOOTSTRAP_CONFIG_FILE, 'utf-8');
+ const bootstrap = JSON.parse(content);
+ return bootstrap.storeDirectory || null;
+ } catch (error) {
+ // Bootstrap file doesn't exist or invalid
+ return null;
+ }
+}
+
+// Helper function to get individual session file path
+async function getSessionFilePath(chatId: string): Promise<string | null> {
+ const storageDir = await getStorageDirectory();
+ if (!storageDir) return null;
+ return join(storageDir, `chat-${chatId}.json`);
+}
+
+// Helper function to ensure storage directory exists
+async function ensureStorageDirectory(): Promise<void> {
+ const storageDir = await getStorageDirectory();
+ if (storageDir) {
+ await mkdir(storageDir, { recursive: true });
+ }
+}
+
+// Helper function to get session order config file path
+async function getSessionOrderConfigPath(): Promise<string | null> {
+ const storageDir = await getStorageDirectory();
+ if (!storageDir) return null;
+ return join(storageDir, 'session-order.json');
+}
+
+// Helper function to load session order
+async function loadSessionOrder(): Promise<string[]> {
+ try {
+ const configPath = await getSessionOrderConfigPath();
+ if (!configPath) return [];
+
+ await access(configPath);
+ const content = await readFile(configPath, 'utf-8');
+ const config = JSON.parse(content);
+ return config.sessionOrder || [];
+ } catch (error) {
+ return [];
+ }
+}
+
+// Unified session order update function
+async function updateSessionOrder(sessionIds: string[], operation: 'create' | 'delete' | 'reorder' = 'reorder'): Promise<void> {
+ try {
+ const configPath = await getSessionOrderConfigPath();
+ if (!configPath) return;
+
+ await ensureStorageDirectory();
+
+ let currentOrder: string[] = [];
+
+ // Try to load existing order configuration
+ try {
+ await access(configPath);
+ const content = await readFile(configPath, 'utf-8');
+ const config = JSON.parse(content);
+ currentOrder = config.sessionOrder || [];
+ } catch (error) {
+ // session-order.json not found, create new one
+ console.log('📄 session-order.json not found, creating new one');
+ }
+
+ let newOrder: string[];
+
+ switch (operation) {
+ case 'create':
+ // New session created: add to the beginning (latest at the top)
+ newOrder = [
+ ...sessionIds.filter(id => !currentOrder.includes(id)),
+ ...currentOrder
+ ];
+ break;
+
+ case 'delete':
+ // Session deleted: remove from the order
+ newOrder = currentOrder.filter(id => !sessionIds.includes(id));
+ break;
+
+ case 'reorder':
+ // Drag and drop reorder: use new order directly
+ newOrder = sessionIds;
+ break;
+
+ default:
+ newOrder = sessionIds;
+ }
+
+ // Save updated order configuration
+ const config = {
+ sessionOrder: newOrder,
+ lastUpdated: new Date().toISOString(),
+ operation,
+ };
+
+ await writeFile(configPath, JSON.stringify(config, null, 2), 'utf-8');
+ console.log(`✅ Session order updated (${operation}):`, newOrder.length, 'sessions');
+
+ } catch (error) {
+ console.error('Failed to update session order:', error);
+ }
+}
+
+/**
+ * Register all chat session related IPC handlers
+ */
+export function registerChatSessionHandlers(): void {
+ // Load single chat session
+ ipcMain.handle('load-chat-session', async (_, chatId: string) => {
+ try {
+ const sessionFilePath = await getSessionFilePath(chatId);
+ if (!sessionFilePath) {
+ return { success: false, error: 'Storage directory not configured' };
+ }
+
+ await access(sessionFilePath);
+ const content = await readFile(sessionFilePath, 'utf-8');
+ const session = JSON.parse(content);
+
+ return { success: true, session };
+ } catch (error) {
+ // File doesn't exist, return null
+ return { success: true, session: null };
+ }
+ });
+
+ // Save single chat session
+ ipcMain.handle('save-chat-session', async (_, chatId: string, sessionData: Record<string, any>) => {
+ try {
+ const sessionFilePath = await getSessionFilePath(chatId);
+ if (!sessionFilePath) {
+ return { success: false, error: 'Storage directory not configured' };
+ }
+
+ await ensureStorageDirectory();
+
+ // Check if session already exists
+ const isNewSession = !(await access(sessionFilePath).then(() => true).catch(() => false));
+
+ const dataToSave = {
+ ...sessionData,
+ lastUpdated: new Date().toISOString()
+ };
+
+ await writeFile(sessionFilePath, JSON.stringify(dataToSave, null, 2), 'utf-8');
+
+ // If new session, update order configuration
+ if (isNewSession) {
+ await updateSessionOrder([chatId], 'create');
+ }
+
+ return { success: true };
+ } catch (error) {
+ const errorMessage = error instanceof Error ? error.message : String(error);
+ return { success: false, error: errorMessage };
+ }
+ });
+
+ // List all chat sessions
+ ipcMain.handle('list-chat-sessions', async () => {
+ try {
+ const storageDir = await getStorageDirectory();
+ if (!storageDir) {
+ return { success: true, sessions: [] };
+ }
+
+ await access(storageDir);
+ const files = await readdir(storageDir);
+
+ const sessionFiles = files.filter(file => file.startsWith('chat-') && file.endsWith('.json'));
+ const sessions: any[] = [];
+
+ for (const file of sessionFiles) {
+ try {
+ const filePath = join(storageDir, file);
+ const content = await readFile(filePath, 'utf-8');
+ const session = JSON.parse(content);
+ sessions.push(session);
+ } catch (error) {
+ // Skip invalid session files
+ console.warn(`Failed to read session file ${file}:`, error);
+ }
+ }
+
+ // Load user-defined order
+ const customOrder = await loadSessionOrder();
+
+ // Apply user-defined order
+ if (customOrder.length > 0) {
+ const orderedSessions: any[] = [];
+ const sessionMap = new Map(sessions.map(s => [s.id, s]));
+
+ // 1. Add existing sessions in custom order
+ for (const sessionId of customOrder) {
+ const session = sessionMap.get(sessionId);
+ if (session) {
+ orderedSessions.push(session);
+ sessionMap.delete(sessionId);
+ }
+ }
+
+ // 2. Add new sessions (not in order configuration), sorted by time
+ const newSessions = Array.from(sessionMap.values())
+ .sort((a, b) => new Date(b.lastUpdated).getTime() - new Date(a.lastUpdated).getTime());
+ orderedSessions.push(...newSessions);
+
+ return { success: true, sessions: orderedSessions };
+ } else {
+ // No custom order, use default time sorting
+ sessions.sort((a, b) => new Date(b.lastUpdated).getTime() - new Date(a.lastUpdated).getTime());
+ return { success: true, sessions };
+ }
+ } catch (error) {
+ // Directory doesn't exist, return empty sessions
+ return { success: true, sessions: [] };
+ }
+ });
+
+ // Delete single chat session
+ ipcMain.handle('delete-chat-session', async (_, chatId: string) => {
+ try {
+ const sessionFilePath = await getSessionFilePath(chatId);
+ if (!sessionFilePath) {
+ return { success: false, error: 'Storage directory not configured' };
+ }
+
+ const { unlink } = await import('node:fs/promises');
+ await unlink(sessionFilePath);
+
+ // Update order configuration after deletion
+ await updateSessionOrder([chatId], 'delete');
+
+ return { success: true };
+ } catch (error) {
+ const errorMessage = error instanceof Error ? error.message : String(error);
+ return { success: false, error: errorMessage };
+ }
+ });
+
+ // Get storage directory info
+ ipcMain.handle('get-storage-info', async () => {
+ try {
+ await access(BOOTSTRAP_CONFIG_FILE);
+ const content = await readFile(BOOTSTRAP_CONFIG_FILE, 'utf-8');
+ const bootstrap = JSON.parse(content);
+
+ return {
+ success: true,
+ storeDirectory: bootstrap.storeDirectory,
+ isConfigured: !!bootstrap.storeDirectory
+ };
+ } catch (error) {
+ return {
+ success: true,
+ storeDirectory: null,
+ isConfigured: false
+ };
+ }
+ });
+
+ // Create storage directory if not exists
+ ipcMain.handle('ensure-storage-directory', async () => {
+ try {
+ await ensureStorageDirectory();
+ return { success: true };
+ } catch (error) {
+ const errorMessage = error instanceof Error ? error.message : String(error);
+ return { success: false, error: errorMessage };
+ }
+ });
+
+ // Unified session order update handler
+ ipcMain.handle('update-session-order', async (_, sessionIds: string[], operation: 'create' | 'delete' | 'reorder' = 'reorder') => {
+ try {
+ await updateSessionOrder(sessionIds, operation);
+ return { success: true };
+ } catch (error) {
+ const errorMessage = error instanceof Error ? error.message : String(error);
+ return { success: false, error: errorMessage };
+ }
+ });
+}
\ No newline at end of file
diff --git a/Vimo-desktop/src/main/handlers/file-handlers.ts b/Vimo-desktop/src/main/handlers/file-handlers.ts
new file mode 100644
index 0000000..e5ee224
--- /dev/null
+++ b/Vimo-desktop/src/main/handlers/file-handlers.ts
@@ -0,0 +1,120 @@
+import { dialog, ipcMain } from 'electron';
+import { readFile, writeFile, stat } from 'node:fs/promises';
+
+/**
+ * Register all file-related IPC handlers
+ */
+export function registerFileHandlers(): void {
+ // Echo message handler
+ ipcMain.handle('echo-message', async (_, message: string) => {
+ // Simple echo functionality - returns whatever user inputs
+ return `Echo: ${message}`;
+ });
+
+ // Read file handler
+ ipcMain.handle('read-file', async () => {
+ try {
+ const result = await dialog.showOpenDialog({
+ properties: ['openFile'],
+ filters: [
+ { name: 'Text Files', extensions: ['txt', 'md'] },
+ { name: 'All Files', extensions: ['*'] },
+ ],
+ });
+
+ if (!result.canceled && result.filePaths.length > 0) {
+ const filePath = result.filePaths[0];
+ const content = await readFile(filePath, 'utf-8');
+ return { success: true, content, path: filePath };
+ }
+
+ return { success: false, error: 'No file selected' };
+ } catch (error) {
+ const errorMessage = error instanceof Error ? error.message : String(error);
+ return { success: false, error: errorMessage };
+ }
+ });
+
+ // Save file handler
+ ipcMain.handle('save-file', async (_, content: string) => {
+ try {
+ const result = await dialog.showSaveDialog({
+ filters: [
+ { name: 'Text Files', extensions: ['txt'] },
+ { name: 'All Files', extensions: ['*'] },
+ ],
+ });
+
+ if (!result.canceled && result.filePath) {
+ await writeFile(result.filePath, content, 'utf-8');
+ return { success: true, path: result.filePath };
+ }
+
+ return { success: false, error: 'Save cancelled' };
+ } catch (error) {
+ const errorMessage = error instanceof Error ? error.message : String(error);
+ return { success: false, error: errorMessage };
+ }
+ });
+
+ // Select folder handler
+ ipcMain.handle('select-folder', async () => {
+ try {
+ const result = await dialog.showOpenDialog({
+ properties: ['openDirectory'],
+ });
+
+ if (!result.canceled && result.filePaths.length > 0) {
+ return { success: true, path: result.filePaths[0] };
+ }
+
+ return { success: false, error: 'No folder selected' };
+ } catch (error) {
+ const errorMessage = error instanceof Error ? error.message : String(error);
+ return { success: false, error: errorMessage };
+ }
+ });
+
+ // Select video files handler
+ ipcMain.handle('select-video-files', async () => {
+ try {
+ const result = await dialog.showOpenDialog({
+ properties: ['openFile', 'multiSelections'],
+ filters: [
+ {
+ name: 'Video Files',
+ extensions: ['mp4', 'avi', 'mov', 'wmv', 'flv', 'webm', 'mkv', '3gp', 'mpg', 'mpeg']
+ },
+ { name: 'All Files', extensions: ['*'] },
+ ],
+ });
+
+ if (!result.canceled && result.filePaths.length > 0) {
+ const files: { name: string; path: string; size: number }[] = [];
+
+ for (const filePath of result.filePaths) {
+ try {
+ const stats = await stat(filePath);
+ const fileName = filePath.split('/').pop() || filePath.split('\\').pop() || 'unknown';
+
+ files.push({
+ name: fileName,
+ path: filePath,
+ size: stats.size,
+ });
+ } catch (error) {
+ console.error(`Error getting file stats for ${filePath}:`, error);
+ continue;
+ }
+ }
+
+ return { success: true, files };
+ }
+
+ return { success: false, error: 'No files selected' };
+ } catch (error) {
+ const errorMessage = error instanceof Error ? error.message : String(error);
+ return { success: false, error: errorMessage };
+ }
+ });
+}
\ No newline at end of file
diff --git a/Vimo-desktop/src/main/handlers/settings.ts b/Vimo-desktop/src/main/handlers/settings.ts
new file mode 100644
index 0000000..5b818d3
--- /dev/null
+++ b/Vimo-desktop/src/main/handlers/settings.ts
@@ -0,0 +1,165 @@
+import { ipcMain } from 'electron';
+import { readFile, writeFile, access, mkdir } from 'node:fs/promises';
+import { join } from 'node:path';
+import { homedir } from 'node:os';
+
+// Bootstrap configuration file path (only stores storeDirectory)
+const BOOTSTRAP_CONFIG_FILE = join(homedir(), '.videorag-bootstrap.json');
+
+// Helper function to get the main config file path
+async function getMainConfigPath(): Promise<string | null> {
+ try {
+ await access(BOOTSTRAP_CONFIG_FILE);
+ const content = await readFile(BOOTSTRAP_CONFIG_FILE, 'utf-8');
+ const bootstrap = JSON.parse(content);
+ if (bootstrap.storeDirectory) {
+ return join(bootstrap.storeDirectory, 'config.json');
+ }
+ } catch (error) {
+ // Bootstrap file doesn't exist or invalid
+ }
+ return null;
+}
+
+/**
+ * Register all settings-related IPC handlers
+ */
+export function registerSettingsHandlers(): void {
+ // Save settings handler
+ ipcMain.handle('save-settings', async (_, settings: any) => {
+ try {
+ // If storeDirectory is being set, save it to bootstrap config
+ if (settings.storeDirectory) {
+ await writeFile(
+ BOOTSTRAP_CONFIG_FILE,
+ JSON.stringify({ storeDirectory: settings.storeDirectory }, null, 2),
+ 'utf-8'
+ );
+ }
+
+ // Get main config path
+ const mainConfigPath = await getMainConfigPath();
+ if (mainConfigPath) {
+ // Ensure the directory exists
+ const configDir = join(mainConfigPath, '..');
+ await mkdir(configDir, { recursive: true });
+
+ // Save all settings to main config file (excluding storeDirectory as it's in bootstrap)
+ const { storeDirectory, ...mainSettings } = settings;
+ await writeFile(mainConfigPath, JSON.stringify(mainSettings, null, 2), 'utf-8');
+ } else {
+ // If no storeDirectory set yet, save to bootstrap for now
+ await writeFile(
+ BOOTSTRAP_CONFIG_FILE,
+ JSON.stringify(settings, null, 2),
+ 'utf-8'
+ );
+ }
+
+ return { success: true };
+ } catch (error) {
+ const errorMessage = error instanceof Error ? error.message : String(error);
+ return { success: false, error: errorMessage };
+ }
+ });
+
+ // Load settings handler
+ ipcMain.handle('load-settings', async () => {
+ try {
+ let settings: any = {
+ openaiBaseUrl: 'https://api.openai.com/v1',
+ openaiApiKey: '',
+ processingModel: 'gpt-4o-mini',
+ analysisModel: 'gpt-4o-mini',
+ dashscopeApiKey: '',
+ captionModel: 'qwen-vl-plus-latest',
+ asrModel: 'paraformer-realtime-v2',
+ storeDirectory: '',
+ pythonPath: '',
+ pythonInstalled: false,
+ pythonVersion: '',
+ selectedCondaEnvironment: '',
+ imagebindInstalled: false,
+ };
+
+ // Try to load bootstrap config first
+ try {
+ await access(BOOTSTRAP_CONFIG_FILE);
+ const bootstrapContent = await readFile(BOOTSTRAP_CONFIG_FILE, 'utf-8');
+ const bootstrap = JSON.parse(bootstrapContent);
+ settings = { ...settings, ...bootstrap };
+ } catch (error) {
+ // Bootstrap doesn't exist, use defaults
+ }
+
+ // Try to load main config if storeDirectory exists
+ const mainConfigPath = await getMainConfigPath();
+ if (mainConfigPath) {
+ try {
+ await access(mainConfigPath);
+ const mainContent = await readFile(mainConfigPath, 'utf-8');
+ const mainSettings = JSON.parse(mainContent);
+ settings = { ...settings, ...mainSettings };
+ } catch (error) {
+ // Main config doesn't exist yet, use current settings
+ }
+ }
+
+ return { success: true, settings };
+ } catch (error) {
+ // Return default settings on error
+ return {
+ success: true,
+ settings: {
+ openaiBaseUrl: 'https://api.openai.com/v1',
+ openaiApiKey: '',
+ processingModel: 'gpt-4o-mini',
+ analysisModel: 'gpt-4o-mini',
+ dashscopeApiKey: '',
+ captionModel: 'qwen-vl-plus-latest',
+ asrModel: 'paraformer-realtime-v2',
+ storeDirectory: '',
+ pythonPath: '',
+ pythonInstalled: false,
+ pythonVersion: '',
+ selectedCondaEnvironment: '',
+ imagebindInstalled: false,
+ },
+ };
+ }
+ });
+
+ // Test API Key handler
+ ipcMain.handle('test-api-key', async (_, apiKey: string) => {
+ try {
+ if (!apiKey || !apiKey.startsWith('sk-')) {
+ return { success: false, error: 'Invalid API key format' };
+ }
+
+ // Here you can add actual API testing logic
+ // For example, call OpenAI API for verification
+
+ // Simulate API test for now
+ return { success: true };
+ } catch (error) {
+ return { success: false, error: (error as Error).message };
+ }
+ });
+}
+
+/**
+ * Get the configuration file path
+ * @returns string path to config file (returns bootstrap path if main config not available)
+ */
+export async function getConfigFilePath(): Promise<string> {
+ const mainConfigPath = await getMainConfigPath();
+ return mainConfigPath || BOOTSTRAP_CONFIG_FILE;
+}
+
+/**
+ * Get the bootstrap configuration file path (for backward compatibility)
+ * @returns string path to bootstrap config file
+ */
+export function getBootstrapConfigFilePath(): string {
+ return BOOTSTRAP_CONFIG_FILE;
+}
\ No newline at end of file
diff --git a/Vimo-desktop/src/main/handlers/videorag-handlers.ts b/Vimo-desktop/src/main/handlers/videorag-handlers.ts
new file mode 100644
index 0000000..4b1878c
--- /dev/null
+++ b/Vimo-desktop/src/main/handlers/videorag-handlers.ts
@@ -0,0 +1,754 @@
+import { ipcMain } from 'electron'
+import axios from 'axios'
+import { ChildProcess, spawn } from 'child_process'
+import path from 'path'
+import fs from 'fs'
+
+let VIDEORAG_API_BASE_URL = 'http://localhost:64451/api'
+
+// Update API base URL
+function updateAPIBaseURL(port: number) {
+ VIDEORAG_API_BASE_URL = `http://localhost:${port}/api`
+ console.log(`📡 Updated API base URL to: ${VIDEORAG_API_BASE_URL}`)
+}
+
+// Python backend process management
+let pythonProcess: ChildProcess | null = null
+
+// Port configuration
+const PORT_RANGE_START = 64451
+const PORT_RANGE_END = 64470
+
+// Efficiently scan port range to find VideoRAG service
+async function scanForVideoRAGService(startPort?: number, endPort?: number): Promise<number | null> {
+ const start = startPort || PORT_RANGE_START
+ const end = endPort || PORT_RANGE_END
+
+ console.log(`🔍 Scanning for VideoRAG service on ports ${start}-${end}...`)
+
+ for (let port = start; port <= end; port++) {
+ try {
+ const isHealthy = await attemptHealthCheck(port)
+ if (isHealthy) {
+ console.log(`🎯 Found healthy VideoRAG service on port ${port}`)
+ return port
+ }
+ } catch (error) {
+ // Continue checking next port
+ continue
+ }
+ }
+
+ console.log(`❌ No VideoRAG service found in port range ${start}-${end}`)
+ return null
+}
+
+// Start Python backend service
+export function startVideoRAGService(): Promise<boolean> {
+ return new Promise(async (resolve, reject) => {
+ try {
+ // Check if we're in development environment
+ const isDev = process.env.NODE_ENV === 'development'
+
+ // Prevent multiple resolve/reject
+ let resolved = false
+ const safeResolve = (value: boolean) => {
+ if (!resolved) {
+ resolved = true
+ resolve(value)
+ }
+ }
+ const safeReject = (error: Error) => {
+ if (!resolved) {
+ resolved = true
+ reject(error)
+ }
+ }
+
+ if (isDev) {
+ // Development mode: skip starting backend, but still scan for existing service
+ console.log('🚀 Development mode detected - skipping backend service startup')
+ console.log('💡 In development, scanning for manually started Python backend...')
+ } else {
+ // Production mode: start the packaged executable
+ console.log('🚀 Production mode - starting packaged backend service')
+
+ // Determine executable path for production
+ const executableName = process.platform === 'win32' ? 'videorag_api.exe' : 'videorag_api'
+ const executablePath = path.join(process.resourcesPath, 'python_backend', 'dist', 'videorag_api', executableName)
+
+ // Check if executable exists
+ if (!fs.existsSync(executablePath)) {
+ console.error(`❌ Packaged executable not found at: ${executablePath}`)
+ safeReject(new Error(`VideoRAG executable not found at: ${executablePath}`))
+ return
+ }
+
+ console.log(`✅ Found packaged executable: ${executablePath}`)
+
+ // Start packaged executable
+ try {
+ console.log(`🚀 Starting VideoRAG service with packaged executable: ${executablePath}`)
+
+ pythonProcess = spawn(executablePath, [], {
+ stdio: ['pipe', 'pipe', 'pipe'],
+ cwd: path.dirname(executablePath),
+ env: { ...process.env },
+ })
+
+ pythonProcess.stdout?.on('data', (data) => {
+ const output = data.toString()
+ console.log(`VideoRAG API: ${output}`)
+ })
+
+ pythonProcess.stderr?.on('data', (data) => {
+ const errorStr = data.toString()
+ console.error(`VideoRAG API Error: ${errorStr}`)
+ })
+
+ console.log(`✅ Successfully started packaged executable`)
+
+ } catch (error) {
+ console.error(`❌ Failed to start packaged executable:`, error)
+ safeReject(new Error(`Failed to start packaged executable: ${error}`))
+ return
+ }
+
+ if (!pythonProcess) {
+ safeReject(new Error('Failed to start packaged executable. Please ensure the executable was built correctly.'))
+ return
+ }
+
+ pythonProcess.on('close', (code) => {
+ console.log(`VideoRAG API process exited with code ${code}`)
+ pythonProcess = null
+ if (!resolved) {
+ safeReject(new Error(`VideoRAG process exited with code ${code}`))
+ }
+ })
+
+ pythonProcess.on('error', (error) => {
+ console.error(`Python process error:`, error)
+ if (!resolved) {
+ safeReject(error)
+ }
+ })
+ }
+
+ // Smart timeout handling - continuous scanning
+ setTimeout(async () => {
+ if (!resolved) {
+ console.log('⏳ Initial timeout reached, starting continuous service detection...')
+
+ let scanAttempts = 0
+ const maxScanAttempts = 1000000 // Maximum scan attempts
+ const scanInterval = 3000 // Scan every 3 seconds
+
+ const continuousScan = async () => {
+ scanAttempts++
+ console.log(`🔍 Scanning attempt ${scanAttempts}/${maxScanAttempts}...`)
+
+ const foundPort = await scanForVideoRAGService(PORT_RANGE_START, PORT_RANGE_END)
+ if (foundPort) {
+ console.log(`✅ Found service on port ${foundPort} after ${scanAttempts} attempts!`)
+ updateAPIBaseURL(foundPort)
+ initializeVideoRAGConfig()
+ .then(() => safeResolve(true))
+ .catch(() => {
+ console.error('Configuration initialization failed, but service is running')
+ safeResolve(true) // Service started, even if configuration fails
+ })
+ return
+ }
+
+ // If not reached maximum attempts, continue scanning
+ if (scanAttempts < maxScanAttempts) {
+ console.log(`❌ Service not found, retrying in ${scanInterval/1000} seconds... (${scanAttempts}/${maxScanAttempts})`)
+ setTimeout(continuousScan, scanInterval)
+ } else {
+ console.error(`❌ Failed to locate VideoRAG service after ${maxScanAttempts} scan attempts`)
+ safeReject(new Error(`Failed to locate VideoRAG service after ${maxScanAttempts} scan attempts over ${(maxScanAttempts * scanInterval / 1000)} seconds`))
+ }
+ }
+
+ // Start first scan
+ continuousScan()
+ }
+ }, 10000) // Start scanning after 10 seconds
+
+ } catch (error) {
+ reject(error)
+ }
+ })
+}
+
+// Stop Python backend service
+export function stopVideoRAGService() {
+ if (pythonProcess && !pythonProcess.killed) {
+ pythonProcess.kill()
+ pythonProcess = null
+ }
+}
+
+// API call helper function - supports asynchronous operations
+async function callVideoRAGAPI(endpoint: string, method: 'GET' | 'POST' | 'DELETE' = 'GET', data?: any, customTimeout?: number) {
+ // Set different timeouts for different operations
+ let timeout = customTimeout || 30000; // Default 30 seconds
+
+ // Asynchronous operation: return quickly, do not wait for completion
+ if (endpoint.includes('/upload')) {
+ timeout = customTimeout || 60000; // Video upload operation: 60 seconds
+ } else if (endpoint.includes('/initialize')) {
+ timeout = customTimeout || 120000; // Initialization still needs to wait: 2 minutes
+ } else if (endpoint.includes('/status')) {
+ timeout = customTimeout || 10000; // Status query: 10 seconds
+ } else if (endpoint.includes('/imagebind/load') || endpoint.includes('/imagebind/release')) {
+ timeout = customTimeout || 180000; // ImageBind model load/release: 3 minutes
+ } else if (endpoint.includes('/imagebind/status')) {
+ timeout = customTimeout || 10000; // ImageBind status query: 10 seconds
+ }
+
+ try {
+ console.log(`📡 API call: ${method} ${endpoint} (timeout: ${timeout}ms)`)
+ const response = await axios({
+ method,
+ url: `${VIDEORAG_API_BASE_URL}${endpoint}`,
+ data,
+ timeout
+ })
+ return response.data
+ } catch (error: any) {
+ console.error(`VideoRAG API call failed:`, error)
+ if (error.code === 'ECONNABORTED') {
+ throw new Error(`Request timeout after ${timeout}ms. The operation might need more time to complete.`)
+ }
+ throw new Error(error.response?.data?.error || error.message || 'API call failed')
+ }
+}
+
+// Modify: automatically initialize VideoRAG configuration, dynamically build ImageBind path
+async function initializeVideoRAGConfig(): Promise<void> {
+ try {
+ console.log('🔧 Loading VideoRAG configuration...')
+
+ // 1. Load basic configuration from settings
+ const settingsResult = await loadSettingsFromFile()
+ if (!settingsResult.success) {
+ throw new Error('Failed to load settings')
+ }
+
+ const settings = settingsResult.settings
+ console.log('🔧 Loaded settings:', {
+ ...settings,
+ // Hide sensitive information
+ openaiApiKey: settings.openaiApiKey ? '***' : 'NOT_SET',
+ dashscopeApiKey: settings.dashscopeApiKey ? '***' : 'NOT_SET'
+ })
+
+ // 2. Dynamically build ImageBind model path
+ let imagebindModelPath = ''
+ if (settings.storeDirectory) {
+ imagebindModelPath = require('path').join(settings.storeDirectory, 'imagebind_huge', 'imagebind_huge.pth')
+ console.log('🔧 Constructed ImageBind path:', imagebindModelPath)
+ }
+
+ // 3. Build VideoRAG configuration object (only set default values for allowed fields)
+ const videoragConfig = {
+ // Required fields - no default values
+ ali_dashscope_api_key: settings.dashscopeApiKey,
+ openai_api_key: settings.openaiApiKey,
+ image_bind_model_path: imagebindModelPath, // Use dynamically built path
+ base_storage_path: settings.storeDirectory,
+
+ // Fields with default values
+ ali_dashscope_base_url: settings.dashscopeBaseUrl || 'https://dashscope.aliyuncs.com/compatible-mode/v1',
+ openai_base_url: settings.openaiBaseUrl || 'https://api.openai.com/v1',
+ analysisModel: settings.analysisModel || 'gpt-4o-mini',
+ processingModel: settings.processingModel || 'gpt-4o-mini',
+ caption_model: settings.captionModel || 'qwen-vl-plus-latest',
+ asr_model: settings.asrModel || 'paraformer-realtime-v2'
+ }
+
+ console.log('🔧 VideoRAG configuration validation:', {
+ ali_dashscope_api_key: videoragConfig.ali_dashscope_api_key ? '✅ SET' : '❌ MISSING',
+ ali_dashscope_base_url: '✅ SET (default allowed)',
+ openai_api_key: videoragConfig.openai_api_key ? '✅ SET' : '❌ MISSING',
+ openai_base_url: '✅ SET (default allowed)',
+ image_bind_model_path: videoragConfig.image_bind_model_path ? '✅ SET' : '❌ MISSING',
+ base_storage_path: videoragConfig.base_storage_path ? '✅ SET' : '❌ MISSING',
+ analysisModel: '✅ SET (default allowed)',
+ processingModel: '✅ SET (default allowed)',
+ caption_model: '✅ SET (default allowed)',
+ asr_model: '✅ SET (default allowed)'
+ })
+
+ // 4. Validate required fields
+ const missingFields: string[] = []
+
+ if (!videoragConfig.ali_dashscope_api_key || videoragConfig.ali_dashscope_api_key.trim() === '') {
+ missingFields.push('Ali Dashscope API Key (dashscopeApiKey)')
+ }
+
+ if (!videoragConfig.openai_api_key || videoragConfig.openai_api_key.trim() === '') {
+ missingFields.push('OpenAI API Key (openaiApiKey)')
+ }
+
+ if (!videoragConfig.base_storage_path || videoragConfig.base_storage_path.trim() === '') {
+ missingFields.push('Base Storage Path (storeDirectory)')
+ }
+
+ if (!videoragConfig.image_bind_model_path || videoragConfig.image_bind_model_path.trim() === '') {
+ missingFields.push('ImageBind Model Path (storeDirectory + imagebind_huge/imagebind_huge.pth)')
+ }
+
+ // 5. If there are missing fields, throw an error and stop the service
+ if (missingFields.length > 0) {
+ const errorMessage = `❌ VideoRAG configuration validation failed!\n\nMissing required fields:\n${missingFields.map(field => ` • ${field}`).join('\n')}\n\nPlease run the initialization wizard to configure these settings.`
+
+ console.error(errorMessage)
+
+ // Stop VideoRAG service
+ console.log('🛑 Stopping VideoRAG service due to configuration errors...')
+ stopVideoRAGService()
+
+ throw new Error(`Missing required configuration fields: ${missingFields.join(', ')}`)
+ }
+
+ // 6. Validate ImageBind model file exists
+ try {
+ const { access } = await import('node:fs/promises')
+ await access(videoragConfig.image_bind_model_path)
+ console.log('✅ ImageBind model file verified:', videoragConfig.image_bind_model_path)
+ } catch (error) {
+ const errorMessage = `❌ ImageBind model file not found: ${videoragConfig.image_bind_model_path}\n\nThe file should be downloaded during initialization wizard.\nPlease run the initialization wizard to download the ImageBind model.`
+
+ console.error(errorMessage)
+
+ // Stop VideoRAG service
+ console.log('🛑 Stopping VideoRAG service due to missing model file...')
+ stopVideoRAGService()
+
+ throw new Error(`ImageBind model file not found: ${videoragConfig.image_bind_model_path}`)
+ }
+
+ // 7. Validate storage directory is accessible/creatable
+ try {
+ const { access, mkdir } = await import('node:fs/promises')
+ try {
+ await access(videoragConfig.base_storage_path)
+ console.log('✅ Storage directory verified:', videoragConfig.base_storage_path)
+ } catch (error) {
+ // Directory not found, attempt to create
+ console.log('📁 Storage directory not found, attempting to create:', videoragConfig.base_storage_path)
+ await mkdir(videoragConfig.base_storage_path, { recursive: true })
+ console.log('✅ Storage directory created successfully:', videoragConfig.base_storage_path)
+ }
+ } catch (error) {
+ const errorMessage = `❌ Cannot access or create storage directory: ${videoragConfig.base_storage_path}\n\nPlease ensure the path is valid and you have write permissions.`
+
+ console.error(errorMessage)
+
+ // Stop VideoRAG service
+ console.log('🛑 Stopping VideoRAG service due to storage directory error...')
+ stopVideoRAGService()
+
+ throw new Error(`Storage directory error: ${videoragConfig.base_storage_path}`)
+ }
+
+ console.log('🔧 All required configuration validated successfully:', {
+ ...videoragConfig,
+ // Hide sensitive information for logging
+ ali_dashscope_api_key: '***',
+ openai_api_key: '***'
+ })
+
+ // 8. Call VideoRAG API for initialization
+ const result = await callVideoRAGAPI('/initialize', 'POST', videoragConfig)
+
+ if (result.success) {
+ console.log('✅ VideoRAG global configuration set successfully!')
+ } else {
+ console.error('❌ VideoRAG API initialization failed:', result.error)
+
+ // Stop VideoRAG service
+ console.log('🛑 Stopping VideoRAG service due to API initialization failure...')
+ stopVideoRAGService()
+
+ throw new Error(`VideoRAG initialization failed: ${result.error}`)
+ }
+
+ } catch (error) {
+ console.error('❌ VideoRAG configuration initialization failed:', error)
+ throw error
+ }
+}
+
+// Modify: load settings from file, remove hardcoded imagebind path
+async function loadSettingsFromFile(): Promise<{ success: boolean; settings?: any; error?: string }> {
+ try {
+ const { readFile, access } = await import('node:fs/promises')
+ const { join } = await import('node:path')
+ const { homedir } = await import('node:os')
+
+ const BOOTSTRAP_CONFIG_FILE = join(homedir(), '.videorag-bootstrap.json')
+
+ let settings: any = {
+ // Only set default values for fields with allowed defaults
+ openaiBaseUrl: 'https://api.openai.com/v1',
+ dashscopeBaseUrl: 'https://dashscope.aliyuncs.com/compatible-mode/v1',
+ processingModel: 'gpt-4o-mini',
+ analysisModel: 'gpt-4o-mini',
+
+ // Required fields without default values
+ openaiApiKey: '',
+ dashscopeApiKey: '',
+ storeDirectory: '', // This determines the imagebind model path
+ // imagebindModelPath field removed, because it is dynamically built
+ }
+
+ // Try to load bootstrap configuration
+ try {
+ await access(BOOTSTRAP_CONFIG_FILE)
+ const bootstrapContent = await readFile(BOOTSTRAP_CONFIG_FILE, 'utf-8')
+ const bootstrap = JSON.parse(bootstrapContent)
+ settings = { ...settings, ...bootstrap }
+ console.log('📁 Loaded bootstrap config:', Object.keys(bootstrap))
+ } catch (error) {
+ // Bootstrap file not found, using defaults
+ console.log('📁 Bootstrap config not found, using defaults')
+ }
+
+ // Try to load main configuration file
+ if (settings.storeDirectory) {
+ try {
+ const mainConfigPath = join(settings.storeDirectory, 'config.json')
+ await access(mainConfigPath)
+ const mainContent = await readFile(mainConfigPath, 'utf-8')
+ const mainSettings = JSON.parse(mainContent)
+ settings = { ...settings, ...mainSettings }
+ console.log('📁 Loaded main config from:', mainConfigPath)
+ } catch (error) {
+ // Main config file not found, using current settings
+ console.log('📁 Main config not found, using bootstrap + defaults')
+ }
+ }
+
+ return { success: true, settings }
+ } catch (error: any) {
+ return { success: false, error: error.message }
+ }
+}
+
+// IPC handlers setup
+export function setupVideoRAGHandlers() {
+
+ // Manually start service
+ ipcMain.handle('videorag:start-service', async () => {
+ try {
+ const isDev = process.env.NODE_ENV === 'development'
+
+ // Production mode: check if already running first
+ if (!isDev && pythonProcess && !pythonProcess.killed) {
+ return { success: true, message: 'Service is already running' }
+ }
+
+ // Both dev and production: start service (dev will skip actual startup but scan for existing)
+ const result = await startVideoRAGService()
+
+ if (isDev) {
+ return {
+ success: result,
+ message: result
+ ? 'Found manually started backend service'
+ : 'No backend service found - please start it manually'
+ }
+ } else {
+ return {
+ success: result,
+ message: result ? 'Service started successfully' : 'Failed to start service'
+ }
+ }
+ } catch (error: any) {
+ return { success: false, error: error.message }
+ }
+ })
+
+ // Manually stop service
+ ipcMain.handle('videorag:stop-service', async () => {
+ try {
+ const isDev = process.env.NODE_ENV === 'development'
+
+ if (isDev) {
+ // Development mode: return mock response
+ return {
+ success: true,
+ message: 'Development mode - backend service not managed by Electron'
+ }
+ }
+
+ // Production mode: actually stop the service
+ stopVideoRAGService()
+ return { success: true, message: 'Service stopped successfully' }
+ } catch (error: any) {
+ return { success: false, error: error.message }
+ }
+ })
+
+ // Get service status
+ ipcMain.handle('videorag:service-status', async () => {
+ try {
+ const isDev = process.env.NODE_ENV === 'development'
+
+ if (isDev) {
+ // Development mode: return mock status
+ return {
+ success: true,
+ isRunning: false,
+ pythonProcess: 'development_mode',
+ message: 'Development mode - backend service not managed by Electron'
+ }
+ }
+
+ // Production mode: check actual process status
+ const isRunning = pythonProcess && !pythonProcess.killed
+ return { success: true, isRunning, pythonProcess: isRunning ? 'running' : 'stopped' }
+ } catch (error: any) {
+ return { success: false, error: error.message }
+ }
+ })
+
+ // Check API health status
+ ipcMain.handle('videorag:health-check', async () => {
+ try {
+ const result = await callVideoRAGAPI('/health')
+ return { success: true, data: result }
+ } catch (error: any) {
+ return { success: false, error: error.message }
+ }
+ })
+
+ // Set global configuration
+ ipcMain.handle('videorag:initialize', async (_, config) => {
+ try {
+ const result = await callVideoRAGAPI('/initialize', 'POST', config)
+ return { success: true, data: result }
+ } catch (error: any) {
+ return { success: false, error: error.message }
+ }
+ })
+
+
+
+ // Upload video for specific session and start indexing
+ ipcMain.handle('videorag:upload-video', async (_, chatId: string, videoPathList: string[], baseStoragePath: string) => {
+ try {
+ const result = await callVideoRAGAPI(`/sessions/${chatId}/videos/upload`, 'POST', {
+ video_path_list: videoPathList,
+ base_storage_path: baseStoragePath
+ })
+ return { success: true, data: result }
+ } catch (error: any) {
+ return { success: false, error: error.message }
+ }
+ })
+
+ // Get indexing status for specific session
+ ipcMain.handle('videorag:get-status', async (_, chatId: string, type?: string) => {
+ try {
+ const url = type ? `/sessions/${chatId}/status?type=${type}` : `/sessions/${chatId}/status`
+ const result = await callVideoRAGAPI(url)
+ return { success: true, data: result }
+ } catch (error: any) {
+ return { success: false, error: error.message }
+ }
+ })
+
+ // Get list of indexed videos for specific session
+ ipcMain.handle('videorag:list-indexed', async (_, chatId: string) => {
+ try {
+ const result = await callVideoRAGAPI(`/sessions/${chatId}/videos/indexed`)
+ return { success: true, data: result }
+ } catch (error: any) {
+ return { success: false, error: error.message }
+ }
+ })
+
+ // Get status for specific session
+ ipcMain.handle('videorag:session-status', async (_, chatId: string) => {
+ try {
+ const result = await callVideoRAGAPI(`/sessions/${chatId}/status`)
+ return { success: true, data: result }
+ } catch (error: any) {
+ return { success: false, error: error.message }
+ }
+ })
+
+ // Query video content for specific session (to be implemented)
+ ipcMain.handle('videorag:query', async (_, chatId: string, query: string, mode: string = 'videorag') => {
+ try {
+ const result = await callVideoRAGAPI(`/sessions/${chatId}/query`, 'POST', { query, mode })
+ return { success: true, data: result }
+ } catch (error: any) {
+ return { success: false, error: error.message }
+ }
+ })
+
+ // New: start query processing
+ ipcMain.handle('videorag:query-video', async (_, chatId: string, query: string) => {
+ try {
+ const result = await callVideoRAGAPI(`/sessions/${chatId}/query`, 'POST', { query })
+ return { success: true, data: result }
+ } catch (error: any) {
+ return { success: false, error: error.message }
+ }
+ })
+
+ // Get system status
+ ipcMain.handle('videorag:system-status', async () => {
+ try {
+ const result = await callVideoRAGAPI('/system/status')
+ return { success: true, data: result }
+ } catch (error: any) {
+ return { success: false, error: error.message }
+ }
+ })
+
+ // Get video duration
+ ipcMain.handle('videorag:get-video-duration', async (_, videoPath: string) => {
+ try {
+ console.log(`📄 Getting video duration for: ${videoPath}`)
+ // Video duration detection may take a long time, especially for large files
+ const result = await callVideoRAGAPI('/video/duration', 'POST', { video_path: videoPath }, 60000)
+ return { success: true, ...result }
+ } catch (error: any) {
+ console.error(`❌ Failed to get video duration for ${videoPath}:`, error.message)
+ return { success: false, error: error.message }
+ }
+ })
+
+ // New: handler to get localStorage configuration from renderer process
+ ipcMain.handle('videorag:get-localStorage-config', async () => {
+ try {
+ // This handler will be called by the renderer process, to get the configuration from localStorage
+ // Actual localStorage reading needs to be done in the renderer process
+ return { success: true, message: 'This handler should be called from renderer' }
+ } catch (error: any) {
+ return { success: false, error: error.message }
+ }
+ })
+
+ // New: manually reinitialize configuration
+ ipcMain.handle('videorag:reinitialize-config', async () => {
+ try {
+ await initializeVideoRAGConfig()
+ return { success: true, message: 'Configuration reinitialized successfully' }
+ } catch (error: any) {
+ return { success: false, error: error.message }
+ }
+ })
+
+ // Delete specific session and its resources
+ ipcMain.handle('videorag:delete-session', async (_, chatId: string) => {
+ try {
+ const result = await callVideoRAGAPI(`/sessions/${chatId}/delete`, 'DELETE')
+ return { success: true, data: result }
+ } catch (error: any) {
+ return { success: false, error: error.message }
+ }
+ })
+
+ // Load ImageBind model
+ ipcMain.handle('videorag:load-imagebind', async () => {
+ try {
+ const result = await callVideoRAGAPI('/imagebind/load', 'POST')
+ return { success: true, data: result }
+ } catch (error: any) {
+ return { success: false, error: error.message }
+ }
+ })
+
+ // Release ImageBind model
+ ipcMain.handle('videorag:release-imagebind', async () => {
+ try {
+ const result = await callVideoRAGAPI('/imagebind/release', 'POST')
+ return { success: true, data: result }
+ } catch (error: any) {
+ return { success: false, error: error.message }
+ }
+ })
+
+ // Get ImageBind status
+ ipcMain.handle('videorag:imagebind-status', async () => {
+ try {
+ const result = await callVideoRAGAPI('/imagebind/status', 'GET')
+ return { success: true, data: result }
+ } catch (error: any) {
+ return { success: false, error: error.message }
+ }
+ })
+
+ // Application restart
+ ipcMain.handle('app:restart', async () => {
+ try {
+ const { app } = await import('electron')
+ app.relaunch()
+ app.exit(0)
+ return { success: true }
+ } catch (error: any) {
+ return { success: false, error: error.message }
+ }
+ })
+
+ // Clean configuration file
+ ipcMain.handle('app:clear-config', async () => {
+ try {
+ const { unlink } = await import('node:fs/promises')
+ const { join } = await import('node:path')
+ const { homedir } = await import('node:os')
+
+ const BOOTSTRAP_CONFIG_FILE = join(homedir(), '.videorag-bootstrap.json')
+
+ try {
+ await unlink(BOOTSTRAP_CONFIG_FILE)
+ console.log('Bootstrap config file deleted successfully')
+ } catch (error) {
+ console.log('Bootstrap config file not found or already deleted')
+ }
+
+ return { success: true }
+ } catch (error: any) {
+ return { success: false, error: error.message }
+ }
+ })
+}
+
+// Single health check attempt
+async function attemptHealthCheck(port: number): Promise<boolean> {
+ try {
+ const response = await axios({
+ method: 'GET',
+ url: `http://localhost:${port}/api/health`,
+ timeout: 5000,
+ validateStatus: (status) => status === 200
+ })
+
+ // Validate response content
+ if (response.data && response.data.status === 'ok') {
+ console.log(`✅ Health check successful on port ${port}:`, response.data)
+ return true
+ } else {
+ console.log(`⚠️ Unexpected health check response:`, response.data)
+ return false
+ }
+
+ } catch (error: any) {
+ if (error.code === 'ECONNREFUSED') {
+ console.log(`🔍 Port ${port} not ready yet (connection refused)`)
+ } else if (error.code === 'ECONNRESET') {
+ console.log(`🔍 Port ${port} connection reset, service might be starting`)
+ } else {
+ console.log(`🔍 Health check failed on port ${port}:`, error.message)
+ }
+ return false
+ }
+}
\ No newline at end of file
diff --git a/Vimo-desktop/src/main/handlers/window.ts b/Vimo-desktop/src/main/handlers/window.ts
new file mode 100644
index 0000000..b5b872e
--- /dev/null
+++ b/Vimo-desktop/src/main/handlers/window.ts
@@ -0,0 +1,36 @@
+import { BrowserWindow } from 'electron';
+import { join } from 'node:path';
+
+/**
+ * Create the main application window
+ * @returns BrowserWindow instance
+ */
+export function createMainWindow(): BrowserWindow {
+ const mainWindow = new BrowserWindow({
+ width: 1200,
+ height: 800,
+ show: false,
+ autoHideMenuBar: true,
+ titleBarStyle: 'hiddenInset',
+ webPreferences: {
+ preload: join(__dirname, '../preload/index.js'),
+ sandbox: false,
+ nodeIntegration: false,
+ contextIsolation: true,
+ },
+ });
+
+ mainWindow.on('ready-to-show', () => {
+ mainWindow.show();
+ });
+
+ // Load development server in dev mode, load bundled files in production
+ if (process.env.NODE_ENV === 'development') {
+ mainWindow.loadURL('http://localhost:5173');
+ // mainWindow.webContents.openDevTools(); // Comment out automatic dev tools opening
+ } else {
+ mainWindow.loadFile(join(__dirname, '../renderer/index.html'));
+ }
+
+ return mainWindow;
+}
\ No newline at end of file
diff --git a/Vimo-desktop/src/main/main.ts b/Vimo-desktop/src/main/main.ts
new file mode 100644
index 0000000..fe7581b
--- /dev/null
+++ b/Vimo-desktop/src/main/main.ts
@@ -0,0 +1,186 @@
+import { app, BrowserWindow } from 'electron';
+import { electronApp, optimizer } from '@electron-toolkit/utils';
+import { join } from 'node:path';
+import { ipcMain } from 'electron';
+import { createMainWindow } from './handlers/window'
+import { setupVideoRAGHandlers, stopVideoRAGService } from './handlers/videorag-handlers';
+import { registerFileHandlers } from './handlers/file-handlers';
+import { registerSettingsHandlers } from './handlers/settings';
+import { registerChatSessionHandlers } from './handlers/chat-session-handlers';
+
+
+// Create window when app is ready
+app.whenReady().then(() => {
+ electronApp.setAppUserModelId('com.videorag.app');
+
+ app.on('browser-window-created', (_, window) => {
+ optimizer.watchWindowShortcuts(window);
+ });
+
+ // Register all IPC handlers
+ registerFileHandlers();
+ registerSettingsHandlers();
+ registerChatSessionHandlers();
+ setupVideoRAGHandlers();
+ registerModelHandlers();
+
+ // VideoRAG API service is now started manually via UI button
+ // Users can start it after configuring their environment
+ console.log('VideoRAG API service will be started manually via UI');
+
+ createMainWindow();
+
+ app.on('activate', function () {
+ if (BrowserWindow.getAllWindows().length === 0) createMainWindow();
+ });
+});
+
+// Quit app when all windows are closed (except on macOS)
+app.on('window-all-closed', () => {
+ if (process.platform !== 'darwin') app.quit();
+});
+
+// Clean up VideoRAG service when app quits
+app.on('before-quit', () => {
+ stopVideoRAGService();
+});
+
+/**
+ * Register model-related IPC handlers
+ * Note: This is a simplified version. Full model download functionality
+ * has been moved to a separate module for better maintainability.
+ */
+function registerModelHandlers(): void {
+ // Check model files
+ ipcMain.handle('check-model-files', async (_, storeDirectory: string) => {
+ try {
+ const { access } = require('fs/promises');
+
+ const imagebindPath = join(storeDirectory, 'imagebind_huge', 'imagebind_huge.pth');
+
+ let imagebind = false;
+
+ try {
+ await access(imagebindPath);
+ imagebind = true;
+ } catch {}
+
+ return { imagebind };
+ } catch (error) {
+ return { imagebind: false };
+ }
+ });
+
+ // Download ImageBind model
+ ipcMain.handle('download-imagebind', async (event, storeDirectory: string) => {
+ try {
+ const https = require('https');
+ const { createWriteStream, mkdirSync, existsSync } = require('fs');
+ const { access } = require('fs/promises');
+
+ // Create directory if it doesn't exist
+ if (!existsSync(storeDirectory)) {
+ mkdirSync(storeDirectory, { recursive: true });
+ }
+
+ // Create imagebind_huge directory
+ const imagebindDir = join(storeDirectory, 'imagebind_huge');
+ if (!existsSync(imagebindDir)) {
+ mkdirSync(imagebindDir, { recursive: true });
+ }
+
+ const imagebindPath = join(imagebindDir, 'imagebind_huge.pth');
+
+ // Check if file already exists
+ try {
+ await access(imagebindPath);
+ return { success: true, message: 'ImageBind model already exists' };
+ } catch {
+ // File doesn't exist, proceed with download
+ }
+
+ const url = 'https://dl.fbaipublicfiles.com/imagebind/imagebind_huge.pth';
+
+ return new Promise((resolve) => {
+ const file = createWriteStream(imagebindPath);
+ let downloadedBytes = 0;
+ let totalBytes = 0;
+
+ const request = https.get(url, (response) => {
+ if (response.statusCode !== 200) {
+ // Delete the entire imagebind_huge directory on HTTP error
+ const { rmSync } = require('fs');
+ try {
+ rmSync(imagebindDir, { recursive: true, force: true });
+ } catch (cleanupError) {
+ console.error('Failed to cleanup imagebind directory:', cleanupError);
+ }
+ resolve({ success: false, error: `HTTP ${response.statusCode}: ${response.statusMessage}` });
+ return;
+ }
+
+ totalBytes = parseInt(response.headers['content-length'] || '0', 10);
+
+ response.on('data', (chunk) => {
+ downloadedBytes += chunk.length;
+ if (totalBytes > 0) {
+ const progress = Math.round((downloadedBytes / totalBytes) * 100);
+ event.sender.send('download-progress', {
+ type: 'imagebind',
+ progress,
+ downloaded: downloadedBytes,
+ total: totalBytes
+ });
+ }
+ });
+
+ response.pipe(file);
+
+ file.on('finish', () => {
+ file.close();
+ resolve({ success: true, message: 'ImageBind download completed' });
+ });
+
+ file.on('error', (err) => {
+ file.close();
+ // Delete the entire imagebind_huge directory on error
+ const { rmSync } = require('fs');
+ try {
+ rmSync(imagebindDir, { recursive: true, force: true });
+ } catch (cleanupError) {
+ console.error('Failed to cleanup imagebind directory:', cleanupError);
+ }
+ resolve({ success: false, error: err.message });
+ });
+ });
+
+ request.on('error', (err) => {
+ // Delete the entire imagebind_huge directory on error
+ const { rmSync } = require('fs');
+ try {
+ rmSync(imagebindDir, { recursive: true, force: true });
+ } catch (cleanupError) {
+ console.error('Failed to cleanup imagebind directory:', cleanupError);
+ }
+ resolve({ success: false, error: err.message });
+ });
+
+ request.setTimeout(300000, () => { // 5 minute timeout
+ request.destroy();
+ // Delete the entire imagebind_huge directory on timeout
+ const { rmSync } = require('fs');
+ try {
+ rmSync(imagebindDir, { recursive: true, force: true });
+ } catch (cleanupError) {
+ console.error('Failed to cleanup imagebind directory:', cleanupError);
+ }
+ resolve({ success: false, error: 'Download timeout' });
+ });
+ });
+
+ } catch (error) {
+ const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
+ return { success: false, error: errorMessage };
+ }
+ });
+}
diff --git a/Vimo-desktop/src/preload/index.ts b/Vimo-desktop/src/preload/index.ts
new file mode 100644
index 0000000..e693c6f
--- /dev/null
+++ b/Vimo-desktop/src/preload/index.ts
@@ -0,0 +1,227 @@
+import { contextBridge, ipcRenderer } from 'electron';
+import { electronAPI } from '@electron-toolkit/preload';
+
+// Define API types
+export interface VideoRAGAPI {
+ echoMessage: (message: string) => Promise<string>;
+ readFile: () => Promise<{
+ success: boolean;
+ content?: string;
+ path?: string;
+ error?: string;
+ }>;
+ saveFile: (
+ content: string,
+ ) => Promise<{ success: boolean; path?: string; error?: string }>;
+ selectFolder: () => Promise<{
+ success: boolean;
+ path?: string;
+ error?: string;
+ }>;
+ selectVideoFiles: () => Promise<{
+ success: boolean;
+ files?: Array<{ name: string; path: string; size: number }>;
+ error?: string;
+ }>;
+
+ saveSettings: (
+ settings: any,
+ ) => Promise<{ success: boolean; error?: string }>;
+ loadSettings: () => Promise<{
+ success: boolean;
+ settings?: any;
+ error?: string;
+ }>;
+ testApiKey: (apiKey: string) => Promise<{ success: boolean; error?: string }>;
+ processWithVideoRAG: (inputText: string, apiKey?: string) => Promise<{
+ success: boolean;
+ data?: any;
+ error?: string;
+ details?: string;
+ pythonCommand?: string;
+ }>;
+ testPythonBackend: () => Promise<{
+ success: boolean;
+ data?: any;
+ error?: string;
+ details?: string;
+ message?: string;
+ }>;
+ // VideoRAG environment management
+ installVideoragEnvironment: (tempDir: string) => Promise<{
+ success: boolean;
+ installation_info?: any;
+ error?: string;
+ details?: string;
+ }>;
+ getInstallationProgress: (tempDir: string) => Promise<{
+ stage: string;
+ percentage: number;
+ message: string;
+ }>;
+ checkVideoragEnvironment: () => Promise<{
+ installed: boolean;
+ config?: any;
+ message?: string;
+ }>;
+ processWithVideoragEnv: (query: string, videoPath?: string) => Promise<{
+ success: boolean;
+ data?: any;
+ environment?: string;
+ error?: string;
+ details?: string;
+ }>;
+ // Model file checking and downloading
+ checkModelFiles: (storeDirectory: string) => Promise<{
+ imagebind: boolean;
+ }>;
+ downloadImageBind: (storeDirectory: string) => Promise<{
+ success: boolean;
+ error?: string;
+ }>;
+
+ // Event listeners
+ onDownloadProgress: (callback: (event: any, data: { type: string, progress: number, downloaded?: number, total?: number }) => void) => void;
+ onDownloadError: (callback: (event: any, data: { type: string, error: string }) => void) => void;
+ removeDownloadListeners: () => void;
+
+
+ // Chat Session Management API (File System Based)
+ chatSessions: {
+ load: (chatId: string) => Promise<{ success: boolean; session?: any; error?: string }>;
+ save: (chatId: string, sessionData: any) => Promise<{ success: boolean; error?: string }>;
+ list: () => Promise<{ success: boolean; sessions?: any[]; error?: string }>;
+ delete: (chatId: string) => Promise<{ success: boolean; error?: string }>;
+ getStorageInfo: () => Promise<{ success: boolean; storeDirectory?: string; isConfigured?: boolean; error?: string }>;
+ ensureStorageDirectory: () => Promise<{ success: boolean; error?: string }>;
+ updateSessionOrder: (sessionIds: string[], operation?: 'create' | 'delete' | 'reorder') => Promise<{ success: boolean; error?: string }>;
+ };
+
+ // VideoRAG Service Control API
+ videorag: {
+ healthCheck: () => Promise<{ success: boolean; data?: any; error?: string }>;
+ initialize: (config: any) => Promise<{ success: boolean; data?: any; error?: string }>;
+ uploadVideo: (chatId: string, videoPathList: string[], baseStoragePath: string) => Promise<{ success: boolean; data?: any; error?: string }>;
+ getStatus: (chatId: string, type?: string) => Promise<{ success: boolean; data?: any; error?: string }>;
+ listIndexed: (chatId: string) => Promise<{ success: boolean; data?: any; error?: string }>;
+ sessionStatus: (chatId: string) => Promise<{ success: boolean; data?: any; error?: string }>;
+ query: (chatId: string, query: string, mode?: string) => Promise<{ success: boolean; data?: any; error?: string }>;
+ queryVideo: (chatId: string, query: string) => Promise<{ success: boolean; data?: any; error?: string }>;
+ systemStatus: () => Promise<{ success: boolean; data?: any; error?: string }>;
+ getVideoDuration: (videoPath: string) => Promise<{ success: boolean; duration?: number; fps?: number; width?: number; height?: number; error?: string }>;
+ deleteSession: (chatId: string) => Promise<{ success: boolean; data?: any; error?: string }>;
+ // Service control
+ startService: () => Promise<{ success: boolean; message?: string; error?: string }>;
+ stopService: () => Promise<{ success: boolean; message?: string; error?: string }>;
+ serviceStatus: () => Promise<{ success: boolean; isRunning?: boolean; message?: string; error?: string }>;
+ loadImageBind: () => Promise<{ success: boolean; data?: any; error?: string }>;
+ releaseImageBind: () => Promise<{ success: boolean; data?: any; error?: string }>;
+ imagebindStatus: () => Promise<{ success: boolean; data?: any; error?: string }>;
+ reinitializeConfig: () => Promise<{ success: boolean; message?: string; error?: string }>;
+ };
+
+ // App control
+ app: {
+ restart: () => Promise<{ success: boolean; error?: string }>;
+ clearConfig: () => Promise<{ success: boolean; error?: string }>;
+ };
+}
+
+// Custom API
+const api: VideoRAGAPI = {
+ echoMessage: (message: string) => ipcRenderer.invoke('echo-message', message),
+ readFile: () => ipcRenderer.invoke('read-file'),
+ saveFile: (content: string) => ipcRenderer.invoke('save-file', content),
+ selectFolder: () => ipcRenderer.invoke('select-folder'),
+ selectVideoFiles: () => ipcRenderer.invoke('select-video-files'),
+
+ saveSettings: (settings: any) =>
+ ipcRenderer.invoke('save-settings', settings),
+ loadSettings: () => ipcRenderer.invoke('load-settings'),
+ testApiKey: (apiKey: string) => ipcRenderer.invoke('test-api-key', apiKey),
+ processWithVideoRAG: (inputText: string, apiKey?: string) =>
+ ipcRenderer.invoke('process-with-videorag', inputText, apiKey),
+ testPythonBackend: () => ipcRenderer.invoke('test-python-backend'),
+ // VideoRAG environment management
+ installVideoragEnvironment: (tempDir: string) =>
+ ipcRenderer.invoke('install-videorag-environment', tempDir),
+ getInstallationProgress: (tempDir: string) =>
+ ipcRenderer.invoke('get-installation-progress', tempDir),
+ checkVideoragEnvironment: () =>
+ ipcRenderer.invoke('check-videorag-environment'),
+ processWithVideoragEnv: (query: string, videoPath?: string) =>
+ ipcRenderer.invoke('process-with-videorag-env', query, videoPath),
+ // Model file checking and downloading
+ checkModelFiles: (storeDirectory: string) =>
+ ipcRenderer.invoke('check-model-files', storeDirectory),
+ downloadImageBind: (storeDirectory: string) =>
+ ipcRenderer.invoke('download-imagebind', storeDirectory),
+
+ // Event listener implementations
+ onDownloadProgress: (callback: (event: any, data: { type: string, progress: number, downloaded?: number, total?: number }) => void) => {
+ ipcRenderer.on('download-progress', callback);
+ },
+ onDownloadError: (callback: (event: any, data: { type: string, error: string }) => void) => {
+ ipcRenderer.on('download-error', callback);
+ },
+ removeDownloadListeners: () => {
+ ipcRenderer.removeAllListeners('download-progress');
+ ipcRenderer.removeAllListeners('download-error');
+ },
+
+
+ // Chat Session Management API implementation
+ chatSessions: {
+ load: (chatId: string) => ipcRenderer.invoke('load-chat-session', chatId),
+ save: (chatId: string, sessionData: any) => ipcRenderer.invoke('save-chat-session', chatId, sessionData),
+ list: () => ipcRenderer.invoke('list-chat-sessions'),
+ delete: (chatId: string) => ipcRenderer.invoke('delete-chat-session', chatId),
+ getStorageInfo: () => ipcRenderer.invoke('get-storage-info'),
+ ensureStorageDirectory: () => ipcRenderer.invoke('ensure-storage-directory'),
+ updateSessionOrder: (sessionIds: string[], operation?: 'create' | 'delete' | 'reorder') => ipcRenderer.invoke('update-session-order', sessionIds, operation),
+ },
+
+ // VideoRAG Service Control API implementation
+ videorag: {
+ healthCheck: () => ipcRenderer.invoke('videorag:health-check'),
+ initialize: (config: any) => ipcRenderer.invoke('videorag:initialize', config),
+ uploadVideo: (chatId: string, videoPathList: string[], baseStoragePath: string) => ipcRenderer.invoke('videorag:upload-video', chatId, videoPathList, baseStoragePath),
+ getStatus: (chatId: string, type?: string) => ipcRenderer.invoke('videorag:get-status', chatId, type),
+ listIndexed: (chatId: string) => ipcRenderer.invoke('videorag:list-indexed', chatId),
+ sessionStatus: (chatId: string) => ipcRenderer.invoke('videorag:session-status', chatId),
+ query: (chatId: string, query: string, mode?: string) => ipcRenderer.invoke('videorag:query', chatId, query, mode),
+ queryVideo: (chatId: string, query: string) => ipcRenderer.invoke('videorag:query-video', chatId, query),
+ systemStatus: () => ipcRenderer.invoke('videorag:system-status'),
+ getVideoDuration: (videoPath: string) => ipcRenderer.invoke('videorag:get-video-duration', videoPath),
+ deleteSession: (chatId: string) => ipcRenderer.invoke('videorag:delete-session', chatId),
+ // Service control
+ startService: () => ipcRenderer.invoke('videorag:start-service'),
+ stopService: () => ipcRenderer.invoke('videorag:stop-service'),
+ serviceStatus: () => ipcRenderer.invoke('videorag:service-status'),
+ loadImageBind: () => ipcRenderer.invoke('videorag:load-imagebind'),
+ releaseImageBind: () => ipcRenderer.invoke('videorag:release-imagebind'),
+ imagebindStatus: () => ipcRenderer.invoke('videorag:imagebind-status'),
+ reinitializeConfig: () => ipcRenderer.invoke('videorag:reinitialize-config')
+ },
+
+ // App control
+ app: {
+ restart: () => ipcRenderer.invoke('app:restart'),
+ clearConfig: () => ipcRenderer.invoke('app:clear-config'),
+ },
+};
+
+// Use electronAPI in development environment, expose only necessary API in production
+if (process.contextIsolated) {
+ try {
+ contextBridge.exposeInMainWorld('electron', electronAPI);
+ contextBridge.exposeInMainWorld('api', api);
+ } catch (error) {
+ console.error(error);
+ }
+} else {
+ // @ts-ignore (define in dts)
+ window.electron = electronAPI;
+ // @ts-ignore (define in dts)
+ window.api = api;
+}
diff --git a/Vimo-desktop/src/renderer/index.html b/Vimo-desktop/src/renderer/index.html
new file mode 100644
index 0000000..0df0da8
--- /dev/null
+++ b/Vimo-desktop/src/renderer/index.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="UTF-8" />
+ <title>VideoRAG</title>
+ <meta
+ http-equiv="Content-Security-Policy"
+ content="default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline' 'https://fonts.googleapis.com'; font-src 'self' 'https://fonts.gstatic.com';"
+ />
+ <link rel="preconnect" href="https://fonts.googleapis.com">
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
+ <style>
+ body {
+ margin: 0;
+ font-family: 'Inter', 'Roboto', 'Noto Sans', 'Helvetica Neue', Arial, sans-serif;
+ background-color: #f5f5f5;
+ }
+
+ .loading {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ height: 100vh;
+ font-size: 18px;
+ color: #666;
+ }
+ </style>
+ </head>
+ <body>
+ <div id="root">
+ <div class="loading">Loading VideoRAG...</div>
+ </div>
+ <script type="module" src="./src/main.tsx"></script>
+ </body>
+</html>
\ No newline at end of file
diff --git a/Vimo-desktop/src/renderer/src/App.tsx b/Vimo-desktop/src/renderer/src/App.tsx
new file mode 100644
index 0000000..0bee629
--- /dev/null
+++ b/Vimo-desktop/src/renderer/src/App.tsx
@@ -0,0 +1,111 @@
+import { Route, HashRouter, Routes, Navigate } from 'react-router';
+import { lazy, Suspense, useState, useEffect } from 'react';
+import { Toaster } from 'sonner';
+
+import { MainLayout } from './layouts/MainLayout';
+import InitializationWizard from './components/InitializationWizard';
+import { ServiceProvider } from './contexts/ServiceContext';
+import { ChatSessionProvider } from './contexts/ChatSessionContext';
+import './styles/globals.css';
+
+const Chat = lazy(() => import('./pages/chat'));
+const Settings = lazy(() => import('./pages/settings'));
+
+function AppContent() {
+ const [isInitialized, setIsInitialized] = useState<boolean | null>(null);
+ const [isLoading, setIsLoading] = useState(true);
+
+ // Check initialization status
+ useEffect(() => {
+ const checkInitialization = async () => {
+ try {
+ // Load settings to check if initialization is complete
+ const result = await window.api.loadSettings();
+
+ if (result.success && result.settings) {
+ const { storeDirectory, imagebindInstalled } = result.settings;
+
+ // If store directory exists and models are marked as installed,
+ // further verify that model files actually exist
+ if (storeDirectory && imagebindInstalled) {
+ try {
+ const modelCheck = await window.api.checkModelFiles(storeDirectory);
+ setIsInitialized(modelCheck.imagebind);
+ } catch (error) {
+ console.warn('Failed to check model files:', error);
+ setIsInitialized(false);
+ }
+ } else {
+ setIsInitialized(false);
+ }
+ } else {
+ setIsInitialized(false);
+ }
+ } catch (error) {
+ console.error('Failed to check initialization:', error);
+ setIsInitialized(false);
+ } finally {
+ setIsLoading(false);
+ }
+ };
+
+ checkInitialization();
+ }, []);
+
+ const handleInitializationComplete = () => {
+ setIsInitialized(true);
+ };
+
+ // Show loading state
+ if (isLoading) {
+ return (
+ <div className="flex items-center justify-center min-h-screen bg-gray-50">
+ <div className="text-center">
+ <div className="animate-spin rounded-full h-12 w-12 border-b-2 border-purple-600 mx-auto mb-4"></div>
+ <p className="text-gray-600">Checking VideoRAG environment...</p>
+ </div>
+ </div>
+ );
+ }
+
+ // Show initialization wizard
+ if (isInitialized === false) {
+ return <InitializationWizard onComplete={handleInitializationComplete} />;
+ }
+
+ // Normal application interface
+ return (
+ <HashRouter>
+ <Suspense
+ fallback={
+ <div className="loading-container">
+ <div className="loading-spinner" />
+ </div>
+ }
+ >
+ <Routes>
+ <Route element={<MainLayout />}>
+ <Route path="/" element={<Navigate to="/chat/new" replace />} />
+ <Route path="/chat/:chatId" element={<Chat />} />
+ <Route path="/settings" element={<Settings />} />
+ </Route>
+ </Routes>
+ <Toaster
+ position="top-right"
+ offset={{ top: '48px' }}
+ mobileOffset={{ top: '48px' }}
+ />
+ </Suspense>
+ </HashRouter>
+ );
+}
+
+export default function App() {
+ return (
+ <ServiceProvider>
+ <ChatSessionProvider>
+ <AppContent />
+ </ChatSessionProvider>
+ </ServiceProvider>
+ );
+}
diff --git a/Vimo-desktop/src/renderer/src/assets/images/vimi-logo.png b/Vimo-desktop/src/renderer/src/assets/images/vimi-logo.png
new file mode 100644
index 0000000..3ab3bd2
Binary files /dev/null and b/Vimo-desktop/src/renderer/src/assets/images/vimi-logo.png differ
diff --git a/Vimo-desktop/src/renderer/src/components/InitializationWizard.tsx b/Vimo-desktop/src/renderer/src/components/InitializationWizard.tsx
new file mode 100644
index 0000000..dcc35fb
--- /dev/null
+++ b/Vimo-desktop/src/renderer/src/components/InitializationWizard.tsx
@@ -0,0 +1,692 @@
+import React, { useState, useEffect } from 'react';
+import { Button } from './ui/button';
+import {
+ FolderOpen,
+ Download,
+ CheckCircle,
+ RefreshCw,
+ Sparkles,
+ ArrowRight,
+ ArrowLeft,
+ Settings,
+ Brain,
+ Star,
+ ExternalLink,
+} from 'lucide-react';
+import vimoLogo from '../assets/images/vimi-logo.png';
+
+interface InitializationWizardProps {
+ onComplete: () => void;
+}
+
+const InitializationWizard: React.FC<InitializationWizardProps> = ({ onComplete }) => {
+ // Define steps configuration
+ const steps = [
+ { step: 1, icon: FolderOpen, label: 'Directory' },
+ { step: 2, icon: Download, label: 'Models' },
+ { step: 3, icon: Brain, label: 'API Keys' },
+ { step: 4, icon: Star, label: 'Complete' }
+ ];
+ const totalSteps = steps.length;
+
+ const [currentStep, setCurrentStep] = useState(1);
+ const [storeDirectory, setStoreDirectory] = useState('');
+ const [imagebindStatus, setImagebindStatus] = useState<'pending' | 'downloading' | 'completed' | 'error'>('pending');
+ const [downloadProgress, setDownloadProgress] = useState({ imagebind: 0 });
+ const [isInitializing, setIsInitializing] = useState(true);
+ const [isRefreshing, setIsRefreshing] = useState(false);
+
+ // API Key configuration status
+ const [apiKeySettings, setApiKeySettings] = useState({
+ openaiBaseUrl: 'https://api.openai.com/v1',
+ openaiApiKey: '',
+ processingModel: 'gpt-4o-mini',
+ analysisModel: 'gpt-4o-mini',
+ dashscopeApiKey: '',
+ captionModel: 'qwen-vl-plus-latest',
+ asrModel: 'paraformer-realtime-v2'
+ });
+
+
+ // Initialize component - check for existing settings and models
+ useEffect(() => {
+ const initializeComponent = async () => {
+ try {
+ // Load existing settings
+ const settingsResult = await window.api.loadSettings();
+
+ if (settingsResult.success && settingsResult.settings?.storeDirectory) {
+ const existingDirectory = settingsResult.settings.storeDirectory;
+ setStoreDirectory(existingDirectory);
+
+ // Check if models already exist in the stored directory
+ await checkModelFiles(existingDirectory);
+ }
+ } catch (error) {
+ console.error('Failed to initialize component:', error);
+ } finally {
+ setIsInitializing(false);
+ }
+ };
+
+ initializeComponent();
+ }, []);
+
+ // Listen for download progress events
+ useEffect(() => {
+ const handleDownloadProgress = (_, data: { type: string, progress: number, downloaded?: number, total?: number }) => {
+ console.log('Download progress:', data);
+ if (data.type === 'imagebind') {
+ setDownloadProgress(prev => ({ ...prev, imagebind: data.progress }));
+ }
+ };
+
+ // Add event listeners
+ window.api.onDownloadProgress(handleDownloadProgress);
+
+ // Cleanup function
+ return () => {
+ window.api.removeDownloadListeners();
+ };
+ }, []);
+
+ // Check if model files exist
+ const checkModelFiles = async (directory?: string) => {
+ const targetDirectory = directory || storeDirectory;
+ if (!targetDirectory) return { imagebind: false };
+
+ try {
+ const result = await window.api.checkModelFiles(targetDirectory);
+ console.log('Model check result:', result);
+
+ setImagebindStatus(result.imagebind ? 'completed' : 'pending');
+
+ // Update progress to 100% for completed models
+ if (result.imagebind) {
+ setDownloadProgress(prev => ({ ...prev, imagebind: 100 }));
+ }
+
+ return result;
+ } catch (error) {
+ console.error('Failed to check model files:', error);
+ return { imagebind: false };
+ }
+ };
+
+ // Select storage directory
+ const selectDirectory = async () => {
+ try {
+ const result = await window.api.selectFolder();
+ if (result.success && result.path) {
+ setStoreDirectory(result.path);
+ // Check if model files already exist in this directory
+ setTimeout(() => checkModelFiles(result.path), 500);
+ }
+ } catch (error) {
+ console.error('Failed to select directory:', error);
+ }
+ };
+
+ // Download ImageBind model
+ const downloadImageBind = async () => {
+ if (!storeDirectory) return;
+
+ setImagebindStatus('downloading');
+ setDownloadProgress(prev => ({ ...prev, imagebind: 0 }));
+
+ try {
+ console.log('Starting ImageBind download...');
+ const result = await window.api.downloadImageBind(storeDirectory);
+
+ if (result.success) {
+ setImagebindStatus('completed');
+ setDownloadProgress(prev => ({ ...prev, imagebind: 100 }));
+ console.log('ImageBind download completed successfully');
+ } else {
+ setImagebindStatus('error');
+ alert(`ImageBind download failed: ${result.error}`);
+ }
+ } catch (error) {
+ setImagebindStatus('error');
+ console.error('ImageBind download failed:', error);
+ alert(`ImageBind download error: ${error}`);
+ }
+ };
+
+ // Check if can proceed to next step
+ const canProceedToStep2 = storeDirectory !== '';
+ const canProceedToStep3 = imagebindStatus === 'completed';
+ // API keys are optional but recommended
+ const canProceedToStep4 = canProceedToStep3;
+
+ // Handle step transitions with animation
+ const goToStep = (step: number) => {
+ setCurrentStep(step);
+ };
+
+ // Refresh model status
+ const refreshModelsStatus = async () => {
+ if (!storeDirectory || isRefreshing) return;
+
+ setIsRefreshing(true);
+
+ try {
+ const result = await window.api.checkModelFiles(storeDirectory);
+ console.log('Refresh check result:', result);
+
+ setImagebindStatus(result.imagebind ? 'completed' : 'pending');
+
+ // Update progress for completed models
+ if (result.imagebind) {
+ setDownloadProgress(prev => ({ ...prev, imagebind: 100 }));
+ } else {
+ setDownloadProgress(prev => ({ ...prev, imagebind: 0 }));
+ }
+ } catch (error) {
+ console.error('Failed to refresh model status:', error);
+ } finally {
+ setIsRefreshing(false);
+ }
+ };
+
+ // Handle API key changes
+ const handleApiKeyChange = (field: string, value: string) => {
+ setApiKeySettings(prev => ({
+ ...prev,
+ [field]: value
+ }));
+ };
+
+
+
+ // Complete initialization
+ const completeInitialization = async () => {
+ // Save configuration including API keys
+ const settings = {
+ storeDirectory,
+ imagebindInstalled: true,
+ ...apiKeySettings, // Include API key settings
+ initializedAt: new Date().toISOString()
+ };
+
+ await window.api.saveSettings(settings);
+
+ // Trigger configuration update event, notify sidebar to reload sessions
+ const event = new CustomEvent('storage-config-updated', {
+ detail: { storeDirectory }
+ });
+ window.dispatchEvent(event);
+
+ onComplete();
+ };
+
+ // Show loading state while initializing
+ if (isInitializing) {
+ return (
+ <div className="fixed inset-0 bg-gradient-to-br from-blue-50 via-white to-purple-50 z-50 overflow-auto">
+ <div className="min-h-full flex items-center justify-center p-4">
+ <div className="text-center">
+ <div className="animate-spin rounded-full h-12 w-12 border-b-2 border-purple-600 mx-auto mb-4"></div>
+ <p className="text-gray-600">Checking VideoRAG environment...</p>
+ </div>
+ </div>
+ </div>
+ );
+ }
+
+ const renderStep1 = () => (
+ <div className="space-y-6">
+ <div className="text-center">
+ <h2 className="text-2xl font-bold text-gray-900 mb-3">Select Storage Location</h2>
+ <p className="text-gray-600 max-w-2xl mx-auto">
+ Choose a safe location to store your AI models and data files
+ </p>
+ </div>
+
+ <div className="bg-gradient-to-r from-blue-50 to-purple-50 rounded-xl p-6 border border-blue-100">
+ <div className="flex items-center gap-3 mb-4">
+ <div className="w-10 h-10 bg-gradient-to-r from-blue-500 to-purple-500 rounded-lg flex items-center justify-center">
+ <FolderOpen className="w-5 h-5 text-white" />
+ </div>
+ <div>
+ <h3 className="text-lg font-semibold text-gray-900">Data Storage Directory</h3>
+ <p className="text-sm text-gray-600">AI models and Vimo cache data will be stored at this location</p>
+ </div>
+ </div>
+
+ <div className="space-y-4">
+ <div className="flex gap-3">
+ <input
+ type="text"
+ placeholder="Click browse to select directory..."
+ value={storeDirectory}
+ readOnly
+ className="flex-1 px-3 py-2 text-sm border border-gray-300 rounded-lg bg-white focus:outline-none focus:border-purple-400 transition-colors"
+ />
+ <Button
+ onClick={selectDirectory}
+ className="px-4 py-2 bg-gradient-to-r from-blue-500 to-purple-500 hover:from-blue-600 hover:to-purple-600 text-white rounded-lg font-medium transition-all"
+ >
+ <FolderOpen className="w-4 h-4 mr-2" />
+ Select
+ </Button>
+ </div>
+
+ </div>
+ </div>
+
+ <div className="flex justify-end">
+ <Button
+ onClick={() => goToStep(2)}
+ disabled={!canProceedToStep2}
+ className="px-6 py-2 bg-gradient-to-r from-purple-500 to-blue-500 hover:from-purple-600 hover:to-blue-600 text-white rounded-lg font-medium transition-all disabled:opacity-50"
+ >
+ Next
+ <ArrowRight className="w-4 h-4 ml-2" />
+ </Button>
+ </div>
+ </div>
+ );
+
+ const renderStep2 = () => (
+ <div className="space-y-6">
+ <div className="text-center">
+ <div className="flex items-center justify-center gap-3 mb-3">
+ <h2 className="text-2xl font-bold text-gray-900">AI Models Status</h2>
+ <Button
+ onClick={refreshModelsStatus}
+ size="sm"
+ variant="outline"
+ disabled={isRefreshing}
+ className="px-3 py-1 border-gray-300 hover:border-purple-400 hover:bg-purple-50 transition-all disabled:opacity-50"
+ title="Refresh model status"
+ >
+ <RefreshCw className={`w-4 h-4 mr-2 ${isRefreshing ? 'animate-spin' : ''}`} />
+ {isRefreshing ? 'Checking...' : 'Refresh Status'}
+ </Button>
+ </div>
+ <p className="text-gray-600">
+ {canProceedToStep3
+ ? "All AI models are already available and ready to use!"
+ : "Preparing powerful AI models for you, this may take a few minutes"
+ }
+ </p>
+ </div>
+
+ <div className="grid grid-cols-1 gap-6">
+ {/* ImageBind Card */}
+ <div className="bg-gradient-to-br from-blue-50 to-indigo-50 rounded-xl p-5 border border-blue-100">
+ <div className="flex items-center gap-3 mb-4">
+ <div className="w-10 h-10 bg-gradient-to-r from-blue-500 to-indigo-500 rounded-lg flex items-center justify-center">
+ <Brain className="w-6 h-6 text-white" />
+ </div>
+ <div>
+ <h3 className="text-lg font-bold text-blue-900">ImageBind</h3>
+ <p className="text-sm text-blue-700">Image & Video Understanding</p>
+ </div>
+ </div>
+
+ <div className="space-y-3">
+ <div className="flex justify-between items-center p-2 bg-white/60 rounded-lg text-sm">
+ <span>File Size</span>
+ <span className="font-semibold text-blue-700">~4.5GB</span>
+ </div>
+
+ {imagebindStatus === 'downloading' && (
+ <div className="space-y-2">
+ <div className="flex justify-between text-sm">
+ <span>Progress</span>
+ <span>{Math.round(downloadProgress.imagebind)}%</span>
+ </div>
+ <div className="w-full bg-blue-200 rounded-full h-2">
+ <div
+ className="bg-gradient-to-r from-blue-500 to-indigo-500 h-2 rounded-full transition-all duration-300"
+ style={{ width: `${downloadProgress.imagebind}%` }}
+ />
+ </div>
+ </div>
+ )}
+
+ <Button
+ onClick={downloadImageBind}
+ disabled={imagebindStatus === 'downloading' || imagebindStatus === 'completed'}
+ className={`w-full py-2 font-medium rounded-lg transition-all ${
+ imagebindStatus === 'completed'
+ ? 'bg-green-500 hover:bg-green-600 text-white'
+ : 'bg-gradient-to-r from-blue-500 to-indigo-500 hover:from-blue-600 hover:to-indigo-600 text-white'
+ }`}
+ >
+ {imagebindStatus === 'downloading' && <RefreshCw className="w-4 h-4 mr-2 animate-spin" />}
+ {imagebindStatus === 'completed' && <CheckCircle className="w-4 h-4 mr-2" />}
+ {imagebindStatus === 'pending' && <Download className="w-4 h-4 mr-2" />}
+
+ {imagebindStatus === 'completed' ? 'Completed' :
+ imagebindStatus === 'downloading' ? 'Downloading...' : 'Start Download'}
+ </Button>
+ </div>
+ </div>
+
+
+ </div>
+
+ <div className="flex justify-between items-center">
+ <Button
+ onClick={() => goToStep(1)}
+ className="px-4 py-2 bg-gray-100 hover:bg-gray-200 text-gray-700 rounded-lg font-medium transition-all"
+ >
+ <ArrowLeft className="w-4 h-4 mr-2" />
+ Back
+ </Button>
+
+ <Button
+ onClick={() => goToStep(3)}
+ disabled={!canProceedToStep3}
+ className="px-6 py-2 bg-gradient-to-r from-purple-500 to-blue-500 hover:from-purple-600 hover:to-blue-600 text-white rounded-lg font-medium transition-all disabled:opacity-50"
+ >
+ Next
+ <ArrowRight className="w-4 h-4 ml-2" />
+ </Button>
+ </div>
+ </div>
+ );
+
+ const renderApiKeySetup = () => (
+ <div className="space-y-6">
+ <div className="text-center">
+ <h2 className="text-2xl font-bold text-gray-900 mb-2">API Key Configuration</h2>
+ <p className="text-gray-600">
+ Configure your API keys for enhanced video analysis capabilities
+ </p>
+ <p className="text-sm text-gray-500 mt-2">
+ All API keys are stored locally and never shared with third parties
+ </p>
+ </div>
+
+ <div className="space-y-6">
+ {/* OpenAI Configuration */}
+ <div className="bg-gradient-to-r from-blue-50 to-indigo-50 rounded-xl p-6 border border-blue-100">
+ <div className="flex items-center gap-3 mb-4">
+ <div className="w-10 h-10 bg-gradient-to-r from-blue-500 to-indigo-500 rounded-lg flex items-center justify-center">
+ <Brain className="w-6 h-6 text-white" />
+ </div>
+ <div>
+ <h3 className="text-lg font-bold text-blue-900">OpenAI Configuration</h3>
+ <p className="text-sm text-blue-700">Language model services for intelligent analysis</p>
+ </div>
+ </div>
+
+ <div className="space-y-4">
+ <div>
+ <label className="text-sm font-medium text-gray-700 block mb-2">
+ Base URL
+ </label>
+ <input
+ type="text"
+ placeholder="https://api.openai.com/v1"
+ value={apiKeySettings.openaiBaseUrl}
+ onChange={(e) => handleApiKeyChange('openaiBaseUrl', e.target.value)}
+ className="w-full px-3 py-2 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
+ />
+ </div>
+
+ <div>
+ <label className="text-sm font-medium text-gray-700 block mb-2">
+ API Key
+ </label>
+ <input
+ type="password"
+ placeholder="sk-..."
+ value={apiKeySettings.openaiApiKey}
+ onChange={(e) => handleApiKeyChange('openaiApiKey', e.target.value)}
+ className="w-full px-3 py-2 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
+ />
+ </div>
+
+ <div className="grid grid-cols-2 gap-4">
+ <div>
+ <label className="text-sm font-medium text-gray-700 block mb-2">
+ Processing Model
+ </label>
+ <input
+ type="text"
+ value="gpt-4o-mini"
+ readOnly
+ className="w-full px-3 py-2 text-sm border border-gray-300 rounded-md bg-gray-100 text-gray-600"
+ />
+ <p className="text-xs text-gray-500 mt-1">Fixed model for high-volume preprocessing</p>
+ </div>
+
+ <div>
+ <label className="text-sm font-medium text-gray-700 block mb-2">
+ Analysis Model
+ </label>
+ <input
+ type="text"
+ value="gpt-4o-mini"
+ readOnly
+ className="w-full px-3 py-2 text-sm border border-gray-300 rounded-md bg-gray-100 text-gray-600"
+ />
+ <p className="text-xs text-gray-500 mt-1">Fixed model for detailed analysis tasks</p>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ {/* DashScope Configuration */}
+ <div className="bg-gradient-to-r from-orange-50 to-yellow-50 rounded-xl p-6 border border-orange-100">
+ <div className="flex items-center justify-between mb-4">
+ <div className="flex items-center gap-3">
+ <div className="w-10 h-10 bg-gradient-to-r from-orange-500 to-yellow-500 rounded-lg flex items-center justify-center">
+ <Settings className="w-6 h-6 text-white" />
+ </div>
+ <div>
+ <h3 className="text-lg font-bold text-orange-900">DashScope Configuration</h3>
+ <p className="text-sm text-orange-700">Alibaba Cloud API for video captioning</p>
+ </div>
+ </div>
+ <a
+ href="https://www.alibabacloud.com/help/en/model-studio/get-api-key?spm=a2c63.p38356.0.i1"
+ target="_blank"
+ rel="noopener noreferrer"
+ className="flex items-center gap-1 text-sm text-blue-600 hover:text-blue-800 transition-colors"
+ >
+ <ExternalLink size={14} />
+ Get API Key Tutorial
+ </a>
+ </div>
+
+ <div>
+ <label className="text-sm font-medium text-gray-700 block mb-2">
+ DashScope API Key
+ </label>
+ <input
+ type="password"
+ placeholder="sk-..."
+ value={apiKeySettings.dashscopeApiKey}
+ onChange={(e) => handleApiKeyChange('dashscopeApiKey', e.target.value)}
+ className="w-full px-3 py-2 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-orange-500"
+ />
+ </div>
+
+ <div className="grid grid-cols-2 gap-4">
+ <div>
+ <label className="text-sm font-medium text-gray-700 block mb-2">
+ Caption Model
+ </label>
+ <input
+ type="text"
+ value="qwen-vl-plus-latest"
+ readOnly
+ className="w-full px-3 py-2 text-sm border border-gray-300 rounded-md bg-gray-100 text-gray-600"
+ />
+ <p className="text-xs text-gray-500 mt-1">Fixed model for video captioning tasks</p>
+ </div>
+
+ <div>
+ <label className="text-sm font-medium text-gray-700 block mb-2">
+ ASR Model
+ </label>
+ <input
+ type="text"
+ value="paraformer-realtime-v2"
+ readOnly
+ className="w-full px-3 py-2 text-sm border border-gray-300 rounded-md bg-gray-100 text-gray-600"
+ />
+ <p className="text-xs text-gray-500 mt-1">Fixed model for speech recognition tasks</p>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div className="flex justify-between items-center">
+ <Button
+ onClick={() => goToStep(2)}
+ className="px-4 py-2 bg-gray-100 hover:bg-gray-200 text-gray-700 rounded-lg font-medium transition-all"
+ >
+ <ArrowLeft className="w-4 h-4 mr-2" />
+ Back
+ </Button>
+
+ <Button
+ onClick={() => goToStep(4)}
+ disabled={!canProceedToStep4}
+ className="px-6 py-2 bg-gradient-to-r from-purple-500 to-blue-500 hover:from-purple-600 hover:to-blue-600 text-white rounded-lg font-medium transition-all disabled:opacity-50"
+ >
+ Complete Setup
+ <Sparkles className="w-4 h-4 ml-2" />
+ </Button>
+ </div>
+ </div>
+ );
+
+ const renderCelebration = () => (
+ <div className="space-y-6 text-center">
+ <div className="mx-auto w-20 h-20 bg-gradient-to-r from-purple-500 to-pink-500 rounded-full flex items-center justify-center mb-4">
+ <Sparkles className="w-10 h-10 text-white" />
+ </div>
+
+ <div>
+ <h2 className="text-3xl font-bold text-gray-900 mb-3">🎉 Setup Complete!</h2>
+ <p className="text-lg text-gray-600 mb-4">
+ Vimo is ready! You can now start using intelligent video analysis features
+ </p>
+ </div>
+
+ <div className="grid grid-cols-2 md:grid-cols-4 gap-3 max-w-2xl mx-auto">
+ <div className="p-3 bg-blue-50 rounded-lg border border-blue-100">
+ <CheckCircle className="w-5 h-5 text-blue-600 mx-auto mb-1" />
+ <div className="text-sm font-medium text-blue-800">Directory</div>
+ <div className="text-xs text-blue-600">Storage Setup</div>
+ </div>
+ <div className="p-3 bg-green-50 rounded-lg border border-green-100">
+ <CheckCircle className="w-5 h-5 text-green-600 mx-auto mb-1" />
+ <div className="text-sm font-medium text-green-800">ImageBind</div>
+ <div className="text-xs text-green-600">AI Model</div>
+ </div>
+ <div className="p-3 bg-orange-50 rounded-lg border border-orange-100">
+ <CheckCircle className="w-5 h-5 text-orange-600 mx-auto mb-1" />
+ <div className="text-sm font-medium text-orange-800">API Keys</div>
+ <div className="text-xs text-orange-600">Configuration</div>
+ </div>
+ <div className="p-3 bg-purple-50 rounded-lg border border-purple-100">
+ <CheckCircle className="w-5 h-5 text-purple-600 mx-auto mb-1" />
+ <div className="text-sm font-medium text-purple-800">Vimo</div>
+ <div className="text-xs text-purple-600">Ready!</div>
+ </div>
+ </div>
+
+ <Button
+ onClick={completeInitialization}
+ className="px-8 py-3 text-lg font-bold bg-gradient-to-r from-purple-500 to-blue-500 hover:from-purple-600 hover:to-blue-600 text-white rounded-lg shadow-lg transition-all"
+ >
+ Start Using Vimo
+ <ArrowRight className="w-5 h-5 ml-2" />
+ </Button>
+ </div>
+ );
+
+ return (
+ <div className="fixed inset-0 bg-gradient-to-br from-blue-50 via-white to-purple-50 z-50 overflow-auto">
+ {/* Draggable area */}
+ <div className="fixed top-0 left-0 right-0 h-8 bg-transparent z-50" style={{ WebkitAppRegion: 'drag' } as any}></div>
+
+ <div className="min-h-full flex items-center justify-center p-4 pt-12">
+ <div className="w-full max-w-3xl mx-auto">
+ {/* Welcome header */}
+ <div className="text-center mb-6">
+ <div className="mb-4">
+ <div className="flex items-center justify-center gap-3 mb-4">
+ <img src={vimoLogo} alt="Vimo" className="w-16 h-16 rounded-2xl shadow-lg" />
+ <h1 className="text-4xl font-bold bg-gradient-to-r from-blue-500 via-purple-600 to-pink-500 bg-clip-text text-transparent">
+ Vimo
+ </h1>
+ </div>
+ </div>
+ <p className="text-gray-600 mb-1 text-lg">Agentic Video Understanding</p>
+ <p className="text-sm text-gray-500">Let's set up your AI environment</p>
+ </div>
+
+ {/* Modern Progress indicator */}
+ <div className="mb-8 mt-8">
+ <div className="max-w-4xl mx-auto px-8">
+ {/* Progress bar background */}
+ <div className="relative pt-4 pb-12">
+ <div className="h-2 bg-gray-200 rounded-full">
+ <div
+ className="h-2 bg-gradient-to-r from-purple-500 to-blue-500 rounded-full transition-all duration-700 ease-out"
+ style={{ width: `${((currentStep - 1) / (totalSteps - 1)) * 100}%` }}
+ />
+ </div>
+
+ {/* Step indicators */}
+ <div className="absolute top-1 left-0 right-0 flex justify-between items-center">
+ {steps.map(({ step, icon: Icon, label }) => (
+ <div key={step} className="flex flex-col items-center relative">
+ {/* Step circle */}
+ <div className={`
+ w-8 h-8 rounded-full flex items-center justify-center border-4 border-white shadow-lg transition-all duration-300
+ ${step < currentStep
+ ? 'bg-gradient-to-r from-purple-500 to-blue-500 text-white'
+ : step === currentStep
+ ? 'bg-purple-500 text-white animate-pulse'
+ : 'bg-gray-300 text-gray-500'
+ }
+ `}>
+ {step < currentStep ? (
+ <CheckCircle className="w-4 h-4" />
+ ) : step === currentStep ? (
+ <Icon className="w-4 h-4" />
+ ) : (
+ <div className="w-2 h-2 bg-gray-400 rounded-full" />
+ )}
+ </div>
+
+ {/* Step label */}
+ <span className={`mt-4 text-sm font-medium transition-colors duration-300 ${
+ step < currentStep ? 'text-purple-600'
+ : step === currentStep ? 'text-purple-600'
+ : 'text-gray-500'
+ }`}>
+ {label}
+ </span>
+ </div>
+ ))}
+ </div>
+ </div>
+ </div>
+ </div>
+
+ {/* Step content */}
+ <div className="bg-white/80 backdrop-blur-sm rounded-xl shadow-lg border border-white/20 p-6">
+ {currentStep === 1 && renderStep1()}
+ {currentStep === 2 && renderStep2()}
+ {currentStep === 3 && renderApiKeySetup()}
+ {currentStep === 4 && renderCelebration()}
+ </div>
+ </div>
+ </div>
+ </div>
+ );
+};
+
+export default InitializationWizard;
\ No newline at end of file
diff --git a/Vimo-desktop/src/renderer/src/components/VideoRAGConfig.tsx b/Vimo-desktop/src/renderer/src/components/VideoRAGConfig.tsx
new file mode 100644
index 0000000..d16d2a0
--- /dev/null
+++ b/Vimo-desktop/src/renderer/src/components/VideoRAGConfig.tsx
@@ -0,0 +1,336 @@
+import { useState, useEffect } from 'react'
+import { X, Settings, CheckCircle, AlertCircle, Play, Square, RefreshCw } from 'lucide-react'
+import { Button } from './ui/button'
+import { useVideoRAG, VideoRAGConfig } from '../hooks/useVideoRAG'
+import { useVideoRAGService } from '../hooks/useVideoRAGService'
+
+interface VideoRAGConfigProps {
+ isOpen: boolean
+ onClose: () => void
+}
+
+export const VideoRAGConfigModal = ({ isOpen, onClose }: VideoRAGConfigProps) => {
+ const { initialize, loading, error, clearError } = useVideoRAG()
+ const {
+ serviceState,
+ loading: serviceLoading,
+ checkServiceStatus,
+ startService,
+ stopService
+ } = useVideoRAGService()
+
+ const [config, setConfig] = useState<VideoRAGConfig>({
+ ali_dashscope_api_key: '',
+ ali_dashscope_base_url: 'https://dashscope.aliyuncs.com/compatible-mode/v1',
+ openai_api_key: '',
+ openai_base_url: 'https://api.nuwaapi.com/v1',
+ image_bind_model_path: '/Users/renxubin/Desktop/videorag-store/imagebind_huge/imagebind_huge.pth',
+ base_storage_path: './videorag-sessions'
+ })
+
+ // Local check configuration completeness, not dependent on network status
+ const isConfigured = !!(config.openai_api_key &&
+ config.ali_dashscope_api_key &&
+ config.image_bind_model_path)
+
+ const [showApiKeys, setShowApiKeys] = useState(false)
+
+ // Load saved config from localStorage
+ useEffect(() => {
+ const savedConfig = localStorage.getItem('videorag-config')
+ if (savedConfig) {
+ try {
+ setConfig(JSON.parse(savedConfig))
+ } catch (error) {
+ console.error('Failed to load saved config:', error)
+ }
+ }
+ }, [])
+
+ const handleConfigChange = (field: keyof VideoRAGConfig, value: string) => {
+ setConfig(prev => ({
+ ...prev,
+ [field]: value
+ }))
+ }
+
+ const handleSave = async () => {
+ // Save config to localStorage
+ localStorage.setItem('videorag-config', JSON.stringify(config))
+
+ // Initialize VideoRAG
+ const success = await initialize(config)
+ if (success) {
+ onClose()
+ }
+ }
+
+ const selectImageBindPath = async () => {
+ try {
+ const result = await window.api.selectFolder()
+ if (result.success && result.path) {
+ // Assume the model file is in the selected folder
+ const modelPath = `${result.path}/imagebind_huge.pth`
+ handleConfigChange('image_bind_model_path', modelPath)
+ }
+ } catch (error) {
+ console.error('Failed to select folder:', error)
+ }
+ }
+
+ if (!isOpen) return null
+
+ return (
+ <div className="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50">
+ <div className="bg-white rounded-lg shadow-xl w-full max-w-2xl mx-4 max-h-[90vh] overflow-y-auto">
+ <div className="flex items-center justify-between p-6 border-b">
+ <div className="flex items-center space-x-2">
+ <Settings className="w-5 h-5" />
+ <h2 className="text-xl font-semibold">VideoRAG Configuration</h2>
+ </div>
+ <Button variant="outline" size="sm" onClick={onClose}>
+ <X className="w-4 h-4" />
+ </Button>
+ </div>
+
+ <div className="p-6 space-y-6">
+ {/* Service Status */}
+ <div className="space-y-4">
+ {/* Service Control */}
+ <div className="p-4 rounded-lg bg-gray-50">
+ <div className="flex items-center justify-between">
+ <div className="flex items-center space-x-2">
+ <Settings className="w-5 h-5" />
+ <span className="font-medium">VideoRAG Service</span>
+ </div>
+ <div className="flex items-center space-x-2">
+ <Button
+ size="sm"
+ variant="outline"
+ onClick={checkServiceStatus}
+ disabled={serviceLoading.checkingService}
+ >
+ {serviceLoading.checkingService ? (
+ <RefreshCw className="w-4 h-4 animate-spin" />
+ ) : (
+ <RefreshCw className="w-4 h-4" />
+ )}
+ </Button>
+ {serviceState.isRunning ? (
+ <Button
+ size="sm"
+ variant="destructive"
+ onClick={stopService}
+ disabled={serviceLoading.stopping}
+ >
+ {serviceLoading.stopping ? (
+ <RefreshCw className="w-4 h-4 animate-spin" />
+ ) : (
+ <Square className="w-4 h-4" />
+ )}
+ Stop
+ </Button>
+ ) : (
+ <Button
+ size="sm"
+ variant="default"
+ onClick={startService}
+ disabled={serviceLoading.starting}
+ >
+ {serviceLoading.starting ? (
+ <RefreshCw className="w-4 h-4 animate-spin" />
+ ) : (
+ <Play className="w-4 h-4" />
+ )}
+ Start
+ </Button>
+ )}
+ </div>
+ </div>
+ <div className="mt-2 text-sm">
+ {serviceState.isRunning ? (
+ <div className="flex items-center space-x-2">
+ <CheckCircle className="w-4 h-4 text-green-500" />
+ <span className="text-green-600">Service is running</span>
+ </div>
+ ) : (
+ <div className="flex items-center space-x-2">
+ <AlertCircle className="w-4 h-4 text-yellow-500" />
+ <span className="text-yellow-600">Service is stopped</span>
+ </div>
+ )}
+ {serviceState.message && (
+ <div className="text-xs text-gray-500 mt-1">{serviceState.message}</div>
+ )}
+ {serviceState.error && (
+ <div className="text-xs text-red-500 mt-1">{serviceState.error}</div>
+ )}
+ </div>
+ </div>
+
+ {/* Configuration Status */}
+ <div className="p-4 rounded-lg bg-gray-50">
+ <div className="flex items-center space-x-2">
+ {isConfigured ? (
+ <CheckCircle className="w-5 h-5 text-green-500" />
+ ) : (
+ <AlertCircle className="w-5 h-5 text-yellow-500" />
+ )}
+ <span className="font-medium">
+ Configuration: {isConfigured ? 'Complete' : 'Incomplete'}
+ </span>
+ </div>
+ {isConfigured && (
+ <p className="text-sm text-green-600 mt-1">
+ Global configuration is set and ready for use
+ </p>
+ )}
+ </div>
+ </div>
+
+ {/* Error Display */}
+ {error && (
+ <div className="p-4 bg-red-50 border border-red-200 rounded-lg">
+ <div className="flex items-start space-x-2">
+ <AlertCircle className="w-5 h-5 text-red-500 mt-0.5 flex-shrink-0" />
+ <div className="flex-1">
+ <p className="text-sm text-red-700">{error}</p>
+ <Button
+ size="sm"
+ variant="outline"
+ onClick={clearError}
+ className="mt-2"
+ >
+ Dismiss
+ </Button>
+ </div>
+ </div>
+ </div>
+ )}
+
+ {/* API Keys Section */}
+ <div className="space-y-4">
+ <div className="flex items-center justify-between">
+ <h3 className="font-medium">API Keys</h3>
+ <Button
+ size="sm"
+ variant="outline"
+ onClick={() => setShowApiKeys(!showApiKeys)}
+ >
+ {showApiKeys ? 'Hide' : 'Show'} Keys
+ </Button>
+ </div>
+
+ <div className="space-y-4">
+ <div>
+ <label className="block text-sm font-medium mb-1">
+ OpenAI API Key *
+ </label>
+ <input
+ type={showApiKeys ? 'text' : 'password'}
+ value={config.openai_api_key}
+ onChange={(e) => handleConfigChange('openai_api_key', e.target.value)}
+ placeholder="sk-..."
+ className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
+ />
+ </div>
+
+ <div>
+ <label className="block text-sm font-medium mb-1">
+ OpenAI Base URL
+ </label>
+ <input
+ type="text"
+ value={config.openai_base_url}
+ onChange={(e) => handleConfigChange('openai_base_url', e.target.value)}
+ placeholder="https://api.openai.com/v1"
+ className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
+ />
+ </div>
+
+ <div>
+ <label className="block text-sm font-medium mb-1">
+ Alibaba DashScope API Key *
+ </label>
+ <input
+ type={showApiKeys ? 'text' : 'password'}
+ value={config.ali_dashscope_api_key}
+ onChange={(e) => handleConfigChange('ali_dashscope_api_key', e.target.value)}
+ placeholder="sk-..."
+ className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
+ />
+ </div>
+
+ <div>
+ <label className="block text-sm font-medium mb-1">
+ DashScope Base URL
+ </label>
+ <input
+ type="text"
+ value={config.ali_dashscope_base_url}
+ onChange={(e) => handleConfigChange('ali_dashscope_base_url', e.target.value)}
+ placeholder="https://dashscope.aliyuncs.com/compatible-mode/v1"
+ className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
+ />
+ </div>
+ </div>
+ </div>
+
+ {/* Model Path Section */}
+ <div className="space-y-4">
+ <h3 className="font-medium">Model Configuration</h3>
+
+ <div>
+ <label className="block text-sm font-medium mb-1">
+ ImageBind Model Path *
+ </label>
+ <div className="flex space-x-2">
+ <input
+ type="text"
+ value={config.image_bind_model_path}
+ onChange={(e) => handleConfigChange('image_bind_model_path', e.target.value)}
+ placeholder="/path/to/imagebind_huge.pth"
+ className="flex-1 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
+ />
+ <Button onClick={selectImageBindPath} variant="outline">
+ Browse
+ </Button>
+ </div>
+ <p className="text-xs text-gray-500 mt-1">
+ Path to the ImageBind model file (imagebind_huge.pth)
+ </p>
+ </div>
+
+ <div>
+ <label className="block text-sm font-medium mb-1">
+ Base Storage Directory
+ </label>
+ <input
+ type="text"
+ value={config.base_storage_path}
+ onChange={(e) => handleConfigChange('base_storage_path', e.target.value)}
+ placeholder="./videorag-sessions"
+ className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
+ />
+ <p className="text-xs text-gray-500 mt-1">
+ Base directory where each chat session will create its own subdirectory
+ </p>
+ </div>
+ </div>
+ </div>
+
+ <div className="flex justify-end space-x-3 p-6 border-t bg-gray-50">
+ <Button variant="outline" onClick={onClose}>
+ Cancel
+ </Button>
+ <Button
+ onClick={handleSave}
+ disabled={loading.initializing || !config.openai_api_key || !config.ali_dashscope_api_key || !config.image_bind_model_path}
+ >
+ {loading.initializing ? 'Configuring...' : 'Save & Configure'}
+ </Button>
+ </div>
+ </div>
+ </div>
+ )
+}
\ No newline at end of file
diff --git a/Vimo-desktop/src/renderer/src/components/chat/ChatInput.tsx b/Vimo-desktop/src/renderer/src/components/chat/ChatInput.tsx
new file mode 100644
index 0000000..d96660d
--- /dev/null
+++ b/Vimo-desktop/src/renderer/src/components/chat/ChatInput.tsx
@@ -0,0 +1,134 @@
+import React from 'react';
+import { Send, GripHorizontal } from 'lucide-react';
+import { Button } from '../ui/button';
+import { useServiceContext } from '../../contexts/ServiceContext';
+
+interface ChatInputProps {
+ inputValue: string;
+ setInputValue: (value: string) => void;
+ onVideoUpload: () => void;
+ onSendMessage: () => void;
+ isLoading: boolean;
+ height: number;
+ onResizeMouseDown: (e: React.MouseEvent) => void;
+ isAnalyzing?: boolean;
+ isQueryProcessing?: boolean;
+}
+
+export const ChatInput = ({
+ inputValue,
+ setInputValue,
+ onSendMessage,
+ isLoading,
+ height,
+ onResizeMouseDown,
+ isAnalyzing = false,
+ isQueryProcessing = false,
+}: ChatInputProps) => {
+ const { serviceState, loading } = useServiceContext();
+
+ // Only allow sending messages when ImageBind is loaded and not in operation
+ const isServiceReady = serviceState.imagebindLoaded && !loading.loadingImageBind && !loading.releasingImageBind;
+ const isInputDisabled = isAnalyzing || isQueryProcessing || isLoading || !isServiceReady;
+
+
+
+ const handleKeyPress = (e: React.KeyboardEvent) => {
+ if (e.key === 'Enter' && !e.shiftKey && !isInputDisabled) {
+ e.preventDefault();
+ onSendMessage();
+ }
+ };
+
+ const handleSendMessage = () => {
+ if (!isInputDisabled) {
+ onSendMessage();
+ }
+ };
+
+ return (
+ <div
+ className="bg-white border-t flex-shrink-0 relative"
+ style={{ height: `${height}px` }}
+ >
+ {/* Resize Handle */}
+ <div
+ className="absolute top-0 left-0 right-0 h-2 cursor-row-resize bg-transparent hover:bg-gray-200 transition-all duration-200 group"
+ onMouseDown={onResizeMouseDown}
+ style={{ zIndex: 50 }}
+ title="Drag to resize chat area"
+ >
+ <div className="absolute top-0 left-1/2 transform -translate-x-1/2 w-16 h-0.5 bg-gray-300 rounded-full opacity-0 group-hover:opacity-100 transition-opacity duration-200" />
+ <div className="absolute top-0.5 left-1/2 transform -translate-x-1/2 opacity-0 group-hover:opacity-100 transition-opacity duration-200">
+ <GripHorizontal size={12} className="text-gray-400" />
+ </div>
+ </div>
+
+ <div className="max-w-3xl mx-auto p-4 h-full flex flex-col">
+ {/* Input Box - Claude Style */}
+ <div className="relative bg-white rounded-xl border border-gray-200 shadow-sm">
+ <div className="p-3">
+ <div className="relative">
+ {/* Input Box */}
+ <textarea
+ value={inputValue}
+ onChange={(e) => setInputValue(e.target.value)}
+ onKeyPress={handleKeyPress}
+ placeholder={
+ isAnalyzing
+ ? "Please wait, analyzing your video..."
+ : isQueryProcessing
+ ? "Processing your query..."
+ : !isServiceReady
+ ? "Vimo service is not ready..."
+ : "Ask me anything about your videos..."
+ }
+ disabled={isInputDisabled}
+ className={`w-full px-4 py-3 pr-12 border rounded-xl resize-none focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent text-sm leading-relaxed min-h-[44px] ${
+ isInputDisabled
+ ? 'bg-gray-100 text-gray-500 cursor-not-allowed'
+ : 'bg-white text-gray-900'
+ }`}
+ style={{
+ height: '44px',
+ minHeight: '44px',
+ maxHeight: '120px',
+ overflowY: 'auto',
+ }}
+ rows={1}
+ />
+
+ {/* Send Button - Absolute Positioned in Top Right */}
+ <Button
+ onClick={handleSendMessage}
+ disabled={!inputValue.trim() || isInputDisabled}
+ className={`absolute right-1 top-2 h-8 w-8 p-0 ${
+ isInputDisabled
+ ? 'bg-gray-400 hover:bg-gray-400 cursor-not-allowed'
+ : 'bg-gradient-to-r from-blue-500 to-purple-600 hover:from-blue-600 hover:to-purple-700'
+ }`}
+ >
+ <Send size={14} className="text-white" />
+ </Button>
+ </div>
+
+ {/* Toolbar */}
+ <div className="flex items-center justify-end mt-3">
+ <div className="text-xs text-gray-500">
+ {isAnalyzing
+ ? 'Please wait for analysis to complete'
+ : isQueryProcessing
+ ? 'Please wait for query processing to complete'
+ : !isServiceReady
+ ? 'Vimo service not ready'
+ : 'Enter to send, Shift+Enter for new line'
+ }
+ </div>
+ </div>
+ </div>
+ </div>
+
+ </div>
+ </div>
+ );
+};
\ No newline at end of file
diff --git a/Vimo-desktop/src/renderer/src/components/chat/ChatProgressBar.tsx b/Vimo-desktop/src/renderer/src/components/chat/ChatProgressBar.tsx
new file mode 100644
index 0000000..676d778
--- /dev/null
+++ b/Vimo-desktop/src/renderer/src/components/chat/ChatProgressBar.tsx
@@ -0,0 +1,70 @@
+import React, { useState } from 'react';
+import { ChevronDown, ChevronUp } from 'lucide-react';
+import { AnalysisStep } from '../../types/chat';
+
+interface ChatProgressBarProps {
+ content: string;
+ analysisSteps: AnalysisStep[];
+}
+
+export const ChatProgressBar: React.FC<ChatProgressBarProps> = ({ content, analysisSteps }) => {
+ const [isCollapsed, setIsCollapsed] = useState(false);
+
+ const toggleCollapse = () => {
+ setIsCollapsed(!isCollapsed);
+ };
+
+ return (
+ <div className="p-4">
+ <div
+ className="flex items-center justify-between mb-3 cursor-pointer hover:bg-gray-50 rounded-lg p-2 -m-2 transition-colors"
+ onClick={toggleCollapse}
+ >
+ <div className="flex items-center">
+ <div className="w-2 h-2 bg-blue-500 rounded-full mr-3"></div>
+ <h3 className="text-sm font-medium text-gray-900">{content}</h3>
+ </div>
+ <div className="flex items-center">
+ {isCollapsed ? (
+ <ChevronDown className="w-4 h-4 text-gray-500" />
+ ) : (
+ <ChevronUp className="w-4 h-4 text-gray-500" />
+ )}
+ </div>
+ </div>
+
+ {!isCollapsed && (
+ <div className="space-y-2 relative">
+ {analysisSteps.map((step) => (
+ <div key={step.id} className="flex items-center space-x-3 relative">
+ {/* Status Indicator */}
+ <div className="flex-shrink-0">
+ {step.status === 'completed' ? (
+ <div className="w-2 h-2 bg-gray-400 rounded-full"></div>
+ ) : step.status === 'error' ? (
+ <div className="w-2 h-2 bg-red-500 rounded-full"></div>
+ ) : (
+ <div className="w-2 h-2 bg-blue-500 rounded-full animate-pulse"></div>
+ )}
+ </div>
+
+ {/* Step Content */}
+ <div className="flex-1 min-w-0">
+ <div className={`text-sm ${
+ step.status === 'completed'
+ ? 'text-gray-500'
+ : step.status === 'error'
+ ? 'text-red-600'
+ : 'text-gray-900'
+ }`}>
+ <span className="font-medium">{step.name}</span>
+ <span className="ml-2 font-normal text-xs">{step.message}</span>
+ </div>
+ </div>
+ </div>
+ ))}
+ </div>
+ )}
+ </div>
+ );
+};
\ No newline at end of file
diff --git a/Vimo-desktop/src/renderer/src/components/chat/MessageList.tsx b/Vimo-desktop/src/renderer/src/components/chat/MessageList.tsx
new file mode 100644
index 0000000..f32248a
--- /dev/null
+++ b/Vimo-desktop/src/renderer/src/components/chat/MessageList.tsx
@@ -0,0 +1,125 @@
+import { useRef, useEffect } from 'react';
+import { Video } from 'lucide-react';
+import { Message } from '../../types/chat';
+import { ChatProgressBar } from './ChatProgressBar';
+import vimoLogo from '../../assets/images/vimi-logo.png';
+
+interface MessageListProps {
+ messages: Message[];
+ isLoading: boolean;
+}
+
+export const MessageList = ({ messages, isLoading }: MessageListProps) => {
+ const messagesEndRef = useRef<HTMLDivElement>(null);
+
+ useEffect(() => {
+ messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' });
+ }, [messages]);
+
+ return (
+ <div className="h-full overflow-y-auto px-4 pt-20 pb-6">
+ <div className="max-w-3xl mx-auto transition-all duration-300">
+ {messages.map((message) => (
+ <div key={message.id} className="mb-6">
+ {message.type === 'user' ? (
+ // User Message
+ <div className="flex justify-end">
+ <div className="max-w-[85%]">
+ {message.videos && message.videos.length > 0 && (
+ <div className="mb-2 text-right">
+ <div className="inline-flex items-center gap-1 text-sm text-gray-600 bg-gray-100 px-3 py-1 rounded-full">
+ <Video size={14} />
+ {message.videos.length} video(s) uploaded
+ </div>
+ </div>
+ )}
+ <div className="bg-gradient-to-r from-blue-500 to-purple-600 text-white p-4 rounded-2xl rounded-tr-md shadow-lg">
+ <p className="text-sm leading-relaxed whitespace-pre-wrap">
+ {message.content}
+ </p>
+ </div>
+ </div>
+ </div>
+ ) : (
+ // Assistant Message
+ <div className="flex justify-start">
+ <div className="max-w-[85%]">
+ <div className="flex items-center gap-2 mb-2">
+ <img src={vimoLogo} alt="Vimo" className="w-6 h-6 rounded-lg shadow-sm border border-gray-100/50" />
+ <span className="text-sm font-medium text-gray-600">
+ Vimo
+ </span>
+ </div>
+ <div className={`bg-white p-4 rounded-2xl rounded-tl-md shadow-sm border border-gray-100 transition-all duration-500 ease-out ${
+ message.isProgressBar ? 'overflow-hidden' : ''
+ }`}>
+ {message.isProgressBar ? (
+ <div className="transition-all duration-500 ease-out">
+ <ChatProgressBar
+ content={message.content}
+ analysisSteps={message.analysisSteps || []}
+ />
+ </div>
+ ) : message.isQueryAnalyzing ? (
+ <div className="flex items-center gap-3">
+ <div className="flex space-x-1">
+ <div className="w-2 h-2 bg-gray-400 rounded-full animate-bounce"></div>
+ <div
+ className="w-2 h-2 bg-gray-400 rounded-full animate-bounce"
+ style={{ animationDelay: '0.1s' }}
+ ></div>
+ <div
+ className="w-2 h-2 bg-gray-400 rounded-full animate-bounce"
+ style={{ animationDelay: '0.2s' }}
+ ></div>
+ </div>
+ <span className="text-sm text-gray-600">
+ Analyzing... {message.queryMessage}
+ </span>
+ </div>
+ ) : (
+ <p className="text-sm leading-relaxed text-gray-800 whitespace-pre-wrap">
+ {message.content}
+ </p>
+ )}
+ </div>
+ </div>
+ </div>
+ )}
+ </div>
+ ))}
+
+ {isLoading && (
+ <div className="flex justify-start">
+ <div className="max-w-[85%]">
+ <div className="flex items-center gap-2 mb-2">
+ <img src={vimoLogo} alt="Vimo" className="w-6 h-6 rounded-lg shadow-sm border border-gray-100/50" />
+ <span className="text-sm font-medium text-gray-600">
+ Vimo
+ </span>
+ </div>
+ <div className="bg-white p-4 rounded-2xl rounded-tl-md shadow-sm border border-gray-100">
+ <div className="flex items-center gap-3">
+ <div className="flex space-x-1">
+ <div className="w-2 h-2 bg-gray-400 rounded-full animate-bounce"></div>
+ <div
+ className="w-2 h-2 bg-gray-400 rounded-full animate-bounce"
+ style={{ animationDelay: '0.1s' }}
+ ></div>
+ <div
+ className="w-2 h-2 bg-gray-400 rounded-full animate-bounce"
+ style={{ animationDelay: '0.2s' }}
+ ></div>
+ </div>
+ <span className="text-sm text-gray-600">Analyzing...</span>
+ </div>
+ </div>
+ </div>
+ </div>
+ )}
+
+ <div ref={messagesEndRef} />
+ </div>
+ </div>
+ );
+};
\ No newline at end of file
diff --git a/Vimo-desktop/src/renderer/src/components/chat/WelcomeScreen.tsx b/Vimo-desktop/src/renderer/src/components/chat/WelcomeScreen.tsx
new file mode 100644
index 0000000..ee729d1
--- /dev/null
+++ b/Vimo-desktop/src/renderer/src/components/chat/WelcomeScreen.tsx
@@ -0,0 +1,102 @@
+import { Video, Upload } from 'lucide-react';
+import { Button } from '../ui/button';
+import { useServiceContext } from '../../contexts/ServiceContext';
+import { UploadedVideo, VideoAnalysisState } from '../../types/chat';
+
+interface WelcomeScreenProps {
+ onVideoUpload: () => void;
+ uploadedVideos: UploadedVideo[];
+ onRemoveVideo: (videoId: string) => void;
+ onStartAnalysis: () => void;
+ formatFileSize: (bytes: number) => string;
+ analysisState: VideoAnalysisState;
+}
+
+export const WelcomeScreen = ({
+ onVideoUpload,
+ uploadedVideos,
+ analysisState
+}: WelcomeScreenProps) => {
+ const { serviceState, loading } = useServiceContext();
+
+ // Only allow uploading videos when ImageBind is loaded and not in operation
+ const isServiceReady = serviceState.imagebindLoaded && !loading.loadingImageBind && !loading.releasingImageBind;
+
+
+
+ // Debug information
+ console.log('WelcomeScreen - Analysis State:', {
+ isAnalyzing: analysisState.isAnalyzing,
+ progress: analysisState.progress,
+ currentStep: analysisState.currentStep,
+ selectedVideos: analysisState.selectedVideos,
+ uploadedVideos: uploadedVideos,
+ shouldShowVideoBar: uploadedVideos.length > 0 || analysisState.selectedVideos.length > 0
+ });
+
+ const handleClick = () => {
+ if (isServiceReady) {
+ onVideoUpload();
+ }
+ };
+
+ return (
+ <div className="flex-1 flex flex-col">
+ {/* Main Content */}
+ <div className={`flex-1 flex flex-col justify-start p-8 ${
+ (uploadedVideos.length > 0 || analysisState.selectedVideos.length > 0) ? 'pt-20' : 'pt-16'
+ }`}>
+ {!analysisState.isAnalyzing && (
+ /* Welcome View */
+ <div className="text-center max-w-4xl mx-auto">
+ {/* Welcome Message */}
+ <div className="mb-16">
+ <h1 className="text-5xl font-bold text-gray-800 mb-4">
+ Welcome, it's <span className="bg-gradient-to-r from-blue-500 via-purple-600 to-pink-500 bg-clip-text text-transparent">Vimo</span> !
+ </h1>
+ </div>
+
+ {/* Video Upload Card - Main Feature */}
+ <div
+ className={`bg-white rounded-3xl border-2 border-dashed p-16 transition-all duration-300 group ${
+ isServiceReady
+ ? 'border-gray-200 cursor-pointer hover:border-blue-300 hover:bg-blue-50/30'
+ : 'border-gray-100 cursor-not-allowed opacity-60'
+ }`}
+ onClick={isServiceReady ? handleClick : undefined}
+ >
+ <div className="flex flex-col items-center">
+ <div className={`w-20 h-20 bg-gradient-to-r from-blue-500 to-purple-600 rounded-full flex items-center justify-center mb-6 transition-transform ${
+ isServiceReady ? 'group-hover:scale-110' : ''
+ }`}>
+ <Video size={40} className="text-white" />
+ </div>
+ <h3 className="text-2xl font-semibold text-gray-800 mb-3">
+ Upload Your Videos
+ </h3>
+ <p className="text-gray-600 mb-8 max-w-lg text-lg">
+ Upload videos to get started with intelligent video analysis.
+ </p>
+ <Button
+ className={`px-8 py-3 rounded-lg font-medium text-lg ${
+ isServiceReady
+ ? 'bg-gradient-to-r from-blue-500 to-purple-600 hover:from-blue-600 hover:to-purple-700 text-white'
+ : 'bg-gray-300 text-gray-500 cursor-not-allowed'
+ }`}
+ disabled={!isServiceReady}
+ >
+ <Upload size={20} className="mr-2" />
+ Choose Videos
+ </Button>
+ <p className="text-sm text-gray-500 mt-6">
+ Supported formats: MP4, MOV, AVI, WebM
+ </p>
+ </div>
+ </div>
+
+ </div>
+ )}
+ </div>
+ </div>
+ );
+};
\ No newline at end of file
diff --git a/Vimo-desktop/src/renderer/src/components/common/VideoPreviewCard.tsx b/Vimo-desktop/src/renderer/src/components/common/VideoPreviewCard.tsx
new file mode 100644
index 0000000..0c9f080
--- /dev/null
+++ b/Vimo-desktop/src/renderer/src/components/common/VideoPreviewCard.tsx
@@ -0,0 +1,129 @@
+import React, { useState, useEffect } from 'react';
+import { Clock, X, Video } from 'lucide-react';
+import { UploadedVideo } from '../../types/chat';
+
+interface VideoPreviewCardProps {
+ video: UploadedVideo;
+ onRemove: (videoId: string) => void;
+ formatFileSize: (bytes: number) => string;
+ disabled?: boolean;
+ showDeleteButton?: boolean;
+}
+
+export const VideoPreviewCard: React.FC<VideoPreviewCardProps> = ({
+ video,
+ onRemove,
+ disabled = false,
+ showDeleteButton = true,
+}) => {
+ const [duration, setDuration] = useState<number | null>(null);
+ const [isLoading, setIsLoading] = useState(true);
+
+ useEffect(() => {
+ // Reset states when video URL changes
+ setDuration(null);
+ setIsLoading(true);
+
+ const fetchVideoDuration = async () => {
+ try {
+ if (!video.path) {
+ console.error('❌ VideoPreviewCard: video.path is undefined or empty');
+ return;
+ }
+
+ // Use window.api to call video duration API
+ const result = await window.api.videorag.getVideoDuration(video.path);
+
+ if (result.success) {
+ setDuration(result.duration ?? null);
+ } else {
+ console.error('Failed to get video duration:', result.error);
+ }
+ } catch (error) {
+ console.error('Error fetching video duration:', error);
+ } finally {
+ setIsLoading(false);
+ }
+ };
+
+ fetchVideoDuration();
+ }, [video.path]);
+
+ const formatDuration = (seconds: number): string => {
+ const mins = Math.floor(seconds / 60);
+ const secs = Math.floor(seconds % 60);
+ return `${mins}:${secs.toString().padStart(2, '0')}`;
+ };
+
+ const handleRemove = () => {
+ if (!disabled && showDeleteButton) {
+ onRemove(video.id);
+ }
+ };
+
+ return (
+ <div className={`relative bg-white rounded-lg shadow-sm border transition-all duration-200 group p-4 ${
+ disabled
+ ? 'border-gray-200 opacity-75'
+ : 'border-gray-200 hover:shadow-md'
+ }`}>
+ {/* Remove button - only show if showDeleteButton is true */}
+ {showDeleteButton && (
+ <button
+ onClick={handleRemove}
+ disabled={disabled}
+ className={`absolute top-2 right-2 z-10 rounded-full p-1 transition-opacity ${
+ disabled
+ ? 'bg-gray-400 text-gray-300 cursor-not-allowed opacity-50'
+ : 'bg-black bg-opacity-50 hover:bg-opacity-70 text-white opacity-0 group-hover:opacity-100'
+ }`}
+ >
+ <X size={14} />
+ </button>
+ )}
+
+ {/* Video icon and info */}
+ <div className="flex items-start gap-3">
+ {/* Video icon */}
+ <div className={`flex-shrink-0 w-12 h-12 rounded-lg flex items-center justify-center ${
+ disabled
+ ? 'bg-gray-400'
+ : 'bg-gradient-to-r from-blue-500 to-purple-600'
+ }`}>
+ <Video size={20} className="text-white" />
+ </div>
+
+ {/* Video details */}
+ <div className="flex-1 min-w-0">
+ <h3 className={`text-sm font-medium mb-2 leading-tight ${
+ disabled ? 'text-gray-500' : 'text-gray-800'
+ }`}
+ style={{
+ display: '-webkit-box',
+ WebkitLineClamp: 2,
+ WebkitBoxOrient: 'vertical',
+ overflow: 'hidden',
+ minHeight: '2.5rem'
+ }}
+ title={video.name}>
+ {video.name}
+ </h3>
+
+ {/* Duration info */}
+ <div className={`flex items-center gap-1 text-xs ${
+ disabled ? 'text-gray-400' : 'text-gray-500'
+ }`}>
+ <Clock size={12} />
+ {isLoading ? (
+ <span>Loading...</span>
+ ) : duration ? (
+ <span>{formatDuration(duration)}</span>
+ ) : (
+ <span>--:--</span>
+ )}
+ </div>
+ </div>
+ </div>
+ </div>
+ );
+};
\ No newline at end of file
diff --git a/Vimo-desktop/src/renderer/src/components/common/VideoSelectionBar.tsx b/Vimo-desktop/src/renderer/src/components/common/VideoSelectionBar.tsx
new file mode 100644
index 0000000..594aa16
--- /dev/null
+++ b/Vimo-desktop/src/renderer/src/components/common/VideoSelectionBar.tsx
@@ -0,0 +1,135 @@
+import React, { useState, useEffect } from 'react';
+import { ChevronUp, ChevronDown, Sparkles, CheckCircle } from 'lucide-react';
+import { UploadedVideo } from '../../types/chat';
+import { VideoPreviewCard } from './VideoPreviewCard';
+import { Button } from '../ui/button';
+
+interface VideoSelectionBarProps {
+ videos: UploadedVideo[];
+ onRemoveVideo: (videoId: string) => void;
+ onStartAnalysis: () => void;
+ formatFileSize: (bytes: number) => string;
+ isServiceReady: boolean;
+ isAnalyzing?: boolean;
+ analysisCompleted?: boolean;
+}
+
+export const VideoSelectionBar: React.FC<VideoSelectionBarProps> = ({
+ videos,
+ onRemoveVideo,
+ onStartAnalysis,
+ formatFileSize,
+ isServiceReady,
+ isAnalyzing = false,
+ analysisCompleted = false,
+}) => {
+ const [isExpanded, setIsExpanded] = useState(true);
+
+ // Auto-collapse when analysis starts, but allow manual expansion during analysis
+ useEffect(() => {
+ if (isAnalyzing && isExpanded) {
+ setIsExpanded(false);
+ }
+ }, [isAnalyzing]);
+
+ if (videos.length === 0) return null;
+
+ const toggleExpanded = () => {
+ setIsExpanded(!isExpanded);
+ };
+
+ const getStatusText = () => {
+ if (analysisCompleted) {
+ return `${videos.length} Video${videos.length > 1 ? 's' : ''} Analyzed`;
+ }
+ if (isAnalyzing) {
+ return `${videos.length} Video${videos.length > 1 ? 's' : ''} Being Analyzed`;
+ }
+ return `${videos.length} Video${videos.length > 1 ? 's' : ''} Selected`;
+ };
+
+ const getStatusIndicator = () => {
+ if (analysisCompleted) {
+ return (
+ <div className="flex items-center gap-2 text-green-600">
+ <CheckCircle size={16} />
+ <span className="text-sm">Completed</span>
+ </div>
+ );
+ }
+ if (isAnalyzing) {
+ return (
+ <div className="flex items-center gap-2 text-blue-600">
+ <div className="w-2 h-2 bg-blue-500 rounded-full animate-pulse"></div>
+ <span className="text-sm">Processing...</span>
+ </div>
+ );
+ }
+ return null;
+ };
+
+ const isDeleteDisabled = isAnalyzing || analysisCompleted;
+ const isAnalysisButtonDisabled = !isServiceReady || videos.length === 0 || isAnalyzing || analysisCompleted;
+
+ // Only show Start Analysis button when new chat and not analyzing
+ const shouldShowAnalysisButton = !isAnalyzing && !analysisCompleted;
+
+ return (
+ <div className="bg-white border border-gray-200 shadow-lg transition-all duration-300 rounded-b-lg">
+ {/* Header */}
+ <div className="flex items-center justify-between px-6 py-3 bg-gray-50 border-b border-gray-100 rounded-t-lg">
+ <div className="flex items-center gap-3">
+ <button
+ onClick={toggleExpanded}
+ className="flex items-center gap-2 text-gray-700 hover:text-gray-900 transition-colors"
+ >
+ {isExpanded ? <ChevronDown size={20} /> : <ChevronUp size={20} />}
+ <span className="font-medium">
+ {getStatusText()}
+ </span>
+ </button>
+ {getStatusIndicator()}
+ </div>
+
+ {/* Only show Start Analysis button when needed */}
+ {shouldShowAnalysisButton && (
+ <div className="flex items-center gap-3">
+ <Button
+ onClick={onStartAnalysis}
+ disabled={isAnalysisButtonDisabled}
+ className={`px-6 py-2 rounded-lg font-medium transition-all duration-200 flex items-center gap-2 ${
+ isAnalysisButtonDisabled
+ ? 'bg-gray-300 text-gray-500 cursor-not-allowed'
+ : 'bg-gradient-to-r from-blue-500 to-purple-600 hover:from-blue-600 hover:to-purple-700 text-white'
+ }`}
+ >
+ <Sparkles size={16} />
+ Start Analysis
+ </Button>
+ </div>
+ )}
+ </div>
+
+ {/* Content */}
+ <div className={`overflow-hidden transition-all duration-300 ${
+ isExpanded ? 'max-h-32 opacity-100' : 'max-h-0 opacity-0'
+ }`}>
+ <div className="p-4">
+ <div className="flex gap-4 overflow-x-auto pb-2">
+ {videos.map((video) => (
+ <div key={video.id} className="flex-shrink-0 w-80">
+ <VideoPreviewCard
+ video={video}
+ onRemove={onRemoveVideo}
+ formatFileSize={formatFileSize}
+ disabled={isDeleteDisabled}
+ showDeleteButton={!isDeleteDisabled}
+ />
+ </div>
+ ))}
+ </div>
+ </div>
+ </div>
+ </div>
+ );
+};
\ No newline at end of file
diff --git a/Vimo-desktop/src/renderer/src/components/common/drag.tsx b/Vimo-desktop/src/renderer/src/components/common/drag.tsx
new file mode 100644
index 0000000..4c31b37
--- /dev/null
+++ b/Vimo-desktop/src/renderer/src/components/common/drag.tsx
@@ -0,0 +1,11 @@
+export function DragArea() {
+ return (
+ <div
+ className="draggable-area h-8 w-full"
+ style={{
+ WebkitAppRegion: 'drag',
+ userSelect: 'none',
+ } as any}
+ />
+ );
+}
diff --git a/Vimo-desktop/src/renderer/src/components/sidebar/app-sidebar.tsx b/Vimo-desktop/src/renderer/src/components/sidebar/app-sidebar.tsx
new file mode 100644
index 0000000..6c64467
--- /dev/null
+++ b/Vimo-desktop/src/renderer/src/components/sidebar/app-sidebar.tsx
@@ -0,0 +1,536 @@
+import { useCallback, useState, useEffect } from 'react';
+import { useNavigate, useLocation } from 'react-router';
+import { Settings, Plus, MessageCircle, Video, Trash2, GripVertical, Server } from 'lucide-react';
+
+import {
+ Sidebar,
+ SidebarContent,
+ SidebarFooter,
+ SidebarHeader,
+ SidebarMenu,
+ SidebarMenuButton,
+} from '../ui/sidebar';
+import { DragArea } from '../common/drag';
+import { VideoRAGHeader } from './nav-header';
+import { Button } from '../ui/button';
+import { ToggleSwitch } from '../ui/toggle-switch';
+import { useServiceContext } from '../../contexts/ServiceContext';
+import { useChatSessionContext } from '../../contexts/ChatSessionContext';
+
+interface ChatHistory {
+ id: string;
+ title: string;
+ lastMessage: string;
+ timestamp: Date;
+}
+
+export function AppSidebar() {
+ const navigate = useNavigate();
+ const location = useLocation();
+ const [chatHistory, setChatHistory] = useState<ChatHistory[]>([]);
+ const [draggedItem, setDraggedItem] = useState<string | null>(null);
+ const [dragOverItem, setDragOverItem] = useState<string | null>(null);
+ const [dropPosition, setDropPosition] = useState<'before' | 'after' | null>(null);
+
+ // VideoRAG service control
+ const {
+ serviceState,
+ loading: serviceLoading,
+ loadImageBind,
+ releaseImageBind
+ } = useServiceContext();
+
+ // Chat Session information management
+ const sessionInfo = useChatSessionContext();
+
+ // Debug information
+ console.log('AppSidebar - Service State:', {
+ isRunning: serviceState.isRunning,
+ loading: serviceLoading,
+ message: serviceState.message,
+ error: serviceState.error
+ });
+
+ // Load chat history from session info
+ useEffect(() => {
+ if (sessionInfo.isLoading) return;
+
+ // Build chat history based on session info
+ const chatHistoryFromSessions = sessionInfo.sessions.map(session => ({
+ id: session.id,
+ title: session.title,
+ lastMessage: session.lastMessage ||
+ (session.analysisState === 'completed'
+ ? 'Video analysis completed - Ready for questions!'
+ : session.analysisState === 'analyzing'
+ ? 'Video analysis in progress...'
+ : 'New chat session'),
+ timestamp: session.lastUpdated,
+ }));
+
+ // Backend has handled sorting, use directly
+ setChatHistory(chatHistoryFromSessions);
+ }, [sessionInfo.isLoading, sessionInfo.sessions]);
+
+ // Note: No longer need to listen to chatHistoryEvent, because now using context to share state
+ // sidebar will automatically listen to changes in sessions through context
+
+ const handleNewChat = useCallback(() => {
+ const newChatId = `new`;
+ navigate(`/chat/${newChatId}`);
+ }, [navigate]);
+
+ const handleChatSelect = useCallback(
+ (chatId: string) => {
+ // If dragging, do not process click
+ if (draggedItem) {
+ return;
+ }
+
+ // Ensure correct navigation and force reload
+ navigate(`/chat/${chatId}`);
+
+ // Add a small delay to ensure navigation is complete before triggering message load
+ setTimeout(() => {
+ const event = new CustomEvent('force-reload-chat', {
+ detail: { chatId },
+ });
+ window.dispatchEvent(event);
+ }, 100);
+ },
+ [navigate, draggedItem],
+ );
+
+ const handleDeleteChat = useCallback(
+ (chatId: string, event: React.MouseEvent) => {
+ event.stopPropagation(); // Prevent triggering chat selection
+
+ const chatToDelete = chatHistory.find((chat) => chat.id === chatId);
+ const chatTitle = chatToDelete?.title || 'Untitled Chat';
+
+ // Confirm deletion
+ if (
+ confirm(
+ `Are you sure you want to delete "${chatTitle}"?\n\nThis conversation and all its messages will be permanently removed.`,
+ )
+ ) {
+ // Delete session info (this will automatically delete messages and chat history)
+ sessionInfo.deleteSessionInfo(chatId);
+
+ // If the deleted chat is the current chat, navigate to new chat
+ const currentChatId = location.pathname.split('/')[2];
+ if (currentChatId === chatId) {
+ navigate('/chat/new');
+ }
+ }
+ },
+ [chatHistory, location.pathname, navigate, sessionInfo],
+ );
+
+ const handleSettingsClick = useCallback(() => {
+ navigate('/settings');
+ }, [navigate]);
+
+ const formatTime = (timestamp: Date) => {
+ const now = new Date();
+ const diff = now.getTime() - timestamp.getTime();
+ const minutes = Math.floor(diff / (1000 * 60));
+ const hours = Math.floor(diff / (1000 * 60 * 60));
+ const days = Math.floor(diff / (1000 * 60 * 60 * 24));
+
+ if (minutes < 60) return `${minutes}m ago`;
+ if (hours < 24) return `${hours}h ago`;
+ return `${days}d ago`;
+ };
+
+ const handleClearAllHistory = useCallback(() => {
+ if (
+ confirm(
+ `Are you sure you want to clear all ${chatHistory.length} conversations?\n\nThis action cannot be undone and will permanently delete all chat history.`,
+ )
+ ) {
+ // Clear all session info (this will automatically delete all messages and chat history)
+ sessionInfo.clearAllSessions();
+
+ // Navigate to new chat
+ navigate('/chat/new');
+ }
+ }, [chatHistory, navigate, sessionInfo]);
+
+ // Drag handling functions
+ const handleDragStart = useCallback((e: React.DragEvent, chatId: string) => {
+ setDraggedItem(chatId);
+ e.dataTransfer.effectAllowed = 'move';
+ e.dataTransfer.setData('text/plain', chatId);
+ }, []);
+
+ const handleDragEnd = useCallback(() => {
+ setDraggedItem(null);
+ setDragOverItem(null);
+ setDropPosition(null);
+ }, []);
+
+ const handleDragOver = useCallback((e: React.DragEvent, chatId: string) => {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'move';
+
+ if (draggedItem && draggedItem !== chatId) {
+ const rect = e.currentTarget.getBoundingClientRect();
+ const y = e.clientY;
+ const midPoint = rect.top + rect.height / 2;
+
+ setDragOverItem(chatId);
+ setDropPosition(y < midPoint ? 'before' : 'after');
+ }
+ }, [draggedItem]);
+
+ const handleDragEnter = useCallback((e: React.DragEvent, chatId: string) => {
+ e.preventDefault();
+ if (draggedItem && draggedItem !== chatId) {
+ const rect = e.currentTarget.getBoundingClientRect();
+ const y = e.clientY;
+ const midPoint = rect.top + rect.height / 2;
+
+ setDragOverItem(chatId);
+ setDropPosition(y < midPoint ? 'before' : 'after');
+ }
+ }, [draggedItem]);
+
+ const handleDragLeave = useCallback((e: React.DragEvent) => {
+ // Only clear dragOverItem when mouse truly leaves element
+ const rect = e.currentTarget.getBoundingClientRect();
+ const x = e.clientX;
+ const y = e.clientY;
+
+ if (x < rect.left || x > rect.right || y < rect.top || y > rect.bottom) {
+ setDragOverItem(null);
+ setDropPosition(null);
+ }
+ }, []);
+
+ const handleDrop = useCallback(async (e: React.DragEvent, targetChatId: string) => {
+ e.preventDefault();
+ const sourceChatId = draggedItem;
+
+ if (!sourceChatId || sourceChatId === targetChatId) {
+ setDraggedItem(null);
+ setDragOverItem(null);
+ setDropPosition(null);
+ return;
+ }
+
+ // Reorder session info
+ const sessions = sessionInfo.sessions;
+ const sourceSession = sessions.find(s => s.id === sourceChatId);
+ const targetSession = sessions.find(s => s.id === targetChatId);
+
+ if (sourceSession && targetSession) {
+ const reorderedSessions = [...sessions];
+ const sourceIndex = reorderedSessions.findIndex(s => s.id === sourceChatId);
+ const targetIndex = reorderedSessions.findIndex(s => s.id === targetChatId);
+
+ if (sourceIndex !== -1 && targetIndex !== -1) {
+ // Move element
+ const [movedSession] = reorderedSessions.splice(sourceIndex, 1);
+
+ // Calculate insert position
+ let insertIndex = targetIndex;
+ if (sourceIndex < targetIndex) {
+ insertIndex = targetIndex - 1;
+ }
+
+ // Adjust insert index based on drop position
+ if (dropPosition === 'after') {
+ insertIndex += 1;
+ }
+
+ reorderedSessions.splice(insertIndex, 0, movedSession);
+ await sessionInfo.reorderSessions(reorderedSessions);
+ }
+ }
+
+ setDraggedItem(null);
+ setDragOverItem(null);
+ setDropPosition(null);
+ }, [draggedItem, dropPosition, sessionInfo]);
+
+ const currentChatId = location.pathname.split('/')[2];
+
+ return (
+ <Sidebar collapsible="icon" className="select-none">
+ <DragArea />
+ <SidebarHeader>
+ <VideoRAGHeader />
+
+ {/* New Chat Button */}
+ <div className="px-2 flex justify-center">
+ <Button
+ onClick={handleNewChat}
+ className="min-w-[120px] max-w-[200px] w-full justify-center gap-2 bg-gradient-to-r from-blue-500 to-purple-600 hover:from-blue-600 hover:to-purple-700 text-white transition-all duration-200 shadow-lg hover:shadow-xl active:scale-95"
+ >
+ <Plus size={16} />
+ <span className="font-medium">New Chat</span>
+ </Button>
+ </div>
+ </SidebarHeader>
+
+ <SidebarContent className="px-2">
+ <div className="space-y-1">
+ {chatHistory.length === 0 ? (
+ <div className="text-center text-muted-foreground text-sm py-8">
+ <MessageCircle size={32} className="mx-auto mb-2 opacity-50" />
+ <p>No chat history</p>
+ <p className="text-xs">Start a new conversation</p>
+ </div>
+ ) : (
+ <>
+ {/* Drag Hint */}
+ {chatHistory.length > 1 && !draggedItem && (
+ <div className="text-xs text-gray-400 mb-2 px-2 flex items-center gap-1">
+ <GripVertical size={12} />
+ <span>Drag to reorder conversations</span>
+ </div>
+ )}
+
+ {/* Clear All Button */}
+ {chatHistory.length > 0 && (
+ <div className="pb-2 mb-2 border-b border-gray-200">
+ <button
+ onClick={handleClearAllHistory}
+ className="w-full text-left text-xs text-gray-500 hover:text-red-600 transition-all duration-200 p-2 rounded-md hover:bg-red-50 flex items-center gap-2 group"
+ title={`Clear all ${chatHistory.length} conversations`}
+ >
+ <Trash2
+ size={12}
+ className="group-hover:scale-110 transition-transform duration-200"
+ />
+ Clear all history ({chatHistory.length})
+ </button>
+ </div>
+ )}
+
+ {/* Top Drop Zone for first position */}
+ {draggedItem && (
+ <div
+ className="h-4 -mx-2 px-2 flex items-center"
+ onDragOver={(e) => {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'move';
+ setDragOverItem('__TOP__');
+ setDropPosition('before');
+ }}
+ onDragLeave={(e) => {
+ const rect = e.currentTarget.getBoundingClientRect();
+ const x = e.clientX;
+ const y = e.clientY;
+ if (x < rect.left || x > rect.right || y < rect.top || y > rect.bottom) {
+ if (dragOverItem === '__TOP__') {
+ setDragOverItem(null);
+ setDropPosition(null);
+ }
+ }
+ }}
+ onDrop={async (e) => {
+ e.preventDefault();
+ const sourceChatId = draggedItem;
+ if (sourceChatId) {
+ // Reorder session info
+ const sessions = sessionInfo.sessions;
+ const sourceSession = sessions.find(s => s.id === sourceChatId);
+ if (sourceSession) {
+ const filteredSessions = sessions.filter(s => s.id !== sourceChatId);
+ const reorderedSessions = [sourceSession, ...filteredSessions];
+ await sessionInfo.reorderSessions(reorderedSessions);
+ }
+ }
+ setDraggedItem(null);
+ setDragOverItem(null);
+ setDropPosition(null);
+ }}
+ >
+ {dragOverItem === '__TOP__' && (
+ <div className="h-0.5 bg-blue-500 w-full rounded-full shadow-sm" />
+ )}
+ </div>
+ )}
+
+ {/* History Items */}
+ {chatHistory.map((chat) => (
+ <div key={`chat-container-${chat.id}`} className="relative">
+ {/* Insert Line Before */}
+ {dragOverItem === chat.id && dropPosition === 'before' && (
+ <div className="h-0.5 bg-blue-500 mx-2 mb-1 rounded-full shadow-sm transition-all duration-200" />
+ )}
+
+ <div
+ key={chat.id}
+ draggable
+ onClick={() => handleChatSelect(chat.id)}
+ onDragStart={(e) => handleDragStart(e, chat.id)}
+ onDragEnd={handleDragEnd}
+ onDragOver={(e) => handleDragOver(e, chat.id)}
+ onDragEnter={(e) => handleDragEnter(e, chat.id)}
+ onDragLeave={handleDragLeave}
+ onDrop={(e) => handleDrop(e, chat.id)}
+ className={`
+ group p-3 rounded-lg cursor-pointer transition-all duration-200 border relative select-none
+ ${currentChatId === chat.id ? 'bg-blue-50 border-blue-200' : 'border-transparent'}
+ ${draggedItem === chat.id ? 'opacity-50 scale-95 bg-gray-100 shadow-lg rotate-2' : ''}
+ ${!draggedItem ? 'hover:bg-gray-100' : ''}
+ `}
+ style={{
+ transformOrigin: 'center',
+ }}
+ >
+ <div className="flex items-start gap-2">
+ {/* Drag Handle */}
+ <div
+ className="drag-handle opacity-0 group-hover:opacity-100 transition-all duration-200 cursor-grab active:cursor-grabbing text-gray-400 hover:text-gray-600 mt-0.5 flex-shrink-0"
+ title="Drag to reorder"
+ onMouseDown={(e) => {
+ // Ensure drag handle can trigger parent element's drag
+ e.stopPropagation();
+ }}
+ >
+ <GripVertical size={14} />
+ </div>
+
+ <Video
+ size={16}
+ className="text-blue-500 mt-0.5 flex-shrink-0"
+ />
+ <div className="flex-1 min-w-0">
+ <p className="font-medium text-sm truncate">
+ {chat.title}
+ </p>
+ <p className="text-xs text-muted-foreground truncate">
+ {chat.lastMessage}
+ </p>
+ <p className="text-xs text-muted-foreground mt-1">
+ {formatTime(chat.timestamp)}
+ </p>
+ </div>
+
+ {/* Delete Button - Shows on hover */}
+ <button
+ onClick={(e) => handleDeleteChat(chat.id, e)}
+ className="opacity-0 group-hover:opacity-100 transition-all duration-200 p-1.5 rounded-md hover:bg-red-100 hover:text-red-600 text-gray-400 hover:scale-110 active:scale-95"
+ title={`Delete "${chat.title}"`}
+ >
+ <Trash2 size={14} />
+ </button>
+ </div>
+ </div>
+
+ {/* Insert Line After */}
+ {dragOverItem === chat.id && dropPosition === 'after' && (
+ <div className="h-0.5 bg-blue-500 mx-2 mt-1 rounded-full shadow-sm transition-all duration-200" />
+ )}
+ </div>
+ ))}
+
+ {/* Bottom Drop Zone for last position */}
+ {draggedItem && (
+ <div
+ className="h-4 -mx-2 px-2 flex items-center"
+ onDragOver={(e) => {
+ e.preventDefault();
+ e.dataTransfer.dropEffect = 'move';
+ setDragOverItem('__BOTTOM__');
+ setDropPosition('after');
+ }}
+ onDragLeave={(e) => {
+ const rect = e.currentTarget.getBoundingClientRect();
+ const x = e.clientX;
+ const y = e.clientY;
+ if (x < rect.left || x > rect.right || y < rect.top || y > rect.bottom) {
+ if (dragOverItem === '__BOTTOM__') {
+ setDragOverItem(null);
+ setDropPosition(null);
+ }
+ }
+ }}
+ onDrop={async (e) => {
+ e.preventDefault();
+ const sourceChatId = draggedItem;
+ if (sourceChatId) {
+ // Reorder session info (move to end)
+ const sessions = sessionInfo.sessions;
+ const sourceSession = sessions.find(s => s.id === sourceChatId);
+ if (sourceSession) {
+ const filteredSessions = sessions.filter(s => s.id !== sourceChatId);
+ const reorderedSessions = [...filteredSessions, sourceSession];
+ await sessionInfo.reorderSessions(reorderedSessions);
+ }
+ }
+ setDraggedItem(null);
+ setDragOverItem(null);
+ setDropPosition(null);
+ }}
+ >
+ {dragOverItem === '__BOTTOM__' && (
+ <div className="h-0.5 bg-blue-500 w-full rounded-full shadow-sm" />
+ )}
+ </div>
+ )}
+ </>
+ )}
+ </div>
+ </SidebarContent>
+
+ <SidebarFooter className="p-2 space-y-2">
+ {/* Service Control */}
+ <div className="p-3 bg-gray-50 rounded-lg">
+ <div className="flex items-center justify-between">
+ <div className="flex items-center space-x-2">
+ <Server size={16} className={`${serviceState.imagebindLoaded ? 'text-green-500' : 'text-gray-400'}`} />
+ <span className="text-sm font-medium">
+ Vimo Service
+ </span>
+ </div>
+ <ToggleSwitch
+ checked={serviceState.imagebindLoaded}
+ onChange={async (checked) => {
+ if (checked) {
+ await loadImageBind();
+ } else {
+ await releaseImageBind();
+ }
+ }}
+ disabled={serviceLoading.loadingImageBind || serviceLoading.releasingImageBind}
+ size="sm"
+ />
+ </div>
+ <div className="mt-2 text-xs text-gray-600">
+ {serviceLoading.loadingImageBind && 'Loading Embedding model...'}
+ {serviceLoading.releasingImageBind && 'Releasing Embedding model...'}
+ {!serviceLoading.loadingImageBind && !serviceLoading.releasingImageBind && (
+ serviceState.imagebindLoaded ? 'Ready for video processing' : (
+ serviceState.isRunning ? (
+ <span className="text-yellow-600">
+ Click to load Embedding model
+ </span>
+ ) : (
+ <span className="bg-gradient-to-r from-purple-600 to-purple-400 bg-clip-text text-transparent font-medium">
+ Click to start
+ </span>
+ )
+ )
+ )}
+ </div>
+ </div>
+
+ <SidebarMenu>
+ <SidebarMenuButton
+ className="font-medium"
+ onClick={handleSettingsClick}
+ isActive={location.pathname === '/settings'}
+ >
+ <Settings />
+ Settings
+ </SidebarMenuButton>
+ </SidebarMenu>
+ </SidebarFooter>
+ </Sidebar>
+ );
+}
diff --git a/Vimo-desktop/src/renderer/src/components/sidebar/nav-header.tsx b/Vimo-desktop/src/renderer/src/components/sidebar/nav-header.tsx
new file mode 100644
index 0000000..eb185a7
--- /dev/null
+++ b/Vimo-desktop/src/renderer/src/components/sidebar/nav-header.tsx
@@ -0,0 +1,17 @@
+import vimoLogo from '../../assets/images/vimi-logo.png'
+
+export function VideoRAGHeader() {
+ return (
+ <div className="flex items-center gap-2 px-3 py-2">
+ <img
+ src={vimoLogo}
+ alt="Vimo"
+ className="size-8 rounded-lg shadow-lg border-2 border-white/20 hover:shadow-xl hover:scale-105 transition-all duration-300 ring-1 ring-gray-200/50"
+ />
+ <div className="flex flex-col">
+ <span className="text-sm font-semibold">Vimo</span>
+ <span className="text-xs text-muted-foreground">AI Assistant</span>
+ </div>
+ </div>
+ );
+}
diff --git a/Vimo-desktop/src/renderer/src/components/ui/button.tsx b/Vimo-desktop/src/renderer/src/components/ui/button.tsx
new file mode 100644
index 0000000..c96d6b5
--- /dev/null
+++ b/Vimo-desktop/src/renderer/src/components/ui/button.tsx
@@ -0,0 +1,57 @@
+import * as React from 'react';
+import { Slot } from '@radix-ui/react-slot';
+import { cva, type VariantProps } from 'class-variance-authority';
+import { cn } from '../../lib/utils';
+
+const buttonVariants = cva(
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
+ {
+ variants: {
+ variant: {
+ default:
+ 'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90',
+ destructive:
+ 'bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',
+ outline:
+ 'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50',
+ secondary:
+ 'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80',
+ ghost:
+ 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',
+ link: 'text-primary underline-offset-4 hover:underline',
+ },
+ size: {
+ default: 'h-9 px-4 py-2 has-[>svg]:px-3',
+ sm: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5',
+ lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',
+ icon: 'size-9',
+ },
+ },
+ defaultVariants: {
+ variant: 'default',
+ size: 'default',
+ },
+ },
+);
+
+export interface ButtonProps
+ extends React.ButtonHTMLAttributes<HTMLButtonElement>,
+ VariantProps<typeof buttonVariants> {
+ asChild?: boolean;
+}
+
+const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
+ ({ className, variant, size, asChild = false, ...props }, ref) => {
+ const Comp = asChild ? Slot : 'button';
+ return (
+ <Comp
+ className={cn(buttonVariants({ variant, size, className }))}
+ ref={ref}
+ {...props}
+ />
+ );
+ },
+);
+Button.displayName = 'Button';
+
+export { Button, buttonVariants };
diff --git a/Vimo-desktop/src/renderer/src/components/ui/card.tsx b/Vimo-desktop/src/renderer/src/components/ui/card.tsx
new file mode 100644
index 0000000..e66d10d
--- /dev/null
+++ b/Vimo-desktop/src/renderer/src/components/ui/card.tsx
@@ -0,0 +1,77 @@
+import * as React from 'react';
+import { cn } from '../../lib/utils';
+
+function Card({ className, ...props }: React.ComponentProps<'div'>) {
+ return (
+ <div
+ data-slot="card"
+ className={cn(
+ 'bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm',
+ className,
+ )}
+ {...props}
+ />
+ );
+}
+
+function CardHeader({ className, ...props }: React.ComponentProps<'div'>) {
+ return (
+ <div
+ data-slot="card-header"
+ className={cn(
+ '@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6',
+ className,
+ )}
+ {...props}
+ />
+ );
+}
+
+function CardTitle({ className, ...props }: React.ComponentProps<'div'>) {
+ return (
+ <div
+ data-slot="card-title"
+ className={cn('leading-none font-semibold', className)}
+ {...props}
+ />
+ );
+}
+
+function CardDescription({ className, ...props }: React.ComponentProps<'div'>) {
+ return (
+ <div
+ data-slot="card-description"
+ className={cn('text-muted-foreground text-sm', className)}
+ {...props}
+ />
+ );
+}
+
+function CardContent({ className, ...props }: React.ComponentProps<'div'>) {
+ return (
+ <div
+ data-slot="card-content"
+ className={cn('px-6', className)}
+ {...props}
+ />
+ );
+}
+
+function CardFooter({ className, ...props }: React.ComponentProps<'div'>) {
+ return (
+ <div
+ data-slot="card-footer"
+ className={cn('flex items-center px-6 [.border-t]:pt-6', className)}
+ {...props}
+ />
+ );
+}
+
+export {
+ Card,
+ CardHeader,
+ CardFooter,
+ CardTitle,
+ CardDescription,
+ CardContent,
+};
diff --git a/Vimo-desktop/src/renderer/src/components/ui/sidebar.tsx b/Vimo-desktop/src/renderer/src/components/ui/sidebar.tsx
new file mode 100644
index 0000000..68a2187
--- /dev/null
+++ b/Vimo-desktop/src/renderer/src/components/ui/sidebar.tsx
@@ -0,0 +1,238 @@
+import * as React from 'react';
+import { cn } from '../../lib/utils';
+
+interface SidebarProviderProps extends React.ComponentProps<'div'> {
+ defaultOpen?: boolean;
+ open?: boolean;
+ onOpenChange?: (open: boolean) => void;
+ defaultWidth?: number;
+ minWidth?: number;
+ maxWidth?: number;
+}
+
+const SidebarContext = React.createContext<{
+ state: 'expanded' | 'collapsed';
+ open: boolean;
+ setOpen: (open: boolean) => void;
+ toggleSidebar: () => void;
+ width: number;
+ setWidth: (width: number) => void;
+} | null>(null);
+
+function useSidebar() {
+ const context = React.useContext(SidebarContext);
+ if (!context) {
+ throw new Error('useSidebar must be used within a SidebarProvider.');
+ }
+ return context;
+}
+
+function SidebarProvider({
+ defaultOpen = true,
+ open: openProp,
+ onOpenChange: setOpenProp,
+ defaultWidth = 240, // 15rem = 240px (minimum width)
+ minWidth = 240,
+ maxWidth = 480,
+ className,
+ style,
+ children,
+ ...props
+}: SidebarProviderProps) {
+ const [_open, _setOpen] = React.useState(defaultOpen);
+ const [width, setWidth] = React.useState(defaultWidth);
+
+ const open = openProp ?? _open;
+ const setOpen = React.useCallback(
+ (value: boolean | ((value: boolean) => boolean)) => {
+ const openState = typeof value === 'function' ? value(open) : value;
+ if (setOpenProp) {
+ setOpenProp(openState);
+ } else {
+ _setOpen(openState);
+ }
+ },
+ [setOpenProp, open],
+ );
+
+ const toggleSidebar = React.useCallback(() => {
+ setOpen((open) => !open);
+ }, [setOpen]);
+
+ const state: 'expanded' | 'collapsed' = open ? 'expanded' : 'collapsed';
+
+ const contextValue = React.useMemo(
+ () => ({
+ state,
+ open,
+ setOpen,
+ toggleSidebar,
+ width,
+ setWidth: (newWidth: number) => {
+ const clampedWidth = Math.max(minWidth, Math.min(maxWidth, newWidth));
+ setWidth(clampedWidth);
+ },
+ }),
+ [state, open, setOpen, toggleSidebar, width, minWidth, maxWidth],
+ );
+
+ return (
+ <SidebarContext.Provider value={contextValue}>
+ <div
+ style={
+ {
+ '--sidebar-width': `${width}px`,
+ '--sidebar-width-icon': '3rem',
+ ...style,
+ } as React.CSSProperties
+ }
+ className={cn('flex min-h-svh w-full', className)}
+ {...props}
+ >
+ {children}
+ </div>
+ </SidebarContext.Provider>
+ );
+}
+
+// 拖拽调整组件
+function SidebarResizer() {
+ const { setWidth } = useSidebar();
+ const [isDragging, setIsDragging] = React.useState(false);
+
+ const handleMouseDown = React.useCallback((e: React.MouseEvent) => {
+ e.preventDefault();
+ setIsDragging(true);
+ }, []);
+
+ React.useEffect(() => {
+ if (!isDragging) return;
+
+ const handleMouseMove = (e: MouseEvent) => {
+ const newWidth = e.clientX;
+ setWidth(newWidth);
+ };
+
+ const handleMouseUp = () => {
+ setIsDragging(false);
+ };
+
+ document.addEventListener('mousemove', handleMouseMove);
+ document.addEventListener('mouseup', handleMouseUp);
+
+ return () => {
+ document.removeEventListener('mousemove', handleMouseMove);
+ document.removeEventListener('mouseup', handleMouseUp);
+ };
+ }, [isDragging, setWidth]);
+
+ return (
+ <div
+ className={cn(
+ 'absolute right-0 top-0 bottom-0 w-2 cursor-col-resize bg-transparent hover:bg-blue-500/30 transition-all duration-200 group',
+ isDragging && 'bg-blue-500/50',
+ )}
+ onMouseDown={handleMouseDown}
+ style={{ zIndex: 50 }}
+ >
+ <div className="absolute right-0 top-1/2 transform -translate-y-1/2 w-1 h-8 bg-gray-300 rounded-full opacity-0 group-hover:opacity-100 transition-opacity duration-200" />
+ </div>
+ );
+}
+
+function Sidebar({
+ side = 'left',
+ collapsible = 'icon',
+ className,
+ children,
+ ...props
+}: React.ComponentProps<'div'> & {
+ side?: 'left' | 'right';
+ collapsible?: 'offcanvas' | 'icon' | 'none';
+}) {
+ return (
+ <div
+ className={cn(
+ 'bg-sidebar text-sidebar-foreground flex h-full flex-col border-r relative',
+ className,
+ )}
+ style={{ width: 'var(--sidebar-width)' }}
+ {...props}
+ >
+ {children}
+ <SidebarResizer />
+ </div>
+ );
+}
+
+function SidebarInset({ className, ...props }: React.ComponentProps<'main'>) {
+ return (
+ <main
+ className={cn('flex flex-1 flex-col overflow-hidden', className)}
+ {...props}
+ />
+ );
+}
+
+function SidebarHeader({ className, ...props }: React.ComponentProps<'div'>) {
+ return (
+ <div className={cn('flex flex-col gap-2 p-2', className)} {...props} />
+ );
+}
+
+function SidebarFooter({ className, ...props }: React.ComponentProps<'div'>) {
+ return (
+ <div
+ className={cn('flex flex-col gap-2 p-2 mt-auto', className)}
+ {...props}
+ />
+ );
+}
+
+function SidebarContent({ className, ...props }: React.ComponentProps<'div'>) {
+ return (
+ <div
+ className={cn('flex flex-col gap-2 overflow-auto p-2', className)}
+ {...props}
+ />
+ );
+}
+
+function SidebarMenu({ className, ...props }: React.ComponentProps<'ul'>) {
+ return (
+ <ul className={cn('flex flex-col gap-1 min-h-0', className)} {...props} />
+ );
+}
+
+function SidebarMenuButton({
+ className,
+ isActive = false,
+ children,
+ ...props
+}: React.ComponentProps<'button'> & { isActive?: boolean }) {
+ return (
+ <button
+ className={cn(
+ 'flex items-center gap-2 rounded-md px-2 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground',
+ isActive && 'bg-accent text-accent-foreground',
+ className,
+ )}
+ {...props}
+ >
+ {children}
+ </button>
+ );
+}
+
+export {
+ Sidebar,
+ SidebarProvider,
+ SidebarInset,
+ SidebarHeader,
+ SidebarFooter,
+ SidebarContent,
+ SidebarMenu,
+ SidebarMenuButton,
+ SidebarResizer,
+ useSidebar,
+};
diff --git a/Vimo-desktop/src/renderer/src/components/ui/toggle-switch.tsx b/Vimo-desktop/src/renderer/src/components/ui/toggle-switch.tsx
new file mode 100644
index 0000000..cf56249
--- /dev/null
+++ b/Vimo-desktop/src/renderer/src/components/ui/toggle-switch.tsx
@@ -0,0 +1,69 @@
+import React from 'react'
+
+interface ToggleSwitchProps {
+ checked: boolean
+ onChange: (checked: boolean) => void
+ disabled?: boolean
+ label?: string
+ size?: 'sm' | 'md' | 'lg'
+}
+
+export const ToggleSwitch: React.FC<ToggleSwitchProps> = ({
+ checked,
+ onChange,
+ disabled = false,
+ label,
+ size = 'md'
+}) => {
+ const sizes = {
+ sm: {
+ container: 'w-8 h-4',
+ thumb: 'w-3 h-3',
+ translate: 'translate-x-4'
+ },
+ md: {
+ container: 'w-11 h-6',
+ thumb: 'w-5 h-5',
+ translate: 'translate-x-5'
+ },
+ lg: {
+ container: 'w-14 h-8',
+ thumb: 'w-6 h-6',
+ translate: 'translate-x-6'
+ }
+ }
+
+ const currentSize = sizes[size]
+
+ return (
+ <div className="flex items-center space-x-2">
+ {label && (
+ <label className="text-sm font-medium text-gray-700 cursor-pointer">
+ {label}
+ </label>
+ )}
+ <button
+ type="button"
+ onClick={() => !disabled && onChange(!checked)}
+ disabled={disabled}
+ className={`
+ relative inline-flex ${currentSize.container} items-center rounded-full
+ transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2
+ ${disabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer'}
+ ${checked
+ ? 'bg-gradient-to-r from-blue-500 to-blue-600 shadow-lg'
+ : 'bg-gray-200 hover:bg-gray-300'
+ }
+ `}
+ >
+ <span className="sr-only">Toggle</span>
+ <div
+ className={`
+ ${currentSize.thumb} bg-white rounded-full shadow-lg transform transition-transform duration-200 ease-in-out
+ ${checked ? currentSize.translate : 'translate-x-0.5'}
+ `}
+ />
+ </button>
+ </div>
+ )
+}
\ No newline at end of file
diff --git a/Vimo-desktop/src/renderer/src/contexts/ChatSessionContext.tsx b/Vimo-desktop/src/renderer/src/contexts/ChatSessionContext.tsx
new file mode 100644
index 0000000..06e758d
--- /dev/null
+++ b/Vimo-desktop/src/renderer/src/contexts/ChatSessionContext.tsx
@@ -0,0 +1,42 @@
+import React, { createContext, useContext, ReactNode } from 'react';
+import { useChatSessionInfo } from '../hooks/useChatSessionInfo';
+import { ChatSessionInfo, UploadedVideo } from '../types/chat';
+
+export interface ChatSessionContextType {
+ sessions: ChatSessionInfo[];
+ isLoading: boolean;
+ createSessionInfo: (sessionId: string, title: string) => ChatSessionInfo | null;
+ updateSessionInfo: (sessionId: string, updates: Partial<ChatSessionInfo>) => void;
+ startAnalysis: (sessionId: string, videos: UploadedVideo[]) => void;
+ updateAnalysisProgress: (sessionId: string, progress: number, currentStep: string) => void;
+ completeAnalysis: (sessionId: string) => void;
+ deleteSessionInfo: (sessionId: string) => void;
+ getSessionInfo: (sessionId: string) => ChatSessionInfo | null;
+ reorderSessions: (reorderedSessions: ChatSessionInfo[]) => void;
+ clearAllSessions: () => void;
+ loadSessionsFromStorage: () => Promise<void>;
+}
+
+const ChatSessionContext = createContext<ChatSessionContextType | null>(null);
+
+interface ChatSessionProviderProps {
+ children: ReactNode;
+}
+
+export const ChatSessionProvider: React.FC<ChatSessionProviderProps> = ({ children }) => {
+ const sessionInfo = useChatSessionInfo();
+
+ return (
+ <ChatSessionContext.Provider value={sessionInfo}>
+ {children}
+ </ChatSessionContext.Provider>
+ );
+};
+
+export const useChatSessionContext = (): ChatSessionContextType => {
+ const context = useContext(ChatSessionContext);
+ if (!context) {
+ throw new Error('useChatSessionContext must be used within a ChatSessionProvider');
+ }
+ return context;
+};
\ No newline at end of file
diff --git a/Vimo-desktop/src/renderer/src/contexts/ServiceContext.tsx b/Vimo-desktop/src/renderer/src/contexts/ServiceContext.tsx
new file mode 100644
index 0000000..ee1c204
--- /dev/null
+++ b/Vimo-desktop/src/renderer/src/contexts/ServiceContext.tsx
@@ -0,0 +1,65 @@
+import { createContext, useContext, ReactNode } from 'react';
+import { useVideoRAGService } from '../hooks/useVideoRAGService';
+
+// Create Service Status Context
+interface ServiceContextType {
+ serviceState: {
+ isRunning: boolean;
+ imagebindLoaded: boolean;
+ message?: string;
+ error?: string;
+ };
+ loading: {
+ starting: boolean;
+ stopping: boolean;
+ checkingService: boolean;
+ loadingImageBind: boolean;
+ releasingImageBind: boolean;
+ };
+ startService: () => Promise<boolean>;
+ stopService: () => Promise<boolean>;
+ checkServiceStatus: () => Promise<void>;
+ loadImageBind: () => Promise<boolean>;
+ releaseImageBind: () => Promise<boolean>;
+ checkImageBindStatus: () => Promise<void>;
+}
+
+const ServiceContext = createContext<ServiceContextType | null>(null);
+
+export const ServiceProvider = ({ children }: { children: ReactNode }) => {
+ const {
+ serviceState,
+ loading,
+ startService,
+ stopService,
+ checkServiceStatus,
+ loadImageBind,
+ releaseImageBind,
+ checkImageBindStatus
+ } = useVideoRAGService();
+
+ return (
+ <ServiceContext.Provider
+ value={{
+ serviceState,
+ loading,
+ startService,
+ stopService,
+ checkServiceStatus,
+ loadImageBind,
+ releaseImageBind,
+ checkImageBindStatus
+ }}
+ >
+ {children}
+ </ServiceContext.Provider>
+ );
+};
+
+export const useServiceContext = () => {
+ const context = useContext(ServiceContext);
+ if (!context) {
+ throw new Error('useServiceContext must be used within a ServiceProvider');
+ }
+ return context;
+};
\ No newline at end of file
diff --git a/Vimo-desktop/src/renderer/src/hooks/useChat.ts b/Vimo-desktop/src/renderer/src/hooks/useChat.ts
new file mode 100644
index 0000000..d88babf
--- /dev/null
+++ b/Vimo-desktop/src/renderer/src/hooks/useChat.ts
@@ -0,0 +1,926 @@
+import { useState, useEffect, useCallback } from 'react';
+import { useParams, useNavigate } from 'react-router';
+import { Message, UploadedVideo, VideoAnalysisState, AnalysisStep } from '../types/chat';
+import {
+ loadMessages,
+ addMessage,
+ updateMessage,
+ generateMessageId,
+ generateChatId,
+} from '../utils/chat';
+import { useVideoRAG } from './useVideoRAG';
+import { useChatSessionContext } from '../contexts/ChatSessionContext';
+
+export const useChat = () => {
+ const { chatId } = useParams();
+ const navigate = useNavigate();
+
+ const [messages, setMessages] = useState<Message[]>([]);
+ const [inputValue, setInputValue] = useState('');
+ const [uploadedVideos, setUploadedVideos] = useState<UploadedVideo[]>([]);
+ const [isLoading, setIsLoading] = useState(false);
+ const [isQueryProcessing, setIsQueryProcessing] = useState(false);
+ const [analysisState, setAnalysisState] = useState<VideoAnalysisState>({
+ isAnalyzing: false,
+ progress: 0,
+ currentStep: 'Initializing',
+ selectedVideos: [],
+ });
+
+ const {
+ sessionStatus,
+ indexedVideos,
+ processingVideos,
+ videoStatus,
+ error: videoragError
+ } = useVideoRAG();
+
+ // Integrate Chat Session information management system
+ const sessionInfo = useChatSessionContext();
+
+ // Intelligent polling management
+ const [activePolling, setActivePolling] = useState<NodeJS.Timeout | null>(null);
+
+
+
+ // Load chat messages and session info
+ useEffect(() => {
+ if (!chatId || sessionInfo.isLoading) return;
+
+ // Load messages directly from file system
+ const loadChatMessages = async () => {
+ const messages = await loadMessages(chatId);
+ setMessages(messages);
+ };
+
+ // Load video state from JSON file to memory - remove sessionInfo.sessions dependency
+ const loadVideoStateFromJSON = async () => {
+ if (chatId === 'new') {
+ // New chat does not clear uploaded videos, keep temporary state
+ // Only clear uploaded videos when first entering or switching from other sessions to new
+ console.log('📂 New chat: preserving temporary uploaded videos');
+ setAnalysisState({
+ isAnalyzing: false,
+ progress: 0,
+ currentStep: 'Initializing',
+ selectedVideos: [],
+ });
+ return;
+ }
+
+ // Existing session: load video state from JSON file to memory
+ const currentSessionInfo = sessionInfo.getSessionInfo(chatId);
+ if (currentSessionInfo && currentSessionInfo.videos.length > 0) {
+ // Load video data from JSON file to memory state as temporary working state
+ console.log('📂 Loading videos from JSON to memory for session:', chatId, currentSessionInfo.videos);
+ setUploadedVideos([...currentSessionInfo.videos]);
+
+ // Restore analysis state
+ setAnalysisState({
+ isAnalyzing: currentSessionInfo.analysisState === 'analyzing',
+ progress: currentSessionInfo.analysisProgress || 0,
+ currentStep: currentSessionInfo.currentStep || 'Initializing',
+ selectedVideos: currentSessionInfo.videos,
+ });
+ } else {
+ // Existing session but no videos: clear memory state
+ setUploadedVideos([]);
+ setAnalysisState({
+ isAnalyzing: false,
+ progress: 0,
+ currentStep: 'Initializing',
+ selectedVideos: [],
+ });
+ }
+ };
+
+ // Load messages and video state simultaneously
+ Promise.all([
+ loadChatMessages(),
+ loadVideoStateFromJSON()
+ ]);
+ }, [chatId, sessionInfo.isLoading]); // Remove sessionInfo.sessions dependency
+
+ // Listen for chat messages updates
+ useEffect(() => {
+ const handleMessagesUpdate = (event: CustomEvent) => {
+ const { chatId: updatedChatId } = event.detail;
+ if (updatedChatId && updatedChatId === chatId) {
+ // Reload messages from file system to refresh interface
+ const reloadMessages = async () => {
+ const messages = await loadMessages(updatedChatId);
+ setMessages(messages);
+ };
+ reloadMessages();
+ }
+ };
+
+ const handleForceReload = (event: CustomEvent) => {
+ const { chatId: reloadChatId } = event.detail;
+ if (reloadChatId && reloadChatId === chatId) {
+ // Reload messages from file system
+ const reloadMessages = async () => {
+ const messages = await loadMessages(reloadChatId);
+ setMessages(messages);
+ };
+ reloadMessages();
+ }
+ };
+
+ const handleSessionDeleted = (event: CustomEvent) => {
+ const { chatId: deletedChatId } = event.detail;
+ if (deletedChatId && deletedChatId === chatId) {
+ console.log('🛑 Session deleted, stopping polling immediately for:', deletedChatId);
+ // Immediately stop polling (user will be navigated to new page, no need to reset state)
+ if (activePolling) {
+ clearTimeout(activePolling);
+ setActivePolling(null);
+ console.log('🛑 Polling stopped due to session deletion');
+ }
+ }
+ };
+
+ window.addEventListener('chat-messages-updated', handleMessagesUpdate as EventListener);
+ window.addEventListener('force-reload-chat', handleForceReload as EventListener);
+ window.addEventListener('session-deleted', handleSessionDeleted as EventListener);
+ return () => {
+ window.removeEventListener('chat-messages-updated', handleMessagesUpdate as EventListener);
+ window.removeEventListener('force-reload-chat', handleForceReload as EventListener);
+ window.removeEventListener('session-deleted', handleSessionDeleted as EventListener);
+ };
+ }, [chatId, sessionInfo, activePolling]);
+
+ // Clean up polling
+ useEffect(() => {
+ return () => {
+ if (activePolling) {
+ clearTimeout(activePolling);
+ setActivePolling(null);
+ }
+ };
+ }, []);
+
+ // Clear temporary state when chatId changes (session binding)
+ useEffect(() => {
+ // Don't clear state during analysis if we're just transitioning from 'new' to actual chat ID
+ // This prevents clearing state during the analysis flow
+ if (analysisState.isAnalyzing) return;
+
+ // Clear temporary input state when switching sessions
+ setInputValue('');
+ setIsLoading(false);
+ }, [chatId, analysisState.isAnalyzing]); // Remove sessionInfo.sessions dependency, avoid other session state updates affecting current session
+
+ // Special handling for switching to new chat
+ const [previousChatId, setPreviousChatId] = useState<string | undefined>(chatId);
+ useEffect(() => {
+ // Check if switching from other session to new chat
+ if (previousChatId && previousChatId !== 'new' && chatId === 'new') {
+ console.log('🧹 Switching from session to new chat, clearing uploaded videos');
+ // Clear temporary uploaded videos, prepare for new upload
+ setUploadedVideos(currentVideos => {
+ currentVideos.forEach((video) => URL.revokeObjectURL(video.url));
+ return [];
+ });
+ setAnalysisState({
+ isAnalyzing: false,
+ progress: 0,
+ currentStep: 'Initializing',
+ selectedVideos: [],
+ });
+ }
+
+ // Update previous chatId
+ setPreviousChatId(chatId);
+ }, [chatId, previousChatId]);
+
+ // Adjust polling interval to 2 seconds to avoid too frequent steps
+ const getPollingInterval = (): number => {
+ return 2000; // 2 seconds query, balance real-time and stability
+ };
+
+ // Persistent polling function - support asynchronous flow
+ const startPersistentPolling = (chatId: string) => {
+ const poll = async () => {
+ let shouldContinuePolling = true; // Default to continue polling
+
+ try {
+ console.log('DEBUG: Polling status for chat:', chatId);
+ const result = await window.api.videorag.getStatus(chatId);
+
+ if (result.success && result.data) {
+ const status = result.data;
+ console.log('🔍 Polling status:', status);
+
+ // Handle different statuses
+ switch (status.status) {
+ case 'initializing':
+ console.log('🔄 Initializing...');
+ break;
+
+ case 'completed':
+ console.log('✅ Analysis completed!');
+ await completeAnalysis(chatId, status.current_step, status.message);
+ shouldContinuePolling = false; // Stop polling
+ break;
+
+ case 'error':
+ console.error('❌ Analysis failed:', status.message);
+ await addAnalysisStep(chatId, status.current_step, status.message, 'error');
+ await handleAnalysisError(chatId, status.message || 'Analysis failed');
+ shouldContinuePolling = false; // Stop polling
+ break;
+
+
+
+ case 'processing':
+ // Processing video
+ const currentStep = status.current_step || 'Processing';
+ const message = status.message || 'Processing videos...';
+ console.log(`🔄 Video processing: ${currentStep} - ${message}`);
+ await addAnalysisStep(chatId, currentStep, message, 'active');
+ break;
+
+ case 'not_found':
+ // Session not found - need to check if session is not created or deleted
+ console.log('⚠️ Session not found in backend');
+
+ // Check if session still exists in frontend session list
+ const sessionExists = sessionInfo.getSessionInfo(chatId);
+ if (!sessionExists) {
+ // Frontend also does not have this session, indicating it has been deleted, stop polling
+ console.log('🛑 Session also deleted from frontend, stopping polling');
+ shouldContinuePolling = false;
+ } else {
+ // Frontend still has this session, possibly upload has not started, continue polling
+ console.log('🔄 Session exists in frontend, continuing polling (upload may not have started)');
+ }
+ break;
+
+ default:
+ // Other status, continue polling
+ console.log(`🔄 Unknown status: ${status.status} - ${status.message}`);
+ if (status.current_step && status.message) {
+ await addAnalysisStep(chatId, status.current_step, status.message, 'active');
+ }
+ break;
+ }
+
+ } else {
+ console.warn('⚠️ Polling failed, will retry in next interval', result.error);
+ }
+
+ } catch (error: any) {
+ console.error('❌ Polling error:', error);
+ // Network error, continue retrying
+ }
+
+ // Ensure polling continues in all cases (unless explicitly stopped)
+ if (shouldContinuePolling) {
+ const interval = getPollingInterval();
+ console.log(`🔄 Scheduling next poll in ${interval}ms`);
+ const timeout = setTimeout(poll, interval);
+ setActivePolling(timeout);
+ } else {
+ console.log('🛑 Polling stopped');
+ setActivePolling(null);
+ }
+ };
+
+ console.log('🚀 Starting persistent polling for chat:', chatId);
+ // Start first polling
+ poll();
+ };
+
+ // Stop polling function
+ const stopPolling = () => {
+ if (activePolling) {
+ clearTimeout(activePolling);
+ setActivePolling(null);
+ console.log('🛑 Polling stopped');
+ }
+ };
+
+
+ // Add or update analysis steps for video analysis (progress bar mode) - avoid duplicates but allow multiple videos independently
+ const addAnalysisStep = async (chatId: string, stepName: string, message: string, status: 'active' | 'completed' | 'error') => {
+ try {
+ // Load existing messages from JSON file
+ const result = await window.api.chatSessions.load(chatId);
+ const existingMessages = result.session?.messages || [];
+
+ // Find existing progress bar message
+ const progressMsgIndex = existingMessages.findIndex((msg: any) => msg.isProgressBar);
+
+ if (progressMsgIndex >= 0) {
+ // Update existing progress bar message
+ const progressMsg = existingMessages[progressMsgIndex];
+ const currentSteps = progressMsg.analysisSteps || [];
+
+ // Check if there is an exact duplicate step (step name + message content)
+ const existingStepIndex = currentSteps.findIndex((step: any) =>
+ step.name === stepName && step.message === message
+ );
+
+ let newSteps: AnalysisStep[];
+
+ if (existingStepIndex >= 0) {
+ // If an exact duplicate step is found, only update the status, do not add a new step
+ newSteps = [...currentSteps];
+ newSteps[existingStepIndex] = {
+ ...newSteps[existingStepIndex],
+ status,
+ timestamp: new Date()
+ };
+ console.log(`🔄 Updated existing step: ${stepName} - ${message}`);
+ } else {
+ // If it is a new step (different stepName or message), add it
+ // Change the previous active step to completed
+ newSteps = currentSteps.map((step: any) =>
+ step.status === 'active'
+ ? { ...step, status: 'completed' as const }
+ : step
+ );
+
+ // Add new step
+ newSteps.push({
+ id: `step-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
+ name: stepName,
+ message,
+ status,
+ timestamp: new Date()
+ });
+ console.log(`✅ Added new step: ${stepName} - ${message}`);
+ }
+
+ // Update messages in JSON file
+ await updateMessage(chatId, progressMsg.id, { analysisSteps: newSteps });
+ } else {
+ // If no progress bar message is found, create a new one
+ const newProgressMessage: Message = {
+ id: `progress-${Date.now()}`,
+ type: 'assistant',
+ content: `Start Analyzing Videos`,
+ timestamp: new Date(),
+ isProgressBar: true,
+ analysisSteps: [{
+ id: `step-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
+ name: stepName,
+ message,
+ status,
+ timestamp: new Date()
+ }],
+ };
+
+ // Add new message to JSON file
+ await addMessage(chatId, newProgressMessage);
+ console.log(`🆕 Created new progress message with step: ${stepName} - ${message}`);
+ }
+ } catch (error) {
+ console.error('Failed to add analysis step:', error);
+ }
+ };
+
+ // Query progress management - flush mode update (with animation effect)
+ const updateQueryProgress = async (chatId: string, stepName: string, message: string, status: 'active' | 'completed' | 'error') => {
+ try {
+ // Step 1: Load existing messages from JSON file
+ const result = await window.api.chatSessions.load(chatId);
+ const existingMessages = result.session?.messages || [];
+
+ // Find existing query analysis message
+ const queryMsgIndex = existingMessages.findIndex((msg: any) => msg.isQueryAnalyzing);
+
+ if (queryMsgIndex >= 0) {
+ // Update existing query analysis message
+ await updateMessage(chatId, existingMessages[queryMsgIndex].id, {
+ queryStep: stepName,
+ queryMessage: message,
+ queryStatus: status
+ });
+ } else {
+ // Create new query analysis message (with animation effect)
+ const queryMessage: Message = {
+ id: `query-analyzing-${Date.now()}`,
+ type: 'assistant',
+ content: '', // content is empty because using animation component to display
+ timestamp: new Date(),
+ isQueryAnalyzing: true,
+ queryStep: stepName,
+ queryMessage: message,
+ queryStatus: status
+ };
+
+ await addMessage(chatId, queryMessage);
+ }
+ } catch (error) {
+ console.error('Failed to update query progress:', error);
+ }
+ };
+
+ // Complete analysis
+ const completeAnalysis = async (chatId: string, stepName: string, message: string) => {
+ // Stop polling
+ stopPolling();
+
+ // Add final completion step
+ await addAnalysisStep(chatId, stepName, message, 'completed');
+
+ // Complete analysis and update session info
+ sessionInfo.completeAnalysis(chatId);
+
+ // Update state
+ setAnalysisState(prev => ({
+ ...prev,
+ isAnalyzing: false,
+ }));
+
+ // Add completion message
+ setTimeout(async () => {
+ const completionMessage: Message = {
+ id: `ai-${Date.now()}`,
+ type: 'assistant',
+ content: `🎉 Video analysis complete! You can now ask me questions!`,
+ timestamp: new Date(),
+ };
+
+ // Add message according to JSON file priority
+ await addMessage(chatId, completionMessage);
+ }, 1000);
+
+ // Clean up uploaded videos
+ setUploadedVideos(currentVideos => {
+ currentVideos.forEach((video) => URL.revokeObjectURL(video.url));
+ return [];
+ });
+ };
+
+ // Handle analysis error
+ const handleAnalysisError = async (chatId: string, errorMessage: string) => {
+ // Stop polling
+ stopPolling();
+
+ // Update state
+ setAnalysisState(prev => ({
+ ...prev,
+ isAnalyzing: false,
+ }));
+
+ // Reset session state
+ sessionInfo.updateSessionInfo(chatId, {
+ analysisState: 'none',
+ analysisProgress: 0,
+ });
+
+ // Display error message
+ const errorMsg: Message = {
+ id: `error-${Date.now()}`,
+ type: 'assistant',
+ content: `❌ Analysis Failed\n\nSorry, I encountered an error while analyzing your video:\n\n${errorMessage}\n\nPlease try again or check your VideoRAG configuration.`,
+ timestamp: new Date(),
+ };
+
+ // Add error message according to JSON file priority
+ await addMessage(chatId, errorMsg);
+ };
+
+ const handleStartAnalysis = useCallback(async () => {
+ if (!chatId || uploadedVideos.length === 0) return;
+ console.log('🚀 handleStartAnalysis');
+
+ const videosCopy = [...uploadedVideos];
+
+ // Create a new chat ID if needed and navigate
+ let actualChatId = chatId;
+ if (chatId === 'new') {
+ actualChatId = generateChatId();
+ // Navigate after setting analysis state to prevent clearing
+ setTimeout(() => {
+ navigate(`/chat/${actualChatId}`, { replace: true });
+ }, 100);
+ }
+
+ // Create chat history event immediately with video name
+ const title = videosCopy.length > 0
+ ? `${videosCopy[0].name.replace(/\.[^/.]+$/, '')}` // Remove file extension
+ : 'Video Analysis';
+
+ // Create or update session info
+ const existingSessionInfo = sessionInfo.getSessionInfo(actualChatId);
+ if (!existingSessionInfo) {
+ const newSession = sessionInfo.createSessionInfo(actualChatId, title);
+ if (!newSession) {
+ console.error('❌ Failed to create session info for chatId:', actualChatId);
+ return; // Prevent further execution
+ }
+ } else {
+ sessionInfo.updateSessionInfo(actualChatId, { title });
+ }
+
+ // Start analysis by synchronizing memory state to JSON file
+ console.log('💾 Syncing memory videos to JSON file:', videosCopy);
+ sessionInfo.startAnalysis(actualChatId, videosCopy);
+
+ // Set analysis state FIRST
+ setAnalysisState({
+ isAnalyzing: true,
+ progress: 0,
+ currentStep: 'Initializing',
+ selectedVideos: videosCopy,
+ });
+
+ // Clear uploadedVideos in memory after starting analysis to avoid duplicate display
+ console.log('🧹 Clearing memory uploadedVideos after starting analysis');
+ setUploadedVideos([]);
+
+ // Step 1: Start async VideoRAG workflow
+ try {
+ console.log('🚀 Starting async VideoRAG workflow...');
+
+ // Get storage info for base path
+ const storageInfo = await window.api.chatSessions.getStorageInfo();
+ const baseStoragePath = storageInfo.storeDirectory || './videorag-sessions';
+
+ // Start asynchronous VideoRAG analysis workflow - including session creation and video processing
+ await startRealAnalysis(actualChatId, videosCopy, baseStoragePath);
+
+ } catch (error: any) {
+ console.error('❌ VideoRAG workflow startup failed:', error);
+ await handleAnalysisError(actualChatId, error.message || 'Failed to start VideoRAG workflow');
+ }
+
+ }, [chatId, uploadedVideos, navigate, sessionInfo, activePolling]);
+
+ // Start real VideoRAG analysis - asynchronous flow
+ const startRealAnalysis = async (chatId: string, videos: UploadedVideo[], baseStoragePath: string) => {
+ try {
+ console.log('🔄 Starting async video analysis workflow...');
+ console.log('🔄 videos:', videos.map(v => v.path));
+
+ // Save video information to state for polling
+ setAnalysisState(prev => ({
+ ...prev,
+ selectedVideos: videos
+ }));
+
+ // Start video analysis directly - includes VideoRAG instance creation and video processing
+ console.log('🚀 Starting video analysis (includes VideoRAG creation and processing)...');
+
+ try {
+ // Pass video path list and storage path to backend
+ const video_path_list = videos.map(v => v.path);
+ console.log('🚀 Starting video upload/indexing with videos:', video_path_list);
+
+ const uploadResult = await window.api.videorag.uploadVideo(chatId, video_path_list, baseStoragePath);
+
+ if (!uploadResult.success) {
+ throw new Error(`Failed to start video processing: ${uploadResult.error}`);
+ }
+
+ console.log('✅ Video processing started:', uploadResult.data?.status || 'unknown');
+
+ // Immediately add initial processing step
+ await addAnalysisStep(chatId, 'Initializing', 'Initializing AI Assistant...', 'active');
+
+ } catch (error: any) {
+ console.error('❌ Video processing startup failed:', error);
+ throw new Error(`Failed to start video processing: ${error.message}`);
+ }
+
+ // Immediately start persistent polling - monitor video processing workflow
+ console.log('🔄 Starting 5s persistent polling for video processing workflow...');
+ startPersistentPolling(chatId);
+
+ } catch (error: any) {
+ console.error('❌ Video analysis workflow startup failed:', error);
+ await handleAnalysisError(chatId, error.message || 'Failed to start video analysis workflow');
+ }
+ };
+
+ // Start query processing
+ const startQueryProcessing = async (chatId: string, query: string) => {
+ try {
+ console.log('🚀 Starting query processing for:', query);
+ setIsQueryProcessing(true);
+
+ // Call backend API to start query processing
+ const queryResult = await window.api.videorag.queryVideo(chatId, query);
+
+ if (!queryResult.success) {
+ throw new Error(`Failed to start query processing: ${queryResult.error}`);
+ }
+
+ console.log('✅ Query processing started:', queryResult.data?.status || 'unknown');
+
+ // Immediately add initial processing step
+ await updateQueryProgress(chatId, 'Initializing', 'Initializing query processing...', 'active');
+
+ // Start polling to monitor query processing progress
+ console.log('🔄 Starting polling for query processing...');
+ startQueryPolling(chatId);
+
+ } catch (error: any) {
+ console.error('❌ Query processing startup failed:', error);
+ await handleQueryError(chatId, error.message || 'Failed to start query processing');
+ }
+ };
+
+ // Query polling function
+ const startQueryPolling = (chatId: string) => {
+ const poll = async () => {
+ let shouldContinuePolling = true;
+
+ try {
+ console.log('DEBUG: Polling query status for chat:', chatId);
+ const result = await window.api.videorag.getStatus(chatId, 'query');
+
+ if (result.success && result.data) {
+ const status = result.data;
+ console.log('🔍 Query status:', status);
+
+ switch (status.status) {
+ case 'completed':
+ console.log('✅ Query processing completed!');
+ await completeQueryProcessing(chatId, status.current_step, status.message, status.answer);
+ shouldContinuePolling = false;
+ break;
+
+ case 'error':
+ console.error('❌ Query processing failed:', status.message);
+ await updateQueryProgress(chatId, status.current_step, status.message, 'error');
+ await handleQueryError(chatId, status.message || 'Query processing failed');
+ shouldContinuePolling = false;
+ break;
+
+ case 'processing':
+ const currentStep = status.current_step || 'Processing';
+ const message = status.message || 'Processing query...';
+ console.log(`🔄 Query processing: ${currentStep} - ${message}`);
+ await updateQueryProgress(chatId, currentStep, message, 'active');
+ break;
+ }
+ }
+ } catch (error: any) {
+ console.error('❌ Query polling error:', error);
+ }
+
+ if (shouldContinuePolling) {
+ const interval = getPollingInterval();
+ console.log(`🔄 Scheduling next query poll in ${interval}ms`);
+ const timeout = setTimeout(poll, interval);
+ setActivePolling(timeout);
+ } else {
+ console.log('🛑 Query polling stopped');
+ setActivePolling(null);
+ }
+ };
+
+ console.log('🚀 Starting query polling for chat:', chatId);
+ poll();
+ };
+
+ // Complete query processing
+ const completeQueryProcessing = async (chatId: string, stepName: string, message: string, answer: string) => {
+ // Stop polling
+ stopPolling();
+ console.log('🔄 completeQueryProcessing', chatId, stepName, message, answer);
+ // Delete analyzing message, add final answer
+ try {
+ // Step 1: Load existing messages from JSON file
+ const result = await window.api.chatSessions.load(chatId);
+ const existingMessages = result.session?.messages || [];
+
+ // Find and delete query analysis message
+ const queryMsgIndex = existingMessages.findIndex((msg: any) => msg.isQueryAnalyzing);
+ if (queryMsgIndex >= 0) {
+ const updatedMessages = existingMessages.filter((msg: any) => !msg.isQueryAnalyzing);
+
+ // Save message list after deleting analysis message
+ await window.api.chatSessions.save(chatId, {
+ ...result.session,
+ messages: updatedMessages,
+ lastUpdated: new Date().toISOString()
+ });
+ }
+
+ // Add final answer message
+ const aiResponse: Message = {
+ id: `ai-${Date.now()}`,
+ type: 'assistant',
+ content: answer || 'Query processing completed',
+ timestamp: new Date(),
+ };
+
+ await addMessage(chatId, aiResponse);
+
+ } catch (error) {
+ console.error('Failed to complete query processing:', error);
+ }
+
+ // Update state
+ setIsLoading(false);
+ setIsQueryProcessing(false);
+ };
+
+ // Handle query error
+ const handleQueryError = async (chatId: string, errorMessage: string) => {
+ // Stop polling
+ stopPolling();
+
+ // Delete analyzing message, add error message
+ try {
+ // Step 1: Load existing messages from JSON file
+ const result = await window.api.chatSessions.load(chatId);
+ const existingMessages = result.session?.messages || [];
+
+ // Find and delete query analysis message
+ const queryMsgIndex = existingMessages.findIndex((msg: any) => msg.isQueryAnalyzing);
+ if (queryMsgIndex >= 0) {
+ const updatedMessages = existingMessages.filter((msg: any) => !msg.isQueryAnalyzing);
+
+ // Save message list after deleting analysis message
+ await window.api.chatSessions.save(chatId, {
+ ...result.session,
+ messages: updatedMessages,
+ lastUpdated: new Date().toISOString()
+ });
+ }
+
+ // Display error message
+ const errorMsg: Message = {
+ id: `error-${Date.now()}`,
+ type: 'assistant',
+ content: `❌ Query Processing Failed\n\nSorry, I encountered an error while processing your query:\n\n${errorMessage}\n\nPlease try again.`,
+ timestamp: new Date(),
+ };
+
+ await addMessage(chatId, errorMsg);
+
+ } catch (error) {
+ console.error('Failed to handle query error:', error);
+ }
+
+ // Update state
+ setIsLoading(false);
+ setIsQueryProcessing(false);
+ };
+
+ const handleSendMessage = useCallback(async () => {
+ if (!inputValue.trim() && uploadedVideos.length === 0) return;
+ if (!chatId) return;
+
+ // If analysis or query processing is in progress, do not process message sending
+ if (analysisState.isAnalyzing || isQueryProcessing) {
+ console.log('📝 Skipping message send during analysis or query processing');
+ return;
+ }
+
+ const newMessage: Message = {
+ id: generateMessageId(),
+ type: 'user',
+ content: inputValue || 'Uploaded videos for analysis',
+ timestamp: new Date(),
+ videos: uploadedVideos.map((v) => v.name),
+ };
+
+ let actualChatId = chatId;
+
+ // If it's a new chat, create a unique chat ID
+ if (chatId === 'new') {
+ actualChatId = generateChatId();
+ navigate(`/chat/${actualChatId}`, { replace: true });
+ }
+
+ // Create session info if it doesn't exist
+ const existingSessionInfo = sessionInfo.getSessionInfo(actualChatId);
+ if (!existingSessionInfo) {
+ const title = inputValue.trim()
+ ? inputValue.length > 50
+ ? inputValue.substring(0, 50) + '...'
+ : inputValue
+ : uploadedVideos.length > 0
+ ? `Video Analysis: ${uploadedVideos[0].name}`
+ : 'New Chat';
+ const newSession = sessionInfo.createSessionInfo(actualChatId, title);
+ if (!newSession) {
+ console.error('❌ Failed to create session info for chatId:', actualChatId);
+ return; // Prevent further execution
+ }
+ }
+
+ // Save message to session info using JSON-first approach
+ await addMessage(actualChatId, newMessage);
+
+ setInputValue('');
+ setIsLoading(true);
+
+ try {
+ let aiContent: string;
+
+ // Prioritize indexed videos from JSON file instead of relying on backend API
+ const currentSessionInfo = sessionInfo.getSessionInfo(actualChatId);
+ const sessionVideos = currentSessionInfo?.videos || [];
+ const isSessionCompleted = currentSessionInfo?.analysisState === 'completed';
+ const isSessionAnalyzing = currentSessionInfo?.analysisState === 'analyzing';
+
+ console.log('🔍 Debug - sessionVideos:', sessionVideos.length, 'isSessionCompleted:', isSessionCompleted, 'isSessionAnalyzing:', isSessionAnalyzing, 'indexedVideos:', indexedVideos.length, 'sessionStatus:', sessionStatus);
+
+ // Use session state from JSON file to determine if there are available videos
+ if (!isSessionCompleted && sessionVideos.length === 0) {
+ // Session not created yet
+ aiContent = `🎯 New Chat Session\n\n` +
+ `Welcome to this new chat session! Each session maintains its own video index for organized analysis.\n\n` +
+ `To get started:\n` +
+ `1. Upload videos using the "Choose Videos" button\n` +
+ `2. Wait for the indexing process to complete\n` +
+ `3. Ask questions about your video content (coming soon)\n\n` +
+ `Your videos will be stored in: chat-${chatId}/`;
+ } else if (isSessionAnalyzing) {
+ // Videos are being processed - use JSON session data
+ aiContent = `⏳ Video Processing in Progress\n\n` +
+ `Currently processing ${sessionVideos.length} video(s) in this session:\n\n` +
+ `${sessionVideos.map((v, i) => `${i + 1}. ${v.name}`).join('\n')}\n\n` +
+ `Please wait for the indexing to complete before asking questions about the video content. ` +
+ `This process includes video segmentation, speech recognition, visual analysis, and knowledge graph construction.\n\n` +
+ `Session: chat-${actualChatId}/`;
+ } else if (!isSessionCompleted) {
+ // No videos indexed in this session yet
+ aiContent = `📺 No Videos in This Session\n\n` +
+ `This chat session doesn't have any indexed videos yet. To get started:\n\n` +
+ `1. Upload videos using the "Choose Videos" button\n` +
+ `2. Wait for the indexing process to complete\n` +
+ `3. Once ready, I can answer questions about your video content\n\n` +
+ `Each session maintains its own video index for organized analysis.\n` +
+ `Session directory: chat-${actualChatId}/`;
+ } else {
+ // Videos are available - start query processing (session completed)
+ if (inputValue.trim()) {
+ // User has a query and session is completed - start query processing
+ await startQueryProcessing(actualChatId, inputValue.trim());
+ return; // Exit early, query processing will handle the response
+ } else {
+ // No query provided - show status
+ aiContent = `🎉 Videos Ready for Analysis!\n\n` +
+ `Great! This session has successfully indexed ${sessionVideos.length} video(s):\n\n` +
+ `${sessionVideos.map((v, i) => `${i + 1}. ${v.name.replace(/\.[^/.]+$/, '')}`).join('\n')}\n\n` +
+ `You can now ask me questions about your video content. What would you like to know?\n\n` +
+ `Your videos have been processed with speech recognition, visual analysis, and knowledge graph construction.\n` +
+ `Session directory: chat-${actualChatId}/`;
+ }
+ }
+
+ const aiResponse: Message = {
+ id: `ai-${Date.now()}`,
+ type: 'assistant',
+ content: aiContent,
+ timestamp: new Date(),
+ };
+
+ // Add AI response according to JSON file priority
+ if (actualChatId && actualChatId !== 'new') {
+ await addMessage(actualChatId, aiResponse);
+ }
+
+ } catch (error) {
+ // Handle call exceptions
+ console.error('Error in VideoRAG status check:', error);
+
+ const errorResponse: Message = {
+ id: `ai-${Date.now()}`,
+ type: 'assistant',
+ content: `🚨 System Error\n\n` +
+ `Error details: ${error instanceof Error ? error.message : 'Unknown error'}\n\n` +
+ `💡 Please try:\n` +
+ `• Refreshing the page\n` +
+ `• Checking VideoRAG configuration\n` +
+ `• Restarting the application`,
+ timestamp: new Date(),
+ };
+
+ // Add error response according to JSON file priority
+ if (actualChatId && actualChatId !== 'new') {
+ await addMessage(actualChatId, errorResponse);
+ }
+ } finally {
+ setIsLoading(false);
+ }
+
+ // Clear uploaded videos
+ uploadedVideos.forEach((video) => URL.revokeObjectURL(video.url));
+ setUploadedVideos([]);
+ }, [inputValue, uploadedVideos, messages, chatId, navigate, sessionStatus, indexedVideos, processingVideos, videoStatus, videoragError]);
+
+ return {
+ messages,
+ inputValue,
+ setInputValue,
+ uploadedVideos,
+ setUploadedVideos,
+ isLoading,
+ isQueryProcessing,
+ handleSendMessage,
+ handleStartAnalysis,
+ analysisState,
+ sessionInfo,
+ };
+};
\ No newline at end of file
diff --git a/Vimo-desktop/src/renderer/src/hooks/useChatSessionInfo.ts b/Vimo-desktop/src/renderer/src/hooks/useChatSessionInfo.ts
new file mode 100644
index 0000000..7fbe326
--- /dev/null
+++ b/Vimo-desktop/src/renderer/src/hooks/useChatSessionInfo.ts
@@ -0,0 +1,261 @@
+import { useState, useEffect, useCallback } from 'react';
+import { ChatSessionInfo, UploadedVideo } from '../types/chat';
+
+export const useChatSessionInfo = () => {
+ const [sessions, setSessions] = useState<ChatSessionInfo[]>([]);
+ const [isLoading, setIsLoading] = useState(true);
+
+ // Load all chat session info from file system
+ const loadSessionsFromStorage = useCallback(async () => {
+ try {
+ // Check if storage directory is configured
+ const storageInfo = await window.api.chatSessions.getStorageInfo();
+ if (!storageInfo.success || !storageInfo.storeDirectory) {
+ console.log('📁 Storage directory not configured, skipping sessions load');
+ setSessions([]);
+ setIsLoading(false);
+ return;
+ }
+
+ const result = await window.api.chatSessions.list();
+ if (result.success && result.sessions) {
+ const sessionsWithDates = result.sessions.map((session: any) => ({
+ ...session,
+ createdAt: new Date(session.createdAt),
+ lastUpdated: new Date(session.lastUpdated),
+ }));
+ setSessions(sessionsWithDates);
+ console.log(`📁 Loaded ${sessionsWithDates.length} chat sessions from storage`);
+ } else {
+ // Get failed, use empty array
+ console.log('📁 Failed to load sessions or no sessions found');
+ setSessions([]);
+ }
+ } catch (error) {
+ console.error('Failed to load chat sessions info:', error);
+ setSessions([]);
+ } finally {
+ setIsLoading(false);
+ }
+ }, []);
+
+ // Save single session to file system
+ const saveSessionToStorage = useCallback(async (sessionData: ChatSessionInfo) => {
+ try {
+ const result = await window.api.chatSessions.save(sessionData.id, sessionData);
+ if (!result.success) {
+ console.error('Failed to save chat session:', result.error);
+ }
+ } catch (error) {
+ console.error('Failed to save chat session:', error);
+ }
+ }, []);
+
+ // Delete single session from file system
+ const deleteSessionFromStorage = useCallback(async (sessionId: string) => {
+ try {
+ // 1. Try to clean up VideoRAG backend resources
+ try {
+ await window.api.videorag.deleteSession(sessionId);
+ } catch (error) {
+ console.warn('VideoRAG backend cleanup failed:', error);
+ }
+
+ // 2. Delete frontend JSON file
+ const result = await window.api.chatSessions.delete(sessionId);
+ if (!result.success) {
+ console.error('Failed to delete chat session:', result.error);
+ }
+ } catch (error) {
+ console.error('Failed to delete chat session:', error);
+ }
+ }, []);
+
+ // 创建新的chat session info
+ const createSessionInfo = useCallback((sessionId: string, title: string) => {
+ // 防护措施:不允许创建 "new" 的 session
+ if (sessionId === 'new') {
+ console.warn('❌ Attempted to create session with reserved ID "new", skipping...');
+ return null;
+ }
+
+ const newSession: ChatSessionInfo = {
+ id: sessionId,
+ title,
+ createdAt: new Date(),
+ lastUpdated: new Date(),
+ videos: [],
+ analysisState: 'none',
+ lastMessage: '',
+ };
+
+ // Update sessions in memory
+ setSessions(prev => [newSession, ...prev]);
+
+ // Save to file system
+ saveSessionToStorage(newSession);
+
+ return newSession;
+ }, [saveSessionToStorage]);
+
+ // Update session info (keep existing messages)
+ const updateSessionInfo = useCallback(async (sessionId: string, updates: Partial<ChatSessionInfo>) => {
+ setSessions(prev => {
+ const updated = prev.map(session =>
+ session.id === sessionId
+ ? { ...session, ...updates, lastUpdated: new Date() }
+ : session
+ );
+ return updated;
+ });
+
+ // Save updated session to file system, but keep existing messages
+ try {
+ const result = await window.api.chatSessions.load(sessionId);
+ const currentSessionData = result.session || {
+ id: sessionId,
+ title: 'New Chat',
+ createdAt: new Date(),
+ lastUpdated: new Date(),
+ videos: [],
+ analysisState: 'none',
+ lastMessage: '',
+ messages: [],
+ };
+
+ // Only update specified fields, keep messages
+ const updatedSession = {
+ ...currentSessionData,
+ ...updates,
+ lastUpdated: new Date(),
+ };
+
+ await window.api.chatSessions.save(sessionId, updatedSession);
+
+ // Trigger session info update event, notify VideoSelectionBar and other components to update
+ window.dispatchEvent(new CustomEvent('session-info-updated', { detail: { chatId: sessionId } }));
+ } catch (error) {
+ console.error('Failed to update session info:', error);
+ }
+ }, []);
+
+ // Start video analysis
+ const startAnalysis = useCallback((sessionId: string, videos: UploadedVideo[]) => {
+ updateSessionInfo(sessionId, {
+ videos,
+ analysisState: 'analyzing',
+ analysisProgress: 0,
+ currentStep: 'Initializing',
+ });
+ }, [updateSessionInfo]);
+
+ // Update analysis progress
+ const updateAnalysisProgress = useCallback((sessionId: string, progress: number, currentStep: string) => {
+ updateSessionInfo(sessionId, {
+ analysisProgress: progress,
+ currentStep,
+ });
+ }, [updateSessionInfo]);
+
+ // Complete analysis
+ const completeAnalysis = useCallback((sessionId: string) => {
+ updateSessionInfo(sessionId, {
+ analysisState: 'completed',
+ analysisProgress: 100,
+ currentStep: 'Completed',
+ });
+ }, [updateSessionInfo]);
+
+ // Delete session info
+ const deleteSessionInfo = useCallback((sessionId: string) => {
+ // 1. Immediately notify the session to stop polling
+ window.dispatchEvent(new CustomEvent('session-deleted', { detail: { chatId: sessionId } }));
+
+ // 2. Remove from memory
+ setSessions(prev => prev.filter(session => session.id !== sessionId));
+
+ // 3. Delete from file system
+ deleteSessionFromStorage(sessionId);
+ }, [deleteSessionFromStorage]);
+
+ // Get session info by ID
+ const getSessionInfo = useCallback((sessionId: string): ChatSessionInfo | null => {
+ return sessions.find(session => session.id === sessionId) || null;
+ }, [sessions]);
+
+ // Reorder sessions (used for sidebar drag)
+ const reorderSessions = useCallback(async (reorderedSessions: ChatSessionInfo[]) => {
+ // 1. Immediately update memory state (frontend temporary rendering data)
+ setSessions(reorderedSessions);
+
+ // 2. Save sorted to backend configuration file (permanent storage)
+ try {
+ const sessionOrder = reorderedSessions.map(session => session.id);
+ const result = await window.api.chatSessions.updateSessionOrder(sessionOrder, 'reorder');
+ if (result.success) {
+ console.log('✅ Session order saved successfully');
+ } else {
+ console.error('Failed to save session order:', result.error);
+ }
+ } catch (error) {
+ console.error('Failed to save session order:', error);
+ }
+ }, []);
+
+ // Clear all session info
+ const clearAllSessions = useCallback(async () => {
+ // Use deleteSessionInfo to ensure sending polling stop notification
+ for (const session of sessions) {
+ // 1. Immediately notify the session to stop polling
+ window.dispatchEvent(new CustomEvent('session-deleted', { detail: { chatId: session.id } }));
+ // 2. Delete file
+ await deleteSessionFromStorage(session.id);
+ }
+ // Clear memory
+ setSessions([]);
+ }, [sessions, deleteSessionFromStorage]);
+
+ // Listen for storage directory configuration changes
+ useEffect(() => {
+ const handleStorageConfigChange = () => {
+ loadSessionsFromStorage();
+ };
+
+ window.addEventListener('storage-config-updated', handleStorageConfigChange as EventListener);
+ return () => {
+ window.removeEventListener('storage-config-updated', handleStorageConfigChange as EventListener);
+ };
+ }, [loadSessionsFromStorage]);
+
+ // Load data when initializing
+ useEffect(() => {
+ loadSessionsFromStorage();
+ }, [loadSessionsFromStorage]);
+
+ // Listen for session info update events
+ useEffect(() => {
+ const handleSessionInfoUpdate = () => {
+ loadSessionsFromStorage();
+ };
+
+ window.addEventListener('chat-messages-updated', handleSessionInfoUpdate as EventListener);
+ return () => {
+ window.removeEventListener('chat-messages-updated', handleSessionInfoUpdate as EventListener);
+ };
+ }, [loadSessionsFromStorage]);
+
+ return {
+ sessions,
+ isLoading,
+ createSessionInfo,
+ updateSessionInfo,
+ startAnalysis,
+ updateAnalysisProgress,
+ completeAnalysis,
+ deleteSessionInfo,
+ getSessionInfo,
+ reorderSessions,
+ clearAllSessions,
+ loadSessionsFromStorage,
+ };
+};
\ No newline at end of file
diff --git a/Vimo-desktop/src/renderer/src/hooks/useCurrentSessionInfo.ts b/Vimo-desktop/src/renderer/src/hooks/useCurrentSessionInfo.ts
new file mode 100644
index 0000000..28c7ed7
--- /dev/null
+++ b/Vimo-desktop/src/renderer/src/hooks/useCurrentSessionInfo.ts
@@ -0,0 +1,93 @@
+import { useState, useEffect, useCallback } from 'react';
+import { ChatSessionInfo } from '../types/chat';
+
+interface UseCurrentSessionInfoReturn {
+ sessionInfo: ChatSessionInfo | null;
+ isLoading: boolean;
+ error: string | null;
+ refreshSessionInfo: () => Promise<void>;
+}
+
+export const useCurrentSessionInfo = (chatId: string | undefined): UseCurrentSessionInfoReturn => {
+ const [sessionInfo, setSessionInfo] = useState<ChatSessionInfo | null>(null);
+ const [isLoading, setIsLoading] = useState(false);
+ const [error, setError] = useState<string | null>(null);
+
+ // Load current session info directly from JSON file
+ const loadCurrentSessionInfo = useCallback(async (sessionId: string) => {
+ if (!sessionId || sessionId === 'new') {
+ setSessionInfo(null);
+ setIsLoading(false);
+ return;
+ }
+
+ try {
+ setIsLoading(true);
+ setError(null);
+
+ const result = await window.api.chatSessions.load(sessionId);
+
+ if (result.success && result.session) {
+ const sessionWithDates: ChatSessionInfo = {
+ ...result.session,
+ createdAt: new Date(result.session.createdAt),
+ lastUpdated: new Date(result.session.lastUpdated),
+ };
+ setSessionInfo(sessionWithDates);
+ } else {
+ setSessionInfo(null);
+ }
+ } catch (err) {
+ console.error('Failed to load current session info:', err);
+ setError(err instanceof Error ? err.message : 'Unknown error');
+ setSessionInfo(null);
+ } finally {
+ setIsLoading(false);
+ }
+ }, []);
+
+ // Refresh session info
+ const refreshSessionInfo = useCallback(async () => {
+ if (chatId) {
+ await loadCurrentSessionInfo(chatId);
+ }
+ }, [chatId, loadCurrentSessionInfo]);
+
+ // When chatId changes, reload session info
+ useEffect(() => {
+ if (chatId) {
+ loadCurrentSessionInfo(chatId);
+ } else {
+ setSessionInfo(null);
+ setIsLoading(false);
+ }
+ }, [chatId, loadCurrentSessionInfo]);
+
+ // Listen for session update events
+ useEffect(() => {
+ const handleSessionUpdate = (event: CustomEvent) => {
+ const { chatId: updatedChatId } = event.detail;
+ if (updatedChatId === chatId) {
+ // Reload session info from JSON file
+ refreshSessionInfo();
+ }
+ };
+
+ // Listen for chat message update events
+ window.addEventListener('chat-messages-updated', handleSessionUpdate as EventListener);
+ // Listen for session info update events (e.g. analysis status, video list, etc.)
+ window.addEventListener('session-info-updated', handleSessionUpdate as EventListener);
+
+ return () => {
+ window.removeEventListener('chat-messages-updated', handleSessionUpdate as EventListener);
+ window.removeEventListener('session-info-updated', handleSessionUpdate as EventListener);
+ };
+ }, [chatId, refreshSessionInfo]);
+
+ return {
+ sessionInfo,
+ isLoading,
+ error,
+ refreshSessionInfo,
+ };
+};
\ No newline at end of file
diff --git a/Vimo-desktop/src/renderer/src/hooks/useResizable.ts b/Vimo-desktop/src/renderer/src/hooks/useResizable.ts
new file mode 100644
index 0000000..96ec22e
--- /dev/null
+++ b/Vimo-desktop/src/renderer/src/hooks/useResizable.ts
@@ -0,0 +1,51 @@
+import { useState, useEffect, useCallback } from 'react';
+
+export const useResizable = (initialHeight: number = 200) => {
+ const [inputAreaHeight, setInputAreaHeight] = useState(initialHeight);
+ const [isDragging, setIsDragging] = useState(false);
+ const [realTimeHeight, setRealTimeHeight] = useState(initialHeight);
+
+ // Sync realTimeHeight and inputAreaHeight
+ useEffect(() => {
+ setRealTimeHeight(inputAreaHeight);
+ }, [inputAreaHeight]);
+
+ const handleResizeMouseDown = useCallback((e: React.MouseEvent) => {
+ e.preventDefault();
+ setIsDragging(true);
+ }, []);
+
+ useEffect(() => {
+ if (!isDragging) return;
+
+ const handleMouseMove = (e: MouseEvent) => {
+ const windowHeight = window.innerHeight;
+ const newHeight = windowHeight - e.clientY - 32; // 32px is the height of the top drag area
+ const clampedHeight = Math.max(150, Math.min(500, newHeight)); // Limit between 150-500px
+ setRealTimeHeight(clampedHeight); // Update height in real time
+ };
+
+ const handleMouseUp = () => {
+ setIsDragging(false);
+ setInputAreaHeight(realTimeHeight); // Save final height after dragging
+ };
+
+ document.addEventListener('mousemove', handleMouseMove);
+ document.addEventListener('mouseup', handleMouseUp);
+
+ return () => {
+ document.removeEventListener('mousemove', handleMouseMove);
+ document.removeEventListener('mouseup', handleMouseUp);
+ };
+ }, [isDragging, realTimeHeight]);
+
+ const getCurrentHeight = () => isDragging ? realTimeHeight : inputAreaHeight;
+
+ return {
+ inputAreaHeight,
+ isDragging,
+ realTimeHeight,
+ handleResizeMouseDown,
+ getCurrentHeight,
+ };
+};
\ No newline at end of file
diff --git a/Vimo-desktop/src/renderer/src/hooks/useVideoRAG.ts b/Vimo-desktop/src/renderer/src/hooks/useVideoRAG.ts
new file mode 100644
index 0000000..eecf445
--- /dev/null
+++ b/Vimo-desktop/src/renderer/src/hooks/useVideoRAG.ts
@@ -0,0 +1,261 @@
+import { useState, useEffect, useCallback } from 'react'
+import { useParams } from 'react-router'
+
+export interface VideoIndexStatus {
+ video_name: string
+ status: 'processing' | 'completed' | 'error'
+ current_step: string
+ message: string
+}
+
+export interface VideoRAGConfig {
+ ali_dashscope_api_key: string
+ ali_dashscope_base_url: string
+ openai_api_key: string
+ openai_base_url: string
+ image_bind_model_path: string
+ base_storage_path?: string
+}
+
+export interface QueryResponse {
+ success: boolean
+ query: string
+ response: string
+ mode: string
+ timestamp: number
+}
+
+export interface SystemStatus {
+ global_config_set: boolean
+ total_sessions: number
+ total_indexed_videos: number
+ processing_videos: string[]
+ sessions: string[]
+}
+
+export interface SessionStatus {
+ session_exists: boolean
+ chat_id: string
+ indexed_videos_count: number
+ processing_videos: string[]
+ working_dir: string
+ available_for_query: boolean
+}
+
+interface UseVideoRAGReturn {
+ // System status
+ systemStatus: SystemStatus | null
+ sessionStatus: SessionStatus | null
+
+ // Video management
+ indexedVideos: string[]
+ processingVideos: string[]
+ videoStatus: Record<string, VideoIndexStatus>
+
+ // API operations
+ initialize: (config: VideoRAGConfig) => Promise<boolean>
+
+ uploadVideo: (videoPath: string, baseStoragePath: string) => Promise<boolean>
+ refreshStatus: () => Promise<void>
+
+ // Loading states
+ loading: {
+ initializing: boolean
+ uploading: boolean
+ refreshing: boolean
+ }
+
+ // Error handling
+ error: string | null
+ clearError: () => void
+}
+
+export function useVideoRAG(): UseVideoRAGReturn {
+ const { chatId } = useParams()
+ const [systemStatus, setSystemStatus] = useState<SystemStatus | null>(null)
+ const [sessionStatus, setSessionStatus] = useState<SessionStatus | null>(null)
+ const [indexedVideos, setIndexedVideos] = useState<string[]>([])
+ const [processingVideos, setProcessingVideos] = useState<string[]>([])
+ const [videoStatus, setVideoStatus] = useState<Record<string, VideoIndexStatus>>({})
+ const [error, setError] = useState<string | null>(null)
+
+ const [loading, setLoading] = useState({
+ initializing: false,
+
+ uploading: false,
+ refreshing: false
+ })
+
+ // Clear error
+ const clearError = useCallback(() => {
+ setError(null)
+ }, [])
+
+ // Set global configuration
+ const initialize = useCallback(async (config: VideoRAGConfig): Promise<boolean> => {
+ try {
+ setLoading(prev => ({ ...prev, initializing: true }))
+ setError(null)
+
+ const result = await window.api.invoke('videorag:initialize', config)
+
+ if (result.success) {
+ await refreshStatus()
+ return true
+ } else {
+ setError(result.error || 'Failed to set global configuration')
+ return false
+ }
+ } catch (err: any) {
+ setError(err.message || 'Failed to set global configuration')
+ return false
+ } finally {
+ setLoading(prev => ({ ...prev, initializing: false }))
+ }
+ }, [])
+
+
+
+ // Upload and index video(s) for current session
+ const uploadVideo = useCallback(async (videoPath: string, baseStoragePath: string): Promise<boolean> => {
+ if (!chatId) return false
+
+ try {
+ setLoading(prev => ({ ...prev, uploading: true }))
+ setError(null)
+
+ // Convert single video path to array for the new API
+ const result = await window.api.videorag.uploadVideo(chatId, [videoPath], baseStoragePath)
+
+ if (result.success) {
+ // Processing started successfully
+ return true
+ } else {
+ setError(result.error || 'Failed to upload video')
+ return false
+ }
+ } catch (err: any) {
+ setError(err.message || 'Failed to upload video')
+ return false
+ } finally {
+ setLoading(prev => ({ ...prev, uploading: false }))
+ }
+ }, [chatId])
+
+ // Query functionality will be added later
+ // For now, we focus on upload and indexing
+
+ // Refresh system and session status
+ const refreshStatus = useCallback(async () => {
+ try {
+ setLoading(prev => ({ ...prev, refreshing: true }))
+
+ // Get global system status
+ const systemResult = await window.api.invoke('videorag:system-status')
+ if (systemResult.success) {
+ setSystemStatus(systemResult.data)
+ }
+
+ // Get session-specific status if chatId exists
+ if (chatId) {
+ const sessionResult = await window.api.invoke('videorag:session-status', chatId)
+ if (sessionResult.success) {
+ setSessionStatus(sessionResult.data)
+
+ if (sessionResult.data.session_exists) {
+ setProcessingVideos(sessionResult.data.processing_videos)
+
+ // Get indexed videos for this session
+ const videosResult = await window.api.invoke('videorag:list-indexed', chatId)
+ if (videosResult.success) {
+ setIndexedVideos(videosResult.data.indexed_videos)
+ }
+ } else {
+ setIndexedVideos([])
+ setProcessingVideos([])
+ }
+ }
+ }
+
+ } catch (err: any) {
+ console.error('Failed to refresh status:', err)
+ } finally {
+ setLoading(prev => ({ ...prev, refreshing: false }))
+ }
+ }, [chatId])
+
+ // Poll video status for processing videos
+ const pollVideoStatus = useCallback(async (videoName: string) => {
+ if (!chatId) return
+
+ const checkStatus = async () => {
+ try {
+ const result = await window.api.invoke('videorag:get-status', chatId, videoName)
+
+ if (result.success) {
+ const status = result.data as VideoIndexStatus
+
+ setVideoStatus(prev => ({
+ ...prev,
+ [videoName]: status
+ }))
+
+ if (status.status === 'completed') {
+ setProcessingVideos(prev => prev.filter(v => v !== videoName))
+ setIndexedVideos(prev => [...prev.filter(v => v !== videoName), videoName])
+ } else if (status.status === 'error') {
+ setProcessingVideos(prev => prev.filter(v => v !== videoName))
+ setError(`Video ${videoName} indexing failed: ${status.message}`)
+ } else if (status.status === 'processing') {
+ // Continue polling after 2 seconds
+ setTimeout(checkStatus, 2000)
+ }
+ }
+ } catch (err) {
+ console.error('Failed to check video status:', err)
+ }
+ }
+
+ checkStatus()
+ }, [chatId])
+
+ // Check health and initial status on mount
+ useEffect(() => {
+ const checkHealth = async () => {
+ try {
+ const result = await window.api.invoke('videorag:health-check')
+ if (result.success) {
+ await refreshStatus()
+ }
+ } catch (err) {
+ console.error('VideoRAG health check failed:', err)
+ }
+ }
+
+ checkHealth()
+ }, [refreshStatus])
+
+ // Poll processing videos status
+ useEffect(() => {
+ processingVideos.forEach(videoName => {
+ if (!videoStatus[videoName] || videoStatus[videoName].status === 'processing') {
+ pollVideoStatus(videoName)
+ }
+ })
+ }, [processingVideos, videoStatus, pollVideoStatus])
+
+ return {
+ systemStatus,
+ sessionStatus,
+ indexedVideos,
+ processingVideos,
+ videoStatus,
+ initialize,
+
+ uploadVideo,
+ refreshStatus,
+ loading,
+ error,
+ clearError
+ }
+}
\ No newline at end of file
diff --git a/Vimo-desktop/src/renderer/src/hooks/useVideoRAGService.ts b/Vimo-desktop/src/renderer/src/hooks/useVideoRAGService.ts
new file mode 100644
index 0000000..f814d79
--- /dev/null
+++ b/Vimo-desktop/src/renderer/src/hooks/useVideoRAGService.ts
@@ -0,0 +1,214 @@
+import { useState } from 'react'
+
+
+
+export interface ServiceState {
+ isRunning: boolean
+ imagebindLoaded: boolean
+ message?: string
+ error?: string
+}
+
+export const useVideoRAGService = () => {
+
+ const [serviceState, setServiceState] = useState<ServiceState>({
+ isRunning: false,
+ imagebindLoaded: false
+ })
+ const [loading, setLoading] = useState({
+ starting: false,
+ stopping: false,
+ checkingService: false,
+ loadingImageBind: false,
+ releasingImageBind: false
+ })
+
+
+
+ // Check service status
+ const checkServiceStatus = async () => {
+ setLoading(prev => ({ ...prev, checkingService: true }))
+ try {
+ const result = await window.api.videorag.systemStatus()
+ if (result.success && result.data) {
+ setServiceState(prev => ({
+ ...prev,
+ isRunning: result.data.total_sessions !== undefined || result.data.global_config_set,
+ imagebindLoaded: result.data.imagebind_loaded || false,
+ message: result.data.imagebind_loaded
+ ? 'Service ready for video processing'
+ : 'Service running - ImageBind not loaded'
+ }))
+ } else {
+ setServiceState(prev => ({
+ ...prev,
+ isRunning: false,
+ imagebindLoaded: false,
+ error: result.error || 'Failed to get system status'
+ }))
+ }
+ } catch (error) {
+ setServiceState(prev => ({
+ ...prev,
+ isRunning: false,
+ imagebindLoaded: false,
+ error: 'Failed to check service status'
+ }))
+ } finally {
+ setLoading(prev => ({ ...prev, checkingService: false }))
+ }
+ }
+
+ // Start service
+ const startService = async () => {
+ setLoading(prev => ({ ...prev, starting: true }))
+ try {
+ const result = await window.api.videorag.startService()
+ if (result.success) {
+ setServiceState(prev => ({
+ ...prev,
+ isRunning: true,
+ message: result.message
+ }))
+ // API returns success means service started successfully, no additional check needed
+ return true
+ } else {
+ setServiceState(prev => ({
+ ...prev,
+ isRunning: false,
+ error: result.error
+ }))
+ return false
+ }
+ } catch (error) {
+ setServiceState(prev => ({
+ ...prev,
+ isRunning: false,
+ error: 'Failed to start service'
+ }))
+ return false
+ } finally {
+ setLoading(prev => ({ ...prev, starting: false }))
+ }
+ }
+
+ // Stop service
+ const stopService = async () => {
+ setLoading(prev => ({ ...prev, stopping: true }))
+ try {
+ const result = await window.api.videorag.stopService()
+ if (result.success) {
+ setServiceState(prev => ({
+ ...prev,
+ isRunning: false,
+ message: result.message
+ }))
+ // API returns success means service stopped successfully, no additional check needed
+ return true
+ } else {
+ setServiceState(prev => ({
+ ...prev,
+ isRunning: false,
+ error: result.error
+ }))
+ return false
+ }
+ } catch (error) {
+ setServiceState(prev => ({
+ ...prev,
+ isRunning: false,
+ error: 'Failed to stop service'
+ }))
+ return false
+ } finally {
+ setLoading(prev => ({ ...prev, stopping: false }))
+ }
+ }
+
+ // Load ImageBind model
+ const loadImageBind = async () => {
+ setLoading(prev => ({ ...prev, loadingImageBind: true }))
+ try {
+ const result = await window.api.videorag.loadImageBind()
+ if (result.success) {
+ setServiceState(prev => ({
+ ...prev,
+ imagebindLoaded: true,
+ message: 'ImageBind model loaded successfully'
+ }))
+ return true
+ } else {
+ setServiceState(prev => ({
+ ...prev,
+ error: result.error
+ }))
+ return false
+ }
+ } catch (error) {
+ setServiceState(prev => ({
+ ...prev,
+ error: 'Failed to load ImageBind model'
+ }))
+ return false
+ } finally {
+ setLoading(prev => ({ ...prev, loadingImageBind: false }))
+ }
+ }
+
+ // Release ImageBind model
+ const releaseImageBind = async () => {
+ setLoading(prev => ({ ...prev, releasingImageBind: true }))
+ try {
+ const result = await window.api.videorag.releaseImageBind()
+ if (result.success) {
+ setServiceState(prev => ({
+ ...prev,
+ imagebindLoaded: false,
+ message: 'ImageBind model released successfully'
+ }))
+ return true
+ } else {
+ setServiceState(prev => ({
+ ...prev,
+ error: result.error
+ }))
+ return false
+ }
+ } catch (error) {
+ setServiceState(prev => ({
+ ...prev,
+ error: 'Failed to release ImageBind model'
+ }))
+ return false
+ } finally {
+ setLoading(prev => ({ ...prev, releasingImageBind: false }))
+ }
+ }
+
+ // Check ImageBind status
+ const checkImageBindStatus = async () => {
+ try {
+ const result = await window.api.videorag.imagebindStatus()
+ if (result.success) {
+ setServiceState(prev => ({
+ ...prev,
+ imagebindLoaded: result.data?.loaded || false
+ }))
+ }
+ } catch (error) {
+ console.error('Failed to check ImageBind status:', error)
+ }
+ }
+
+
+ return {
+ serviceState,
+ loading,
+ checkServiceStatus,
+ startService,
+ stopService,
+ loadImageBind,
+ releaseImageBind,
+ checkImageBindStatus
+ }
+}
\ No newline at end of file
diff --git a/Vimo-desktop/src/renderer/src/hooks/useVideoUpload.ts b/Vimo-desktop/src/renderer/src/hooks/useVideoUpload.ts
new file mode 100644
index 0000000..47eb8ce
--- /dev/null
+++ b/Vimo-desktop/src/renderer/src/hooks/useVideoUpload.ts
@@ -0,0 +1,82 @@
+import { useCallback } from 'react';
+import { UploadedVideo } from '../types/chat';
+import { generateVideoId, formatFileSize } from '../utils/chat';
+
+interface UseVideoUploadProps {
+ uploadedVideos: UploadedVideo[];
+ setUploadedVideos: React.Dispatch<React.SetStateAction<UploadedVideo[]>>;
+ onShowToast?: (message: string, type: 'info' | 'warning' | 'error' | 'success') => void;
+}
+
+export const useVideoUpload = ({ uploadedVideos, setUploadedVideos, onShowToast }: UseVideoUploadProps) => {
+ // Use Electron file selection API
+ const handleVideoUpload = useCallback(async () => {
+ try {
+ const result = await window.api.selectVideoFiles();
+
+ if (result.success && result.files) {
+ const newVideos: UploadedVideo[] = [];
+ const duplicateFiles: string[] = [];
+
+ for (const file of result.files) {
+ // Check if the video already exists with the same path
+ const isDuplicate = uploadedVideos.some(video => video.path === file.path);
+
+ if (isDuplicate) {
+ duplicateFiles.push(file.name);
+ } else {
+ const videoId = generateVideoId();
+ // Use file protocol to create URL for preview
+ const videoUrl = `file://${file.path}`;
+
+ const newVideo: UploadedVideo = {
+ id: videoId,
+ name: file.name,
+ url: videoUrl,
+ path: file.path, // Real file path
+ size: file.size,
+ };
+
+ newVideos.push(newVideo);
+ }
+ }
+
+ // Add new videos
+ if (newVideos.length > 0) {
+ setUploadedVideos((prev) => [...prev, ...newVideos]);
+ }
+
+ // If there are duplicate files, show a prompt
+ if (duplicateFiles.length > 0 && onShowToast) {
+ const message = duplicateFiles.length === 1
+ ? `Video "${duplicateFiles[0]}" has already been added and will not be duplicated.`
+ : `${duplicateFiles.length} videos have already been added and will not be duplicated.`;
+
+ onShowToast(message, 'info');
+ }
+ } else {
+ console.error('Failed to select video files:', result.error);
+ }
+ } catch (error) {
+ console.error('Error selecting video files:', error);
+ }
+ }, [uploadedVideos, setUploadedVideos]);
+
+ // Keep compatibility with drag and drop upload - currently not supported
+ const handleVideoUploadFromFiles = useCallback(async () => {
+ console.warn('Drag and drop upload not supported. Please use the file picker button instead.');
+ }, []);
+
+ const removeVideo = useCallback((videoId: string) => {
+ setUploadedVideos((prev) => {
+ return prev.filter((v) => v.id !== videoId);
+ });
+ }, [setUploadedVideos]);
+
+ return {
+ handleVideoUpload,
+ handleVideoUploadFromFiles,
+ removeVideo,
+ formatFileSize,
+ };
+};
\ No newline at end of file
diff --git a/Vimo-desktop/src/renderer/src/layouts/MainLayout.tsx b/Vimo-desktop/src/renderer/src/layouts/MainLayout.tsx
new file mode 100644
index 0000000..a4ed751
--- /dev/null
+++ b/Vimo-desktop/src/renderer/src/layouts/MainLayout.tsx
@@ -0,0 +1,106 @@
+import { useEffect, useState, useRef } from 'react';
+import { Outlet } from 'react-router';
+import { AppSidebar } from '../components/sidebar/app-sidebar';
+import { SidebarInset, SidebarProvider } from '../components/ui/sidebar';
+import { useVideoRAGService } from '../hooks/useVideoRAGService';
+
+// Liquid glass loading overlay component
+const ServiceLoadingOverlay = ({ show }: { show: boolean }) => {
+ if (!show) return null;
+
+ return (
+ <div className="fixed inset-0 z-50 flex items-center justify-center">
+ {/* Liquid glass background - multiple gradient layers */}
+ <div className="absolute inset-0 bg-gradient-to-br from-blue-50/80 via-white/60 to-purple-50/80 backdrop-blur-xl" />
+ <div className="absolute inset-0 bg-gradient-to-tl from-white/40 via-transparent to-blue-100/30" />
+
+ {/* Main container - liquid glass card */}
+ <div className="relative bg-white/40 backdrop-blur-2xl rounded-3xl p-12 shadow-xl border border-white/30 max-w-md mx-6 transform transition-all duration-500 hover:scale-105">
+ {/* Internal glow effect */}
+ <div className="absolute inset-0 bg-gradient-to-br from-white/60 via-transparent to-blue-50/40 rounded-3xl" />
+ <div className="absolute -inset-1 bg-gradient-to-r from-blue-400/20 via-purple-400/20 to-blue-400/20 rounded-3xl blur-xl" />
+
+ {/* Content area */}
+ <div className="relative flex flex-col items-center space-y-6">
+ {/* Modern loading animation */}
+ <div className="relative">
+ {/* Outer ring halo */}
+ <div className="w-20 h-20 rounded-full bg-gradient-to-r from-blue-400/30 to-purple-400/30 animate-pulse absolute -inset-2" />
+ {/* Active animation circle */}
+ <div className="w-16 h-16 rounded-full border-4 border-transparent bg-gradient-to-r from-blue-500 to-purple-500 animate-spin relative">
+ <div className="absolute inset-2 rounded-full bg-white/90 backdrop-blur-sm" />
+ </div>
+ {/* Center point */}
+ <div className="absolute inset-0 flex items-center justify-center">
+ <div className="w-4 h-4 rounded-full bg-gradient-to-r from-blue-500 to-purple-500 animate-pulse" />
+ </div>
+ </div>
+
+ {/* Title text */}
+ <div className="text-center space-y-3">
+ <h3 className="text-xl font-semibold bg-gradient-to-r from-gray-800 to-gray-600 bg-clip-text text-transparent">
+ Awakening Vimo
+ </h3>
+ </div>
+ </div>
+ </div>
+ </div>
+ );
+};
+
+export function MainLayout() {
+ const { startService, loading } = useVideoRAGService();
+ const [isInitializing, setIsInitializing] = useState(true);
+ const hasInitializedRef = useRef(false);
+
+ // When entering the main interface, automatically start the Python service
+ useEffect(() => {
+ // Avoid duplicate initialization
+ if (hasInitializedRef.current) return;
+
+ const initializeService = async () => {
+ try {
+ console.log('MainLayout: Starting service initialization...');
+
+ // Try to start the service directly, if it is running, the API will return the corresponding status
+ const success = await startService();
+
+ if (success) {
+ console.log('MainLayout: Python service started successfully');
+ } else {
+ console.error('MainLayout: Failed to start Python service');
+ }
+ } catch (error) {
+ console.error('MainLayout: Error during service initialization:', error);
+ } finally {
+ // Mark initialization complete
+ hasInitializedRef.current = true;
+ setIsInitializing(false);
+ }
+ };
+
+ initializeService();
+ }, []);
+
+ // Conditions for displaying the loading overlay
+ const showLoadingOverlay = isInitializing || loading.starting;
+
+ return (
+ <>
+ <SidebarProvider
+ defaultWidth={240}
+ minWidth={240}
+ maxWidth={480}
+ className="flex h-screen w-full bg-white"
+ >
+ <AppSidebar />
+ <SidebarInset className="flex-1">
+ <Outlet />
+ </SidebarInset>
+ </SidebarProvider>
+
+ {/* Service startup loading overlay */}
+ <ServiceLoadingOverlay show={showLoadingOverlay} />
+ </>
+ );
+}
diff --git a/Vimo-desktop/src/renderer/src/lib/utils.ts b/Vimo-desktop/src/renderer/src/lib/utils.ts
new file mode 100644
index 0000000..2819a83
--- /dev/null
+++ b/Vimo-desktop/src/renderer/src/lib/utils.ts
@@ -0,0 +1,6 @@
+import { clsx, type ClassValue } from 'clsx';
+import { twMerge } from 'tailwind-merge';
+
+export function cn(...inputs: ClassValue[]) {
+ return twMerge(clsx(inputs));
+}
diff --git a/Vimo-desktop/src/renderer/src/main.tsx b/Vimo-desktop/src/renderer/src/main.tsx
new file mode 100644
index 0000000..306dcd1
--- /dev/null
+++ b/Vimo-desktop/src/renderer/src/main.tsx
@@ -0,0 +1,6 @@
+import ReactDOM from 'react-dom/client';
+import App from './App';
+
+ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
+ <App />
+);
\ No newline at end of file
diff --git a/Vimo-desktop/src/renderer/src/pages/chat/index.tsx b/Vimo-desktop/src/renderer/src/pages/chat/index.tsx
new file mode 100644
index 0000000..5b83d29
--- /dev/null
+++ b/Vimo-desktop/src/renderer/src/pages/chat/index.tsx
@@ -0,0 +1,178 @@
+import React, { useState } from 'react';
+import { useParams } from 'react-router';
+import { useChat } from '../../hooks/useChat';
+import { useVideoUpload } from '../../hooks/useVideoUpload';
+import { useResizable } from '../../hooks/useResizable';
+import { useCurrentSessionInfo } from '../../hooks/useCurrentSessionInfo';
+import { useServiceContext } from '../../contexts/ServiceContext';
+import { MessageList } from '../../components/chat/MessageList';
+import { WelcomeScreen } from '../../components/chat/WelcomeScreen';
+import { ChatInput } from '../../components/chat/ChatInput';
+import { VideoSelectionBar } from '../../components/common/VideoSelectionBar';
+import { CheckCircle, Info, AlertTriangle, X } from 'lucide-react';
+
+const Chat = () => {
+ const { chatId } = useParams();
+ const chat = useChat();
+ const resize = useResizable(150);
+ const { serviceState, loading: serviceLoading } = useServiceContext();
+
+ // Directly read current session info from JSON file (used for VideoSelectionBar)
+ const { sessionInfo: currentSessionFromFile} = useCurrentSessionInfo(chatId);
+
+ // Toast status management
+ const [toast, setToast] = useState<{
+ show: boolean;
+ message: string;
+ type: 'info' | 'warning' | 'error' | 'success';
+ }>({
+ show: false,
+ message: '',
+ type: 'info'
+ });
+
+ const showToast = (message: string, type: 'info' | 'warning' | 'error' | 'success') => {
+ setToast({ show: true, message, type });
+ // Automatically hide after 3 seconds
+ setTimeout(() => {
+ setToast(prev => ({ ...prev, show: false }));
+ }, 3000);
+ };
+
+ const videoUpload = useVideoUpload({
+ uploadedVideos: chat.uploadedVideos,
+ setUploadedVideos: chat.setUploadedVideos,
+ onShowToast: showToast,
+ });
+
+ const isNewChat = chat.messages.length === 0 && !chat.analysisState.isAnalyzing;
+ // If ImageBind is loaded and not in operation, allow video operations
+ const isServiceReady = serviceState.imagebindLoaded && !serviceLoading.loadingImageBind && !serviceLoading.releasingImageBind;
+
+ // Simplify logic: use memory state, determine whether to display VideoSelectionBar based on the number of videos
+ const shouldShowVideoBar = chat.uploadedVideos.length > 0 || chat.analysisState.selectedVideos.length > 0;
+
+ // New: independent state judgment based on the current session, avoiding session pollution
+ const currentSessionAnalysisState = React.useMemo(() => {
+ // Prioritize using memory state (real-time state)
+ if (chat.analysisState.isAnalyzing) {
+ return { isAnalyzing: true, isCompleted: false };
+ }
+
+ // If not in analysis, check persistent state
+ if (currentSessionFromFile?.analysisState === 'completed') {
+ return { isAnalyzing: false, isCompleted: true };
+ }
+
+ if (currentSessionFromFile?.analysisState === 'analyzing') {
+ return { isAnalyzing: true, isCompleted: false };
+ }
+
+ // Default state: new session or not started analysis
+ return { isAnalyzing: false, isCompleted: false };
+ }, [chat.analysisState.isAnalyzing, currentSessionFromFile?.analysisState]);
+
+ // Debug: add debug information
+ console.log('VideoSelectionBar Debug:', {
+ chatId,
+ uploadedVideosLength: chat.uploadedVideos.length,
+ selectedVideosLength: chat.analysisState.selectedVideos.length,
+ shouldShowVideoBar,
+ isNewChat,
+ currentSessionAnalysisState,
+ messagesLength: chat.messages.length,
+ });
+
+ return (
+ <div className="flex flex-col h-screen bg-gray-50">
+ {/* Header Area */}
+ <div
+ className="draggable-area h-8 w-full bg-white flex-shrink-0"
+ style={{ WebkitAppRegion: 'drag' as any, userSelect: 'none' } as React.CSSProperties}
+ />
+
+ {/* Main Content Area - Use remaining height */}
+ <div className="flex-1 flex flex-col overflow-hidden relative">
+ {/* Video Selection Bar - Overlay on top */}
+ {shouldShowVideoBar && (
+ <div className="absolute top-0 left-0 right-0 z-50 bg-white shadow-lg">
+ <VideoSelectionBar
+ videos={chat.analysisState.isAnalyzing || chat.analysisState.selectedVideos.length > 0
+ ? chat.analysisState.selectedVideos
+ : chat.uploadedVideos}
+ onRemoveVideo={videoUpload.removeVideo}
+ onStartAnalysis={chat.handleStartAnalysis}
+ formatFileSize={videoUpload.formatFileSize}
+ isServiceReady={isServiceReady}
+ isAnalyzing={currentSessionAnalysisState.isAnalyzing}
+ analysisCompleted={currentSessionAnalysisState.isCompleted}
+ />
+ </div>
+ )}
+ {isNewChat && !currentSessionAnalysisState.isAnalyzing ? (
+ <WelcomeScreen
+ onVideoUpload={videoUpload.handleVideoUpload}
+ uploadedVideos={chatId === 'new' || !currentSessionFromFile || currentSessionFromFile.analysisState === 'none'
+ ? chat.uploadedVideos
+ : []}
+ onRemoveVideo={videoUpload.removeVideo}
+ onStartAnalysis={chat.handleStartAnalysis}
+ formatFileSize={videoUpload.formatFileSize}
+ analysisState={chat.analysisState}
+ />
+ ) : (
+ <div className="flex-1 overflow-hidden">
+ <MessageList messages={chat.messages} isLoading={chat.isLoading} />
+ </div>
+ )}
+ </div>
+
+ {/* Input Area - Fixed at bottom - Show when there are messages or during analysis */}
+ {chat.messages.length > 0 || currentSessionAnalysisState.isAnalyzing ? (
+ <div className="flex-shrink-0">
+ <ChatInput
+ inputValue={chat.inputValue}
+ setInputValue={chat.setInputValue}
+ onVideoUpload={videoUpload.handleVideoUpload}
+ onSendMessage={chat.handleSendMessage}
+ isLoading={chat.isLoading}
+ height={resize.getCurrentHeight()}
+ onResizeMouseDown={resize.handleResizeMouseDown}
+ isAnalyzing={currentSessionAnalysisState.isAnalyzing}
+ isQueryProcessing={chat.isQueryProcessing}
+ />
+ </div>
+ ) : null}
+
+ {/* Toast prompt */}
+ {toast.show && (
+ <div className="fixed top-4 right-4 z-50 max-w-sm">
+ <div className={`px-6 py-4 rounded-lg shadow-lg border animate-in slide-in-from-right-5 duration-300 ${
+ toast.type === 'success' ? 'bg-green-500 border-green-400 text-white' :
+ toast.type === 'info' ? 'bg-blue-500 border-blue-400 text-white' :
+ toast.type === 'warning' ? 'bg-yellow-500 border-yellow-400 text-white' :
+ 'bg-red-500 border-red-400 text-white'
+ }`}>
+ <div className="flex items-center gap-3">
+ {toast.type === 'success' && <CheckCircle className="w-6 h-6" />}
+ {toast.type === 'info' && <Info className="w-6 h-6" />}
+ {toast.type === 'warning' && <AlertTriangle className="w-6 h-6" />}
+ {toast.type === 'error' && <X className="w-6 h-6" />}
+ <div className="flex-1">
+ <div className="font-medium text-sm">{toast.message}</div>
+ </div>
+ <button
+ onClick={() => setToast(prev => ({ ...prev, show: false }))}
+ className="hover:opacity-75 ml-2"
+ >
+ <X size={16} />
+ </button>
+ </div>
+ </div>
+ </div>
+ )}
+ </div>
+ );
+};
+
+export default Chat;
diff --git a/Vimo-desktop/src/renderer/src/pages/settings/index.tsx b/Vimo-desktop/src/renderer/src/pages/settings/index.tsx
new file mode 100644
index 0000000..fb1345d
--- /dev/null
+++ b/Vimo-desktop/src/renderer/src/pages/settings/index.tsx
@@ -0,0 +1,553 @@
+import { useState, useEffect } from 'react';
+import {
+ Card,
+ CardContent,
+ CardDescription,
+ CardHeader,
+ CardTitle,
+} from '../../components/ui/card';
+import { Button } from '../../components/ui/button';
+import {
+ Key,
+ FolderOpen,
+ CheckCircle,
+ XCircle,
+ RefreshCw,
+ AlertCircle,
+ ExternalLink,
+ Download,
+ Settings as SettingsIcon,
+ Cpu,
+} from 'lucide-react';
+
+interface SettingsState {
+ // OpenAI Configuration
+ openaiBaseUrl: string;
+ openaiApiKey: string;
+ processingModel: string; // processing model - for massive preprocessing
+ analysisModel: string; // analysis model - for fine-grained analysis
+
+ // DashScope Configuration
+ dashscopeApiKey: string;
+ captionModel: string; // video description model
+ asrModel: string; // speech recognition model
+
+ // System Configuration
+ storeDirectory: string; // model storage directory
+
+ // Initialization tracking
+ imagebindInstalled: boolean;
+}
+
+const Settings = () => {
+ const [settings, setSettings] = useState<SettingsState>({
+ openaiBaseUrl: '',
+ openaiApiKey: '',
+ processingModel: 'gpt-4o-mini',
+ analysisModel: 'gpt-4o-mini',
+ dashscopeApiKey: '',
+ captionModel: 'qwen-vl-plus-latest',
+ asrModel: 'paraformer-realtime-v2',
+ storeDirectory: '',
+ imagebindInstalled: false,
+ });
+
+ const [apiConfigStatus, setApiConfigStatus] = useState<
+ 'idle' | 'saving' | 'saved' | 'error'
+ >('idle');
+
+
+
+// Model Status Section Component
+const ModelStatusSection = ({ storeDirectory }: { storeDirectory: string }) => {
+ const [modelStatus, setModelStatus] = useState<{
+ imagebind: boolean;
+ checking: boolean;
+ }>({
+ imagebind: false,
+ checking: false,
+ });
+
+ const checkModelStatus = async () => {
+ if (!storeDirectory) {
+ setModelStatus(prev => ({ ...prev, imagebind: false }));
+ return;
+ }
+
+ setModelStatus(prev => ({ ...prev, checking: true }));
+
+ try {
+ const result = await window.api.checkModelFiles(storeDirectory);
+ setModelStatus({
+ imagebind: result.imagebind,
+ checking: false,
+ });
+ } catch (error) {
+ console.error('Failed to check model status:', error);
+ setModelStatus({ imagebind: false, checking: false });
+ }
+ };
+
+ useEffect(() => {
+ checkModelStatus();
+ }, [storeDirectory]);
+
+ const getStatusMessage = () => {
+ if (!storeDirectory) return 'Please select a storage directory first';
+ if (modelStatus.checking) return 'Checking model status...';
+ if (modelStatus.imagebind) return 'Ready to use';
+ return 'Model not found - run initialization wizard';
+ };
+
+ const getStatusColor = () => {
+ if (!storeDirectory || !modelStatus.imagebind) return 'text-gray-500';
+ if (modelStatus.imagebind) return 'text-green-600';
+ return 'text-red-600';
+ };
+
+ return (
+ <div className="p-4 border rounded-lg">
+ <div className="flex items-center justify-between">
+ <div className="flex items-center gap-3">
+ <div className="w-10 h-10 bg-blue-100 rounded-lg flex items-center justify-center">
+ <Cpu className="w-5 h-5 text-blue-600" />
+ </div>
+ <div>
+ <div className="flex items-center gap-2">
+ <h4 className="font-medium">ImageBind Model</h4>
+ {modelStatus.checking ? (
+ <RefreshCw className="w-4 h-4 animate-spin text-blue-600" />
+ ) : modelStatus.imagebind ? (
+ <CheckCircle className="w-4 h-4 text-green-600" />
+ ) : (
+ <XCircle className="w-4 h-4 text-red-600" />
+ )}
+ </div>
+ <p className="text-xs text-gray-500">~4.5GB • Image Understanding</p>
+ <p className={`text-sm ${getStatusColor()}`}>
+ {getStatusMessage()}
+ </p>
+ </div>
+ </div>
+
+ <Button
+ variant="outline"
+ size="sm"
+ onClick={checkModelStatus}
+ disabled={modelStatus.checking || !storeDirectory}
+ >
+ {modelStatus.checking ? (
+ <RefreshCw className="w-4 h-4 mr-2 animate-spin" />
+ ) : (
+ <RefreshCw className="w-4 h-4 mr-2" />
+ )}
+ Check Status
+ </Button>
+ </div>
+ </div>
+ );
+};
+
+
+
+ // Load settings
+ useEffect(() => {
+ loadSettings();
+ }, []);
+
+ const loadSettings = async () => {
+ try {
+ // Load settings from configuration file
+ const result = await window.api.loadSettings();
+ if (result.success && result.settings) {
+ // Merge saved settings and default settings
+ setSettings(prevSettings => ({
+ ...prevSettings,
+ ...result.settings,
+ }));
+ }
+ } catch (error) {
+ console.error('Failed to load settings:', error);
+ }
+ };
+
+ const handleOpenaiChange = (field: string, value: string) => {
+ setSettings((prev) => ({ ...prev, [field]: value }));
+ };
+
+ const handleDashscopeChange = (e: React.ChangeEvent<HTMLInputElement>) => {
+ setSettings((prev) => ({ ...prev, dashscopeApiKey: e.target.value }));
+ };
+
+ const handleApiConfigSave = async () => {
+ setApiConfigStatus('saving');
+ try {
+ // Step 1: Save settings to file
+ const saveResult = await window.api.saveSettings(settings);
+
+ if (!saveResult.success) {
+ setApiConfigStatus('error');
+ setTimeout(() => setApiConfigStatus('idle'), 2000);
+ return;
+ }
+
+ // Step 2: Trigger VideoRAG configuration initialization
+ try {
+ const initResult = await window.api.videorag.reinitializeConfig();
+
+ if (initResult.success) {
+ setApiConfigStatus('saved');
+ console.log('✅ VideoRAG configuration initialized successfully');
+ } else {
+ console.warn('⚠️ Settings saved but VideoRAG initialization failed:', initResult.error);
+ setApiConfigStatus('saved'); // Still show success since settings were saved
+ }
+ } catch (initError) {
+ console.warn('⚠️ Settings saved but VideoRAG initialization failed:', initError);
+ setApiConfigStatus('saved'); // Still show success since settings were saved
+ }
+
+ // Trigger configuration update event, notify sidebar to reload sessions (if storage directory has changed)
+ if (settings.storeDirectory) {
+ const event = new CustomEvent('storage-config-updated', {
+ detail: { storeDirectory: settings.storeDirectory }
+ });
+ window.dispatchEvent(event);
+ }
+
+ setTimeout(() => setApiConfigStatus('idle'), 2000);
+ } catch (error) {
+ console.error('Failed to save API configuration:', error);
+ setApiConfigStatus('error');
+ setTimeout(() => setApiConfigStatus('idle'), 2000);
+ }
+ };
+
+ const getApiConfigButtonText = () => {
+ switch (apiConfigStatus) {
+ case 'saving':
+ return 'Saving...';
+ case 'saved':
+ return 'Saved!';
+ case 'error':
+ return 'Save API Configuration';
+ default:
+ return 'Save API Configuration';
+ }
+ };
+
+ const getApiConfigButtonIcon = () => {
+ switch (apiConfigStatus) {
+ case 'saving':
+ return <RefreshCw className="animate-spin" size={16} />;
+ case 'saved':
+ return <CheckCircle className="text-green-600" size={16} />;
+ case 'error':
+ return <XCircle className="text-red-600" size={16} />;
+ default:
+ return <Key size={16} />;
+ }
+ };
+
+ // Restart initialization wizard
+ const restartInitializationWizard = async () => {
+ const confirmed = window.confirm(
+ 'This will restart the application and reset all initialization settings. Are you sure you want to continue?'
+ );
+
+ if (!confirmed) return;
+
+ try {
+ // 1. Clear configuration files
+ console.log('Clearing configuration files...');
+ await window.api.app.clearConfig();
+
+ // 2. Restart application
+ console.log('Restarting application...');
+ await window.api.app.restart();
+
+ } catch (error) {
+ console.error('Failed to restart initialization wizard:', error);
+ alert('Failed to restart setup wizard. Please try again.');
+ }
+ };
+
+ return (
+ <div className="flex flex-col h-full">
+ {/* Header Area */}
+ <div
+ className="draggable-area h-8 w-full"
+ style={{ WebkitAppRegion: 'drag' } as React.CSSProperties}
+ />
+
+ {/* Main Content */}
+ <div className="flex-1 overflow-auto p-6">
+ <div className="mx-auto max-w-4xl space-y-6">
+ {/* Header */}
+ <div className="space-y-2">
+ <h1 className="text-3xl font-bold tracking-tight">Settings</h1>
+ <p className="text-muted-foreground">
+ Configure your Vimo application preferences and environment.
+ </p>
+ </div>
+
+ {/* API Configuration */}
+ <Card>
+ <CardHeader>
+ <div className="flex items-center gap-3">
+ <div className="flex size-10 items-center justify-center rounded-lg bg-blue-100 text-blue-600">
+ <Key size={20} />
+ </div>
+ <div>
+ <CardTitle>API Configuration</CardTitle>
+ <CardDescription>
+ Configure your API keys for external services
+ </CardDescription>
+ </div>
+ </div>
+ </CardHeader>
+ <CardContent className="space-y-6">
+ {/* OpenAI Configuration */}
+ <div className="space-y-4 p-4 border rounded-lg bg-gray-50">
+ <h3 className="text-lg font-semibold text-gray-800">OpenAI Configuration</h3>
+ <p className="text-sm text-gray-600">Configure OpenAI API for language model services</p>
+
+ <div className="space-y-4">
+ <div>
+ <label className="text-sm font-medium block mb-2">
+ Base URL
+ </label>
+ <input
+ type="text"
+ placeholder="https://api.openai.com/v1"
+ value={settings.openaiBaseUrl}
+ onChange={(e) => handleOpenaiChange('openaiBaseUrl', e.target.value)}
+ className="w-full px-3 py-2 text-sm border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
+ />
+ </div>
+
+ <div>
+ <label className="text-sm font-medium block mb-2">
+ API Key
+ </label>
+ <input
+ type="password"
+ placeholder="sk-..."
+ value={settings.openaiApiKey}
+ onChange={(e) => handleOpenaiChange('openaiApiKey', e.target.value)}
+ className="w-full px-3 py-2 text-sm border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
+ />
+ </div>
+
+ <div className="grid grid-cols-2 gap-4">
+ <div>
+ <label className="text-sm font-medium block mb-2">
+ Processing Model
+ </label>
+ <input
+ type="text"
+ value="gpt-4o-mini"
+ readOnly
+ className="w-full px-3 py-2 text-sm border rounded-md bg-gray-100 text-gray-600"
+ />
+ <p className="text-xs text-gray-500 mt-1">Fixed model for high-volume preprocessing tasks</p>
+ </div>
+
+ <div>
+ <label className="text-sm font-medium block mb-2">
+ Analysis Model
+ </label>
+ <input
+ type="text"
+ value="gpt-4o-mini"
+ readOnly
+ className="w-full px-3 py-2 text-sm border rounded-md bg-gray-100 text-gray-600"
+ />
+ <p className="text-xs text-gray-500 mt-1">Fixed model for detailed analysis tasks</p>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ {/* DashScope Configuration */}
+ <div className="space-y-4 p-4 border rounded-lg bg-orange-50">
+ <div className="flex items-center justify-between">
+ <div>
+ <h3 className="text-lg font-semibold text-gray-800">DashScope Configuration</h3>
+ <p className="text-sm text-gray-600">Configure Alibaba Cloud DashScope API for video captioning</p>
+ </div>
+ <a
+ href="https://www.alibabacloud.com/help/en/model-studio/get-api-key?spm=a2c63.p38356.0.i1"
+ target="_blank"
+ rel="noopener noreferrer"
+ className="flex items-center gap-1 text-sm text-blue-600 hover:text-blue-800"
+ >
+ <ExternalLink size={14} />
+ Get API Key Tutorial
+ </a>
+ </div>
+
+ <div className="space-y-4">
+ <div>
+ <label className="text-sm font-medium block mb-2">
+ DashScope API Key
+ </label>
+ <input
+ type="password"
+ placeholder="sk-..."
+ value={settings.dashscopeApiKey}
+ onChange={handleDashscopeChange}
+ className="w-full px-3 py-2 text-sm border rounded-md focus:outline-none focus:ring-2 focus:ring-orange-500"
+ />
+ </div>
+
+ <div className="grid grid-cols-2 gap-4">
+ <div>
+ <label className="text-sm font-medium block mb-2">
+ Caption Model
+ </label>
+ <input
+ type="text"
+ value="qwen-vl-plus-latest"
+ readOnly
+ className="w-full px-3 py-2 text-sm border rounded-md bg-gray-100 text-gray-600"
+ />
+ <p className="text-xs text-gray-500 mt-1">Fixed model for video captioning tasks</p>
+ </div>
+
+ <div>
+ <label className="text-sm font-medium block mb-2">
+ ASR Model
+ </label>
+ <input
+ type="text"
+ value="paraformer-realtime-v2"
+ readOnly
+ className="w-full px-3 py-2 text-sm border rounded-md bg-gray-100 text-gray-600"
+ />
+ <p className="text-xs text-gray-500 mt-1">Fixed model for speech recognition tasks</p>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <p className="text-xs text-muted-foreground">
+ All API keys are stored locally and never shared with third parties
+ </p>
+
+ {/* Save API Configuration Button */}
+ <div className="flex justify-end">
+ <Button
+ variant="outline"
+ onClick={handleApiConfigSave}
+ disabled={apiConfigStatus === 'saving'}
+ className="px-6"
+ >
+ {getApiConfigButtonIcon()}
+ <span className="ml-2">{getApiConfigButtonText()}</span>
+ </Button>
+ </div>
+ </CardContent>
+ </Card>
+
+ {/* Model Status */}
+ <Card>
+ <CardHeader>
+ <div className="flex items-center gap-3">
+ <div className="flex size-10 items-center justify-center rounded-lg bg-blue-100 text-blue-600">
+ <Download size={20} />
+ </div>
+ <div>
+ <CardTitle>AI Model Status</CardTitle>
+ <CardDescription>
+ Check the status of ImageBind model
+ </CardDescription>
+ </div>
+ </div>
+ </CardHeader>
+ <CardContent className="space-y-4">
+ <ModelStatusSection storeDirectory={settings.storeDirectory} />
+ </CardContent>
+ </Card>
+
+ {/* File System Configuration */}
+ <Card>
+ <CardHeader>
+ <div className="flex items-center gap-3">
+ <div className="flex size-10 items-center justify-center rounded-lg bg-purple-100 text-purple-600">
+ <FolderOpen size={20} />
+ </div>
+ <div>
+ <CardTitle>File System</CardTitle>
+ <CardDescription>
+ Configure file storage and temporary directories
+ </CardDescription>
+ </div>
+ </div>
+ </CardHeader>
+ <CardContent className="space-y-4">
+ <div>
+ <label className="text-sm font-medium block mb-2">
+ Data Storage Directory
+ </label>
+ <input
+ type="text"
+ placeholder="Select a directory..."
+ value={settings.storeDirectory}
+ readOnly
+ className="w-full px-3 py-2 text-sm border rounded-md bg-gray-50 focus:outline-none"
+ />
+ <p className="text-xs text-muted-foreground mt-1">
+ Directory for storing AI models (ImageBind) and Vimo cache data
+ </p>
+ </div>
+ </CardContent>
+ </Card>
+
+ {/* Setup Wizard */}
+ <Card>
+ <CardHeader>
+ <div className="flex items-center gap-3">
+ <div className="flex size-10 items-center justify-center rounded-lg bg-indigo-100 text-indigo-600">
+ <SettingsIcon size={20} />
+ </div>
+ <div>
+ <CardTitle>Setup Wizard</CardTitle>
+ <CardDescription>
+ Re-run the initial configuration wizard to set up directories, download models, and check environment
+ </CardDescription>
+ </div>
+ </div>
+ </CardHeader>
+ <CardContent className="space-y-4">
+ <div className="flex items-start gap-2 p-3 bg-blue-50 border border-blue-200 rounded-lg">
+ <AlertCircle className="text-blue-600 mt-0.5" size={16} />
+ <div className="text-sm">
+ <p className="font-medium text-blue-800">
+ Setup Wizard
+ </p>
+ <p className="text-blue-700 mt-1">
+ Guide you through directory setup, AI model downloads, and environment configuration.
+ </p>
+ </div>
+ </div>
+
+ <div className="flex justify-start">
+ <Button
+ onClick={restartInitializationWizard}
+ variant="outline"
+ className="px-6 py-2"
+ >
+ <SettingsIcon className="w-4 h-4 mr-2" />
+ Re-run Setup Wizard
+ </Button>
+ </div>
+ </CardContent>
+ </Card>
+ </div>
+ </div>
+ </div>
+ );
+};
+
+export default Settings;
diff --git a/Vimo-desktop/src/renderer/src/styles/globals.css b/Vimo-desktop/src/renderer/src/styles/globals.css
new file mode 100644
index 0000000..e85aa8e
--- /dev/null
+++ b/Vimo-desktop/src/renderer/src/styles/globals.css
@@ -0,0 +1,152 @@
+@import "tailwindcss";
+
+:root {
+ --background: oklch(1 0 0);
+ --foreground: oklch(0.145 0 0);
+ --card: oklch(1 0 0);
+ --card-foreground: oklch(0.145 0 0);
+ --popover: oklch(1 0 0);
+ --popover-foreground: oklch(0.145 0 0);
+ --primary: oklch(0.205 0 0);
+ --primary-foreground: oklch(0.985 0 0);
+ --secondary: oklch(0.97 0 0);
+ --secondary-foreground: oklch(0.205 0 0);
+ --muted: oklch(0.97 0 0);
+ --muted-foreground: oklch(0.556 0 0);
+ --accent: oklch(0.97 0 0);
+ --accent-foreground: oklch(0.205 0 0);
+ --destructive: oklch(0.577 0.245 27.325);
+ --destructive-foreground: oklch(0.577 0.245 27.325);
+ --border: oklch(0.922 0 0);
+ --input: oklch(0.922 0 0);
+ --ring: oklch(0.708 0 0);
+ --chart-1: oklch(0.646 0.222 41.116);
+ --chart-2: oklch(0.6 0.118 184.704);
+ --chart-3: oklch(0.398 0.07 227.392);
+ --chart-4: oklch(0.828 0.189 84.429);
+ --chart-5: oklch(0.769 0.188 70.08);
+ --radius: 0.625rem;
+ --sidebar: oklch(0.985 0 0);
+ --sidebar-foreground: oklch(0.145 0 0);
+ --sidebar-primary: oklch(0.205 0 0);
+ --sidebar-primary-foreground: oklch(0.985 0 0);
+ --sidebar-accent: oklch(0.97 0 0);
+ --sidebar-accent-foreground: oklch(0.205 0 0);
+ --sidebar-border: oklch(0.922 0 0);
+ --sidebar-ring: oklch(0.708 0 0);
+}
+
+.dark {
+ --background: oklch(0.145 0 0);
+ --foreground: oklch(0.985 0 0);
+ --card: oklch(0.145 0 0);
+ --card-foreground: oklch(0.985 0 0);
+ --popover: oklch(0.145 0 0);
+ --popover-foreground: oklch(0.985 0 0);
+ --primary: oklch(0.985 0 0);
+ --primary-foreground: oklch(0.205 0 0);
+ --secondary: oklch(0.269 0 0);
+ --secondary-foreground: oklch(0.985 0 0);
+ --muted: oklch(0.269 0 0);
+ --muted-foreground: oklch(0.708 0 0);
+ --accent: oklch(0.269 0 0);
+ --accent-foreground: oklch(0.985 0 0);
+ --destructive: oklch(0.396 0.141 25.723);
+ --destructive-foreground: oklch(0.637 0.237 25.331);
+ --border: oklch(0.269 0 0);
+ --input: oklch(0.269 0 0);
+ --ring: oklch(0.439 0 0);
+ --chart-1: oklch(0.488 0.243 264.376);
+ --chart-2: oklch(0.696 0.17 162.48);
+ --chart-3: oklch(0.769 0.188 70.08);
+ --chart-4: oklch(0.627 0.265 303.9);
+ --chart-5: oklch(0.645 0.246 16.439);
+ --sidebar: oklch(0.205 0 0);
+ --sidebar-foreground: oklch(0.985 0 0);
+ --sidebar-primary: oklch(0.488 0.243 264.376);
+ --sidebar-primary-foreground: oklch(0.985 0 0);
+ --sidebar-accent: oklch(0.269 0 0);
+ --sidebar-accent-foreground: oklch(0.985 0 0);
+ --sidebar-border: oklch(0.269 0 0);
+ --sidebar-ring: oklch(0.439 0 0);
+}
+
+@theme inline {
+ --color-background: var(--background);
+ --color-foreground: var(--foreground);
+ --color-card: var(--card);
+ --color-card-foreground: var(--card-foreground);
+ --color-popover: var(--popover);
+ --color-popover-foreground: var(--popover-foreground);
+ --color-primary: var(--primary);
+ --color-primary-foreground: var(--primary-foreground);
+ --color-secondary: var(--secondary);
+ --color-secondary-foreground: var(--secondary-foreground);
+ --color-muted: var(--muted);
+ --color-muted-foreground: var(--muted-foreground);
+ --color-accent: var(--accent);
+ --color-accent-foreground: var(--accent-foreground);
+ --color-destructive: var(--destructive);
+ --color-destructive-foreground: var(--destructive-foreground);
+ --color-border: var(--border);
+ --color-input: var(--input);
+ --color-ring: var(--ring);
+ --color-chart-1: var(--chart-1);
+ --color-chart-2: var(--chart-2);
+ --color-chart-3: var(--chart-3);
+ --color-chart-4: var(--chart-4);
+ --color-chart-5: var(--chart-5);
+ --radius-sm: calc(var(--radius) - 4px);
+ --radius-md: calc(var(--radius) - 2px);
+ --radius-lg: var(--radius);
+ --radius-xl: calc(var(--radius) + 4px);
+ --color-sidebar: var(--sidebar);
+ --color-sidebar-foreground: var(--sidebar-foreground);
+ --color-sidebar-primary: var(--sidebar-primary);
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
+ --color-sidebar-accent: var(--sidebar-accent);
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
+ --color-sidebar-border: var(--sidebar-border);
+ --color-sidebar-ring: var(--sidebar-ring);
+}
+
+@layer base {
+ * {
+ @apply border-border outline-ring/50;
+ }
+
+ body {
+ @apply bg-background text-foreground;
+ }
+}
+
+.loading-container {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ height: 100vh;
+}
+
+.loading-spinner {
+ display: inline-block;
+ width: 30px;
+ height: 30px;
+ border: 3px solid rgba(0, 0, 0, 0.1);
+ border-radius: 50%;
+ border-top-color: #767676;
+ animation: spin 1s ease-in-out infinite;
+}
+
+@keyframes spin {
+ 0% { transform: rotate(0deg); }
+ 100% { transform: rotate(360deg); }
+}
+
+[role=button],
+button {
+ cursor: pointer;
+}
+
+body {
+ background-color: transparent !important;
+}
\ No newline at end of file
diff --git a/Vimo-desktop/src/renderer/src/types/chat.ts b/Vimo-desktop/src/renderer/src/types/chat.ts
new file mode 100644
index 0000000..3169f80
--- /dev/null
+++ b/Vimo-desktop/src/renderer/src/types/chat.ts
@@ -0,0 +1,67 @@
+export interface AnalysisStep {
+ id: string;
+ name: string;
+ message: string;
+ status: 'active' | 'completed' | 'error';
+ timestamp: Date;
+}
+
+export interface Message {
+ id: string;
+ type: 'user' | 'assistant';
+ content: string;
+ timestamp: Date;
+ videos?: string[];
+ isProgressBar?: boolean;
+ analysisSteps?: AnalysisStep[];
+ messageCategory?: 'user_query' | 'assistant_response' | 'analysis_status' | 'system_info';
+ // Query analyzing related fields
+ isQueryAnalyzing?: boolean;
+ queryStep?: string;
+ queryMessage?: string;
+ queryStatus?: 'active' | 'completed' | 'error';
+}
+
+export interface UploadedVideo {
+ id: string;
+ name: string;
+ url: string;
+ path: string; // Real file path
+ size: number;
+ duration?: number;
+ thumbnail?: string;
+}
+
+export interface VideoAnalysisState {
+ isAnalyzing: boolean;
+ progress: number;
+ currentStep: string;
+ selectedVideos: UploadedVideo[];
+}
+
+// Chat Session information persistent storage
+export interface ChatSessionInfo {
+ id: string;
+ title: string;
+ createdAt: Date;
+ lastUpdated: Date;
+ videos: UploadedVideo[];
+ analysisState: 'none' | 'analyzing' | 'completed';
+ analysisProgress?: number;
+ currentStep?: string;
+ lastMessage?: string;
+ // Note: messages removed from memory, will be loaded from file system on demand
+}
+
+// Note: ChatSessionsStorage interface removed as each session is now stored individually
+
+export interface ChatState {
+ messages: Message[];
+ uploadedVideos: UploadedVideo[];
+ inputValue: string;
+ isLoading: boolean;
+ inputAreaHeight: number;
+ isDragging: boolean;
+ realTimeHeight: number;
+ analysisState: VideoAnalysisState;
+}
\ No newline at end of file
diff --git a/Vimo-desktop/src/renderer/src/types/global.d.ts b/Vimo-desktop/src/renderer/src/types/global.d.ts
new file mode 100644
index 0000000..23ad1e5
--- /dev/null
+++ b/Vimo-desktop/src/renderer/src/types/global.d.ts
@@ -0,0 +1,166 @@
+/// <reference types="vite/client" />
+export interface VideoRAGAPI {
+ echoMessage: (message: string) => Promise<string>;
+ readFile: () => Promise<{
+ success: boolean;
+ content?: string;
+ path?: string;
+ error?: string;
+ }>;
+ saveFile: (content: string) => Promise<{
+ success: boolean;
+ path?: string;
+ error?: string;
+ }>;
+ selectFolder: () => Promise<{
+ success: boolean;
+ path?: string;
+ error?: string;
+ }>;
+
+ saveSettings: (settings: any) => Promise<{
+ success: boolean;
+ error?: string;
+ }>;
+ loadSettings: () => Promise<{
+ success: boolean;
+ settings?: any;
+ error?: string;
+ }>;
+ testApiKey: (apiKey: string) => Promise<{
+ success: boolean;
+ error?: string;
+ }>;
+
+ // VideoRAG environment management
+ installVideoragEnvironment: (tempDir: string) => Promise<{
+ success: boolean;
+ installation_info?: any;
+ error?: string;
+ details?: string;
+ }>;
+ getInstallationProgress: (tempDir: string) => Promise<{
+ stage: string;
+ percentage: number;
+ message: string;
+ }>;
+ checkVideoragEnvironment: () => Promise<{
+ installed: boolean;
+ config?: any;
+ message?: string;
+ }>;
+ processWithVideoragEnv: (query: string, videoPath?: string) => Promise<{
+ success: boolean;
+ data?: any;
+ environment?: string;
+ error?: string;
+ details?: string;
+ }>;
+ // Model file check and download
+ checkModelFiles: (storeDirectory: string) => Promise<{
+ imagebind: boolean;
+ }>;
+ downloadImageBind: (storeDirectory: string) => Promise<{
+ success: boolean;
+ error?: string;
+ }>;
+
+ // Event listeners
+ onDownloadProgress: (callback: (event: any, data: { type: string, progress: number, downloaded?: number, total?: number }) => void) => void;
+ onDownloadError: (callback: (event: any, data: { type: string, error: string }) => void) => void;
+ removeDownloadListeners: () => void;
+
+
+ // VideoRAG API methods
+ invoke: (channel: string, ...args: any[]) => Promise<any>;
+
+ // Chat Session Management API (File System Based)
+ chatSessions: {
+ load: (chatId: string) => Promise<{ success: boolean; session?: any; error?: string }>;
+ save: (chatId: string, sessionData: any) => Promise<{ success: boolean; error?: string }>;
+ list: () => Promise<{ success: boolean; sessions?: any[]; error?: string }>;
+ delete: (chatId: string) => Promise<{ success: boolean; error?: string }>;
+ getStorageInfo: () => Promise<{ success: boolean; storeDirectory?: string; isConfigured?: boolean; error?: string }>;
+ ensureStorageDirectory: () => Promise<{ success: boolean; error?: string }>;
+ // Unified sorting update API
+ updateSessionOrder: (sessionIds: string[], operation?: 'create' | 'delete' | 'reorder') => Promise<{ success: boolean; error?: string }>;
+ };
+
+ // VideoRAG Service Control
+ videorag: {
+ healthCheck: () => Promise<{ success: boolean; data?: any; error?: string }>;
+ initialize: (config: any) => Promise<{ success: boolean; data?: any; error?: string }>;
+ uploadVideo: (chatId: string, videoPathList: string[], baseStoragePath: string) => Promise<{ success: boolean; data?: any; error?: string }>;
+ getStatus: (chatId: string, type?: string) => Promise<{ success: boolean; data?: any; error?: string }>;
+ listIndexed: (chatId: string) => Promise<{ success: boolean; data?: any; error?: string }>;
+ sessionStatus: (chatId: string) => Promise<{ success: boolean; data?: any; error?: string }>;
+ query: (chatId: string, query: string, mode?: string) => Promise<{ success: boolean; data?: any; error?: string }>;
+ queryVideo: (chatId: string, query: string) => Promise<{ success: boolean; data?: any; error?: string }>;
+ systemStatus: () => Promise<{ success: boolean; data?: any; error?: string }>;
+ getVideoDuration: (videoPath: string) => Promise<{ success: boolean; duration?: number; fps?: number; width?: number; height?: number; video_path?: string; error?: string }>;
+ deleteSession: (chatId: string) => Promise<{ success: boolean; data?: any; error?: string }>;
+ // Service control
+ startService: () => Promise<{ success: boolean; message?: string; error?: string }>;
+ stopService: () => Promise<{ success: boolean; message?: string; error?: string }>;
+ serviceStatus: () => Promise<{ success: boolean; isRunning?: boolean; message?: string; error?: string }>;
+ deleteSession: (chatId: string) => Promise<{ success: boolean; data?: any; error?: string }>;
+ loadImageBind: () => Promise<{ success: boolean; data?: any; error?: string }>;
+ releaseImageBind: () => Promise<{ success: boolean; data?: any; error?: string }>;
+ imagebindStatus: () => Promise<{ success: boolean; data?: any; error?: string }>;
+ reinitializeConfig: () => Promise<{ success: boolean; message?: string; error?: string }>;
+ };
+
+ // App control
+ app: {
+ restart: () => Promise<{ success: boolean; error?: string }>;
+ clearConfig: () => Promise<{ success: boolean; error?: string }>;
+ };
+
+ selectVideoFiles: () => Promise<{
+ success: boolean;
+ files?: { name: string; path: string; size: number }[];
+ error?: string
+ }>;
+}
+
+declare global {
+ interface Window {
+ api: VideoRAGAPI;
+ electron: {
+ process: {
+ platform: string;
+ };
+ };
+ }
+
+ // Declare environment variables
+ declare const APP_VERSION: string;
+}
+
+// Image module declaration
+declare module '*.png' {
+ const value: any;
+ export default value;
+}
+
+declare module '*.jpg' {
+ const value: any;
+ export default value;
+}
+
+declare module '*.jpeg' {
+ const value: any;
+ export default value;
+}
+
+declare module '*.svg' {
+ const value: any;
+ export default value;
+}
+
+declare module '*.webp' {
+ const value: any;
+ export default value;
+}
+
+export {};
diff --git a/Vimo-desktop/src/renderer/src/utils/chat.ts b/Vimo-desktop/src/renderer/src/utils/chat.ts
new file mode 100644
index 0000000..7ba94a2
--- /dev/null
+++ b/Vimo-desktop/src/renderer/src/utils/chat.ts
@@ -0,0 +1,221 @@
+import { Message } from '../types/chat';
+
+/**
+ * Format file size
+ */
+export const formatFileSize = (bytes: number): string => {
+ if (bytes === 0) return '0 Bytes';
+ const k = 1024;
+ const sizes = ['Bytes', 'KB', 'MB', 'GB'];
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
+ return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
+};
+
+/**
+ * Automatically classify messages
+ */
+const categorizeMessage = (message: Message): Message => {
+ const categorized = { ...message };
+
+ if (message.type === 'user') {
+ categorized.messageCategory = 'user_query';
+ } else if (message.type === 'assistant') {
+ if (message.isProgressBar) {
+ categorized.messageCategory = 'analysis_status';
+ } else if (message.content.includes('VideoRAG') || message.content.includes('System')) {
+ categorized.messageCategory = 'system_info';
+ } else {
+ categorized.messageCategory = 'assistant_response';
+ }
+ }
+
+ return categorized;
+};
+
+/**
+ * Add a single message to the file system (read JSON → add message → save JSON)
+ */
+export const addMessage = async (chatId: string, newMessage: Message): Promise<void> => {
+ if (chatId && chatId !== 'new') {
+ try {
+ // Step 1: First read the JSON file of the current session
+ const result = await window.api.chatSessions.load(chatId);
+ const sessionData = result.session || {
+ id: chatId,
+ title: 'New Chat',
+ createdAt: new Date(),
+ lastUpdated: new Date(),
+ videos: [],
+ analysisState: 'none',
+ lastMessage: '',
+ messages: [],
+ };
+
+ // Step 2: Add the new message to the existing chat record
+ const existingMessages = sessionData.messages || [];
+ const categorizedMessage = categorizeMessage(newMessage);
+ const updatedMessages = [...existingMessages, categorizedMessage];
+
+ // Step 3: Save JSON file
+ const updatedSession = {
+ ...sessionData,
+ messages: updatedMessages,
+ lastMessage: newMessage.content.length > 50 ? newMessage.content.substring(0, 50) + '...' : newMessage.content,
+ lastUpdated: new Date(),
+ };
+
+ await window.api.chatSessions.save(chatId, updatedSession);
+
+ // Step 4: Trigger frontend interface refresh
+ window.dispatchEvent(new CustomEvent('chat-messages-updated', { detail: { chatId } }));
+ } catch (error) {
+ console.error('Failed to add message:', error);
+ }
+ }
+};
+
+/**
+ * Update existing messages (used for updating progress bars, etc.)
+ */
+export const updateMessage = async (chatId: string, messageId: string, updates: Partial<Message>): Promise<void> => {
+ if (chatId && chatId !== 'new') {
+ try {
+ // Step 1: Read JSON file
+ const result = await window.api.chatSessions.load(chatId);
+ if (!result.session?.messages) return;
+
+ // Step 2: Update specified message
+ const updatedMessages = result.session.messages.map((msg: any) =>
+ msg.id === messageId ? { ...msg, ...updates } : msg
+ );
+
+ // Step 3: Save JSON file
+ const updatedSession = {
+ ...result.session,
+ messages: updatedMessages,
+ lastUpdated: new Date(),
+ };
+
+ await window.api.chatSessions.save(chatId, updatedSession);
+
+ // Step 4: Trigger frontend interface refresh
+ window.dispatchEvent(new CustomEvent('chat-messages-updated', { detail: { chatId } }));
+ } catch (error) {
+ console.error('Failed to update message:', error);
+ }
+ }
+};
+
+/**
+ * Directly save the complete message array to the file system (backward compatibility)
+ */
+export const saveMessages = async (chatId: string, messages: Message[]): Promise<void> => {
+ if (chatId && chatId !== 'new') {
+ const categorizedMessages = messages.map(categorizeMessage);
+ const lastMessage = messages.length > 0 ? messages[messages.length - 1].content : '';
+
+ try {
+ // First load the current session info, keep other fields
+ const result = await window.api.chatSessions.load(chatId);
+ const sessionData = result.session || {
+ id: chatId,
+ title: 'New Chat',
+ createdAt: new Date(),
+ lastUpdated: new Date(),
+ videos: [],
+ analysisState: 'none',
+ lastMessage: '',
+ };
+
+ // Only update messages and lastMessage, keep other fields unchanged
+ const updatedSession = {
+ ...sessionData,
+ messages: categorizedMessages,
+ lastMessage: lastMessage.length > 50 ? lastMessage.substring(0, 50) + '...' : lastMessage,
+ lastUpdated: new Date(),
+ };
+
+ await window.api.chatSessions.save(chatId, updatedSession);
+
+ // Trigger frontend interface refresh
+ window.dispatchEvent(new CustomEvent('chat-messages-updated', { detail: { chatId } }));
+ } catch (error) {
+ console.error('Failed to save messages:', error);
+ }
+ }
+};
+
+/**
+ * Directly load messages from the file system
+ */
+export const loadMessages = async (chatId: string): Promise<Message[]> => {
+ if (chatId && chatId !== 'new') {
+ try {
+ const result = await window.api.chatSessions.load(chatId);
+ if (result.success && result.session?.messages) {
+ return result.session.messages.map((msg: any) => ({
+ ...msg,
+ timestamp: new Date(msg.timestamp),
+ }));
+ }
+ } catch (error) {
+ console.error('Failed to load messages:', error);
+ }
+ }
+ return [];
+};
+
+/**
+ * Generate a unique message ID
+ */
+export const generateMessageId = (): string => `msg-${Date.now()}`;
+
+/**
+ * Generate a unique video ID
+ */
+export const generateVideoId = (): string => `video-${Date.now()}-${Math.random()}`;
+
+/**
+ * Generate a unique chat ID
+ */
+export const generateChatId = (): string => `chat-${Date.now()}`;
+
+/**
+ * Get welcome message
+ */
+export const getWelcomeMessage = (): Message => ({
+ id: 'welcome',
+ type: 'assistant',
+ content: "Hello! I'm Vimo, your AI assistant for video analysis. Upload videos and ask me anything about them - I can analyze content, summarize key points, and answer questions about what I see.",
+ timestamp: new Date(),
+});
+
+/**
+ * Update the lastMessage in the session info (does not affect the messages array)
+ */
+export const updateSessionLastMessage = async (chatId: string, lastMessage: string): Promise<void> => {
+ if (chatId && chatId !== 'new') {
+ try {
+ const result = await window.api.chatSessions.load(chatId);
+ if (result.success && result.session) {
+ const updatedSession = {
+ ...result.session,
+ lastMessage: lastMessage.length > 50 ? lastMessage.substring(0, 50) + '...' : lastMessage,
+ lastUpdated: new Date(),
+ };
+ await window.api.chatSessions.save(chatId, updatedSession);
+ }
+ } catch (error) {
+ console.error('Failed to update session last message:', error);
+ }
+ }
+};
+
+/**
+ * Create chat history update event
+ */
+export const createChatHistoryEvent = (chatId: string, title: string, lastMessage: string) => {
+ return new CustomEvent('chat-history-update', {
+ detail: { chatId, title, lastMessage },
+ });
+};
\ No newline at end of file
diff --git a/Vimo-desktop/tailwind.config.js b/Vimo-desktop/tailwind.config.js
new file mode 100644
index 0000000..3e95faa
--- /dev/null
+++ b/Vimo-desktop/tailwind.config.js
@@ -0,0 +1,14 @@
+/** @type {import('tailwindcss').Config} */
+module.exports = {
+ content: [
+ "./src/renderer/**/*.{js,ts,jsx,tsx,html}",
+ ],
+ theme: {
+ extend: {
+ fontFamily: {
+ 'sans': ['Inter', 'Roboto', 'Noto Sans', 'Helvetica Neue', 'Arial', 'sans-serif'],
+ },
+ },
+ },
+ plugins: [],
+}
\ No newline at end of file
diff --git a/Vimo-desktop/tsconfig.json b/Vimo-desktop/tsconfig.json
new file mode 100644
index 0000000..6c46c1f
--- /dev/null
+++ b/Vimo-desktop/tsconfig.json
@@ -0,0 +1,19 @@
+{
+ "extends": "@electron-toolkit/tsconfig/tsconfig.json",
+ "include": [
+ "src/**/*",
+ "electron.vite.config.*"
+ ],
+ "compilerOptions": {
+ "composite": true,
+ "baseUrl": ".",
+ "paths": {
+ "@/*": ["./src/*"],
+ "@main/*": ["./src/main/*"],
+ "@renderer/*": ["./src/renderer/*"],
+ "@preload/*": ["./src/preload/*"]
+ },
+ "types": ["node"],
+ "moduleResolution": "bundler"
+ }
+}
\ No newline at end of file
diff --git a/Vimo-desktop/tsconfig.node.json b/Vimo-desktop/tsconfig.node.json
new file mode 100644
index 0000000..9cb8a3a
--- /dev/null
+++ b/Vimo-desktop/tsconfig.node.json
@@ -0,0 +1,13 @@
+{
+ "extends": "@electron-toolkit/tsconfig/tsconfig.node.json",
+ "include": [
+ "src/main/**/*",
+ "src/preload/**/*",
+ "electron.vite.config.*"
+ ],
+ "compilerOptions": {
+ "composite": true,
+ "types": ["node"],
+ "moduleResolution": "bundler"
+ }
+}
\ No newline at end of file
diff --git a/Vimo-desktop/tsconfig.web.json b/Vimo-desktop/tsconfig.web.json
new file mode 100644
index 0000000..f91cf6f
--- /dev/null
+++ b/Vimo-desktop/tsconfig.web.json
@@ -0,0 +1,16 @@
+{
+ "extends": "@electron-toolkit/tsconfig/tsconfig.web.json",
+ "include": [
+ "src/renderer/**/*"
+ ],
+ "compilerOptions": {
+ "composite": true,
+ "jsx": "react-jsx",
+ "jsxImportSource": "react",
+ "baseUrl": ".",
+ "paths": {
+ "@/*": ["./src/*"],
+ "@renderer/*": ["./src/renderer/src/*"]
+ }
+ }
+}
\ No newline at end of file