@pheem49/mint 1.4.0 → 1.4.2

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.
package/.codex ADDED
File without changes
package/README.md CHANGED
@@ -1,200 +1,153 @@
1
1
  # Mint
2
2
 
3
3
  <p align="center">
4
- <img src="assets/icon.png" alt="Luna Mint Icon" width="160">
4
+ <img src="assets/icon.png" alt="Mint Icon" width="160">
5
5
  </p>
6
6
 
7
7
  <p align="center">
8
- <strong>An advanced AI Assistant built for the modern workflow now on Desktop & Terminal.</strong>
8
+ <strong>The Unified AI Desktop Assistant & Agentic Coding CLI. Built for speed, power, and local control.</strong>
9
9
  </p>
10
10
 
11
11
  <p align="center">
12
12
  <img src="https://img.shields.io/badge/License-AGPL--3.0-blue?style=for-the-badge" alt="License">
13
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">
14
+ <img src="https://img.shields.io/badge/Electron-40.x-47848F?style=for-the-badge&logo=electron" alt="Electron">
15
+ <img src="https://img.shields.io/badge/CLI-Unified_Agent-orange?style=for-the-badge" alt="CLI Agentic">
16
16
  </p>
17
17
 
18
- ---
18
+ Mint is an advanced AI assistant designed to live in your workspace. It features a rich Electron desktop interface for day-to-day assistance and a powerful, unified CLI agent that seamlessly merges conversational chat with complex coding tasks.
19
19
 
20
- **Mint** is a powerful AI Assistant built with **Electron**, **Node.js**, and **Google Gemini** (with extended support for Hugging Face, Anthropic, OpenAI, and Local Models). 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
- - **Code Agent Mode**: Use `mint code "<task>"` to inspect, edit, and verify a project directly from the current terminal workspace.
26
- - **Chat-First Workflow**: Regular Mint chat can now auto-route coding requests into workspace Code Mode, so the main chat acts as the control surface.
27
- - **Advanced Multi-Agent Hub**:
28
- - **Smart Routing**: Intelligently routes coding/general tasks to the most capable configured provider (e.g., Claude, OpenAI, Gemini).
29
- - **Agent Collaboration**: Enable Multi-Agent Review so that a primary AI writes the code while a secondary AI automatically reviews it in the same loop.
30
- - **Resilient Fallback**: Automatically fallbacks to alternative AI providers (Gemini, Anthropic, OpenAI, Hugging Face, LM Studio, Ollama) if your active provider fails.
31
- - **Visible Mode State**: The CLI status bar now shows whether Mint is currently in `Chat` or `Code` mode.
32
- - **Interactive Slash Commands**: Manage models and settings in the terminal with `/model`, `/config`, `/clear`, etc.
33
- - **Smart TUI Experience**: Professional message framing, character-wrapped Thai text support, and mouse scroll wheel navigation.
34
- - **System Information Action**: Retrieve OS, Kernel, and Architecture details via natural language.
35
- - **Dynamic UI Aesthetics**: Animated **Aura Glow** for the AI widget and **Glassmorphism** design.
36
- - **Minimize-to-Tray**: Keep Mint running in the background via the System Tray.
37
- - **Vision-Ready (Desktop)**: Capture, analyze, and translate any part of your screen in real-time.
38
- - **Automation First**: Control your system and browser via natural language from both App and Terminal.
39
- - **Background Agent**: Install Mint as a `systemd` user service for proactive monitoring.
20
+ ## 🌟 What's New in v1.4.1
40
21
 
41
- ---
22
+ - **Unified Agent Loop:** No more switching modes. Every interaction in the CLI is now handled by a sophisticated agent that can think, plan, and execute tools autonomously.
23
+ - **Agentic Web Search:** Mint can now search the internet in real-time to answer questions with the latest information using integrated web tools.
24
+ - **Upgraded TUI:** A redesigned terminal interface featuring a Braille spinner, thinking timer, and a cleaner "✓ ActionName" logging style.
25
+ - **Interactive "Ask User":** The agent can now pause and ask you for clarification or preferences during complex multi-step tasks.
26
+ - **Enhanced System Control:** Reliable multi-fallback support for opening files, folders, and applications on Linux (Pop!_OS/Ubuntu), macOS, and Windows.
42
27
 
43
- ## Screenshots
28
+ ## 🚀 Key Features
44
29
 
45
- <p align="center">
46
- <img src="assets/Agent_Mint.png" alt="Agent Mint UI" width="48%">
47
- <img src="assets/Settings.png" alt="Settings Window" width="48%">
48
- </p>
49
- <p align="center">
50
- <em>Desktop Interface and personalized Settings window</em>
51
- </p>
30
+ ### 💻 Unified CLI Agent
31
+ Mint CLI is not just a chat wrapper; it's a full agentic workflow.
32
+ - **Think & Plan:** Every response starts with a reasoning phase where Mint plans its next move.
33
+ - **Autonomous Tools:** `web_search`, `list_files`, `read_file`, `search_code`, `run_shell`, `apply_patch`, `write_file`, `open_folder`, and more.
34
+ - **User-in-the-Loop:** Safety first. Mint asks for your approval before running shell commands or making file edits.
35
+ - **Workspace Aware:** Automatically understands your project structure, git status, and testing framework.
52
36
 
53
- ---
37
+ ### 🖥️ Desktop Assistant
38
+ - **Screen Vision:** Capture and analyze your screen for instant help with what you're looking at.
39
+ - **Real-time Translation:** Instantly translate text from your screen into Thai or English.
40
+ - **Proactive Engine:** Mint monitors your system events to provide helpful suggestions before you even ask.
41
+ - **System Tray & Floating Widgets:** Quick access to Mint from anywhere on your desktop.
54
42
 
55
- ## CLI Usage (Power Users)
43
+ ### 🛠️ Multi-Provider Support
44
+ Mint supports the latest LLMs and local backends:
45
+ - **Cloud:** Gemini 1.5/2.0 Pro & Flash, Anthropic Claude 3.5, OpenAI GPT-4o.
46
+ - **Local:** Ollama, LM Studio, Hugging Face Inference API.
47
+ - **MCP:** Full support for Model Context Protocol to extend Mint's capabilities with external tools.
56
48
 
57
- Mint CLI is built for speed and efficiency. Use the **`mint`** command from anywhere.
49
+ ## 📸 Screenshots
58
50
 
59
51
  <p align="center">
60
- <img src="assets/CLI_Screen.png" alt="Mint CLI Preview" width="100%">
52
+ <img src="assets/Agent_Mint.png" alt="Mint Desktop UI" width="48%">
53
+ <img src="assets/Settings.png" alt="Mint Settings" width="48%">
61
54
  </p>
62
55
 
63
- ### Professional Commands
64
- - **`mint`** : Start interactive chat mode (Default).
65
- - **`mint code "task"`** : Run Mint as a workspace-aware coding agent in the current project folder.
66
- - **`mint agent`** : Run Mint as a headless background agent (Monitoring mode).
67
- - **`mint agent "task"`** : Start agent and execute an autonomous task immediately.
68
- - **`mint task "task"`** : Delegate a multi-step task to an already running background agent.
69
- - **`mint onboard`** : Setup API Key, Model, and initialize global configuration in `~/.mint/`.
70
- - **`mint list`** : See full list of automation actions and plugins.
71
-
72
- ---
73
-
74
- ### Autonomous Agent (Task Delegate)
75
- Mint isn't just a chatbot—it's an autonomous worker. Assign complex tasks that require multiple steps of reasoning.
76
-
77
- ### Code Agent Mode
78
- Mint now includes a dedicated coding workflow as the first step toward a Claude-Code-like experience in the terminal.
79
-
80
- **What it can do now:**
81
- - Inspect the current workspace before editing
82
- - Search code across the repo
83
- - Read targeted file ranges
84
- - Run non-destructive shell commands in the project with interactive approval
85
- - Apply patch-based file edits with approval before changes are written
86
- - Reuse lightweight session memory and git/test context per project
56
+ <p align="center">
57
+ <img src="assets/CLI_Screen.png" alt="Mint CLI" width="100%">
58
+ </p>
87
59
 
88
- **Usage Example:**
89
- ```bash
90
- mint code "fix the failing CLI command and verify it"
91
- ```
60
+ ## 📦 Installation
92
61
 
93
- **Chat-first Example:**
62
+ ### Global Install
94
63
  ```bash
95
- mint
96
- > สำรวจโปรเจคนี้ให้หน่อย
64
+ npm install -g @pheem49/mint@latest
97
65
  ```
98
66
 
99
- Mint will classify the request, switch the status bar to `Code`, and return to `Chat` mode after the coding flow finishes.
100
-
101
- **Supported Autonomous Tools:**
102
- - **Web Automation**: Full Puppeteer-based browsing, info extraction, and research.
103
- - **File System**: Create, Write, Delete, and Manage folders using `~/` path expansion.
104
- - **Knowledge Search**: Query local files and documentation (RAG).
105
- - **Safety Mode (Bash)**: Mint proposes commands via notifications; you choose whether to run them.
106
-
107
- **Usage Examples:**
67
+ ### Local Development
108
68
  ```bash
109
- # Research and write a report
110
- mint agent 'Search for the latest iPhone reviews and write a SUMMARY.md to my desktop.'
111
-
112
- # Background Task
113
- mint task 'Process these 5 files and move them to ~/Documents/Archive'
69
+ git clone https://github.com/Pheem49/Mint.git
70
+ cd Mint
71
+ npm install
114
72
  ```
115
73
 
116
- ---
117
-
118
- ### Slash Commands (Interactive Chat)
119
- While in terminal chat, type **`/`** to access advanced tools with the new visual autocomplete system.
120
- > [!TIP]
121
- > Use **Up/Down arrow keys** to navigate the suggestion list and press **Enter** to select!
122
-
123
- - `/help` : View all commands and descriptions.
124
- - `/models` : List and switch between Gemini, Ollama, Hugging Face, Anthropic, OpenAI, and Local models.
125
- - `/config` : Check your active API keys and preferences.
126
- - `/clear` / `/reset` : Clean terminal or reset AI context.
127
-
128
- ---
129
-
130
- ### Proactive Monitoring
131
- When running in `agent` mode, Mint monitors your system in the background:
132
- - **Battery Alerts**: Notifies you when power is low or charging status changes.
133
- - **Network Status**: Alerts you when connection status changes.
134
- - **Resource Usage**: Proactive tips if system load is too high (System Metrics).
135
-
74
+ ## ⚡ Quick Start
136
75
 
137
- ---
138
-
139
- ## Desktop GUI Features
76
+ 1. **Setup Mint:**
77
+ ```bash
78
+ mint onboard
79
+ ```
80
+ 2. **Start Chatting:**
81
+ ```bash
82
+ mint
83
+ ```
84
+ 3. **Run the Desktop App:**
85
+ ```bash
86
+ npm start
87
+ ```
140
88
 
141
- - **Floating Widget**: A persistent AI character on your desktop.
142
- - **Animated Aura**: The widget breathes and glows when Mint is thinking or proactive.
143
- - **Minimize to Tray**: Click the dash icon (-) to hide the window to your system tray. Mint stays active!
144
- - **Widget Toggle**: Enable or disable the desktop widget anytime from **Settings > General**.
145
- - **Screen Overlay Glow**: Visual feedback when Mint is capturing your screen for analysis.
89
+ ## ⌨️ CLI Commands
146
90
 
147
- ---
91
+ - `mint` / `mint chat` : Start the unified interactive agent UI.
92
+ - `mint code "<task>"` : Run a specific coding task in the current workspace.
93
+ - `mint task "<task>"` : Queue a background task for the headless agent.
94
+ - `mint mcp` : Manage Model Context Protocol (MCP) servers.
95
+ - `mint list` : Display all available features and commands.
148
96
 
149
- ## Security & Privacy
97
+ ## 🔌 MCP Management (Extensions)
150
98
 
151
- - **Push Protection**: Automated `.gitignore` patterns for `mint-config.json` and `.env` files.
152
- - **History Scrubbing**: Integrated tools to ensure API keys are never leaked to Git history.
153
- - **Local First**: Built-in **Ollama** and **LM Studio (OpenAI Compatible)** support for 100% private, offline AI processing.
99
+ Mint supports the **Model Context Protocol (MCP)**, allowing you to extend its capabilities via the CLI without manual config editing.
154
100
 
155
- ---
101
+ ### Add a New Server
102
+ ```bash
103
+ # Template
104
+ mint mcp add <name> <command> --args <args...> --env <KEY=VALUE>
156
105
 
157
- ## Getting Started
106
+ # Example: Google Search
107
+ mint mcp add google-search npx --args -y @modelcontextprotocol/server-google-search --env GOOGLE_API_KEY=your_key GOOGLE_SEARCH_ENGINE_ID=your_id
158
108
 
159
- ### Prerequisites
160
- - [Node.js](https://nodejs.org/) (LTS)
161
- - [npm](https://www.npmjs.com/)
162
- - A **Google Gemini API Key** (Get one at [Google AI Studio](https://aistudio.google.com/))
109
+ # Example: Filesystem Access
110
+ mint mcp add my-files npx --args -y @modelcontextprotocol/server-filesystem /path/to/folder
111
+ ```
163
112
 
164
- ### Installation
165
- 1. **Install via NPM (Recommended)**
166
- ```bash
167
- npm install -g @pheem49/mint@latest
168
- ```
113
+ ### List Configured Servers
114
+ ```bash
115
+ mint mcp list
116
+ ```
169
117
 
170
- 2. **Manual Installation (For Developers)**
171
- ```bash
172
- git clone https://github.com/Pheem49/Mint.git
173
- cd Mint
174
- npm install
175
- sudo npm link
176
- ```
118
+ ### Remove a Server
119
+ ```bash
120
+ mint mcp remove google-search
121
+ ```
177
122
 
178
- ---
123
+ ### Clear All Servers
124
+ ```bash
125
+ mint mcp clear
126
+ ```
179
127
 
180
- ## Project Structure
128
+ ## 🏗️ Project Structure
181
129
 
182
130
  ```text
183
131
  Mint/
184
132
  ├── src/
185
- │ ├── AI_Brain/ # Gemini/Ollama integration & logic
186
- │ ├── Automation/ # Puppeteer and browser scripts
187
- │ ├── CLI/ # CLI Onboarding and Feature list
188
- │ ├── Plugins/ # Spotify, Docker, Obsidian, Git, etc.
189
- │ ├── System/ # Config, Daemon, and Event Monitoring
190
- │ └── UI/ # Electron renderer (Glassmorphism & Aura)
191
- ├── mint-cli.js # CLI Main Entry
192
- ├── main.js # Electron Main process
193
- └── package.json # Binaries and dependencies
133
+ │ ├── AI_Brain/ # Gemini API, Unified Agent Client, Memory Store
134
+ │ ├── Automation_Layer/ # File Ops, Browser Automation, System Control
135
+ │ ├── CLI/ # TUI logic, Chat Router, Code Agent
136
+ │ ├── Plugins/ # MCP Manager, System Monitor, Third-party integrations
137
+ │ ├── System/ # Config, Notifications, Daemons
138
+ │ └── UI/ # Electron Renderer, Settings, Widgets
139
+ ├── mint-cli.js # Main CLI entry point
140
+ └── package.json
194
141
  ```
195
142
 
196
- ---
143
+ ## 🛡️ Security & Privacy
144
+ - **Local Control:** Mint prioritizes local execution and user privacy.
145
+ - **Approval System:** No destructive command or file change happens without your explicit `y/n` confirmation.
146
+ - **Secure Config:** API keys are stored locally on your machine and never transmitted outside of the chosen AI provider.
197
147
 
198
- ## License
148
+ ## 📜 License
149
+ Mint is licensed under the **GNU Affero General Public License v3.0**.
150
+ See the [LICENSE](LICENSE) file for more details.
199
151
 
200
- Distributed under the **GNU Affero General Public License v3.0**. See `LICENSE` for details.
152
+ ---
153
+ <p align="center">Made with 💚 by <a href="https://github.com/Pheem49">Pheem49</a></p>
package/main.js CHANGED
@@ -6,7 +6,7 @@ const { handleChat, resetChat, getChatTranscript, translateImageContent, refresh
6
6
  const { openApp } = require('./src/Automation_Layer/open_app');
7
7
  const { openWebsite, openSearch } = require('./src/Automation_Layer/open_website');
8
8
  const { performWebAutomation } = require('./src/Automation_Layer/browser_automation');
9
- const { createFolder, openFile, deleteFile } = require('./src/Automation_Layer/file_operations');
9
+ const { createFolder, openFile, deleteFile, findPath } = require('./src/Automation_Layer/file_operations');
10
10
  const { getSystemInfo, getWeather } = require('./src/System/system_info');
11
11
  const { readConfig, writeConfig } = require('./src/System/config_manager');
12
12
  const { parseCommand } = require('./src/Command_Parser/parser');
@@ -868,6 +868,26 @@ async function executeAction(action) {
868
868
  case 'delete_file':
869
869
  await deleteFile(action.target);
870
870
  break;
871
+ case 'find_path': {
872
+ const result = findPath(action.target, {
873
+ type: action.pathType,
874
+ maxResults: 10
875
+ });
876
+ if (!result.success) {
877
+ return result.message;
878
+ }
879
+
880
+ if (action.openAfter === true) {
881
+ if (result.matches.length === 1) {
882
+ const match = result.matches[0];
883
+ const openResult = await openFile(match.path);
884
+ return openResult || `Successfully found and opened ${match.type === 'dir' ? 'folder' : 'file'}: ${match.path} ✅`;
885
+ }
886
+ return `Found multiple matches for "${action.target}". Please be more specific:\n${result.matches.map(m => `- [${m.type}] ${m.path}`).join('\n')}`;
887
+ }
888
+
889
+ return `Found matches for "${action.target}":\n${result.matches.map(m => `- [${m.type}] ${m.path}`).join('\n')}`;
890
+ }
871
891
  case 'clipboard_write':
872
892
  clipboard.writeText(action.target);
873
893
  break;
package/mint-cli-logic.js CHANGED
@@ -1,10 +1,7 @@
1
1
  // Mint CLI Action Logic
2
2
  const { openApp } = require('./src/Automation_Layer/open_app');
3
3
  const { openWebsite, openSearch } = require('./src/Automation_Layer/open_website');
4
- const { createFolder, openFile, deleteFile } = require('./src/Automation_Layer/file_operations');
5
- const { indexFile } = require('./src/AI_Brain/knowledge_base');
6
- const SystemAutomation = require('./src/System/system_automation');
7
- const pluginManager = require('./src/Plugins/plugin_manager');
4
+ const { createFolder, openFile, deleteFile, findPath } = require('./src/Automation_Layer/file_operations');
8
5
 
9
6
  async function executeAction(action) {
10
7
  if (!action || action.type === 'none') return null;
@@ -24,14 +21,32 @@ async function executeAction(action) {
24
21
  createFolder(action.target);
25
22
  return `Created folder: ${action.target}`;
26
23
  case 'open_file':
27
- await openFile(action.target);
28
- return `Opening: ${action.target}`;
29
24
  case 'open_folder':
30
- await openFile(action.target);
31
- return `Opening folder: ${action.target}`;
25
+ const res = await openFile(action.target);
26
+ return res === true ? `Opening: ${action.target}` : res;
32
27
  case 'delete_file':
33
28
  await deleteFile(action.target);
34
29
  return `Deleted: ${action.target}`;
30
+ case 'find_path': {
31
+ const result = findPath(action.target, {
32
+ type: action.pathType,
33
+ maxResults: 10
34
+ });
35
+ if (!result.success) {
36
+ return result.message;
37
+ }
38
+
39
+ if (action.openAfter === true) {
40
+ if (result.matches.length === 1) {
41
+ const match = result.matches[0];
42
+ await openFile(match.path);
43
+ return `Found and opened ${match.type === 'dir' ? 'folder' : 'file'}: ${match.path}`;
44
+ }
45
+ return `Found multiple matches for "${action.target}". Please be more specific:\n${result.matches.map(m => `- [${m.type}] ${m.path}`).join('\n')}`;
46
+ }
47
+
48
+ return `Found matches for "${action.target}":\n${result.matches.map(m => `- [${m.type}] ${m.path}`).join('\n')}`;
49
+ }
35
50
  case 'learn_file':
36
51
  return await indexFile(action.target);
37
52
  case 'mcp_tool':