@pheem49/mint 1.4.2 → 1.5.0

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 (60) hide show
  1. package/GUIDE_TH.md +113 -0
  2. package/README.md +239 -76
  3. package/assets/CLI_Screen.png +0 -0
  4. package/docs/assets/CLI_Screen.png +0 -0
  5. package/docs/guide.html +632 -0
  6. package/docs/index.html +5 -4
  7. package/main.js +66 -894
  8. package/mint-cli-logic.js +13 -1
  9. package/mint-cli.js +100 -9
  10. package/package.json +12 -4
  11. package/src/AI_Brain/Gemini_API.js +77 -20
  12. package/src/AI_Brain/autonomous_brain.js +10 -0
  13. package/src/AI_Brain/behavior_memory.js +26 -5
  14. package/src/AI_Brain/headless_agent.js +4 -0
  15. package/src/AI_Brain/knowledge_base.js +61 -8
  16. package/src/AI_Brain/memory_store.js +55 -7
  17. package/src/Automation_Layer/file_operations.js +1 -1
  18. package/src/CLI/chat_router.js +3 -2
  19. package/src/CLI/chat_ui.js +263 -838
  20. package/src/CLI/code_agent.js +144 -42
  21. package/src/CLI/gmail_auth.js +210 -0
  22. package/src/CLI/list_features.js +2 -0
  23. package/src/CLI/onboarding.js +307 -55
  24. package/src/CLI/updater.js +208 -0
  25. package/src/Channels/brave_search_bridge.js +35 -0
  26. package/src/Channels/discord_bridge.js +68 -0
  27. package/src/Channels/google_search_bridge.js +38 -0
  28. package/src/Channels/line_bridge.js +60 -0
  29. package/src/Channels/slack_bridge.js +53 -0
  30. package/src/Channels/telegram_bridge.js +49 -0
  31. package/src/Channels/whatsapp_bridge.js +55 -0
  32. package/src/Command_Parser/parser.js +12 -1
  33. package/src/Plugins/gmail.js +251 -0
  34. package/src/Plugins/google_calendar.js +245 -19
  35. package/src/Plugins/notion.js +256 -0
  36. package/src/System/action_executor.js +129 -0
  37. package/src/System/bridge_manager.js +76 -0
  38. package/src/System/chat_history_manager.js +23 -5
  39. package/src/System/config_manager.js +41 -7
  40. package/src/System/custom_workflows.js +31 -2
  41. package/src/System/google_tts_urls.js +51 -0
  42. package/src/System/ipc_handlers.js +238 -0
  43. package/src/System/proactive_loop.js +137 -0
  44. package/src/System/safety_manager.js +165 -0
  45. package/src/System/screen_capture.js +175 -0
  46. package/src/System/task_manager.js +15 -5
  47. package/src/System/window_manager.js +210 -0
  48. package/src/UI/renderer.js +33 -7
  49. package/src/UI/settings.html +24 -0
  50. package/src/UI/settings.js +14 -4
  51. package/src/UI/styles.css +14 -1
  52. package/tests/action_executor_safety.test.js +67 -0
  53. package/tests/gmail.test.js +135 -0
  54. package/tests/gmail_auth.test.js +129 -0
  55. package/tests/google_calendar.test.js +113 -0
  56. package/tests/google_tts_urls.test.js +24 -0
  57. package/tests/notion.test.js +121 -0
  58. package/tests/provider_routing.test.js +17 -1
  59. package/tests/safety_manager.test.js +40 -0
  60. package/tests/updater.test.js +32 -0
package/GUIDE_TH.md ADDED
@@ -0,0 +1,113 @@
1
+ # 🌿 Mint: คู่มือการใช้งานฉบับสมบูรณ์ (Official Guide)
2
+
3
+ ยินดีต้อนรับสู่ **Mint** ผู้ช่วย AI อัจฉริยะที่รวมพลังของ Desktop UI และ CLI Agent เข้าด้วยกัน เพื่อช่วยให้การทำงานและเขียนโค้ดของคุณง่ายขึ้น รวดเร็วขึ้น และสนุกยิ่งขึ้น!
4
+
5
+ ---
6
+
7
+ ## 📥 1. การติดตั้ง (Installation)
8
+
9
+ คุณสามารถติดตั้ง Mint ได้สองวิธีหลักๆ ดังนี้:
10
+
11
+ ### วิธีที่ 1: ติดตั้งผ่าน NPM (แนะนำสำหรับผู้ใช้ทั่วไป)
12
+ หากคุณต้องการใช้งานคำสั่ง `mint` ได้จากทุกที่ในเครื่อง:
13
+ ```bash
14
+ npm install -g @pheem49/mint@latest
15
+ ```
16
+
17
+ ### วิธีที่ 2: ติดตั้งจาก Source Code (สำหรับนักพัฒนา)
18
+ หากคุณต้องการแก้ไขโค้ดหรือลองฟีเจอร์ใหม่ๆ:
19
+ 1. Clone repository: `git clone https://github.com/Pheem49/Mint.git`
20
+ 2. เข้าไปที่โฟลเดอร์: `cd Mint`
21
+ 3. ติดตั้ง dependencies: `npm install`
22
+ 4. เรียกใช้งานผ่าน: `node mint-cli.js` หรือ `npm start` (สำหรับ GUI)
23
+
24
+ ---
25
+
26
+ ## ⚙️ 2. การตั้งค่าเริ่มต้น (Initial Setup)
27
+
28
+ หลังจากติดตั้งเสร็จ สิ่งแรกที่ควรทำคือการตั้งค่า API Key และบริการต่างๆ ผ่านระบบ Onboarding:
29
+
30
+ ```bash
31
+ mint onboard
32
+ ```
33
+
34
+ ### ขั้นตอนการ Onboard:
35
+ 1. **Gemini API Key**: กรอกคีย์จาก [Google AI Studio](https://aistudio.google.com/) (จำเป็นสำหรับการทำงานหลัก)
36
+ 2. **Select Model**: เลือกโมเดลที่ต้องการ (แนะนำ `gemini-1.5-flash` เพื่อความเร็ว หรือ `gemini-1.5-pro` เพื่อความฉลาด)
37
+ 3. **QuickStart Selection**: เลือกบริการที่ต้องการเปิดใช้งาน (ใช้ปุ่ม **Space** เพื่อเลือก/ยกเลิก และ **Enter** เพื่อยืนยัน)
38
+ - **Chat Bridges**: Telegram, Discord, WhatsApp, LINE, Slack
39
+ - **AI Providers**: Anthropic (Claude), OpenAI (GPT-4), Hugging Face, Local AI (Ollama/LM Studio)
40
+ - **Search APIs**: Google Search, Brave Search
41
+ 4. **กรอกรายละเอียด**: ระบบจะถามคีย์หรือ URL ตามบริการที่คุณเลือกไว้
42
+
43
+ ---
44
+
45
+ ## ⌨️ 3. การใช้งานผ่าน CLI (Terminal)
46
+
47
+ Mint CLI เป็นมากกว่าแค่แชท แต่มันคือ **Agent** ที่สามารถคิดและทำงานแทนคุณได้
48
+
49
+ ### การเริ่มแชทปกติ
50
+ ```bash
51
+ mint
52
+ ```
53
+ *หรือใช้คำสั่งเต็ม:* `mint chat`
54
+
55
+ ### คำสั่งพิเศษ (Slash Commands)
56
+ ขณะอยู่ในหน้าแชท คุณสามารถพิมพ์ `/` เพื่อเรียกใช้งานเมนูคำสั่งด่วน:
57
+ - `/help`: ดูรายการคำสั่งทั้งหมด
58
+ - `/code <งาน>`: บังคับเข้าโหมดเขียนโค้ด (Workspace Aware)
59
+ - `/cd <เส้นทาง>`: เปลี่ยนโฟลเดอร์ทำงานปัจจุบัน
60
+ - `/models`: ดูหรือสลับโมเดล AI
61
+ - `/config`: ดูการตั้งค่าปัจจุบัน
62
+ - `/clear` / `/reset`: ล้างประวัติการสนทนา
63
+ - `/agent <ชื่อ>`: สลับบุคลิกของ AI (เช่น `code`, `reviewer`)
64
+ - `/stats`: ดูสถานะทรัพยากรเครื่อง
65
+ - `/exit`: ออกจากโปรแกรม
66
+
67
+ ### การเขียนโค้ด (Agentic Coding)
68
+ คุณสามารถสั่งงานที่ซับซ้อนในโปรเจกต์ของคุณได้ เช่น:
69
+ ```bash
70
+ mint code "ช่วยเขียน Unit Test สำหรับไฟล์ src/System/config_manager.js ให้หน่อย"
71
+ ```
72
+ มิ้นท์จะทำการ:
73
+ 1. **คิด (Thinking)**: วางแผนการทำงาน
74
+ 2. **ใช้เครื่องมือ (Tools)**: อ่านไฟล์, ค้นหาโค้ด, เขียนไฟล์, รันคำสั่ง Shell
75
+ 3. **ขออนุมัติ (Approval)**: ถามคุณก่อนรันคำสั่งที่อาจเป็นอันตรายหรือแก้ไขไฟล์
76
+
77
+ ---
78
+
79
+ ## 🔌 4. การจัดการ MCP (Model Context Protocol)
80
+
81
+ MCP คือระบบที่ช่วยให้มิ้นท์สามารถ "ขยายร่าง" ไปใช้เครื่องมือภายนอกได้
82
+
83
+ ### เพิ่ม Server ใหม่
84
+ ```bash
85
+ # รูปแบบ: mint mcp add <ชื่อ> <คำสั่ง> --args <อาร์กิวเมนต์> --env <ตัวแปรสภาพแวดล้อม>
86
+
87
+ # ตัวอย่าง: เพิ่มความสามารถในการค้นหา Google Search
88
+ mint mcp add google-search npx --args -y @modelcontextprotocol/server-google-search --env GOOGLE_API_KEY=คีย์ของคุณ GOOGLE_SEARCH_ENGINE_ID=ไอดีของคุณ
89
+ ```
90
+
91
+ ### คำสั่งอื่นๆ ของ MCP:
92
+ - `mint mcp list`: ดูรายชื่อ Server ที่เชื่อมต่ออยู่
93
+ - `mint mcp remove <ชื่อ>`: ลบ Server ออก
94
+ - `mint mcp clear`: ล้าง Server ทั้งหมด
95
+
96
+ ---
97
+
98
+ ## 🖥️ 5. การใช้งาน Desktop UI (GUI)
99
+
100
+ หากคุณติดตั้งแบบ Source Code หรือเปิดแอป Mint ขึ้นมา:
101
+ - **Floating Widget**: หน้าต่างจิ๋วที่ลอยอยู่บนหน้าจอ กดเรียกแชทได้ทันที
102
+ - **Screen Vision**: คลิกที่ไอคอนกล้องเพื่อให้มิ้นท์ "มองเห็น" หน้าจอของคุณ และถามคำถามเกี่ยวกับสิ่งที่คุณเห็นได้
103
+ - **Proactive Engine**: มิ้นท์จะคอยสังเกตการณ์และแจ้งเตือนสิ่งที่เป็นประโยชน์ (ตั้งค่าเปิด/ปิดได้ใน Settings)
104
+ - **Settings**: ปรับแต่งสีธีม, ความเร็วเสียงอ่าน (TTS), และความถี่ในการตรวจจับหน้าจอ
105
+
106
+ ---
107
+
108
+ ## 🛡️ ความปลอดภัยและทางเลือก
109
+ - **Approval System**: มิ้นท์จะไม่รันคำสั่ง Shell หรือเขียนไฟล์โดยที่คุณไม่กด `y` ยืนยัน
110
+ - **Local First**: หากคุณต้องการความเป็นส่วนตัวสูงสุด สามารถเลือกใช้ **Ollama** หรือ **LM Studio** ร่วมกับ Mint ได้ 100%
111
+
112
+ ---
113
+ *จัดทำโดย มิ้นท์ (ผู้ช่วยส่วนตัวของคุณ) และ Pheem49* 💚✨
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  </p>
6
6
 
7
7
  <p align="center">
8
- <strong>The Unified AI Desktop Assistant & Agentic Coding CLI. Built for speed, power, and local control.</strong>
8
+ <strong>Unified AI Desktop Assistant, Agentic CLI, and local-first automation workspace.</strong>
9
9
  </p>
10
10
 
11
11
  <p align="center">
@@ -13,40 +13,122 @@
13
13
  <img src="https://img.shields.io/badge/Node.js-LTS-green?style=for-the-badge&logo=node.js" alt="Node.js">
14
14
  <img src="https://img.shields.io/badge/Electron-40.x-47848F?style=for-the-badge&logo=electron" alt="Electron">
15
15
  <img src="https://img.shields.io/badge/CLI-Unified_Agent-orange?style=for-the-badge" alt="CLI Agentic">
16
+ <a href="https://pheem49.github.io/Mint/guide.html"><img src="https://img.shields.io/badge/Documentation-View_Guide-00ffa3?style=for-the-badge" alt="Documentation"></a>
16
17
  </p>
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
+ Mint is an AI assistant built to live in your desktop and terminal. It combines a transparent Electron desktop assistant, a unified agentic CLI, project-aware coding tools, local memory, automation, multi-provider AI routing, MCP extensions, and safety controls.
20
+
21
+ ## What's New
22
+
23
+ - **Unified CLI Agent:** `mint` now routes every normal message through the same agent loop. It can think, answer conversationally, inspect projects, edit files, run tools, and finish directly for simple chat.
24
+ - **Provider Fallback:** The agent can fall back across supported providers, for example from local OpenAI-compatible backends to Gemini.
25
+ - **Provider Visibility:** Desktop and CLI responses show the provider/model that actually answered, including fallback results.
26
+ - **Google Workspace + Notion Integrations:** Gmail, Google Calendar, and Notion plugins can be configured from onboarding.
27
+ - **Safety Manager:** Central safety policy for shell commands and actions, including deterministic command blocking, permission tiers, path guards, and action logs.
28
+ - **Refactored Main Process:** Electron startup is split into focused modules for windows, IPC, proactive loop, screen capture, and action execution.
29
+ - **CI & Audit Baseline:** GitHub Actions runs install, tests, and security audit. Current local test baseline is `120` passing tests and `0` high vulnerabilities.
30
+ - **Dependency Hardening:** Removed vulnerable `google-tts-api` and `xlsx`; replaced with internal Google TTS URL generation and `read-excel-file`.
31
+
32
+ ## Key Features
33
+
34
+ ### Unified CLI Agent
35
+
36
+ Mint CLI is not just a chat wrapper. It is a workspace-aware agent loop.
37
+
38
+ - **Think Before Acting:** Every request goes through an agent decision step.
39
+ - **Conversational + Coding in One Flow:** Casual messages can finish directly; coding tasks can inspect, plan, edit, and verify.
40
+ - **Workspace Context:** Reads current path, git status, diff summary, package scripts, and previous workspace session memory.
41
+ - **Tool Use:** Supports web search, file listing, file reading, code search, path finding, shell commands, patch edits, file writes, opening folders, and asking the user.
42
+ - **Approval Flow:** Shell commands, patches, and full-file writes require user approval.
43
+ - **Provider Support:** Gemini, OpenAI, Anthropic, and local OpenAI-compatible endpoints for agent tasks.
44
+ - **Agent Collaboration Option:** Optional reviewer pass can be enabled for longer tasks.
45
+
46
+ ### Desktop Assistant
47
+
48
+ - **Electron Desktop UI:** Transparent desktop assistant window with tray support.
49
+ - **Floating Widget:** Always-on-top quick access widget.
50
+ - **Spotlight Launcher:** `Alt+Space` quick prompt window.
51
+ - **Screen Vision:** Capture the screen and send selected regions to the AI.
52
+ - **Live Translation:** Continuously translate a selected screen area.
53
+ - **Proactive Suggestions:** Periodic screen/context analysis with behavior memory.
54
+ - **System Notifications:** Low battery, connection changes, and proactive notices.
55
+ - **Settings UI:** Configure provider, model, theme, keys, bridge options, MCP, and assistant behavior.
56
+
57
+ ### Automation
58
+
59
+ - **Apps and Websites:** Open local apps, URLs, search queries, files, and folders.
60
+ - **Browser Automation:** Use Puppeteer-driven browser workflows.
61
+ - **File Operations:** Create folders, find paths, open files/folders, and move files to trash.
62
+ - **System Automation:** Volume, mute, brightness, suspend, restart, shutdown, and window minimization helpers.
63
+ - **Granular Automation:** Mouse move, mouse click, typing, and key tap actions.
64
+ - **Custom Workflows:** Process-monitoring rules loaded from local config.
65
+ - **Headless Agent:** Queue background tasks with `mint task`.
66
+
67
+ ### Knowledge and Memory
68
+
69
+ - **Chat History:** Persistent local chat transcript.
70
+ - **Behavior Memory:** Stores recurring user context for proactive suggestions.
71
+ - **Long-Term Memory Store:** SQLite-backed user context, session memories, usage patterns, and response cache.
72
+ - **Knowledge Base / RAG:** Index and search local `.txt`, `.md`, `.pdf`, `.docx`, and `.xlsx` files.
73
+ - **Workspace Session Memory:** Remembers previous task summary and verification for each workspace.
74
+
75
+ ### Multi-Provider AI
76
+
77
+ - **Gemini:** Main default provider with model selection.
78
+ - **OpenAI:** GPT-compatible cloud provider.
79
+ - **Anthropic:** Claude-compatible provider.
80
+ - **Local OpenAI Compatible:** LM Studio or other local `/v1/chat/completions` servers.
81
+ - **Ollama / Hugging Face:** Available in general provider configuration where supported.
82
+ - **Fallback Routing:** Agent provider selection can fall back when local providers are offline.
83
+ - **Response Badges:** Chat surfaces show the provider/model that produced the final response, such as `gemini • gemini-3.1-flash-lite-preview`.
84
+
85
+ ### Messaging Bridges and Plugins
86
+
87
+ - **Discord Bridge**
88
+ - **Telegram Bridge**
89
+ - **Slack Bridge**
90
+ - **LINE Bridge**
91
+ - **WhatsApp Bridge**
92
+ - **Google Search and Brave Search Bridges**
93
+ - **Spotify Plugin**
94
+ - **Docker Plugin**
95
+ - **Obsidian Plugin**
96
+ - **System Monitor and Metrics Plugins**
97
+ - **Google Calendar Plugin:** List events and create calendar events via Google Calendar API, with browser fallback.
98
+ - **Gmail Plugin:** Search/read Gmail and create drafts safely. It does not send email automatically.
99
+ - **Notion Plugin:** Create notes/pages, read databases, and append page blocks through the Notion API.
100
+ - **MCP Manager**
101
+
102
+ ### MCP Extensions
103
+
104
+ Mint supports the **Model Context Protocol (MCP)** so external tools can be added without hardcoding them into Mint.
19
105
 
20
- ## 🌟 What's New in v1.4.1
106
+ ```bash
107
+ mint mcp add <name> <command> --args <args...> --env <KEY=VALUE>
108
+ mint mcp list
109
+ mint mcp remove <name>
110
+ mint mcp clear
111
+ ```
21
112
 
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.
113
+ Example:
27
114
 
28
- ## 🚀 Key Features
115
+ ```bash
116
+ mint mcp add google-search npx --args -y @modelcontextprotocol/server-google-search --env GOOGLE_API_KEY=your_key GOOGLE_SEARCH_ENGINE_ID=your_id
117
+ ```
29
118
 
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.
119
+ ## Safety System
36
120
 
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.
121
+ Mint includes a central safety layer in `src/System/safety_manager.js`.
42
122
 
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.
123
+ - **Permission Tiers:** `safe`, `approval`, `dangerous`, and `blocked`.
124
+ - **Deterministic Command Blocking:** Blocks known dangerous shell commands regardless of what the AI requests.
125
+ - **Blocked Examples:** `rm -rf`, `git reset --hard`, `git clean -f`, `mkfs`, raw disk writes, `shutdown`, `reboot`, `sudo`, `chmod -R 777`, `curl | sh`, and `wget | bash`.
126
+ - **Dangerous Actions:** `delete_file` and destructive `system_automation` actions require explicit permission.
127
+ - **Path Guard:** Prevents path traversal outside an allowed root.
128
+ - **Action Logs:** Writes JSONL records to `~/.config/mint/action-log.jsonl`.
129
+ - **Test Coverage:** Safety tests verify destructive command blocking, dangerous action classification, path traversal protection, and action executor enforcement.
48
130
 
49
- ## 📸 Screenshots
131
+ ## Screenshots
50
132
 
51
133
  <p align="center">
52
134
  <img src="assets/Agent_Mint.png" alt="Mint Desktop UI" width="48%">
@@ -57,97 +139,178 @@ Mint supports the latest LLMs and local backends:
57
139
  <img src="assets/CLI_Screen.png" alt="Mint CLI" width="100%">
58
140
  </p>
59
141
 
60
- ## 📦 Installation
142
+ ## Installation
61
143
 
62
144
  ### Global Install
145
+
63
146
  ```bash
64
147
  npm install -g @pheem49/mint@latest
65
148
  ```
66
149
 
67
150
  ### Local Development
151
+
68
152
  ```bash
69
153
  git clone https://github.com/Pheem49/Mint.git
70
154
  cd Mint
71
155
  npm install
72
156
  ```
73
157
 
74
- ## Quick Start
158
+ ## Quick Start
159
+
160
+ ```bash
161
+ mint onboard
162
+ mint
163
+ npm start
164
+ ```
75
165
 
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
- ```
166
+ ## CLI Commands
88
167
 
89
- ## ⌨️ CLI Commands
168
+ - `mint` / `mint chat` - Start the unified interactive agent UI.
169
+ - `mint chat "<message>"` - Start with an initial message.
170
+ - `mint code "<task>"` - Run a specific coding task in the current workspace.
171
+ - `mint gmail auth` - Open Google OAuth and save a Gmail refresh token.
172
+ - `mint gmail auth --no-open` - Print the Gmail OAuth link without opening a browser.
173
+ - `mint task "<task>"` - Queue a background task for the headless agent.
174
+ - `mint agent [task]` - Run the background/headless agent.
175
+ - `mint mcp` - Manage MCP servers.
176
+ - `mint update` - Check npm and install the latest Mint CLI version.
177
+ - `mint update --check` - Check for a newer version without installing it.
178
+ - `mint list` - Display available features and commands.
179
+ - `mint onboard` - Configure Mint for first use.
90
180
 
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.
181
+ ## CLI Updates
96
182
 
97
- ## 🔌 MCP Management (Extensions)
183
+ Mint CLI checks for updates automatically on startup. The auto-check is enabled by default, uses a 24-hour cooldown, and updates from npm with `npm install -g @pheem49/mint@latest` when a newer package version is available.
98
184
 
99
- Mint supports the **Model Context Protocol (MCP)**, allowing you to extend its capabilities via the CLI without manual config editing.
185
+ Use manual update commands when you want direct control:
100
186
 
101
- ### Add a New Server
102
187
  ```bash
103
- # Template
104
- mint mcp add <name> <command> --args <args...> --env <KEY=VALUE>
188
+ mint update
189
+ mint update --check
190
+ mint update --dry-run
191
+ ```
105
192
 
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
193
+ You can skip the startup auto-check for one command:
108
194
 
109
- # Example: Filesystem Access
110
- mint mcp add my-files npx --args -y @modelcontextprotocol/server-filesystem /path/to/folder
195
+ ```bash
196
+ MINT_SKIP_AUTO_UPDATE=1 mint
111
197
  ```
112
198
 
113
- ### List Configured Servers
199
+ To disable automatic update checks, set `enableAutoUpdate` to `false` in your Mint config file.
200
+
201
+ ## Integration Setup
202
+
203
+ Most integrations can be configured from:
204
+
114
205
  ```bash
115
- mint mcp list
206
+ mint onboard
116
207
  ```
117
208
 
118
- ### Remove a Server
209
+ ### Gmail
210
+
211
+ Gmail uses Google OAuth, not a plain Gmail address/password. Configure the OAuth Client ID and Client Secret in onboarding, leave the refresh token empty if you do not have one yet, and keep `Gmail User ID` as `me` for the signed-in account.
212
+
213
+ After onboarding, run one of:
214
+
119
215
  ```bash
120
- mint mcp remove google-search
216
+ mint gmail auth
217
+ mint gmail auth --no-open
121
218
  ```
122
219
 
123
- ### Clear All Servers
220
+ `mint gmail auth` opens the browser automatically. `mint gmail auth --no-open` prints the auth link for you to open manually. Both flows save `gmailRefreshToken` locally after Google redirects back to Mint. Recommended scopes are `gmail.readonly` and `gmail.compose`; Mint creates drafts only and does not send email automatically.
221
+
222
+ ### Google Calendar
223
+
224
+ Google Calendar uses OAuth credentials and a refresh token. Onboarding stores:
225
+
226
+ - `googleCalendarClientId`
227
+ - `googleCalendarClientSecret`
228
+ - `googleCalendarRefreshToken`
229
+ - `googleCalendarId`, usually `primary`
230
+
231
+ The plugin can list events and create events through the Calendar API. If OAuth is not configured, it falls back to opening Google Calendar in the browser.
232
+
233
+ ### Notion
234
+
235
+ Notion uses an internal integration secret. After creating an integration in Notion, share the target page or database with that integration, then configure:
236
+
237
+ - `notionApiKey`
238
+ - `notionDatabaseId`, optional default database
239
+ - `notionPageId`, optional default page
240
+ - `notionTitleProperty`, default `Name`
241
+
242
+ The plugin can create pages, query database pages, and append text blocks.
243
+
244
+ ## Interactive Slash Commands
245
+
246
+ Inside `mint`:
247
+
248
+ - `/help` - Show commands.
249
+ - `/code <task>` - Force Code Mode.
250
+ - `/cd <path>` - Change active workspace directory.
251
+ - `/models [name]` - Show or switch model/provider.
252
+ - `/config` - Show current configuration.
253
+ - `/copy` - Copy last response.
254
+ - `/clear` / `/reset` - Clear conversation history.
255
+ - `/agent <type>` - Switch specialized persona.
256
+ - `/workspace` - Manage registered workspaces.
257
+ - `/stats` - Show system statistics.
258
+ - `/review` - Ask reviewer persona to critique the last answer.
259
+ - `/exit` - Exit.
260
+
261
+ ## Development
262
+
124
263
  ```bash
125
- mint mcp clear
264
+ npm test
265
+ npm test -- --runInBand
266
+ npm audit --audit-level=high
267
+ npm start
268
+ npm run build:linux
126
269
  ```
127
270
 
128
- ## 🏗️ Project Structure
271
+ ## Project Structure
129
272
 
130
273
  ```text
131
274
  Mint/
275
+ ├── main.js # Electron bootstrap and wiring
276
+ ├── mint-cli.js # CLI entry point
277
+ ├── mint-cli-logic.js # CLI action executor bridge
132
278
  ├── src/
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
279
+ │ ├── AI_Brain/ # Providers, memory, RAG, autonomous/headless agents
280
+ │ ├── Automation_Layer/ # File, app, website, and browser automation
281
+ │ ├── Channels/ # Messaging and search bridges
282
+ │ ├── CLI/ # Unified CLI UI, router, code agent, workspaces
283
+ │ ├── Command_Parser/ # Structured AI response parser
284
+ ├── Plugins/ # Plugin manager and integrations
285
+ ├── System/ # Config, IPC, safety, windows, screen capture, notifications
286
+ │ └── UI/ # Electron renderer, settings, widgets, spotlight
287
+ ├── tests/ # Jest tests
288
+ ├── docs/ # Documentation site
140
289
  └── package.json
141
290
  ```
142
291
 
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.
292
+ ## Runtime Notes
293
+
294
+ - Mint is currently a **Node.js + CommonJS** project, not TypeScript.
295
+ - API keys are stored locally in Mint config or environment variables.
296
+ - Google OAuth refresh tokens for Gmail and Calendar are stored locally in Mint config.
297
+ - Local OpenAI-compatible providers require a running local server such as LM Studio.
298
+ - Some desktop features depend on Linux tools such as `xdg-open`, `gio`, `xdotool`, `amixer`, `pactl`, `brightnessctl`, or `xbacklight`.
299
+ - Electron GUI behavior should be smoke-tested manually after large UI or main-process changes.
300
+
301
+ ## Security & Privacy
302
+
303
+ - **Local Control:** Mint prioritizes local execution and local configuration.
304
+ - **User Approval:** Shell commands, patches, and file writes require explicit approval in the CLI agent.
305
+ - **Safety Manager:** Dangerous commands and actions are blocked or gated by deterministic policy.
306
+ - **Action Audit Trail:** Tool actions are logged locally for debugging and accountability.
307
+ - **Secure Config Practice:** Keys stay on the user's machine and are only sent to the selected AI/search provider.
308
+
309
+ ## License
147
310
 
148
- ## 📜 License
149
311
  Mint is licensed under the **GNU Affero General Public License v3.0**.
150
- See the [LICENSE](LICENSE) file for more details.
312
+ See the [LICENSE](LICENSE) file for details.
151
313
 
152
314
  ---
153
- <p align="center">Made with 💚 by <a href="https://github.com/Pheem49">Pheem49</a></p>
315
+
316
+ <p align="center">Made with love by <a href="https://github.com/Pheem49">Pheem49</a></p>
Binary file
Binary file