@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/src/CLI/chat_router.js
CHANGED
|
@@ -9,12 +9,15 @@ const DEFAULT_GEMINI_MODEL = 'gemini-2.5-flash';
|
|
|
9
9
|
const CODE_KEYWORDS = [
|
|
10
10
|
'code', 'repo', 'repository', 'project', 'workspace', 'file', 'files', 'readme',
|
|
11
11
|
'package.json', 'bug', 'fix', 'refactor', 'test', 'tests', 'build', 'lint',
|
|
12
|
-
'implement', 'feature', 'cli', 'function', 'module', 'component', 'diff'
|
|
12
|
+
'implement', 'feature', 'cli', 'function', 'module', 'component', 'diff',
|
|
13
|
+
'list', 'show', 'ls', 'dir', 'directory', 'folders' // เพิ่มคำเหล่านี้ค่ะ
|
|
13
14
|
];
|
|
14
15
|
|
|
16
|
+
|
|
15
17
|
const THAI_CODE_KEYWORDS = [
|
|
16
18
|
'โค้ด', 'โปรเจค', 'โปรเจ็กต์', 'ไฟล์', 'รีโป', 'บั๊ก', 'แก้', 'ทดสอบ', 'เทสต์',
|
|
17
|
-
'รีแฟกเตอร์', 'ฟีเจอร์', 'คอมโพเนนต์', 'ฟังก์ชัน', 'อ่าน', 'สำรวจ', 'โครงสร้าง'
|
|
19
|
+
'รีแฟกเตอร์', 'ฟีเจอร์', 'คอมโพเนนต์', 'ฟังก์ชัน', 'อ่าน', 'สำรวจ', 'โครงสร้าง',
|
|
20
|
+
'ไดเรกทอรี', 'โฟลเดอร์'
|
|
18
21
|
];
|
|
19
22
|
|
|
20
23
|
const ROUTER_PROMPT = `You classify whether a chat message should be routed to a coding agent for the current local workspace.
|
|
@@ -69,11 +72,15 @@ function isLargeCodeTaskRequest(text, workspaceRoot = process.cwd()) {
|
|
|
69
72
|
|
|
70
73
|
const hasCodeKeyword = CODE_KEYWORDS.some(keyword => input.includes(keyword));
|
|
71
74
|
const hasThaiCodeKeyword = THAI_CODE_KEYWORDS.some(keyword => input.includes(keyword));
|
|
72
|
-
const referencesProject = /โปรเจคนี้|โปรเจ็กต์นี้|this project|this repo|this repository|codebase|workspace
|
|
73
|
-
const asksForAction =
|
|
75
|
+
const referencesProject = /โปรเจคนี้|โปรเจ็กต์นี้|this project|this repo|this repository|codebase|workspace|โฟลเดอร์นี้|ในนี้/.test(input);
|
|
76
|
+
const asksForAction = /สำรวจ|ดู|แก้|เพิ่ม|ลบ|ปรับ|ตรวจ|วิเคราะห์|ลิสต์|โชว์|แสดง|มี|implement|inspect|explore|fix|update|change|refactor|review|explain|debug|list|show/.test(input);
|
|
74
77
|
const strongTaskSignal = /failing tests?|run tests?|verify|verification|bug|issue|error|refactor|implement|feature|patch|edit|modify|analyze the project|แก้บั๊ก|รันเทสต์|ทดสอบ|ตรวจสอบ|ยืนยันผล|รีแฟกเตอร์|เพิ่มฟีเจอร์|แก้โค้ด|วิเคราะห์โปรเจค/.test(input);
|
|
75
78
|
const multiStepSignal = /and|then|พร้อม|แล้ว|จากนั้น|ทั้ง|ทั่วทั้ง|ทั้งโปรเจค|project-wide|entire project|whole project/.test(input);
|
|
76
79
|
|
|
80
|
+
// If they ask for files/folder content specifically, it's a code task because Chat can't do it accurately
|
|
81
|
+
const isListFilesRequest = (hasCodeKeyword || hasThaiCodeKeyword) && /มี|โชว์|แสดง|ลิสต์|list|show|what|anything|อะไรบ้าง/.test(input) && /ไฟล์|file|folder|dir|โฟลเดอร์/.test(input);
|
|
82
|
+
|
|
83
|
+
if (isListFilesRequest) return true;
|
|
77
84
|
if (referencesProject && strongTaskSignal) return true;
|
|
78
85
|
if ((hasCodeKeyword || hasThaiCodeKeyword) && asksForAction && strongTaskSignal) return true;
|
|
79
86
|
if ((hasCodeKeyword || hasThaiCodeKeyword) && multiStepSignal && asksForAction) return true;
|
|
@@ -163,7 +170,7 @@ async function detectCodeIntent(text, workspaceRoot = process.cwd(), history = [
|
|
|
163
170
|
|
|
164
171
|
async function runChatRoutedTask(input, context) {
|
|
165
172
|
const text = input.startsWith('/code ') ? input.slice('/code '.length).trim() : input;
|
|
166
|
-
const { appendMessage, setThinking, requestApproval, setMode, history } = context;
|
|
173
|
+
const { appendMessage, setThinking, requestApproval, askUser, setMode, history } = context;
|
|
167
174
|
|
|
168
175
|
const config = readConfig();
|
|
169
176
|
const availableProviders = getAvailableProviders(config);
|
|
@@ -183,9 +190,16 @@ async function runChatRoutedTask(input, context) {
|
|
|
183
190
|
const result = await executeCodeTask(text, {
|
|
184
191
|
cwd: process.cwd(),
|
|
185
192
|
requestApproval,
|
|
193
|
+
askUser,
|
|
186
194
|
provider: preferredProvider,
|
|
187
195
|
history: history,
|
|
188
|
-
onProgress: (
|
|
196
|
+
onProgress: (info) => {
|
|
197
|
+
if (context.appendCodeStep) {
|
|
198
|
+
context.appendCodeStep(info);
|
|
199
|
+
} else {
|
|
200
|
+
appendMessage('system', `[Code] ${typeof info === 'string' ? info : (info.action || info.phase)}`);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
189
203
|
});
|
|
190
204
|
clearInterval(timer);
|
|
191
205
|
setThinking(false);
|
|
@@ -193,7 +207,7 @@ async function runChatRoutedTask(input, context) {
|
|
|
193
207
|
`Code Mode finished.`,
|
|
194
208
|
result.summary,
|
|
195
209
|
`Verification: ${result.verification}`
|
|
196
|
-
].join('\n'));
|
|
210
|
+
].join('\n'), { providerInfo: result.providerInfo });
|
|
197
211
|
} catch (error) {
|
|
198
212
|
clearInterval(timer);
|
|
199
213
|
setThinking(false);
|