@pheem49/mint 1.5.2 → 1.5.4

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 (40) hide show
  1. package/GUIDE_TH.md +23 -11
  2. package/README.md +148 -66
  3. package/assets/Agent_Mint.png +0 -0
  4. package/assets/Settings.png +0 -0
  5. package/install.ps1 +64 -0
  6. package/install.sh +54 -0
  7. package/main.js +12 -0
  8. package/package.json +5 -3
  9. package/preload.js +4 -0
  10. package/scripts/install_linux_desktop_entry.js +48 -0
  11. package/src/AI_Brain/Gemini_API.js +231 -498
  12. package/src/AI_Brain/autonomous_brain.js +46 -19
  13. package/src/AI_Brain/headless_agent.js +21 -2
  14. package/src/AI_Brain/provider_adapter.js +358 -0
  15. package/src/Automation_Layer/file_operations.js +17 -5
  16. package/src/CLI/approval_handler.js +5 -0
  17. package/src/CLI/chat_router.js +7 -0
  18. package/src/CLI/chat_ui.js +397 -76
  19. package/src/CLI/cli_colors.js +86 -3
  20. package/src/CLI/cli_formatters.js +6 -1
  21. package/src/CLI/code_agent.js +706 -273
  22. package/src/CLI/interactive_chat.js +311 -149
  23. package/src/CLI/slash_command_handler.js +2 -2
  24. package/src/CLI/updater.js +21 -1
  25. package/src/System/config_manager.js +5 -1
  26. package/src/System/ipc_handlers.js +95 -1
  27. package/src/System/picture_store.js +109 -0
  28. package/src/System/smart_context.js +227 -0
  29. package/src/System/task_manager.js +127 -0
  30. package/src/System/tool_registry.js +13 -0
  31. package/src/System/window_manager.js +16 -8
  32. package/src/UI/live2d_manager.js +42 -8
  33. package/src/UI/preload-spotlight.js +1 -0
  34. package/src/UI/renderer.js +837 -63
  35. package/src/UI/settings.css +160 -96
  36. package/src/UI/settings.html +9 -0
  37. package/src/UI/settings.js +35 -2
  38. package/src/UI/spotlight.js +13 -9
  39. package/src/UI/styles.css +1592 -165
  40. package/privacy.txt +0 -1
package/GUIDE_TH.md CHANGED
@@ -1,20 +1,32 @@
1
- # 🌿 Mint: คู่มือการใช้งานฉบับสมบูรณ์ (Official Guide)
1
+ # Mint: คู่มือการใช้งานฉบับสมบูรณ์ (Official Guide)
2
2
 
3
3
  ยินดีต้อนรับสู่ **Mint** ผู้ช่วย AI อัจฉริยะที่รวมพลังของ Desktop UI และ CLI Agent เข้าด้วยกัน เพื่อช่วยให้การทำงานและเขียนโค้ดของคุณง่ายขึ้น รวดเร็วขึ้น และสนุกยิ่งขึ้น!
4
4
 
5
5
  ---
6
6
 
7
- ## 📥 1. การติดตั้ง (Installation)
7
+ ## 1. การติดตั้ง (Installation)
8
8
 
9
- คุณสามารถติดตั้ง Mint ได้สองวิธีหลักๆ ดังนี้:
9
+ คุณสามารถติดตั้ง Mint ได้ด้วยวิธีต่างๆ ดังนี้:
10
10
 
11
- ### วิธีที่ 1: ติดตั้งผ่าน NPM (แนะนำสำหรับผู้ใช้ทั่วไป)
12
- หากคุณต้องการใช้งานคำสั่ง `mint` ได้จากทุกที่ในเครื่อง:
11
+ ### วิธีที่ 1: ติดตั้งแบบด่วน (แนะนำ)
12
+ วิธีนี้จะติดตั้ง Mint CLI ให้อัตโนมัติในคำสั่งเดียว:
13
+ **สำหรับ macOS และ Linux:**
14
+ ```bash
15
+ curl -fsSL https://raw.githubusercontent.com/Pheem49/Mint/main/install.sh | bash
16
+ ```
17
+
18
+ **สำหรับ Windows (PowerShell หรือ CMD):**
19
+ ```powershell
20
+ powershell -Command "iwr -useb https://raw.githubusercontent.com/Pheem49/Mint/main/install.ps1 | iex"
21
+ ```
22
+
23
+ ### วิธีที่ 2: ติดตั้งผ่าน NPM
24
+ หากคุณต้องการใช้งานคำสั่ง `mint` และถนัดการใช้ NPM:
13
25
  ```bash
14
26
  npm install -g @pheem49/mint@latest
15
27
  ```
16
28
 
17
- ### วิธีที่ 2: ติดตั้งจาก Source Code (สำหรับนักพัฒนา)
29
+ ### วิธีที่ 3: ติดตั้งจาก Source Code (สำหรับนักพัฒนา)
18
30
  หากคุณต้องการแก้ไขโค้ดหรือลองฟีเจอร์ใหม่ๆ:
19
31
  1. Clone repository: `git clone https://github.com/Pheem49/Mint.git`
20
32
  2. เข้าไปที่โฟลเดอร์: `cd Mint`
@@ -23,7 +35,7 @@ npm install -g @pheem49/mint@latest
23
35
 
24
36
  ---
25
37
 
26
- ## ⚙️ 2. การตั้งค่าเริ่มต้น (Initial Setup)
38
+ ## 2. การตั้งค่าเริ่มต้น (Initial Setup)
27
39
 
28
40
  หลังจากติดตั้งเสร็จ สิ่งแรกที่ควรทำคือการตั้งค่า API Key และบริการต่างๆ ผ่านระบบ Onboarding:
29
41
 
@@ -42,7 +54,7 @@ mint onboard
42
54
 
43
55
  ---
44
56
 
45
- ## ⌨️ 3. การใช้งานผ่าน CLI (Terminal)
57
+ ## 3. การใช้งานผ่าน CLI (Terminal)
46
58
 
47
59
  Mint CLI เป็นมากกว่าแค่แชท แต่มันคือ **Agent** ที่สามารถคิดและทำงานแทนคุณได้
48
60
 
@@ -76,7 +88,7 @@ mint code "ช่วยเขียน Unit Test สำหรับไฟล์
76
88
 
77
89
  ---
78
90
 
79
- ## 🔌 4. การจัดการ MCP (Model Context Protocol)
91
+ ## 4. การจัดการ MCP (Model Context Protocol)
80
92
 
81
93
  MCP คือระบบที่ช่วยให้มิ้นท์สามารถ "ขยายร่าง" ไปใช้เครื่องมือภายนอกได้
82
94
 
@@ -95,7 +107,7 @@ mint mcp add google-search npx --args -y @modelcontextprotocol/server-google-sea
95
107
 
96
108
  ---
97
109
 
98
- ## 🖥️ 5. การใช้งาน Desktop UI (GUI)
110
+ ## 5. การใช้งาน Desktop UI (GUI)
99
111
 
100
112
  หากคุณติดตั้งแบบ Source Code หรือเปิดแอป Mint ขึ้นมา:
101
113
  - **Floating Widget**: หน้าต่างจิ๋วที่ลอยอยู่บนหน้าจอ กดเรียกแชทได้ทันที
@@ -110,4 +122,4 @@ mint mcp add google-search npx --args -y @modelcontextprotocol/server-google-sea
110
122
  - **Local First**: หากคุณต้องการความเป็นส่วนตัวสูงสุด สามารถเลือกใช้ **Ollama** หรือ **LM Studio** ร่วมกับ Mint ได้ 100%
111
123
 
112
124
  ---
113
- *จัดทำโดย มิ้นท์ (ผู้ช่วยส่วนตัวของคุณ) และ Pheem49* 💚✨
125
+ *จัดทำโดย มิ้นท์ (ผู้ช่วยส่วนตัวของคุณ) และ Pheem49*
package/README.md CHANGED
@@ -20,6 +20,10 @@ Mint is an AI assistant built to live in your desktop and terminal. It combines
20
20
 
21
21
  ## What's New
22
22
 
23
+ - **Antigravity-style Desktop Layout:** Desktop UI now has a collapsible sidebar, Chat/Pictures navigation, smoother page transitions, startup loading polish, and clearer destructive-action confirmations.
24
+ - **Local Pictures Library:** Images sent from the desktop chat are saved locally under `~/.config/mint/Pictures` after the user sends the message, with an in-app Pictures gallery and local metadata index.
25
+ - **Image Privacy Hardening:** Chat history no longer stores raw image base64 data for saved images; history keeps a text placeholder while the actual file stays in the local Pictures folder.
26
+ - **Theme & UI Controls:** Settings now include theme, accent color, system text color, glass blur, font family, and font size controls that apply to the desktop interface.
23
27
  - **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
28
  - **Fast Mode:** `/fast` switches the interactive CLI into a quieter `[Fast]` status that keeps the working indicator visible but hides internal `Thinking:` and tool-progress trace messages.
25
29
  - **Live CLI Replies:** Mint responses now appear in one live-updating `Mint` message instead of waiting for the whole final answer to render at once.
@@ -33,8 +37,92 @@ Mint is an AI assistant built to live in your desktop and terminal. It combines
33
37
  - **CI & Audit Baseline:** GitHub Actions runs install, tests, and security audit. Current local test baseline is `137` passing tests and `0` high vulnerabilities.
34
38
  - **Dependency Hardening:** Removed vulnerable `google-tts-api` and `xlsx`; replaced with internal Google TTS URL generation and `read-excel-file`.
35
39
 
40
+ ## Installation & Setup
41
+
42
+ ### Quick Install (Recommended)
43
+
44
+ The easiest way to install Mint CLI is using our installation script:
45
+
46
+ **For macOS & Linux:**
47
+ ```bash
48
+ curl -fsSL https://raw.githubusercontent.com/Pheem49/Mint/main/install.sh | bash
49
+ ```
50
+
51
+ **For Windows (PowerShell or CMD):**
52
+ ```powershell
53
+ powershell -Command "iwr -useb https://raw.githubusercontent.com/Pheem49/Mint/main/install.ps1 | iex"
54
+ ```
55
+
56
+ ### NPM Install
57
+
58
+ If you prefer to install via NPM directly:
59
+
60
+ ```bash
61
+ npm install -g @pheem49/mint@latest
62
+ ```
63
+
64
+ ### Local Development
65
+
66
+ ```bash
67
+ git clone https://github.com/Pheem49/Mint.git
68
+ cd Mint
69
+ npm install
70
+ ```
71
+
72
+ ### Quick Start
73
+
74
+ ```bash
75
+ mint onboard
76
+ mint
77
+ npm start
78
+ ```
79
+
80
+ Most integrations can be configured from:
81
+
82
+ ```bash
83
+ mint onboard
84
+ ```
85
+
86
+ ### Gmail
87
+
88
+ 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.
89
+
90
+ After onboarding, run one of:
91
+
92
+ ```bash
93
+ mint gmail auth
94
+ mint gmail auth --no-open
95
+ ```
96
+
97
+ `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.
98
+
99
+ ### Google Calendar
100
+
101
+ Google Calendar uses OAuth credentials and a refresh token. Onboarding stores:
102
+
103
+ - `googleCalendarClientId`
104
+ - `googleCalendarClientSecret`
105
+ - `googleCalendarRefreshToken`
106
+ - `googleCalendarId`, usually `primary`
107
+
108
+ 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.
109
+
110
+ ### Notion
111
+
112
+ Notion uses an internal integration secret. After creating an integration in Notion, share the target page or database with that integration, then configure:
113
+
114
+ - `notionApiKey`
115
+ - `notionDatabaseId`, optional default database
116
+ - `notionPageId`, optional default page
117
+ - `notionTitleProperty`, default `Name`
118
+
119
+ The plugin can create pages, query database pages, and append text blocks.
120
+
36
121
  ## Key Features
37
122
 
123
+ <details>
124
+ <summary>Show details</summary>
125
+
38
126
  ### Unified CLI Agent
39
127
 
40
128
  Mint CLI is not just a chat wrapper. It is a workspace-aware agent loop.
@@ -44,7 +132,7 @@ Mint CLI is not just a chat wrapper. It is a workspace-aware agent loop.
44
132
  - **Live Answer Rendering:** Final answers are streamed into a single Mint message block as they arrive.
45
133
  - **Conversational + Coding in One Flow:** Casual messages can finish directly; coding tasks can inspect, plan, edit, and verify.
46
134
  - **Workspace Context:** Reads current path, git status, diff summary, package scripts, and previous workspace session memory.
47
- - **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.
135
+ - **Tool Use:** Supports web search, file listing, file reading, scoped code search, path finding, shell commands, patch edits, file writes, opening folders, and asking the user.
48
136
  - **Approval Flow:** Shell commands, patches, and full-file writes require user approval.
49
137
  - **Provider Support:** Gemini, OpenAI, Anthropic, and local OpenAI-compatible endpoints for agent tasks.
50
138
  - **Agent Collaboration Option:** Optional reviewer pass can be enabled for longer tasks.
@@ -52,6 +140,9 @@ Mint CLI is not just a chat wrapper. It is a workspace-aware agent loop.
52
140
  ### Desktop Assistant
53
141
 
54
142
  - **Electron Desktop UI:** Transparent desktop assistant window with tray support.
143
+ - **Collapsible Workspace Sidebar:** Desktop navigation starts collapsed on app launch and can be expanded for Chat, Pictures, model controls, and settings.
144
+ - **Chat Navigation Safety:** `New Chat` and `Clear` ask for confirmation before clearing the current conversation history.
145
+ - **Pictures Gallery:** Sent images are available in a local-only Pictures view inside the desktop app.
55
146
  - **Live2D Model View:** Optional Live2D assistant panel with model show/hide persistence. New installs start with the model hidden until the user enables it.
56
147
  - **Live2D Expressions:** Cycle model expressions from the toolbar and show an on-canvas expression toast for the active expression.
57
148
  - **Click Reactions:** Named model interaction zones (`Head Pat`, `Cheek Poke`, `Hand Tap`, `Shoulder Tap`, and `Careful`) can trigger temporary expressions and send short contextual prompts into the normal chat flow.
@@ -64,6 +155,7 @@ Mint CLI is not just a chat wrapper. It is a workspace-aware agent loop.
64
155
  - **Proactive Suggestions:** Periodic screen/context analysis with behavior memory.
65
156
  - **System Notifications:** Low battery, connection changes, and proactive notices.
66
157
  - **Settings UI:** Configure provider, model, theme, keys, bridge options, MCP, and assistant behavior.
158
+ - **Appearance Controls:** Customize theme, accent color, text color, glass blur, font family, and UI font size.
67
159
 
68
160
  ### Automation
69
161
 
@@ -78,6 +170,8 @@ Mint CLI is not just a chat wrapper. It is a workspace-aware agent loop.
78
170
  ### Knowledge and Memory
79
171
 
80
172
  - **Chat History:** Persistent local chat transcript.
173
+ - **Timestamp Preservation:** Desktop chat history keeps original message timestamps across app restarts and history syncs.
174
+ - **Local Sent-Image Storage:** Desktop image attachments are saved as local files only after sending, under `~/.config/mint/Pictures`.
81
175
  - **Behavior Memory:** Stores recurring user context for proactive suggestions.
82
176
  - **Long-Term Memory Store:** SQLite-backed user context, session memories, usage patterns, and response cache.
83
177
  - **Learned Skill Files:** Import `.md` or `.txt` instruction files with `mint learn <path>` or `/learn <path>`. Mint remembers them as persistent skill/instruction context.
@@ -128,8 +222,13 @@ Example:
128
222
  mint mcp add google-search npx --args -y @modelcontextprotocol/server-google-search --env GOOGLE_API_KEY=your_key GOOGLE_SEARCH_ENGINE_ID=your_id
129
223
  ```
130
224
 
225
+ </details>
226
+
131
227
  ## Safety System
132
228
 
229
+ <details>
230
+ <summary>Show details</summary>
231
+
133
232
  Mint includes a central safety layer in `src/System/safety_manager.js`.
134
233
 
135
234
  - **Permission Tiers:** `safe`, `approval`, `dangerous`, and `blocked`.
@@ -140,43 +239,33 @@ Mint includes a central safety layer in `src/System/safety_manager.js`.
140
239
  - **Action Logs:** Writes JSONL records to `~/.config/mint/action-log.jsonl`.
141
240
  - **Test Coverage:** Safety tests verify destructive command blocking, dangerous action classification, path traversal protection, and action executor enforcement.
142
241
 
242
+ </details>
243
+
143
244
  ## Screenshots
144
245
 
246
+ <details>
247
+ <summary>Show screenshots</summary>
248
+
145
249
  <p align="center">
146
250
  <img src="assets/Agent_Mint.png" alt="Mint Desktop UI" width="48%">
147
251
  <img src="assets/Settings.png" alt="Mint Settings" width="48%">
252
+ <br>
253
+ <sub><strong>Desktop Assistant UI</strong> with Live2D model, chat panel, sidebar navigation, and local Pictures view. <strong>Settings UI</strong> for providers, automation, theme, voice, plugins, and MCP configuration.</sub>
148
254
  </p>
149
255
 
150
256
  <p align="center">
151
257
  <img src="assets/CLI_Screen.png" alt="Mint CLI" width="100%">
258
+ <br>
259
+ <sub><strong>Unified CLI Agent</strong> for chat, coding tasks, tool use, workspace context, image input, and command workflows.</sub>
152
260
  </p>
153
261
 
154
- ## Installation
155
-
156
- ### Global Install
157
-
158
- ```bash
159
- npm install -g @pheem49/mint@latest
160
- ```
161
-
162
- ### Local Development
163
-
164
- ```bash
165
- git clone https://github.com/Pheem49/Mint.git
166
- cd Mint
167
- npm install
168
- ```
169
-
170
- ## Quick Start
171
-
172
- ```bash
173
- mint onboard
174
- mint
175
- npm start
176
- ```
262
+ </details>
177
263
 
178
264
  ## CLI Commands
179
265
 
266
+ <details>
267
+ <summary>Show details</summary>
268
+
180
269
  - `mint` / `mint chat` - Start the unified interactive agent UI.
181
270
  - `mint chat "<message>"` - Start with an initial message.
182
271
  - `mint chat --image ./screenshot.png "What is on this screen?"` - Attach an image to the initial chat message.
@@ -201,8 +290,13 @@ npm start
201
290
  - `mint list` - Display available features and commands.
202
291
  - `mint onboard` - Configure Mint for first use.
203
292
 
293
+ </details>
294
+
204
295
  ## CLI Updates
205
296
 
297
+ <details>
298
+ <summary>Show details</summary>
299
+
206
300
  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.
207
301
 
208
302
  Use manual update commands when you want direct control:
@@ -221,51 +315,13 @@ MINT_SKIP_AUTO_UPDATE=1 mint
221
315
 
222
316
  To disable automatic update checks, set `enableAutoUpdate` to `false` in your Mint config file.
223
317
 
224
- ## Integration Setup
225
-
226
- Most integrations can be configured from:
227
-
228
- ```bash
229
- mint onboard
230
- ```
231
-
232
- ### Gmail
233
-
234
- 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.
235
-
236
- After onboarding, run one of:
237
-
238
- ```bash
239
- mint gmail auth
240
- mint gmail auth --no-open
241
- ```
242
-
243
- `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.
244
-
245
- ### Google Calendar
246
-
247
- Google Calendar uses OAuth credentials and a refresh token. Onboarding stores:
248
-
249
- - `googleCalendarClientId`
250
- - `googleCalendarClientSecret`
251
- - `googleCalendarRefreshToken`
252
- - `googleCalendarId`, usually `primary`
253
-
254
- 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.
255
-
256
- ### Notion
257
-
258
- Notion uses an internal integration secret. After creating an integration in Notion, share the target page or database with that integration, then configure:
259
-
260
- - `notionApiKey`
261
- - `notionDatabaseId`, optional default database
262
- - `notionPageId`, optional default page
263
- - `notionTitleProperty`, default `Name`
264
-
265
- The plugin can create pages, query database pages, and append text blocks.
318
+ </details>
266
319
 
267
320
  ## Interactive Slash Commands
268
321
 
322
+ <details>
323
+ <summary>Show details</summary>
324
+
269
325
  Inside `mint`:
270
326
 
271
327
  - `/help` - Show commands.
@@ -292,8 +348,13 @@ Inside `mint`:
292
348
  - `/review` - Ask reviewer persona to critique the last answer.
293
349
  - `/exit` - Exit.
294
350
 
351
+ </details>
352
+
295
353
  ## Development
296
354
 
355
+ <details>
356
+ <summary>Show details</summary>
357
+
297
358
  ```bash
298
359
  npm test
299
360
  npm test -- --runInBand
@@ -302,8 +363,13 @@ npm start
302
363
  npm run build:linux
303
364
  ```
304
365
 
366
+ </details>
367
+
305
368
  ## Project Structure
306
369
 
370
+ <details>
371
+ <summary>Show details</summary>
372
+
307
373
  ```text
308
374
  Mint/
309
375
  ├── main.js # Electron bootstrap and wiring
@@ -323,23 +389,39 @@ Mint/
323
389
  └── package.json
324
390
  ```
325
391
 
392
+ </details>
393
+
326
394
  ## Runtime Notes
327
395
 
396
+ <details>
397
+ <summary>Show details</summary>
398
+
328
399
  - Mint is currently a **Node.js + CommonJS** project, not TypeScript.
329
400
  - API keys are stored locally in Mint config or environment variables.
330
401
  - Google OAuth refresh tokens for Gmail and Calendar are stored locally in Mint config.
402
+ - Desktop chat images sent by the user are stored locally in `~/.config/mint/Pictures`, with metadata in `~/.config/mint/Pictures/pictures.json`.
403
+ - Desktop chat history is stored locally in `~/.config/mint/mint-chat-history.json`.
331
404
  - Local OpenAI-compatible providers require a running local server such as LM Studio.
332
405
  - Some desktop features depend on Linux tools such as `xdg-open`, `gio`, `xdotool`, `amixer`, `pactl`, `brightnessctl`, or `xbacklight`.
333
406
  - Electron GUI behavior should be smoke-tested manually after large UI or main-process changes.
334
407
 
408
+ </details>
409
+
335
410
  ## Security & Privacy
336
411
 
412
+ <details>
413
+ <summary>Show details</summary>
414
+
337
415
  - **Local Control:** Mint prioritizes local execution and local configuration.
416
+ - **Local Picture Storage:** Desktop images are saved only on the user's machine, under `~/.config/mint/Pictures`, after the user sends a message with an image.
417
+ - **No Raw Image History:** Saved desktop images are omitted from chat history as raw base64 and replaced with a text placeholder.
338
418
  - **User Approval:** Shell commands, patches, and file writes require explicit approval in the CLI agent.
339
419
  - **Safety Manager:** Dangerous commands and actions are blocked or gated by deterministic policy.
340
420
  - **Action Audit Trail:** Tool actions are logged locally for debugging and accountability.
341
421
  - **Secure Config Practice:** Keys stay on the user's machine and are only sent to the selected AI/search provider.
342
422
 
423
+ </details>
424
+
343
425
  ## License
344
426
 
345
427
  Mint is licensed under the **GNU Affero General Public License v3.0**.
Binary file
Binary file
package/install.ps1 ADDED
@@ -0,0 +1,64 @@
1
+ <#
2
+ .SYNOPSIS
3
+ Mint CLI Installation Script for Windows
4
+ .DESCRIPTION
5
+ Installs the Mint CLI package globally via NPM.
6
+ #>
7
+
8
+ $ErrorActionPreference = "Stop"
9
+
10
+ Write-Host "Starting Mint CLI installation..." -ForegroundColor Cyan
11
+
12
+ # 1. Check for Node.js
13
+ try {
14
+ $nodeVersion = (node -v) 2>$null
15
+ if ([string]::IsNullOrWhiteSpace($nodeVersion)) {
16
+ Write-Host "[Error] Node.js is not found on your system!" -ForegroundColor Red
17
+ Write-Host "Please install Node.js (version 18 or higher) before using Mint CLI." -ForegroundColor Yellow
18
+ Write-Host "Download at: https://nodejs.org/"
19
+ exit 1
20
+ }
21
+ } catch {
22
+ Write-Host "[Error] Node.js is not found on your system!" -ForegroundColor Red
23
+ Write-Host "Please install Node.js (version 18 or higher) before using Mint CLI." -ForegroundColor Yellow
24
+ Write-Host "Download at: https://nodejs.org/"
25
+ exit 1
26
+ }
27
+
28
+ # 2. Check for NPM
29
+ try {
30
+ $npmVersion = (npm -v) 2>$null
31
+ if ([string]::IsNullOrWhiteSpace($npmVersion)) {
32
+ Write-Host "[Error] NPM is not found on your system!" -ForegroundColor Red
33
+ exit 1
34
+ }
35
+ } catch {
36
+ Write-Host "[Error] NPM is not found on your system!" -ForegroundColor Red
37
+ exit 1
38
+ }
39
+
40
+ # Check Node.js version (recommend 18+)
41
+ $majorVersion = [int]($nodeVersion.Substring(1).Split('.')[0])
42
+ if ($majorVersion -lt 18) {
43
+ Write-Host "[Warning] Your Node.js version is too old (current: $nodeVersion)" -ForegroundColor Yellow
44
+ Write-Host "It is recommended to update to version 18 or higher for full functionality." -ForegroundColor Yellow
45
+ }
46
+
47
+ # 3. Install Mint CLI via NPM
48
+ Write-Host "Downloading and installing @pheem49/mint..." -ForegroundColor Cyan
49
+
50
+ try {
51
+ # In Windows, we usually don't need sudo for global npm install if Node was installed for the user.
52
+ # We will just run the command normally.
53
+ npm install -g @pheem49/mint@latest
54
+ } catch {
55
+ Write-Host "[Error] Installation failed. Try running PowerShell as Administrator." -ForegroundColor Red
56
+ exit 1
57
+ }
58
+
59
+ Write-Host ""
60
+ Write-Host "Mint CLI installed successfully!" -ForegroundColor Green
61
+ Write-Host "- Run 'mint' to get started."
62
+ Write-Host "- Run 'mint onboard' to set up your API Keys."
63
+ Write-Host "----------------------------------------"
64
+ Write-Host "Happy coding!" -ForegroundColor Cyan
package/install.sh ADDED
@@ -0,0 +1,54 @@
1
+ #!/bin/bash
2
+ # Mint CLI Installation Script
3
+ # Usage: curl -fsSL <URL>/install.sh | bash
4
+
5
+ set -e
6
+
7
+ echo "Starting Mint CLI installation..."
8
+
9
+ # 1. Check for Node.js
10
+ if ! command -v node &> /dev/null
11
+ then
12
+ echo "[Error] Node.js is not found on your system!"
13
+ echo "Please install Node.js (version 18 or higher) before using Mint CLI."
14
+ echo "Download at: https://nodejs.org/"
15
+ exit 1
16
+ fi
17
+
18
+ # 2. Check for NPM
19
+ if ! command -v npm &> /dev/null
20
+ then
21
+ echo "[Error] NPM is not found on your system!"
22
+ exit 1
23
+ fi
24
+
25
+ # Check Node.js version (recommend 18+)
26
+ NODE_VERSION=$(node -v | cut -d 'v' -f 2 | cut -d '.' -f 1)
27
+ if [ "$NODE_VERSION" -lt 18 ]; then
28
+ echo "[Warning] Your Node.js version is too old (current: v${NODE_VERSION})"
29
+ echo "It is recommended to update to version 18 or higher for full functionality."
30
+ fi
31
+
32
+ # 3. Install Mint CLI via NPM
33
+ echo "Downloading and installing @pheem49/mint (may require Admin/Root privileges)..."
34
+
35
+ # Determine if we need sudo
36
+ if [ "$EUID" -ne 0 ] && command -v sudo &> /dev/null; then
37
+ # Check if npm global directory is writable by the current user (e.g., using NVM)
38
+ NPM_PREFIX=$(npm config get prefix 2>/dev/null || echo "/usr/local")
39
+ if [ -w "$NPM_PREFIX" ] || [ -w "$NPM_PREFIX/lib/node_modules" ]; then
40
+ npm install -g @pheem49/mint@latest
41
+ else
42
+ # Preserve user's PATH so sudo can find npm if it's installed via custom paths
43
+ sudo env "PATH=$PATH" npm install -g @pheem49/mint@latest
44
+ fi
45
+ else
46
+ npm install -g @pheem49/mint@latest
47
+ fi
48
+
49
+ echo ""
50
+ echo "Mint CLI installed successfully!"
51
+ echo "- Run 'mint' to get started."
52
+ echo "- Run 'mint onboard' to set up your API Keys."
53
+ echo "----------------------------------------"
54
+ echo "Happy coding!"
package/main.js CHANGED
@@ -1,6 +1,15 @@
1
1
  const { app, BrowserWindow, ipcMain, shell, globalShortcut, clipboard } = require('electron');
2
2
  require('dotenv').config();
3
3
 
4
+ // Linux docks match running windows to a .desktop file through WM_CLASS.
5
+ app.setName('Mint');
6
+ if (process.platform === 'linux') {
7
+ app.commandLine.appendSwitch('class', 'Mint');
8
+ if (typeof app.setDesktopName === 'function') {
9
+ app.setDesktopName('mint-ai.desktop');
10
+ }
11
+ }
12
+
4
13
  const { getSystemInfo, getWeather } = require('./src/System/system_info');
5
14
  const { readConfig, writeConfig } = require('./src/System/config_manager');
6
15
  const { parseCommand } = require('./src/Command_Parser/parser');
@@ -9,6 +18,7 @@ const { createWindowManager } = require('./src/System/window_manager');
9
18
  const { createProactiveLoop } = require('./src/System/proactive_loop');
10
19
  const { createScreenCaptureController } = require('./src/System/screen_capture');
11
20
  const { registerIpcHandlers } = require('./src/System/ipc_handlers');
21
+ const { saveChatImages, listSavedPictures } = require('./src/System/picture_store');
12
22
 
13
23
  const systemEvents = require('./src/System/system_events');
14
24
  const customWorkflows = require('./src/System/custom_workflows');
@@ -57,6 +67,8 @@ registerIpcHandlers({
57
67
  getWeather,
58
68
  readConfig,
59
69
  writeConfig,
70
+ saveChatImages,
71
+ listSavedPictures,
60
72
  parseCommand,
61
73
  executeAction: (...args) => getActionExecutor().executeAction(...args),
62
74
  getGoogleTtsUrls,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pheem49/mint",
3
- "version": "1.5.2",
3
+ "version": "1.5.4",
4
4
  "description": "A powerful Electron-based AI desktop assistant powered by Google Gemini, featuring screen vision, web automation, and proactive suggestions.",
5
5
  "main": "main.js",
6
6
  "scripts": {
@@ -11,7 +11,8 @@
11
11
  "build:mac": "electron-builder --mac",
12
12
  "build:win": "electron-builder --win",
13
13
  "build:all": "electron-builder --linux --mac --win",
14
- "cli": "node mint-cli.js"
14
+ "cli": "node mint-cli.js",
15
+ "install:desktop": "node scripts/install_linux_desktop_entry.js"
15
16
  },
16
17
  "jest": {
17
18
  "testEnvironment": "node",
@@ -45,7 +46,8 @@
45
46
  "ink-text-input": "^6.0.0",
46
47
  "mammoth": "^1.12.0",
47
48
  "pdf-parse": "^2.4.5",
48
- "react": "^19.2.5"
49
+ "react": "^19.2.5",
50
+ "read-excel-file": "^9.0.10"
49
51
  },
50
52
  "peerDependenciesOptional": {
51
53
  "puppeteer": ">=22.0.0",
package/preload.js CHANGED
@@ -8,6 +8,7 @@ contextBridge.exposeInMainWorld('api', {
8
8
  maximizeWindow: () => ipcRenderer.send('maximize-window'),
9
9
  resetChat: () => ipcRenderer.invoke('reset-chat'),
10
10
  getChatHistory: () => ipcRenderer.invoke('get-chat-history'),
11
+ listSavedPictures: () => ipcRenderer.invoke('list-saved-pictures'),
11
12
  openSettings: () => ipcRenderer.invoke('open-settings'),
12
13
  // Clipboard
13
14
  readClipboard: () => ipcRenderer.invoke('clipboard-read'),
@@ -17,18 +18,21 @@ contextBridge.exposeInMainWorld('api', {
17
18
  getWeather: (city) => ipcRenderer.invoke('get-weather', city),
18
19
  // Settings
19
20
  getSettings: () => ipcRenderer.invoke('get-settings'),
21
+ saveSettings: (config) => ipcRenderer.invoke('save-settings', config),
20
22
  // Listen for settings changes from other window
21
23
  onSettingsChanged: (callback) => ipcRenderer.on('settings-changed', (event, data) => callback(data)),
22
24
  // Vision
23
25
  startVision: () => ipcRenderer.invoke('start-screen-capture'),
24
26
  onVisionReady: (callback) => ipcRenderer.on('vision-ready', (event, data) => callback(data)),
25
27
  captureSilentScreen: () => ipcRenderer.invoke('capture-silent-screen'),
28
+ getSmartContext: () => ipcRenderer.invoke('get-smart-context'),
26
29
  // Proactive Assistant
27
30
  onProactiveSuggestion: (callback) => ipcRenderer.on('proactive-suggestion', (event, data) => callback(data)),
28
31
  onProactiveNotification: (callback) => ipcRenderer.on('proactive-notification', (event, data) => callback(data)),
29
32
  toggleProactive: (isOn) => ipcRenderer.send('toggle-proactive', isOn),
30
33
  recordBehavior: (context) => ipcRenderer.send('record-behavior', context),
31
34
  executeProactiveAction: (action) => ipcRenderer.invoke('execute-proactive-action', action),
35
+ executeApprovedAction: (action) => ipcRenderer.invoke('execute-approved-action', action),
32
36
  onSpotlightToChat: (callback) => ipcRenderer.on('spotlight-to-chat', (_event, query) => callback(query)),
33
37
  notifyAiResponse: () => ipcRenderer.send('ai-notify'),
34
38
  clearAiNotifications: () => ipcRenderer.send('ai-notify-clear'),