# 自动化插件 **Repository Path**: coolfors/automation-plugin ## Basic Information - **Project Name**: 自动化插件 - **Description**: 这是一个自动化的demo - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-01-19 - **Last Updated**: 2026-01-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # DeepSeek Automation Desktop Client The DeepSeek Automation Desktop Client is a desktop application built with Electron and Puppeteer, designed to automate interactions with DeepSeek AI. This project provides an intuitive user interface supporting rich text input, image uploads, automated conversations, and result printing. ## Features This client integrates multiple practical features to deliver a seamless AI conversation experience. The rich text editing function allows users to format text, insert images, and paste content from the clipboard within the input field. The automated interaction module automatically handles the conversation flow, including page load monitoring, content submission, real-time response reception, and incremental content updates. The print output module supports segmented printing, final result output, error retry, and session history export in TXT and JSON formats. The logging system provides comprehensive debugging traceability with configurable log levels and export capabilities. Additionally, the application includes a print log container and advanced settings options to accommodate various usage scenarios. ## Technical Architecture The project is built using modern technologies. The frontend interface is developed with HTML5 and CSS3, while the main process leverages Electron’s Main and Renderer process architecture. Browser automation is powered by Puppeteer, enabling precise control over the Chrome browser. The backend API service is implemented using the Express framework, providing stable server support. A modular code structure separates core functionalities into independent modules: the automation module (auto.js), the printing module (printer.js), and the logging module (logger.js), ensuring maintainability and extensibility. ## Project Structure The project’s file organization is clear and well-structured for ease of development and maintenance. Entry files include main.js (Electron main process), renderer.js (renderer process), preload.js (preload script), and index.html (main interface). Core functionality modules reside in the utils directory, handling automation operations (auto.js), print output (printer.js), and logging (logger.js). The server entry point, server.js, provides API server functionality. Configuration and documentation files include package.json (project configuration), .gitignore (Git ignore rules), and development planning documents located in the .trae/documents/ directory. ## Quick Start For environment preparation, ensure Node.js (version 16.x or higher) and the npm package manager are installed on your system. The application depends on Puppeteer for browser automation, which automatically downloads Chrome during installation. Installation steps: First, clone the project repository, then navigate to the project directory and run `npm install` to install all dependencies. After installation, start the application by running `npm start` in the project root directory. To simultaneously launch the API server for development and debugging, execute the command `npm run server`. ## Usage Guide After launching the application, the main interface displays a browser area and a results display area. Enter your question or conversation content in the rich text input field below, which supports text formatting and image insertion. Click the send button to automatically initiate interaction with DeepSeek; responses will be displayed in real time in the results area. The print settings section allows configuration of output formats and printing options, while the print log records all interaction processes. The advanced settings section offers additional configuration options to meet specialized requirements. ## Module Details The `DeepSeekAuto` class is the core of the automation module, responsible for managing the entire conversation flow. It provides methods such as `start()` to initiate automation, `stop()` to halt automation, `sendQuestion()` to send questions, and `startListening()` to begin listening for responses. The class also implements mechanisms for waiting for page readiness, incremental content updates, and response completion markers to ensure conversation reliability. The `Printer` class manages all print output functions. Core methods include `printSegment()` to print content segments, `printFinalResult()` to print the final result, and `printError()` to handle error output. Export functionality is provided via `saveToFile()`, `exportToTxt()`, and `exportToJson()` methods, enabling users to easily save conversation histories. The `Logger` class provides comprehensive logging services. It supports log levels including debug, info, warn, and error, adjustable via the `setLevel()` method. The log export feature allows saving logs to a specified path for troubleshooting and analysis. ## License This project is open-sourced under the MIT License.