@pheem49/mint 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/BUILD_AND_RELEASE.md +75 -0
  2. package/LICENSE +654 -0
  3. package/README.md +165 -0
  4. package/assets/Agent_Mint.png +0 -0
  5. package/assets/CLI_Screen.png +0 -0
  6. package/assets/Settings.png +0 -0
  7. package/assets/icon.png +0 -0
  8. package/benchmark_ai.js +71 -0
  9. package/main.js +968 -0
  10. package/mint-cli-logic.js +71 -0
  11. package/mint-cli.js +239 -0
  12. package/package.json +60 -0
  13. package/preload-picker.js +11 -0
  14. package/preload-settings.js +11 -0
  15. package/preload.js +37 -0
  16. package/privacy.txt +1 -0
  17. package/src/AI_Brain/Gemini_API.js +419 -0
  18. package/src/AI_Brain/autonomous_brain.js +139 -0
  19. package/src/AI_Brain/behavior_memory.js +114 -0
  20. package/src/AI_Brain/headless_agent.js +120 -0
  21. package/src/AI_Brain/knowledge_base.js +222 -0
  22. package/src/AI_Brain/proactive_engine.js +168 -0
  23. package/src/Automation_Layer/browser_automation.js +147 -0
  24. package/src/Automation_Layer/file_operations.js +80 -0
  25. package/src/Automation_Layer/open_app.js +56 -0
  26. package/src/Automation_Layer/open_website.js +38 -0
  27. package/src/CLI/chat_ui.js +468 -0
  28. package/src/CLI/list_features.js +56 -0
  29. package/src/CLI/onboarding.js +60 -0
  30. package/src/Command_Parser/parser.js +34 -0
  31. package/src/Plugins/dev_tools.js +41 -0
  32. package/src/Plugins/discord.js +20 -0
  33. package/src/Plugins/docker.js +45 -0
  34. package/src/Plugins/google_calendar.js +26 -0
  35. package/src/Plugins/obsidian.js +54 -0
  36. package/src/Plugins/plugin_manager.js +81 -0
  37. package/src/Plugins/spotify.js +45 -0
  38. package/src/Plugins/system_metrics.js +31 -0
  39. package/src/System/chat_history_manager.js +57 -0
  40. package/src/System/config_manager.js +73 -0
  41. package/src/System/custom_workflows.js +127 -0
  42. package/src/System/daemon_manager.js +67 -0
  43. package/src/System/system_automation.js +88 -0
  44. package/src/System/system_events.js +79 -0
  45. package/src/System/system_info.js +55 -0
  46. package/src/System/task_manager.js +85 -0
  47. package/src/UI/floating.css +80 -0
  48. package/src/UI/floating.html +17 -0
  49. package/src/UI/floating.js +67 -0
  50. package/src/UI/index.html +126 -0
  51. package/src/UI/preload-floating.js +7 -0
  52. package/src/UI/preload-spotlight.js +10 -0
  53. package/src/UI/preload-widget.js +5 -0
  54. package/src/UI/proactive-glow.html +42 -0
  55. package/src/UI/renderer.js +978 -0
  56. package/src/UI/screenPicker.html +214 -0
  57. package/src/UI/screenPicker.js +262 -0
  58. package/src/UI/settings.css +705 -0
  59. package/src/UI/settings.html +396 -0
  60. package/src/UI/settings.js +514 -0
  61. package/src/UI/spotlight.css +119 -0
  62. package/src/UI/spotlight.html +23 -0
  63. package/src/UI/spotlight.js +181 -0
  64. package/src/UI/styles.css +627 -0
  65. package/src/UI/widget.css +218 -0
  66. package/src/UI/widget.html +29 -0
  67. package/src/UI/widget.js +10 -0
  68. package/tech_news.txt +3 -0
  69. package/test_knowledge.txt +3 -0
package/README.md ADDED
@@ -0,0 +1,165 @@
1
+ # Mint
2
+
3
+ <p align="center">
4
+ <img src="assets/icon.png" alt="Luna Mint Icon" width="160">
5
+ </p>
6
+
7
+ <p align="center">
8
+ <strong>An advanced AI Assistant built for the modern workflow — now on Desktop & Terminal.</strong>
9
+ </p>
10
+
11
+ <p align="center">
12
+ <img src="https://img.shields.io/badge/License-AGPL--3.0-blue?style=for-the-badge" alt="License">
13
+ <img src="https://img.shields.io/badge/Node.js-LTS-green?style=for-the-badge&logo=node.js" alt="Node.js">
14
+ <img src="https://img.shields.io/badge/Electron-Latest-47848F?style=for-the-badge&logo=electron" alt="Electron">
15
+ <img src="https://img.shields.io/badge/Powered%20By-Gemini-orange?style=for-the-badge&logo=google-gemini" alt="Gemini">
16
+ </p>
17
+
18
+ ---
19
+
20
+ **Mint** is a powerful AI Assistant built with **Electron**, **Node.js**, and **Google Gemini**. It bridges the gap between your Desktop and Terminal, featuring real-time screen vision, web automation, local knowledge search, and a professional CLI for developers who love the command line.
21
+
22
+ ## 🌟 Highlights
23
+
24
+ - **Dual-Mode AI**: Switch between a beautiful **Desktop GUI** and a professional **CLI**.
25
+ - **Interactive Slash Commands**: Manage models and settings in the terminal with `/models`, `/config`, `/clear`, etc.
26
+ - **Visual Slash Commands**: Intuitive command suggestions with a scrollable UI and descriptions.
27
+ - **Dynamic UI Aesthetics**: Animated **Aura Glow** for the AI widget and **Glassmorphism** design.
28
+ - **Minimize-to-Tray**: Keep Mint running in the background via the System Tray.
29
+ - **Vision-Ready (Desktop)**: Capture, analyze, and translate any part of your screen in real-time.
30
+ - **Automation First**: Control your system and browser via natural language from both App and Terminal.
31
+ - **Background Agent**: Install Mint as a `systemd` user service for proactive monitoring.
32
+
33
+ ---
34
+
35
+ ## 📸 Screenshots
36
+
37
+ <p align="center">
38
+ <img src="assets/Agent_Mint.png" alt="Agent Mint UI" width="48%">
39
+ <img src="assets/Settings.png" alt="Settings Window" width="48%">
40
+ </p>
41
+ <p align="center">
42
+ <em>Desktop Interface and personalized Settings window</em>
43
+ </p>
44
+
45
+ ---
46
+
47
+ ## ⌨️ CLI Usage (Power Users)
48
+
49
+ Mint CLI is built for speed and efficiency. Use the **`mint`** command from anywhere.
50
+
51
+ <p align="center">
52
+ <img src="assets/CLI_Screen.png" alt="Mint CLI Preview" width="100%">
53
+ </p>
54
+
55
+ ### 🚀 Professional Commands
56
+ - **`mint`** : Start interactive chat mode (Default).
57
+ - **`mint agent`** : Run Mint as a headless background agent (Monitoring mode).
58
+ - **`mint agent "task"`** : **[NEW]** Start agent and execute an autonomous task immediately.
59
+ - **`mint task "task"`** : Delegate a multi-step task to an already running background agent.
60
+ - **`mint onboard`** : Setup API Key, Model, and initialize global configuration in `~/.mint/`.
61
+ - **`mint list`** : See full list of automation actions and plugins.
62
+
63
+ ---
64
+
65
+ ### 🤖 Autonomous Agent (Task Delegate)
66
+ Mint isn't just a chatbot—it's an autonomous worker. Assign complex tasks that require multiple steps of reasoning.
67
+
68
+ **Supported Autonomous Tools:**
69
+ - 🌐 **Web Automation**: Full Puppeteer-based browsing, info extraction, and research.
70
+ - 📁 **File System**: Create, Write, Delete, and Manage folders using `~/` path expansion.
71
+ - 🔍 **Knowledge Search**: Query local files and documentation (RAG).
72
+ - 🛡️ **Safety Mode (Bash)**: Mint proposes commands via notifications; you choose whether to run them.
73
+
74
+ **Usage Examples:**
75
+ ```bash
76
+ # Research and write a report
77
+ mint agent 'Search for the latest iPhone reviews and write a SUMMARY.md to my desktop.'
78
+
79
+ # Background Task
80
+ mint task 'Process these 5 files and move them to ~/Documents/Archive'
81
+ ```
82
+
83
+ ---
84
+
85
+ ### ⚡ Slash Commands (Interactive Chat)
86
+ While in terminal chat, type **`/`** to access advanced tools with the new visual autocomplete system.
87
+ > [!TIP]
88
+ > Use **Up/Down arrow keys** to navigate the suggestion list and press **Enter** to select!
89
+
90
+ - `/help` : View all commands and descriptions.
91
+ - `/models` : List and switch between Gemini/Ollama models.
92
+ - `/config` : Check your active API keys and preferences.
93
+ - `/clear` / `/reset` : Clean terminal or reset AI context.
94
+
95
+ ---
96
+
97
+ ### 🕒 Proactive Monitoring
98
+ When running in `agent` mode, Mint monitors your system in the background:
99
+ - 🔋 **Battery Alerts**: Notifies you when power is low or charging status changes.
100
+ - 🌐 **Network Status**: Alerts you when connection status changes.
101
+ - 📊 **Resource Usage**: Proactive tips if system load is too high (System Metrics).
102
+
103
+
104
+ ---
105
+
106
+ ## 🎨 Desktop GUI Features
107
+
108
+ - **Floating Widget**: A persistent AI character on your desktop.
109
+ - **Animated Aura**: The widget breathes and glows when Mint is thinking or proactive.
110
+ - **Minimize to Tray**: Click the dash icon (-) to hide the window to your system tray. Mint stays active!
111
+ - **Widget Toggle**: Enable or disable the desktop widget anytime from **Settings > General**.
112
+ - **Screen Overlay Glow**: Visual feedback when Mint is capturing your screen for analysis.
113
+
114
+ ---
115
+
116
+ ## 🛡️ Security & Privacy
117
+
118
+ - **Push Protection**: Automated `.gitignore` patterns for `mint-config.json` and `.env` files.
119
+ - **History Scrubbing**: Integrated tools to ensure API keys are never leaked to Git history.
120
+ - **Local First**: Built-in **Ollama** support for 100% private, offline AI processing.
121
+
122
+ ---
123
+
124
+ ## 🛠️ Getting Started
125
+
126
+ ### Prerequisites
127
+ - [Node.js](https://nodejs.org/) (LTS)
128
+ - [npm](https://www.npmjs.com/)
129
+ - A **Google Gemini API Key** (Get one at [Google AI Studio](https://aistudio.google.com/))
130
+
131
+ ### Installation
132
+ 1. **Clone & Install**
133
+ ```bash
134
+ git clone https://github.com/Pheem49/Mint.git
135
+ cd Mint
136
+ npm install
137
+ ```
138
+ 2. **Setup CLI Globally**
139
+ ```bash
140
+ sudo npm link
141
+ ```
142
+
143
+ ---
144
+
145
+ ## 📂 Project Structure
146
+
147
+ ```text
148
+ Mint/
149
+ ├── src/
150
+ │ ├── AI_Brain/ # Gemini/Ollama integration & logic
151
+ │ ├── Automation/ # Puppeteer and browser scripts
152
+ │ ├── CLI/ # CLI Onboarding and Feature list
153
+ │ ├── Plugins/ # Spotify, Docker, Obsidian, Git, etc.
154
+ │ ├── System/ # Config, Daemon, and Event Monitoring
155
+ │ └── UI/ # Electron renderer (Glassmorphism & Aura)
156
+ ├── mint-cli.js # CLI Main Entry
157
+ ├── main.js # Electron Main process
158
+ └── package.json # Binaries and dependencies
159
+ ```
160
+
161
+ ---
162
+
163
+ ## 🏛️ License
164
+
165
+ Distributed under the **GNU Affero General Public License v3.0**. See `LICENSE` for details.
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,71 @@
1
+ const { handleChat, resetChat } = require('./src/AI_Brain/Gemini_API');
2
+ require('dotenv').config();
3
+
4
+ async function runBenchmark() {
5
+ console.log('🚀 Starting AI Response Latency Test...');
6
+ console.log('-------------------------------------------');
7
+
8
+ const testQueries = [
9
+ { name: "Simple Greeting", text: "สวัสดีครับ" },
10
+ { name: "Knowledge Lookup (RAG)", text: "มีข้อมูลอะไรใน test_knowledge.txt บ้าง?" },
11
+ { name: "Action Command", text: "เปิด YouTube ให้หน่อย" },
12
+ { name: "System Command", text: "ขอดูข้อมูลระบบหน่อย" }
13
+ ];
14
+
15
+ const results = [];
16
+
17
+ for (const query of testQueries) {
18
+ console.log(`Testing: ${query.name} ("${query.text}")`);
19
+
20
+ const start = Date.now();
21
+ try {
22
+ const response = await handleChat(query.text);
23
+ const duration = Date.now() - start;
24
+
25
+ results.push({
26
+ name: query.name,
27
+ latency: duration,
28
+ action: response.action.type,
29
+ success: true
30
+ });
31
+ console.log(`✅ Completed in ${duration}ms (Action: ${response.action.type})`);
32
+ } catch (err) {
33
+ const duration = Date.now() - start;
34
+ results.push({
35
+ name: query.name,
36
+ latency: duration,
37
+ success: false,
38
+ error: err.message
39
+ });
40
+ console.log(`❌ Failed after ${duration}ms: ${err.message}`);
41
+ }
42
+
43
+ // Short delay between tests to avoid rate limiting
44
+ await new Promise(resolve => setTimeout(resolve, 1000));
45
+ }
46
+
47
+ console.log('\n-------------------------------------------');
48
+ console.log('📊 Benchmark Summary:');
49
+ const totalLatency = results.reduce((sum, r) => sum + r.latency, 0);
50
+ const avgLatency = (totalLatency / results.length).toFixed(2);
51
+
52
+ results.forEach(r => {
53
+ const status = r.success ? 'OK' : 'FAIL';
54
+ console.log(`- ${r.name.padEnd(25)}: ${r.latency.toString().padStart(5)}ms [${status}]`);
55
+ });
56
+
57
+ console.log(`\nAverage Latency: ${avgLatency}ms`);
58
+
59
+ if (avgLatency > 4000) {
60
+ console.log('\n⚠️ Analysis: Response time is quite high (>4s).');
61
+ console.log('Potential causes:');
62
+ console.log('1. Large System Instruction (Gemini_API.js)');
63
+ console.log('2. Slow Local RAG search (knowledge_base.js)');
64
+ console.log('3. Network latency to Gemini API');
65
+ } else {
66
+ console.log('\n✨ Latency is within acceptable range (<4s).');
67
+ }
68
+ }
69
+
70
+ // Run the benchmark
71
+ runBenchmark().catch(console.error);