@pheem49/mint 1.5.0 → 1.5.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/README.md +35 -1
- package/main.js +28 -14
- package/mint-cli-logic.js +3 -119
- package/mint-cli.js +201 -500
- package/models/Shiroko_Model/Shiroko/Shiroko_Core/72d86db84cfa9730b894c241fd24c0db.png +0 -0
- package/models/Shiroko_Model/Shiroko/Shiroko_Core/items_pinned_to_model.json +14 -0
- package/models/Shiroko_Model/Shiroko/Shiroko_Core//345/221/206/347/214/253.exp3.json +40 -0
- package/models/Shiroko_Model/Shiroko/Shiroko_Core//345/221/206/347/214/253/347/234/274/347/217/240/346/221/207/346/231/203.exp3.json +15 -0
- package/models/Shiroko_Model/Shiroko/Shiroko_Core//345/233/264/350/243/231.exp3.json +10 -0
- package/models/Shiroko_Model/Shiroko/Shiroko_Core//346/213/215/347/205/247.exp3.json +50 -0
- package/models/Shiroko_Model/Shiroko/Shiroko_Core//346/213/277/347/254/224.exp3.json +10 -0
- package/models/Shiroko_Model/Shiroko/Shiroko_Core//347/202/271/344/270/200/344/270/213.exp3.json +15 -0
- package/models/Shiroko_Model/Shiroko/Shiroko_Core//347/214/253/345/222/252/346/273/244/351/225/234.exp3.json +10 -0
- package/models/Shiroko_Model/Shiroko/Shiroko_Core//347/234/274/351/225/234.exp3.json +10 -0
- package/models/Shiroko_Model/Shiroko/Shiroko_Core//351/235/242/351/245/2740.4096/texture_00.png +0 -0
- package/models/Shiroko_Model/Shiroko/Shiroko_Core//351/235/242/351/245/2740.4096/texture_01.png +0 -0
- package/models/Shiroko_Model/Shiroko/Shiroko_Core//351/235/242/351/245/2740.4096/texture_02.png +0 -0
- package/models/Shiroko_Model/Shiroko/Shiroko_Core//351/235/242/351/245/2740.4096/texture_03.png +0 -0
- package/models/Shiroko_Model/Shiroko/Shiroko_Core//351/235/242/351/245/2740.cdi3.json +1498 -0
- package/models/Shiroko_Model/Shiroko/Shiroko_Core//351/235/242/351/245/2740.moc3 +0 -0
- package/models/Shiroko_Model/Shiroko/Shiroko_Core//351/235/242/351/245/2740.model3.json +47 -0
- package/models/Shiroko_Model/Shiroko/Shiroko_Core//351/235/242/351/245/2740.physics3.json +6658 -0
- package/models/Shiroko_Model/Shiroko/Shiroko_Core//351/235/242/351/245/2740.vtube.json +1299 -0
- package/models/Shiroko_Model/Shiroko//342/232/241/351/253/230/344/272/256/342/232/241/344/275/277/347/224/250/346/225/231/347/250/213/344/270/216/346/263/250/346/204/217/344/272/213/351/241/271.txt +23 -0
- package/package.json +40 -17
- package/src/AI_Brain/Gemini_API.js +147 -46
- package/src/AI_Brain/autonomous_brain.js +2 -1
- package/src/AI_Brain/memory_store.js +299 -3
- package/src/AI_Brain/proactive_engine.js +12 -2
- package/src/Automation_Layer/browser_automation.js +26 -24
- package/src/CLI/approval_handler.js +42 -0
- package/src/CLI/chat_router.js +18 -6
- package/src/CLI/chat_ui.js +583 -52
- package/src/CLI/cli_colors.js +32 -0
- package/src/CLI/cli_formatters.js +89 -0
- package/src/CLI/code_agent.js +369 -71
- package/src/CLI/image_input.js +90 -0
- package/src/CLI/intent_detectors.js +181 -0
- package/src/CLI/interactive_chat.js +479 -0
- package/src/CLI/list_features.js +3 -0
- package/src/CLI/onboarding.js +72 -15
- package/src/CLI/repo_summarizer.js +282 -0
- package/src/CLI/semantic_code_search.js +312 -0
- package/src/CLI/skill_manager.js +41 -0
- package/src/CLI/slash_command_handler.js +418 -0
- package/src/CLI/symbol_indexer.js +231 -0
- package/src/CLI/updater.js +6 -4
- package/src/Channels/discord_bridge.js +11 -13
- package/src/Channels/line_bridge.js +10 -10
- package/src/Channels/slack_bridge.js +7 -12
- package/src/Channels/telegram_bridge.js +6 -14
- package/src/Channels/whatsapp_bridge.js +11 -9
- package/src/System/action_executor.js +59 -10
- package/src/System/chat_history_manager.js +20 -12
- package/src/System/config_manager.js +31 -1
- package/src/System/granular_automation.js +122 -53
- package/src/System/optional_require.js +23 -0
- package/src/System/proactive_loop.js +19 -3
- package/src/System/safety_manager.js +108 -0
- package/src/System/sandbox_runner.js +182 -0
- package/src/System/system_automation.js +127 -81
- package/src/System/system_info.js +70 -0
- package/src/System/tool_registry.js +280 -0
- package/src/System/window_manager.js +4 -2
- package/src/UI/live2d_manager.js +566 -0
- package/src/UI/renderer.js +339 -21
- package/src/UI/settings.css +655 -420
- package/src/UI/settings.html +478 -432
- package/src/UI/settings.js +10 -8
- package/src/UI/styles.css +516 -31
- package/.codex +0 -0
- package/docs/assets/Agent_Mint.png +0 -0
- package/docs/assets/CLI_Screen.png +0 -0
- package/docs/assets/Settings.png +0 -0
- package/docs/assets/icon.png +0 -0
- package/docs/guide.html +0 -632
- package/docs/index.html +0 -133
- package/docs/style.css +0 -579
- package/index.html +0 -16
- package/src/UI/index.html +0 -126
- package/tech_news.txt +0 -3
- package/test_knowledge.txt +0 -3
- package/tests/action_executor_safety.test.js +0 -67
- package/tests/agent_orchestrator.test.js +0 -41
- package/tests/chat_router.test.js +0 -42
- package/tests/code_agent.test.js +0 -69
- package/tests/config_manager.test.js +0 -141
- package/tests/docker.test.js +0 -46
- package/tests/file_operations.test.js +0 -57
- package/tests/gmail.test.js +0 -135
- package/tests/gmail_auth.test.js +0 -129
- package/tests/google_calendar.test.js +0 -113
- package/tests/google_tts_urls.test.js +0 -24
- package/tests/memory_store.test.js +0 -185
- package/tests/notion.test.js +0 -121
- package/tests/provider_routing.test.js +0 -83
- package/tests/safety_manager.test.js +0 -40
- package/tests/spotify.test.js +0 -201
- package/tests/system_monitor.test.js +0 -37
- package/tests/updater.test.js +0 -32
- package/tests/workspace_manager.test.js +0 -56
package/README.md
CHANGED
|
@@ -21,12 +21,16 @@ Mint is an AI assistant built to live in your desktop and terminal. It combines
|
|
|
21
21
|
## What's New
|
|
22
22
|
|
|
23
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
|
+
- **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
|
+
- **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.
|
|
26
|
+
- **Learned Skills:** `mint learn <path>` and `/learn <path>` import local `.md` or `.txt` files as persistent skill/instruction memory. Learned skills can be listed and deleted.
|
|
24
27
|
- **Provider Fallback:** The agent can fall back across supported providers, for example from local OpenAI-compatible backends to Gemini.
|
|
25
28
|
- **Provider Visibility:** Desktop and CLI responses show the provider/model that actually answered, including fallback results.
|
|
29
|
+
- **Live2D Assistant Model:** Desktop UI now supports a Live2D Shiroko model with expression cycling, lip sync while speaking, transparent interaction-area overlays, and click-to-chat reactions.
|
|
26
30
|
- **Google Workspace + Notion Integrations:** Gmail, Google Calendar, and Notion plugins can be configured from onboarding.
|
|
27
31
|
- **Safety Manager:** Central safety policy for shell commands and actions, including deterministic command blocking, permission tiers, path guards, and action logs.
|
|
28
32
|
- **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 `
|
|
33
|
+
- **CI & Audit Baseline:** GitHub Actions runs install, tests, and security audit. Current local test baseline is `137` passing tests and `0` high vulnerabilities.
|
|
30
34
|
- **Dependency Hardening:** Removed vulnerable `google-tts-api` and `xlsx`; replaced with internal Google TTS URL generation and `read-excel-file`.
|
|
31
35
|
|
|
32
36
|
## Key Features
|
|
@@ -36,6 +40,8 @@ Mint is an AI assistant built to live in your desktop and terminal. It combines
|
|
|
36
40
|
Mint CLI is not just a chat wrapper. It is a workspace-aware agent loop.
|
|
37
41
|
|
|
38
42
|
- **Think Before Acting:** Every request goes through an agent decision step.
|
|
43
|
+
- **Fast Mode:** Toggle `/fast` to hide internal thought/progress messages while keeping the final answer, approvals, tools, and working indicator unchanged.
|
|
44
|
+
- **Live Answer Rendering:** Final answers are streamed into a single Mint message block as they arrive.
|
|
39
45
|
- **Conversational + Coding in One Flow:** Casual messages can finish directly; coding tasks can inspect, plan, edit, and verify.
|
|
40
46
|
- **Workspace Context:** Reads current path, git status, diff summary, package scripts, and previous workspace session memory.
|
|
41
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.
|
|
@@ -46,6 +52,11 @@ Mint CLI is not just a chat wrapper. It is a workspace-aware agent loop.
|
|
|
46
52
|
### Desktop Assistant
|
|
47
53
|
|
|
48
54
|
- **Electron Desktop UI:** Transparent desktop assistant window with tray support.
|
|
55
|
+
- **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
|
+
- **Live2D Expressions:** Cycle model expressions from the toolbar and show an on-canvas expression toast for the active expression.
|
|
57
|
+
- **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.
|
|
58
|
+
- **Interaction Guide Overlay:** Toggle a transparent overlay that labels clickable model areas without blocking pointer input.
|
|
59
|
+
- **Voice Lip Sync:** When Mint speaks, Live2D mouth parameters animate during TTS playback and reset when speech ends.
|
|
49
60
|
- **Floating Widget:** Always-on-top quick access widget.
|
|
50
61
|
- **Spotlight Launcher:** `Alt+Space` quick prompt window.
|
|
51
62
|
- **Screen Vision:** Capture the screen and send selected regions to the AI.
|
|
@@ -69,6 +80,7 @@ Mint CLI is not just a chat wrapper. It is a workspace-aware agent loop.
|
|
|
69
80
|
- **Chat History:** Persistent local chat transcript.
|
|
70
81
|
- **Behavior Memory:** Stores recurring user context for proactive suggestions.
|
|
71
82
|
- **Long-Term Memory Store:** SQLite-backed user context, session memories, usage patterns, and response cache.
|
|
83
|
+
- **Learned Skill Files:** Import `.md` or `.txt` instruction files with `mint learn <path>` or `/learn <path>`. Mint remembers them as persistent skill/instruction context.
|
|
72
84
|
- **Knowledge Base / RAG:** Index and search local `.txt`, `.md`, `.pdf`, `.docx`, and `.xlsx` files.
|
|
73
85
|
- **Workspace Session Memory:** Remembers previous task summary and verification for each workspace.
|
|
74
86
|
|
|
@@ -167,7 +179,18 @@ npm start
|
|
|
167
179
|
|
|
168
180
|
- `mint` / `mint chat` - Start the unified interactive agent UI.
|
|
169
181
|
- `mint chat "<message>"` - Start with an initial message.
|
|
182
|
+
- `mint chat --image ./screenshot.png "What is on this screen?"` - Attach an image to the initial chat message.
|
|
183
|
+
- `/image ./screenshot.png What is on this screen?` - Attach an image while inside the interactive CLI, then press Enter to send.
|
|
184
|
+
- `Ctrl+V` or `/paste What is on this screen?` - Attach clipboard images inside the interactive CLI, then press Enter to send.
|
|
185
|
+
- `mint learn ./skill.md` - Read a local `.md` or `.txt` file and remember it as a persistent Mint skill/instruction.
|
|
186
|
+
- `mint learn --list` - List learned skill files.
|
|
187
|
+
- `mint learn --delete <id|path|name>` - Delete a learned skill by ID, path, or file name.
|
|
188
|
+
- `mint summarize [path]` - Summarize repository structure, package metadata, git state, and key files.
|
|
189
|
+
- `mint symbols [path]` - Build a local source symbol index for supported code files.
|
|
190
|
+
- `mint semantic-code index [path]` - Create embeddings for local source code chunks.
|
|
191
|
+
- `mint semantic-code search "<query>"` - Search the indexed code semantically.
|
|
170
192
|
- `mint code "<task>"` - Run a specific coding task in the current workspace.
|
|
193
|
+
- `mint code --image ./mockup.png "Build this UI"` - Attach an image as visual context for a coding task.
|
|
171
194
|
- `mint gmail auth` - Open Google OAuth and save a Gmail refresh token.
|
|
172
195
|
- `mint gmail auth --no-open` - Print the Gmail OAuth link without opening a browser.
|
|
173
196
|
- `mint task "<task>"` - Queue a background task for the headless agent.
|
|
@@ -246,9 +269,20 @@ The plugin can create pages, query database pages, and append text blocks.
|
|
|
246
269
|
Inside `mint`:
|
|
247
270
|
|
|
248
271
|
- `/help` - Show commands.
|
|
272
|
+
- `/fast [on|off|status]` - Toggle Fast Mode. Fast Mode shows `[Fast]`, keeps `Mint is thinking...`, and hides `Thinking:`/progress trace messages.
|
|
273
|
+
- `/summarize [path] [--json]` - Summarize the current repository without using the AI agent.
|
|
274
|
+
- `/symbols [path] [--json] [--limit n]` - Build a local source symbol index without using the AI agent.
|
|
275
|
+
- `/semantic-code index` - Create embeddings for source code chunks in the current workspace.
|
|
276
|
+
- `/semantic-code search <query>` - Search the indexed code semantically.
|
|
277
|
+
- `/learn <path>` - Read a local `.md` or `.txt` file and remember it as a persistent Mint skill/instruction.
|
|
278
|
+
- `/memory skills` - Show learned skill files.
|
|
279
|
+
- `/memory skills delete <id|path|name>` - Delete a learned skill.
|
|
280
|
+
- `/image <path> [prompt]` - Attach an image from disk.
|
|
281
|
+
- `/paste [prompt]` - Attach an image from the clipboard.
|
|
249
282
|
- `/code <task>` - Force Code Mode.
|
|
250
283
|
- `/cd <path>` - Change active workspace directory.
|
|
251
284
|
- `/models [name]` - Show or switch model/provider.
|
|
285
|
+
- `/memory [cmd]` - Manage long-term memory.
|
|
252
286
|
- `/config` - Show current configuration.
|
|
253
287
|
- `/copy` - Copy last response.
|
|
254
288
|
- `/clear` / `/reset` - Clear conversation history.
|
package/main.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
const { app, BrowserWindow, ipcMain, shell, globalShortcut, clipboard } = require('electron');
|
|
2
2
|
require('dotenv').config();
|
|
3
3
|
|
|
4
|
-
const { handleChat, resetChat, getChatTranscript, translateImageContent, refreshApiKeyFromConfig } = require('./src/AI_Brain/Gemini_API');
|
|
5
4
|
const { getSystemInfo, getWeather } = require('./src/System/system_info');
|
|
6
5
|
const { readConfig, writeConfig } = require('./src/System/config_manager');
|
|
7
6
|
const { parseCommand } = require('./src/Command_Parser/parser');
|
|
8
|
-
const { executeAction } = require('./src/System/action_executor');
|
|
9
7
|
const { getGoogleTtsUrls } = require('./src/System/google_tts_urls');
|
|
10
8
|
const { createWindowManager } = require('./src/System/window_manager');
|
|
11
9
|
const { createProactiveLoop } = require('./src/System/proactive_loop');
|
|
@@ -16,6 +14,18 @@ const systemEvents = require('./src/System/system_events');
|
|
|
16
14
|
const customWorkflows = require('./src/System/custom_workflows');
|
|
17
15
|
const mcpManager = require('./src/Plugins/mcp_manager');
|
|
18
16
|
|
|
17
|
+
let geminiServices = null;
|
|
18
|
+
function getGeminiServices() {
|
|
19
|
+
if (!geminiServices) {
|
|
20
|
+
geminiServices = require('./src/AI_Brain/Gemini_API');
|
|
21
|
+
}
|
|
22
|
+
return geminiServices;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function getActionExecutor() {
|
|
26
|
+
return require('./src/System/action_executor');
|
|
27
|
+
}
|
|
28
|
+
|
|
19
29
|
const projectRoot = __dirname;
|
|
20
30
|
const windowManager = createWindowManager(projectRoot);
|
|
21
31
|
const proactiveLoop = createProactiveLoop({
|
|
@@ -26,7 +36,7 @@ const proactiveLoop = createProactiveLoop({
|
|
|
26
36
|
});
|
|
27
37
|
const screenCapture = createScreenCaptureController({
|
|
28
38
|
projectRoot,
|
|
29
|
-
translateImageContent,
|
|
39
|
+
translateImageContent: (...args) => getGeminiServices().translateImageContent(...args),
|
|
30
40
|
getMainWindow: windowManager.getMainWindow
|
|
31
41
|
});
|
|
32
42
|
|
|
@@ -39,16 +49,16 @@ registerIpcHandlers({
|
|
|
39
49
|
proactiveLoop,
|
|
40
50
|
screenCapture,
|
|
41
51
|
services: {
|
|
42
|
-
handleChat,
|
|
43
|
-
resetChat,
|
|
44
|
-
getChatTranscript,
|
|
45
|
-
refreshApiKeyFromConfig,
|
|
52
|
+
handleChat: (...args) => getGeminiServices().handleChat(...args),
|
|
53
|
+
resetChat: (...args) => getGeminiServices().resetChat(...args),
|
|
54
|
+
getChatTranscript: (...args) => getGeminiServices().getChatTranscript(...args),
|
|
55
|
+
refreshApiKeyFromConfig: (...args) => getGeminiServices().refreshApiKeyFromConfig(...args),
|
|
46
56
|
getSystemInfo,
|
|
47
57
|
getWeather,
|
|
48
58
|
readConfig,
|
|
49
59
|
writeConfig,
|
|
50
60
|
parseCommand,
|
|
51
|
-
executeAction,
|
|
61
|
+
executeAction: (...args) => getActionExecutor().executeAction(...args),
|
|
52
62
|
getGoogleTtsUrls,
|
|
53
63
|
customWorkflows
|
|
54
64
|
}
|
|
@@ -59,14 +69,18 @@ app.whenReady().then(() => {
|
|
|
59
69
|
const mainWindow = windowManager.createMainWindow();
|
|
60
70
|
windowManager.createTray();
|
|
61
71
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
72
|
+
mainWindow.once('ready-to-show', () => {
|
|
73
|
+
if (config.showDesktopWidget !== false) {
|
|
74
|
+
setTimeout(() => windowManager.createWidgetWindow(), 300);
|
|
75
|
+
}
|
|
65
76
|
|
|
66
|
-
|
|
77
|
+
setTimeout(() => {
|
|
78
|
+
mcpManager.init().catch(err => console.error('[MCP] Init Error:', err));
|
|
67
79
|
|
|
68
|
-
|
|
69
|
-
|
|
80
|
+
const bridgeManager = require('./src/System/bridge_manager');
|
|
81
|
+
bridgeManager.init().catch(err => console.error('[BridgeManager] Init Error:', err));
|
|
82
|
+
}, 1000);
|
|
83
|
+
});
|
|
70
84
|
|
|
71
85
|
systemEvents.startMonitoring();
|
|
72
86
|
if (config.enableCustomWorkflows !== false) {
|
package/mint-cli-logic.js
CHANGED
|
@@ -1,119 +1,3 @@
|
|
|
1
|
-
//
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const { createFolder, openFile, deleteFile, findPath } = require('./src/Automation_Layer/file_operations');
|
|
5
|
-
const safetyManager = require('./src/System/safety_manager');
|
|
6
|
-
|
|
7
|
-
async function executeAction(action, options = {}) {
|
|
8
|
-
if (!action || action.type === 'none') return null;
|
|
9
|
-
|
|
10
|
-
try {
|
|
11
|
-
const safety = safetyManager.assertActionAllowed(action, {
|
|
12
|
-
allowDangerous: options.allowDangerous === true
|
|
13
|
-
});
|
|
14
|
-
safetyManager.appendActionLog({
|
|
15
|
-
source: options.source || 'mint_cli_logic',
|
|
16
|
-
action: action.type,
|
|
17
|
-
target: action.target || action.path || '',
|
|
18
|
-
tier: safety.tier,
|
|
19
|
-
approved: options.allowDangerous === true || safety.tier !== safetyManager.TIERS.DANGEROUS
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
switch (action.type) {
|
|
23
|
-
case 'open_url':
|
|
24
|
-
openWebsite(action.target);
|
|
25
|
-
return `Opened URL: ${action.target}`;
|
|
26
|
-
case 'search':
|
|
27
|
-
openSearch(action.target);
|
|
28
|
-
return `Searching for: ${action.target}`;
|
|
29
|
-
case 'open_app':
|
|
30
|
-
openApp(action.target);
|
|
31
|
-
return `Opening app: ${action.target}`;
|
|
32
|
-
case 'create_folder':
|
|
33
|
-
createFolder(action.target);
|
|
34
|
-
return `Created folder: ${action.target}`;
|
|
35
|
-
case 'open_file':
|
|
36
|
-
case 'open_folder':
|
|
37
|
-
const res = await openFile(action.target);
|
|
38
|
-
return res === true ? `Opening: ${action.target}` : res;
|
|
39
|
-
case 'delete_file':
|
|
40
|
-
await deleteFile(action.target);
|
|
41
|
-
return `Deleted: ${action.target}`;
|
|
42
|
-
case 'find_path': {
|
|
43
|
-
const result = findPath(action.target, {
|
|
44
|
-
type: action.pathType,
|
|
45
|
-
maxResults: 10
|
|
46
|
-
});
|
|
47
|
-
if (!result.success) {
|
|
48
|
-
return result.message;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if (action.openAfter === true) {
|
|
52
|
-
if (result.matches.length === 1) {
|
|
53
|
-
const match = result.matches[0];
|
|
54
|
-
await openFile(match.path);
|
|
55
|
-
return `Found and opened ${match.type === 'dir' ? 'folder' : 'file'}: ${match.path}`;
|
|
56
|
-
}
|
|
57
|
-
return `Found multiple matches for "${action.target}". Please be more specific:\n${result.matches.map(m => `- [${m.type}] ${m.path}`).join('\n')}`;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return `Found matches for "${action.target}":\n${result.matches.map(m => `- [${m.type}] ${m.path}`).join('\n')}`;
|
|
61
|
-
}
|
|
62
|
-
case 'learn_file':
|
|
63
|
-
return await indexFile(action.target);
|
|
64
|
-
case 'mcp_tool':
|
|
65
|
-
const mcpManager = require('./src/Plugins/mcp_manager');
|
|
66
|
-
const mcpResult = await mcpManager.callTool(action.server, action.target, action.args);
|
|
67
|
-
return JSON.stringify(mcpResult.content);
|
|
68
|
-
case 'mouse_move':
|
|
69
|
-
const granularAutomation = require('./src/System/granular_automation');
|
|
70
|
-
return await granularAutomation.mouseMove(action.x, action.y);
|
|
71
|
-
case 'mouse_click':
|
|
72
|
-
const granularAutomationClick = require('./src/System/granular_automation');
|
|
73
|
-
return await granularAutomationClick.mouseClick(action.x, action.y, action.button || 1);
|
|
74
|
-
case 'type_text':
|
|
75
|
-
const granularAutomationType = require('./src/System/granular_automation');
|
|
76
|
-
return await granularAutomationType.typeText(action.target);
|
|
77
|
-
case 'key_tap':
|
|
78
|
-
const granularAutomationKey = require('./src/System/granular_automation');
|
|
79
|
-
return await granularAutomationKey.keyTap(action.target);
|
|
80
|
-
case 'plugin':
|
|
81
|
-
return await pluginManager.executePlugin(action.pluginName, action.target);
|
|
82
|
-
case 'system_automation':
|
|
83
|
-
return await handleSystemAutomation(action.target);
|
|
84
|
-
case 'system_info':
|
|
85
|
-
return await SystemAutomation.getSystemInfo(action.target);
|
|
86
|
-
default:
|
|
87
|
-
return `Action ${action.type} is not yet fully supported in CLI.`;
|
|
88
|
-
}
|
|
89
|
-
} catch (err) {
|
|
90
|
-
return `Error executing action: ${err.message}`;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
async function handleSystemAutomation(target) {
|
|
95
|
-
const [cmd, value] = target.split(':');
|
|
96
|
-
switch (cmd) {
|
|
97
|
-
case 'volume':
|
|
98
|
-
return await SystemAutomation.setVolume(parseInt(value));
|
|
99
|
-
case 'mute':
|
|
100
|
-
return await SystemAutomation.mute();
|
|
101
|
-
case 'brightness':
|
|
102
|
-
return await SystemAutomation.setBrightness(parseInt(value));
|
|
103
|
-
case 'sleep':
|
|
104
|
-
return await SystemAutomation.sleep();
|
|
105
|
-
case 'restart':
|
|
106
|
-
return await SystemAutomation.restart();
|
|
107
|
-
case 'shutdown':
|
|
108
|
-
return await SystemAutomation.shutdown();
|
|
109
|
-
case 'minimize_all':
|
|
110
|
-
return await SystemAutomation.minimizeAll();
|
|
111
|
-
default:
|
|
112
|
-
if (SystemAutomation[target]) {
|
|
113
|
-
return await SystemAutomation[target]();
|
|
114
|
-
}
|
|
115
|
-
throw new Error(`Unknown system command: ${target}`);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
module.exports = { executeAction };
|
|
1
|
+
// Backward-compatible CLI entry point for Mint actions.
|
|
2
|
+
// Keep execution rules in one place so desktop, CLI, and agents share safety behavior.
|
|
3
|
+
module.exports = require('./src/System/action_executor');
|