@pheem49/mint 1.4.1 → 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.
- package/GUIDE_TH.md +113 -0
- package/README.md +214 -142
- package/assets/CLI_Screen.png +0 -0
- package/docs/assets/CLI_Screen.png +0 -0
- package/docs/guide.html +632 -0
- package/docs/index.html +5 -4
- package/main.js +66 -894
- package/mint-cli-logic.js +15 -8
- package/mint-cli.js +305 -195
- package/package.json +12 -4
- package/src/AI_Brain/Gemini_API.js +77 -20
- package/src/AI_Brain/agent_orchestrator.js +6 -6
- package/src/AI_Brain/autonomous_brain.js +10 -0
- package/src/AI_Brain/behavior_memory.js +26 -5
- package/src/AI_Brain/headless_agent.js +4 -0
- package/src/AI_Brain/knowledge_base.js +61 -8
- package/src/AI_Brain/memory_store.js +55 -7
- package/src/Automation_Layer/file_operations.js +14 -3
- package/src/CLI/chat_router.js +21 -7
- package/src/CLI/chat_ui.js +264 -710
- package/src/CLI/code_agent.js +370 -124
- package/src/CLI/gmail_auth.js +210 -0
- package/src/CLI/list_features.js +5 -1
- package/src/CLI/onboarding.js +307 -55
- package/src/CLI/updater.js +208 -0
- package/src/Channels/brave_search_bridge.js +35 -0
- package/src/Channels/discord_bridge.js +68 -0
- package/src/Channels/google_search_bridge.js +38 -0
- package/src/Channels/line_bridge.js +60 -0
- package/src/Channels/slack_bridge.js +53 -0
- package/src/Channels/telegram_bridge.js +49 -0
- package/src/Channels/whatsapp_bridge.js +55 -0
- package/src/Command_Parser/parser.js +12 -1
- package/src/Plugins/gmail.js +251 -0
- package/src/Plugins/google_calendar.js +245 -19
- package/src/Plugins/notion.js +256 -0
- package/src/System/action_executor.js +129 -0
- package/src/System/bridge_manager.js +76 -0
- package/src/System/chat_history_manager.js +23 -5
- package/src/System/config_manager.js +41 -7
- package/src/System/custom_workflows.js +31 -2
- package/src/System/google_tts_urls.js +51 -0
- package/src/System/ipc_handlers.js +238 -0
- package/src/System/proactive_loop.js +137 -0
- package/src/System/safety_manager.js +165 -0
- package/src/System/screen_capture.js +175 -0
- package/src/System/task_manager.js +15 -5
- package/src/System/window_manager.js +210 -0
- package/src/UI/renderer.js +33 -7
- package/src/UI/settings.html +24 -0
- package/src/UI/settings.js +14 -4
- package/src/UI/styles.css +14 -1
- package/tests/action_executor_safety.test.js +67 -0
- package/tests/gmail.test.js +135 -0
- package/tests/gmail_auth.test.js +129 -0
- package/tests/google_calendar.test.js +113 -0
- package/tests/google_tts_urls.test.js +24 -0
- package/tests/notion.test.js +121 -0
- package/tests/provider_routing.test.js +17 -1
- package/tests/safety_manager.test.js +40 -0
- 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,48 +5,128 @@
|
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
|
-
<strong>Desktop
|
|
8
|
+
<strong>Unified AI Desktop Assistant, Agentic CLI, and local-first automation workspace.</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
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-
|
|
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 AI assistant
|
|
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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
- Chat in Desktop or CLI mode
|
|
28
|
-
- Route coding requests into Code Mode automatically from the CLI chat UI
|
|
29
|
-
- Inspect a workspace before editing
|
|
30
|
-
- Search code, read file ranges, and patch files
|
|
31
|
-
- Run non-destructive shell commands with user approval
|
|
32
|
-
- Keep lightweight per-workspace session memory
|
|
33
|
-
- Perform a second-pass reviewer step in Code Mode
|
|
34
|
-
- Execute structured actions such as opening apps, URLs, folders, and system tasks
|
|
35
|
-
- Support multiple providers: Gemini, Anthropic, OpenAI, local OpenAI-compatible endpoints, Ollama, and Hugging Face
|
|
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
|
+
```
|
|
36
112
|
|
|
37
|
-
|
|
113
|
+
Example:
|
|
38
114
|
|
|
39
|
-
|
|
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
|
+
```
|
|
40
118
|
|
|
41
|
-
|
|
119
|
+
## Safety System
|
|
42
120
|
|
|
43
|
-
|
|
44
|
-
- Use tools in a loop: `list_files`, `read_file`, `search_code`, `run_shell`, `apply_patch`, `write_file`
|
|
45
|
-
- Observe tool output and continue iterating
|
|
46
|
-
- Stop with a summary and verification result
|
|
47
|
-
- Ask for approval before shell commands and file changes
|
|
121
|
+
Mint includes a central safety layer in `src/System/safety_manager.js`.
|
|
48
122
|
|
|
49
|
-
|
|
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.
|
|
50
130
|
|
|
51
131
|
## Screenshots
|
|
52
132
|
|
|
@@ -61,13 +141,13 @@ That makes Mint a practical CLI coding agent, while still keeping the user in co
|
|
|
61
141
|
|
|
62
142
|
## Installation
|
|
63
143
|
|
|
64
|
-
### Global
|
|
144
|
+
### Global Install
|
|
65
145
|
|
|
66
146
|
```bash
|
|
67
147
|
npm install -g @pheem49/mint@latest
|
|
68
148
|
```
|
|
69
149
|
|
|
70
|
-
### Local
|
|
150
|
+
### Local Development
|
|
71
151
|
|
|
72
152
|
```bash
|
|
73
153
|
git clone https://github.com/Pheem49/Mint.git
|
|
@@ -77,168 +157,160 @@ npm install
|
|
|
77
157
|
|
|
78
158
|
## Quick Start
|
|
79
159
|
|
|
80
|
-
### Run the desktop app
|
|
81
|
-
|
|
82
|
-
```bash
|
|
83
|
-
npm start
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
### Run the CLI
|
|
87
|
-
|
|
88
|
-
```bash
|
|
89
|
-
mint
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
### First-time setup
|
|
93
|
-
|
|
94
160
|
```bash
|
|
95
161
|
mint onboard
|
|
162
|
+
mint
|
|
163
|
+
npm start
|
|
96
164
|
```
|
|
97
165
|
|
|
98
166
|
## CLI Commands
|
|
99
167
|
|
|
100
|
-
- `mint`
|
|
101
|
-
Start
|
|
102
|
-
|
|
103
|
-
- `mint
|
|
104
|
-
|
|
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.
|
|
105
180
|
|
|
106
|
-
|
|
107
|
-
Queue a background task for the headless agent.
|
|
181
|
+
## CLI Updates
|
|
108
182
|
|
|
109
|
-
- `mint
|
|
110
|
-
Run the background headless agent.
|
|
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.
|
|
111
184
|
|
|
112
|
-
|
|
113
|
-
Show major features and commands.
|
|
114
|
-
|
|
115
|
-
- `mint onboard`
|
|
116
|
-
Configure API keys and local settings.
|
|
117
|
-
|
|
118
|
-
## CLI Examples
|
|
119
|
-
|
|
120
|
-
### Interactive chat
|
|
185
|
+
Use manual update commands when you want direct control:
|
|
121
186
|
|
|
122
187
|
```bash
|
|
123
|
-
mint
|
|
188
|
+
mint update
|
|
189
|
+
mint update --check
|
|
190
|
+
mint update --dry-run
|
|
124
191
|
```
|
|
125
192
|
|
|
126
|
-
|
|
193
|
+
You can skip the startup auto-check for one command:
|
|
127
194
|
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
แก้บัคใน CLI ตัวนี้และรันเทสต์
|
|
131
|
-
open github
|
|
195
|
+
```bash
|
|
196
|
+
MINT_SKIP_AUTO_UPDATE=1 mint
|
|
132
197
|
```
|
|
133
198
|
|
|
134
|
-
|
|
199
|
+
To disable automatic update checks, set `enableAutoUpdate` to `false` in your Mint config file.
|
|
135
200
|
|
|
136
|
-
|
|
137
|
-
mint code "fix the failing tests and verify the result"
|
|
138
|
-
```
|
|
201
|
+
## Integration Setup
|
|
139
202
|
|
|
140
|
-
|
|
203
|
+
Most integrations can be configured from:
|
|
141
204
|
|
|
142
205
|
```bash
|
|
143
|
-
mint
|
|
206
|
+
mint onboard
|
|
144
207
|
```
|
|
145
208
|
|
|
146
|
-
|
|
209
|
+
### Gmail
|
|
147
210
|
|
|
148
|
-
|
|
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.
|
|
149
212
|
|
|
150
|
-
|
|
213
|
+
After onboarding, run one of:
|
|
151
214
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
- Keep a workspace session summary for future tasks
|
|
215
|
+
```bash
|
|
216
|
+
mint gmail auth
|
|
217
|
+
mint gmail auth --no-open
|
|
218
|
+
```
|
|
157
219
|
|
|
158
|
-
|
|
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.
|
|
159
221
|
|
|
160
|
-
|
|
161
|
-
- Edit files outside the current workspace
|
|
162
|
-
- Execute shell edits without approval
|
|
222
|
+
### Google Calendar
|
|
163
223
|
|
|
164
|
-
|
|
224
|
+
Google Calendar uses OAuth credentials and a refresh token. Onboarding stores:
|
|
165
225
|
|
|
166
|
-
-
|
|
167
|
-
-
|
|
168
|
-
-
|
|
169
|
-
-
|
|
170
|
-
- Silent screen capture for analysis
|
|
171
|
-
- Screen translation support
|
|
172
|
-
- Floating widget / overlay UI elements
|
|
226
|
+
- `googleCalendarClientId`
|
|
227
|
+
- `googleCalendarClientSecret`
|
|
228
|
+
- `googleCalendarRefreshToken`
|
|
229
|
+
- `googleCalendarId`, usually `primary`
|
|
173
230
|
|
|
174
|
-
|
|
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.
|
|
175
232
|
|
|
176
|
-
|
|
233
|
+
### Notion
|
|
177
234
|
|
|
178
|
-
|
|
179
|
-
- `anthropic`
|
|
180
|
-
- `openai`
|
|
181
|
-
- `local_openai`
|
|
182
|
-
- `ollama`
|
|
183
|
-
- `huggingface`
|
|
235
|
+
Notion uses an internal integration secret. After creating an integration in Notion, share the target page or database with that integration, then configure:
|
|
184
236
|
|
|
185
|
-
|
|
237
|
+
- `notionApiKey`
|
|
238
|
+
- `notionDatabaseId`, optional default database
|
|
239
|
+
- `notionPageId`, optional default page
|
|
240
|
+
- `notionTitleProperty`, default `Name`
|
|
186
241
|
|
|
187
|
-
|
|
188
|
-
- `anthropic`
|
|
189
|
-
- `openai`
|
|
190
|
-
- `local_openai`
|
|
242
|
+
The plugin can create pages, query database pages, and append text blocks.
|
|
191
243
|
|
|
192
|
-
##
|
|
244
|
+
## Interactive Slash Commands
|
|
193
245
|
|
|
194
|
-
|
|
195
|
-
Mint/
|
|
196
|
-
├── src/
|
|
197
|
-
│ ├── AI_Brain/ # Provider integration, prompts, memory, orchestration
|
|
198
|
-
│ ├── Automation_Layer/ # App/file/browser actions
|
|
199
|
-
│ ├── CLI/ # Chat router, code agent, TUI support, onboarding
|
|
200
|
-
│ ├── Plugins/ # Docker, Spotify, calendar, system monitor, MCP
|
|
201
|
-
│ ├── System/ # Config, notifications, daemon, automation, task queue
|
|
202
|
-
│ └── UI/ # Electron renderer files
|
|
203
|
-
├── tests/ # Jest tests
|
|
204
|
-
├── mint-cli.js # Main CLI entry
|
|
205
|
-
├── mint-cli-logic.js # CLI action executor
|
|
206
|
-
├── main.js # Electron main process
|
|
207
|
-
└── package.json
|
|
208
|
-
```
|
|
246
|
+
Inside `mint`:
|
|
209
247
|
|
|
210
|
-
|
|
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.
|
|
211
260
|
|
|
212
|
-
|
|
261
|
+
## Development
|
|
213
262
|
|
|
214
263
|
```bash
|
|
264
|
+
npm test
|
|
215
265
|
npm test -- --runInBand
|
|
266
|
+
npm audit --audit-level=high
|
|
267
|
+
npm start
|
|
268
|
+
npm run build:linux
|
|
216
269
|
```
|
|
217
270
|
|
|
218
|
-
|
|
271
|
+
## Project Structure
|
|
219
272
|
|
|
220
|
-
```
|
|
221
|
-
|
|
273
|
+
```text
|
|
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
|
|
278
|
+
├── src/
|
|
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
|
|
289
|
+
└── package.json
|
|
222
290
|
```
|
|
223
291
|
|
|
224
|
-
|
|
292
|
+
## Runtime Notes
|
|
225
293
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
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.
|
|
229
300
|
|
|
230
|
-
|
|
301
|
+
## Security & Privacy
|
|
231
302
|
|
|
232
|
-
|
|
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.
|
|
233
308
|
|
|
234
|
-
|
|
235
|
-
- Code Mode asks for approval before shell commands and file edits
|
|
236
|
-
- Workspace path resolution blocks writes outside the active workspace
|
|
237
|
-
- Several shell-based execution paths have been hardened to use argument-based process execution
|
|
309
|
+
## License
|
|
238
310
|
|
|
239
|
-
|
|
311
|
+
Mint is licensed under the **GNU Affero General Public License v3.0**.
|
|
312
|
+
See the [LICENSE](LICENSE) file for details.
|
|
240
313
|
|
|
241
|
-
|
|
314
|
+
---
|
|
242
315
|
|
|
243
|
-
|
|
244
|
-
See [LICENSE](/home/pheem49/vscode/Project/Mint/LICENSE).
|
|
316
|
+
<p align="center">Made with love by <a href="https://github.com/Pheem49">Pheem49</a></p>
|
package/assets/CLI_Screen.png
CHANGED
|
Binary file
|
|
Binary file
|