@pheem49/mint 1.5.5 → 1.6.1
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/.codex +0 -0
- package/.github/FUNDING.yml +2 -0
- package/.github/workflows/ci.yml +45 -0
- package/.github/workflows/release.yml +79 -0
- package/Cargo.lock +5792 -0
- package/Cargo.toml +32 -0
- package/README.md +387 -353
- package/assets/icon.png +0 -0
- package/bin/mint +0 -0
- package/crates/mint-cli/Cargo.toml +23 -0
- package/crates/mint-cli/src/agent.rs +851 -0
- package/crates/mint-cli/src/gmail.rs +216 -0
- package/crates/mint-cli/src/image.rs +142 -0
- package/crates/mint-cli/src/main.rs +2837 -0
- package/crates/mint-cli/src/mcp.rs +63 -0
- package/crates/mint-cli/src/onboard.rs +1149 -0
- package/crates/mint-cli/src/setup.rs +390 -0
- package/crates/mint-cli/src/skills.rs +8 -0
- package/crates/mint-cli/src/updater.rs +279 -0
- package/crates/mint-core/Cargo.toml +22 -0
- package/crates/mint-core/src/agent_loop.rs +94 -0
- package/crates/mint-core/src/api_server.rs +991 -0
- package/crates/mint-core/src/channels.rs +248 -0
- package/crates/mint-core/src/chat.rs +895 -0
- package/crates/mint-core/src/code_tools.rs +729 -0
- package/crates/mint-core/src/config.rs +368 -0
- package/crates/mint-core/src/files.rs +159 -0
- package/crates/mint-core/src/knowledge.rs +541 -0
- package/crates/mint-core/src/lib.rs +84 -0
- package/crates/mint-core/src/mcp.rs +273 -0
- package/crates/mint-core/src/memory.rs +673 -0
- package/crates/mint-core/src/orchestration.rs +2157 -0
- package/crates/mint-core/src/pictures.rs +314 -0
- package/crates/mint-core/src/plugins.rs +727 -0
- package/crates/mint-core/src/safety.rs +416 -0
- package/crates/mint-core/src/semantic.rs +254 -0
- package/crates/mint-core/src/shell.rs +317 -0
- package/crates/mint-core/src/skills.rs +71 -0
- package/crates/mint-core/src/symbols.rs +157 -0
- package/crates/mint-core/src/tasks.rs +308 -0
- package/crates/mint-core/src/tts.rs +92 -0
- package/crates/mint-core/src/weather.rs +93 -0
- package/crates/mint-core/src/web_search.rs +200 -0
- package/crates/mint-core/src/workflows.rs +81 -0
- package/crates/mint-core/tests/mcp_stdio.rs +45 -0
- package/crates/mint-core/tests/memory_persistence.rs +172 -0
- package/crates/mint-core/tests/pictures_storage.rs +14 -0
- package/crates/mint-core/tests/task_lifecycle.rs +87 -0
- package/package.json +35 -99
- package/src/bin/index.js +16 -0
- package/src/renderer/index-web.html +17 -0
- package/src/renderer/index.html +17 -0
- package/src/renderer/public/Live2DCubismCore.js +9 -0
- package/src/renderer/public/assets/icon.png +0 -0
- package/src/renderer/public/models/Shiroko_Model/Shiroko/Shiroko_Core/shiroko.model3.json +36 -0
- package/src/renderer/src/App.tsx +33 -0
- package/src/renderer/src/calculator.ts +47 -0
- package/src/renderer/src/components/ChatPanel.tsx +1598 -0
- package/src/renderer/src/components/DashboardSidebar.tsx +358 -0
- package/src/renderer/src/components/Live2DStage.tsx +374 -0
- package/src/renderer/src/components/MintDashboard.tsx +950 -0
- package/src/renderer/src/components/ModelPanel.tsx +154 -0
- package/src/renderer/src/components/PicturesLibrary.tsx +46 -0
- package/src/renderer/src/components/ProactiveGlow.tsx +19 -0
- package/src/renderer/src/components/ScreenPicker.tsx +579 -0
- package/src/renderer/src/components/SettingsWindow.tsx +1467 -0
- package/src/renderer/src/components/SpotlightWindow.tsx +280 -0
- package/src/renderer/src/components/WidgetWindow.tsx +36 -0
- package/src/renderer/src/components/WorkspacePanel.tsx +268 -0
- package/src/{UI → renderer/src/css}/settings.css +69 -16
- package/src/renderer/src/css/spotlight.css +113 -0
- package/src/renderer/src/css/styles.css +3722 -0
- package/src/renderer/src/css/widget.css +185 -0
- package/src/renderer/src/env.d.ts +116 -0
- package/src/renderer/src/index.css +379 -0
- package/src/renderer/src/main.tsx +13 -0
- package/src/renderer/src/tauri.ts +996 -0
- package/src/renderer/src-web/App.tsx +25 -0
- package/src/renderer/src-web/calculator.ts +47 -0
- package/src/renderer/src-web/components/ChatPanel.tsx +1662 -0
- package/src/renderer/src-web/components/DashboardSidebar.tsx +242 -0
- package/src/renderer/src-web/components/MintDashboard.tsx +763 -0
- package/src/renderer/src-web/components/PicturesLibrary.tsx +73 -0
- package/src/renderer/src-web/components/SettingsWindow.tsx +1500 -0
- package/src/renderer/src-web/css/settings.css +1100 -0
- package/src/{UI → renderer/src-web/css}/spotlight.css +4 -4
- package/src/{UI → renderer/src-web/css}/styles.css +1055 -159
- package/src/{UI → renderer/src-web/css}/widget.css +2 -2
- package/src/renderer/src-web/env.d.ts +107 -0
- package/src/renderer/src-web/index.css +379 -0
- package/src/renderer/src-web/main.tsx +13 -0
- package/src/renderer/src-web/tauri.ts +983 -0
- package/tsconfig.json +30 -0
- package/vite.config.ts +33 -0
- package/vite.config.web.ts +51 -0
- package/GUIDE_TH.md +0 -125
- package/assets/Agent_Mint.png +0 -0
- package/assets/CLI_Screen.png +0 -0
- package/assets/Settings.png +0 -0
- package/benchmark_ai.js +0 -71
- package/install.ps1 +0 -64
- package/install.sh +0 -54
- package/main.js +0 -139
- package/mint-cli-logic.js +0 -3
- package/mint-cli.js +0 -410
- package/models/Shiroko_Model/Shiroko/Shiroko_Core//351/235/242/351/245/2740.model3.json +0 -47
- 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 +0 -23
- package/preload-picker.js +0 -11
- package/preload-settings.js +0 -11
- package/preload.js +0 -41
- package/scripts/install_linux_desktop_entry.js +0 -48
- package/src/AI_Brain/Gemini_API.js +0 -813
- package/src/AI_Brain/agent_orchestrator.js +0 -73
- package/src/AI_Brain/autonomous_brain.js +0 -179
- package/src/AI_Brain/behavior_memory.js +0 -135
- package/src/AI_Brain/headless_agent.js +0 -143
- package/src/AI_Brain/knowledge_base.js +0 -349
- package/src/AI_Brain/memory_store.js +0 -662
- package/src/AI_Brain/proactive_engine.js +0 -172
- package/src/AI_Brain/provider_adapter.js +0 -365
- package/src/Automation_Layer/browser_automation.js +0 -149
- package/src/Automation_Layer/file_operations.js +0 -286
- package/src/Automation_Layer/open_app.js +0 -85
- package/src/Automation_Layer/open_website.js +0 -38
- package/src/CLI/approval_handler.js +0 -47
- package/src/CLI/chat_router.js +0 -247
- package/src/CLI/chat_ui.js +0 -1159
- package/src/CLI/cli_colors.js +0 -115
- package/src/CLI/cli_formatters.js +0 -94
- package/src/CLI/code_agent.js +0 -1667
- package/src/CLI/code_session_memory.js +0 -62
- package/src/CLI/gmail_auth.js +0 -210
- package/src/CLI/image_input.js +0 -90
- package/src/CLI/intent_detectors.js +0 -181
- package/src/CLI/interactive_chat.js +0 -658
- package/src/CLI/list_features.js +0 -64
- package/src/CLI/onboarding.js +0 -416
- package/src/CLI/repo_summarizer.js +0 -282
- package/src/CLI/semantic_code_search.js +0 -312
- package/src/CLI/skill_manager.js +0 -41
- package/src/CLI/slash_command_handler.js +0 -418
- package/src/CLI/symbol_indexer.js +0 -231
- package/src/CLI/updater.js +0 -230
- package/src/CLI/workspace_manager.js +0 -90
- package/src/Channels/brave_search_bridge.js +0 -35
- package/src/Channels/discord_bridge.js +0 -66
- package/src/Channels/google_search_bridge.js +0 -38
- package/src/Channels/line_bridge.js +0 -60
- package/src/Channels/slack_bridge.js +0 -48
- package/src/Channels/telegram_bridge.js +0 -41
- package/src/Channels/whatsapp_bridge.js +0 -57
- package/src/Command_Parser/parser.js +0 -45
- package/src/Plugins/dev_tools.js +0 -41
- package/src/Plugins/discord.js +0 -20
- package/src/Plugins/docker.js +0 -47
- package/src/Plugins/gmail.js +0 -251
- package/src/Plugins/google_calendar.js +0 -252
- package/src/Plugins/mcp_manager.js +0 -95
- package/src/Plugins/notion.js +0 -256
- package/src/Plugins/obsidian.js +0 -54
- package/src/Plugins/plugin_manager.js +0 -81
- package/src/Plugins/spotify.js +0 -173
- package/src/Plugins/system_metrics.js +0 -31
- package/src/Plugins/system_monitor.js +0 -72
- package/src/System/action_executor.js +0 -178
- package/src/System/bridge_manager.js +0 -76
- package/src/System/chat_history_manager.js +0 -83
- package/src/System/config_manager.js +0 -194
- package/src/System/custom_workflows.js +0 -163
- package/src/System/daemon_manager.js +0 -67
- package/src/System/google_tts_urls.js +0 -51
- package/src/System/granular_automation.js +0 -157
- package/src/System/ipc_handlers.js +0 -332
- package/src/System/notifications.js +0 -23
- package/src/System/optional_require.js +0 -23
- package/src/System/picture_store.js +0 -109
- package/src/System/proactive_loop.js +0 -153
- package/src/System/safety_manager.js +0 -273
- package/src/System/sandbox_runner.js +0 -182
- package/src/System/screen_capture.js +0 -175
- package/src/System/smart_context.js +0 -227
- package/src/System/system_automation.js +0 -162
- package/src/System/system_events.js +0 -79
- package/src/System/system_info.js +0 -125
- package/src/System/task_manager.js +0 -222
- package/src/System/tool_registry.js +0 -293
- package/src/System/window_manager.js +0 -220
- package/src/UI/floating.css +0 -80
- package/src/UI/floating.html +0 -17
- package/src/UI/floating.js +0 -67
- package/src/UI/live2d_manager.js +0 -600
- package/src/UI/preload-floating.js +0 -7
- package/src/UI/preload-spotlight.js +0 -11
- package/src/UI/preload-widget.js +0 -5
- package/src/UI/proactive-glow.html +0 -42
- package/src/UI/renderer.js +0 -2127
- package/src/UI/screenPicker.html +0 -214
- package/src/UI/screenPicker.js +0 -262
- package/src/UI/settings.html +0 -577
- package/src/UI/settings.js +0 -770
- package/src/UI/spotlight.html +0 -23
- package/src/UI/spotlight.js +0 -185
- package/src/UI/widget.html +0 -29
- package/src/UI/widget.js +0 -10
- /package/{models → src/renderer/public/models}/Shiroko_Model/Shiroko/Shiroko_Core/72d86db84cfa9730b894c241fd24c0db.png +0 -0
- /package/{models/Shiroko_Model/Shiroko/Shiroko_Core//345/233/264/350/243/231.exp3.json" → src/renderer/public/models/Shiroko_Model/Shiroko/Shiroko_Core/apron.exp3.json} +0 -0
- /package/{models/Shiroko_Model/Shiroko/Shiroko_Core//347/214/253/345/222/252/346/273/244/351/225/234.exp3.json" → src/renderer/public/models/Shiroko_Model/Shiroko/Shiroko_Core/catfilter.exp3.json} +0 -0
- /package/{models/Shiroko_Model/Shiroko/Shiroko_Core//347/202/271/344/270/200/344/270/213.exp3.json" → src/renderer/public/models/Shiroko_Model/Shiroko/Shiroko_Core/click.exp3.json} +0 -0
- /package/{models/Shiroko_Model/Shiroko/Shiroko_Core//345/221/206/347/214/253.exp3.json" → src/renderer/public/models/Shiroko_Model/Shiroko/Shiroko_Core/dazed.exp3.json} +0 -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" → src/renderer/public/models/Shiroko_Model/Shiroko/Shiroko_Core/dazedeyes.exp3.json} +0 -0
- /package/{models/Shiroko_Model/Shiroko/Shiroko_Core//347/234/274/351/225/234.exp3.json" → src/renderer/public/models/Shiroko_Model/Shiroko/Shiroko_Core/glasses.exp3.json} +0 -0
- /package/{models → src/renderer/public/models}/Shiroko_Model/Shiroko/Shiroko_Core/items_pinned_to_model.json +0 -0
- /package/{models/Shiroko_Model/Shiroko/Shiroko_Core//346/213/277/347/254/224.exp3.json" → src/renderer/public/models/Shiroko_Model/Shiroko/Shiroko_Core/pen.exp3.json} +0 -0
- /package/{models/Shiroko_Model/Shiroko/Shiroko_Core//346/213/215/347/205/247.exp3.json" → src/renderer/public/models/Shiroko_Model/Shiroko/Shiroko_Core/photo.exp3.json} +0 -0
- /package/{models/Shiroko_Model/Shiroko/Shiroko_Core//351/235/242/351/245/2740.4096/texture_00.png" → src/renderer/public/models/Shiroko_Model/Shiroko/Shiroko_Core/shiroko.4096/texture_00.png} +0 -0
- /package/{models/Shiroko_Model/Shiroko/Shiroko_Core//351/235/242/351/245/2740.4096/texture_01.png" → src/renderer/public/models/Shiroko_Model/Shiroko/Shiroko_Core/shiroko.4096/texture_01.png} +0 -0
- /package/{models/Shiroko_Model/Shiroko/Shiroko_Core//351/235/242/351/245/2740.4096/texture_02.png" → src/renderer/public/models/Shiroko_Model/Shiroko/Shiroko_Core/shiroko.4096/texture_02.png} +0 -0
- /package/{models/Shiroko_Model/Shiroko/Shiroko_Core//351/235/242/351/245/2740.4096/texture_03.png" → src/renderer/public/models/Shiroko_Model/Shiroko/Shiroko_Core/shiroko.4096/texture_03.png} +0 -0
- /package/{models/Shiroko_Model/Shiroko/Shiroko_Core//351/235/242/351/245/2740.cdi3.json" → src/renderer/public/models/Shiroko_Model/Shiroko/Shiroko_Core/shiroko.cdi3.json} +0 -0
- /package/{models/Shiroko_Model/Shiroko/Shiroko_Core//351/235/242/351/245/2740.moc3" → src/renderer/public/models/Shiroko_Model/Shiroko/Shiroko_Core/shiroko.moc3} +0 -0
- /package/{models/Shiroko_Model/Shiroko/Shiroko_Core//351/235/242/351/245/2740.physics3.json" → src/renderer/public/models/Shiroko_Model/Shiroko/Shiroko_Core/shiroko.physics3.json} +0 -0
- /package/{models/Shiroko_Model/Shiroko/Shiroko_Core//351/235/242/351/245/2740.vtube.json" → src/renderer/public/models/Shiroko_Model/Shiroko/Shiroko_Core/shiroko.vtube.json} +0 -0
package/src/CLI/list_features.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
|
|
4
|
-
const colors = {
|
|
5
|
-
reset: "\x1b[0m",
|
|
6
|
-
bright: "\x1b[1m",
|
|
7
|
-
mint: "\x1b[38;5;121m",
|
|
8
|
-
pink: "\x1b[38;5;213m",
|
|
9
|
-
cyan: "\x1b[36m",
|
|
10
|
-
yellow: "\x1b[33m"
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
function displayFeatures() {
|
|
14
|
-
console.log(`\n${colors.mint}${colors.bright}Mint Feature & Command List${colors.reset}\n`);
|
|
15
|
-
|
|
16
|
-
console.log(`${colors.bright}Quick Setup:${colors.reset}`);
|
|
17
|
-
console.log(` - ${colors.cyan}mint onboard${colors.reset} : Setup API Key and Model`);
|
|
18
|
-
console.log(` - ${colors.cyan}mint onboard --daemon${colors.reset} : Install background agent (Linux)`);
|
|
19
|
-
console.log(` - ${colors.cyan}mint chat${colors.reset} : Start chatting (or just type "mint")`);
|
|
20
|
-
|
|
21
|
-
console.log(`\n${colors.bright}CLI Commands:${colors.reset}`);
|
|
22
|
-
const commands = [
|
|
23
|
-
{ cmd: 'mint', desc: 'Start interactive chat session (Default)' },
|
|
24
|
-
{ cmd: 'mint code "<task>"', desc: 'Run workspace-aware coding agent in current directory' },
|
|
25
|
-
{ cmd: 'mint summarize [path]', desc: 'Summarize repository structure, tooling, git state, and key files' },
|
|
26
|
-
{ cmd: 'mint symbols [path]', desc: 'Build a source symbol index for supported languages' },
|
|
27
|
-
{ cmd: 'mint semantic-code', desc: 'Index and search code semantically with embeddings' },
|
|
28
|
-
{ cmd: 'mint gmail auth', desc: 'Connect Gmail OAuth and save refresh token' },
|
|
29
|
-
{ cmd: 'mint mcp', desc: 'Manage Model Context Protocol (MCP) servers' },
|
|
30
|
-
{ cmd: 'mint task "<task>"', desc: 'Queue an autonomous task for the background agent' },
|
|
31
|
-
{ cmd: 'mint update', desc: 'Check for and install the latest Mint CLI version' },
|
|
32
|
-
{ cmd: 'mint onboard', desc: 'Run setup wizard (API Key, Model, Daemon)' },
|
|
33
|
-
{ cmd: 'mint agent', desc: 'Run Mint as a background agent (Headless)' },
|
|
34
|
-
{ cmd: 'mint list', desc: 'Show this features & commands list' }
|
|
35
|
-
];
|
|
36
|
-
commands.forEach(c => console.log(` - ${colors.cyan}${c.cmd.padEnd(18)}${colors.reset} : ${c.desc}`));
|
|
37
|
-
|
|
38
|
-
console.log(`\n${colors.bright}AI Core Actions (Automation):${colors.reset}`);
|
|
39
|
-
const actions = [
|
|
40
|
-
{ act: 'open_url', desc: 'Open any website or search Google' },
|
|
41
|
-
{ act: 'open_app', desc: 'Launch desktop applications' },
|
|
42
|
-
{ act: 'file_ops', desc: 'Create folders, Open files, Delete/Trash items' },
|
|
43
|
-
{ act: 'knowledge', desc: 'Learn from files (PDF, Docx, TXT, MD, XLSX) or Web URLs' },
|
|
44
|
-
{ act: 'system', desc: 'Volume, Brightness, Mute, Sleep, Power Control' }
|
|
45
|
-
];
|
|
46
|
-
actions.forEach(a => console.log(` - ${colors.yellow}${a.act.padEnd(15)}${colors.reset} : ${a.desc}`));
|
|
47
|
-
|
|
48
|
-
console.log(`\n${colors.bright}Available Plugins:${colors.reset}`);
|
|
49
|
-
const pluginsDir = path.join(__dirname, '../Plugins');
|
|
50
|
-
try {
|
|
51
|
-
const files = fs.readdirSync(pluginsDir);
|
|
52
|
-
const plugins = files
|
|
53
|
-
.filter(f => f.endsWith('.js') && f !== 'plugin_manager.js')
|
|
54
|
-
.map(f => f.replace('.js', ''));
|
|
55
|
-
|
|
56
|
-
plugins.forEach(p => console.log(` - ${colors.pink}${p}${colors.reset}`));
|
|
57
|
-
} catch (err) {
|
|
58
|
-
console.log(' (Could not load plugins list)');
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
console.log(`\n${colors.mint}${colors.bright}Type "mint" to start exploring!${colors.reset}\n`);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
module.exports = { displayFeatures };
|
package/src/CLI/onboarding.js
DELETED
|
@@ -1,416 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
const { readConfig, writeConfig } = require('../System/config_manager');
|
|
4
|
-
const { installDaemon } = require('../System/daemon_manager');
|
|
5
|
-
const { runGmailAuth } = require('./gmail_auth');
|
|
6
|
-
|
|
7
|
-
const CUSTOM_MODEL_VALUE = '__custom_model__';
|
|
8
|
-
const ANTHROPIC_MODEL_CHOICES = [
|
|
9
|
-
'claude-3-5-sonnet-latest',
|
|
10
|
-
'claude-3-opus-latest',
|
|
11
|
-
'claude-3-5-haiku-latest'
|
|
12
|
-
];
|
|
13
|
-
const OPENAI_MODEL_CHOICES = [
|
|
14
|
-
'gpt-4o',
|
|
15
|
-
'gpt-4o-mini',
|
|
16
|
-
'o1-preview',
|
|
17
|
-
'o1-mini'
|
|
18
|
-
];
|
|
19
|
-
|
|
20
|
-
function buildModelChoices(models, currentModel) {
|
|
21
|
-
const choices = models.map(model => ({ name: model, value: model }));
|
|
22
|
-
if (currentModel && !models.includes(currentModel)) {
|
|
23
|
-
choices.push({ name: `${currentModel} (current)`, value: currentModel });
|
|
24
|
-
}
|
|
25
|
-
choices.push({ name: 'Custom...', value: CUSTOM_MODEL_VALUE });
|
|
26
|
-
return choices;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function resolveCustomModelSelection(answers, modelKey, customKey, fallbackModel) {
|
|
30
|
-
if (answers[modelKey] !== CUSTOM_MODEL_VALUE) return;
|
|
31
|
-
const customModel = typeof answers[customKey] === 'string' ? answers[customKey].trim() : '';
|
|
32
|
-
answers[modelKey] = customModel || fallbackModel;
|
|
33
|
-
delete answers[customKey];
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Onboarding Wizard for Mint CLI
|
|
38
|
-
*/
|
|
39
|
-
async function runOnboarding(options = {}) {
|
|
40
|
-
// Dynamic import for ESM-only inquirer in CommonJS
|
|
41
|
-
const inquirer = (await import('inquirer')).default;
|
|
42
|
-
|
|
43
|
-
console.log('\nWelcome to Mint Onboarding! Let\'s get you set up.\n');
|
|
44
|
-
|
|
45
|
-
let config = readConfig();
|
|
46
|
-
|
|
47
|
-
// 1. Basic Setup (Gemini is mandatory for core features)
|
|
48
|
-
const basicAnswers = await inquirer.prompt([
|
|
49
|
-
{
|
|
50
|
-
type: 'input',
|
|
51
|
-
name: 'apiKey',
|
|
52
|
-
message: 'Enter your Google Gemini API Key:',
|
|
53
|
-
default: config.apiKey || undefined,
|
|
54
|
-
validate: (input) => input.trim().length > 0 ? true : 'API Key is required.'
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
type: 'list',
|
|
58
|
-
name: 'geminiModel',
|
|
59
|
-
message: 'Select primary Gemini model:',
|
|
60
|
-
choices: [
|
|
61
|
-
'gemini-2.5-flash',
|
|
62
|
-
'gemini-3.1-flash-lite-preview',
|
|
63
|
-
'gemini-1.5-pro'
|
|
64
|
-
],
|
|
65
|
-
default: config.geminiModel || 'gemini-2.5-flash'
|
|
66
|
-
}
|
|
67
|
-
]);
|
|
68
|
-
|
|
69
|
-
config = { ...config, ...basicAnswers };
|
|
70
|
-
|
|
71
|
-
// 2. Interactive Channel/Provider Selection (QuickStart Style)
|
|
72
|
-
const { selections } = await inquirer.prompt([
|
|
73
|
-
{
|
|
74
|
-
type: 'checkbox',
|
|
75
|
-
name: 'selections',
|
|
76
|
-
message: 'Select channels/providers to configure (QuickStart):',
|
|
77
|
-
pageSize: 20,
|
|
78
|
-
choices: [
|
|
79
|
-
{ name: 'Telegram (Bot API)', value: 'telegram', checked: config.enableTelegramBridge },
|
|
80
|
-
{ name: 'WhatsApp (QR link)', value: 'whatsapp', checked: config.enableWhatsappBridge },
|
|
81
|
-
{ name: 'Discord (Bot API)', value: 'discord', checked: config.enableDiscordBridge },
|
|
82
|
-
{ name: 'Slack (Socket Mode)', value: 'slack', checked: config.enableSlackBridge },
|
|
83
|
-
{ name: 'LINE (Messaging API)', value: 'line', checked: config.enableLineBridge },
|
|
84
|
-
{ name: 'Google Calendar API', value: 'google_calendar', checked: config.pluginCalendarEnabled },
|
|
85
|
-
{ name: 'Gmail API', value: 'gmail', checked: config.pluginGmailEnabled },
|
|
86
|
-
{ name: 'Notion API', value: 'notion', checked: config.pluginNotionEnabled },
|
|
87
|
-
new inquirer.Separator(),
|
|
88
|
-
{ name: 'Anthropic (Claude)', value: 'anthropic', checked: !!config.anthropicApiKey },
|
|
89
|
-
{ name: 'OpenAI (GPT-4o)', value: 'openai', checked: !!config.openaiApiKey },
|
|
90
|
-
{ name: 'Hugging Face', value: 'hf', checked: !!config.hfApiKey },
|
|
91
|
-
{ name: 'Local AI (LM Studio/Ollama)', value: 'local', checked: !!(config.localApiBaseUrl && config.localApiBaseUrl.length > 0) },
|
|
92
|
-
new inquirer.Separator(),
|
|
93
|
-
{ name: 'Google Search API', value: 'google_search', checked: !!config.googleSearchApiKey },
|
|
94
|
-
{ name: 'Brave Search API', value: 'brave_search', checked: !!config.braveSearchApiKey },
|
|
95
|
-
new inquirer.Separator(),
|
|
96
|
-
{ name: 'Skip for now', value: 'skip' }
|
|
97
|
-
]
|
|
98
|
-
}
|
|
99
|
-
]);
|
|
100
|
-
|
|
101
|
-
// 3. Configure selected items
|
|
102
|
-
const dynamicQuestions = [];
|
|
103
|
-
|
|
104
|
-
// Reset enabled flags if we are not skipping
|
|
105
|
-
if (!selections.includes('skip')) {
|
|
106
|
-
config.enableTelegramBridge = selections.includes('telegram');
|
|
107
|
-
config.enableWhatsappBridge = selections.includes('whatsapp');
|
|
108
|
-
config.enableDiscordBridge = selections.includes('discord');
|
|
109
|
-
config.enableSlackBridge = selections.includes('slack');
|
|
110
|
-
config.enableLineBridge = selections.includes('line');
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
// If "Skip for now" is selected or nothing is selected, we move to save
|
|
114
|
-
if (selections.includes('skip')) {
|
|
115
|
-
console.log('\n⏩ Skipping optional configuration...');
|
|
116
|
-
} else {
|
|
117
|
-
if (selections.includes('google_search')) {
|
|
118
|
-
dynamicQuestions.push({
|
|
119
|
-
type: 'input',
|
|
120
|
-
name: 'googleSearchApiKey',
|
|
121
|
-
message: 'Enter Google Search API Key:',
|
|
122
|
-
default: config.googleSearchApiKey
|
|
123
|
-
});
|
|
124
|
-
dynamicQuestions.push({
|
|
125
|
-
type: 'input',
|
|
126
|
-
name: 'googleSearchCx',
|
|
127
|
-
message: 'Enter Google Search CX (Engine ID):',
|
|
128
|
-
default: config.googleSearchCx
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
if (selections.includes('brave_search')) {
|
|
133
|
-
dynamicQuestions.push({
|
|
134
|
-
type: 'input',
|
|
135
|
-
name: 'braveSearchApiKey',
|
|
136
|
-
message: 'Enter Brave Search API Key:',
|
|
137
|
-
default: config.braveSearchApiKey
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
if (selections.includes('discord')) {
|
|
141
|
-
dynamicQuestions.push({
|
|
142
|
-
type: 'input',
|
|
143
|
-
name: 'discordBotToken',
|
|
144
|
-
message: 'Enter Discord Bot Token:',
|
|
145
|
-
default: config.discordBotToken
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
if (selections.includes('telegram')) {
|
|
150
|
-
dynamicQuestions.push({
|
|
151
|
-
type: 'input',
|
|
152
|
-
name: 'telegramBotToken',
|
|
153
|
-
message: 'Enter Telegram Bot Token:',
|
|
154
|
-
default: config.telegramBotToken
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
if (selections.includes('slack')) {
|
|
159
|
-
dynamicQuestions.push({
|
|
160
|
-
type: 'input',
|
|
161
|
-
name: 'slackBotToken',
|
|
162
|
-
message: 'Enter Slack Bot Token (xoxb-...):',
|
|
163
|
-
default: config.slackBotToken
|
|
164
|
-
});
|
|
165
|
-
dynamicQuestions.push({
|
|
166
|
-
type: 'input',
|
|
167
|
-
name: 'slackAppToken',
|
|
168
|
-
message: 'Enter Slack App Token (xapp-...):',
|
|
169
|
-
default: config.slackAppToken
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
if (selections.includes('line')) {
|
|
174
|
-
dynamicQuestions.push({
|
|
175
|
-
type: 'input',
|
|
176
|
-
name: 'lineChannelAccessToken',
|
|
177
|
-
message: 'Enter LINE Channel Access Token:',
|
|
178
|
-
default: config.lineChannelAccessToken
|
|
179
|
-
});
|
|
180
|
-
dynamicQuestions.push({
|
|
181
|
-
type: 'input',
|
|
182
|
-
name: 'lineChannelSecret',
|
|
183
|
-
message: 'Enter LINE Channel Secret:',
|
|
184
|
-
default: config.lineChannelSecret
|
|
185
|
-
});
|
|
186
|
-
dynamicQuestions.push({
|
|
187
|
-
type: 'number',
|
|
188
|
-
name: 'lineWebhookPort',
|
|
189
|
-
message: 'Enter LINE Webhook Port (Local):',
|
|
190
|
-
default: config.lineWebhookPort || 3000
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
if (selections.includes('google_calendar')) {
|
|
195
|
-
dynamicQuestions.push({
|
|
196
|
-
type: 'input',
|
|
197
|
-
name: 'googleCalendarClientId',
|
|
198
|
-
message: 'Enter Google Calendar OAuth Client ID:',
|
|
199
|
-
default: config.googleCalendarClientId
|
|
200
|
-
});
|
|
201
|
-
dynamicQuestions.push({
|
|
202
|
-
type: 'input',
|
|
203
|
-
name: 'googleCalendarClientSecret',
|
|
204
|
-
message: 'Enter Google Calendar OAuth Client Secret:',
|
|
205
|
-
default: config.googleCalendarClientSecret
|
|
206
|
-
});
|
|
207
|
-
dynamicQuestions.push({
|
|
208
|
-
type: 'input',
|
|
209
|
-
name: 'googleCalendarRefreshToken',
|
|
210
|
-
message: 'Enter Google Calendar Refresh Token:',
|
|
211
|
-
default: config.googleCalendarRefreshToken
|
|
212
|
-
});
|
|
213
|
-
dynamicQuestions.push({
|
|
214
|
-
type: 'input',
|
|
215
|
-
name: 'googleCalendarId',
|
|
216
|
-
message: 'Enter Google Calendar ID:',
|
|
217
|
-
default: config.googleCalendarId || 'primary'
|
|
218
|
-
});
|
|
219
|
-
config.pluginCalendarEnabled = true;
|
|
220
|
-
} else {
|
|
221
|
-
config.pluginCalendarEnabled = false;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
if (selections.includes('gmail')) {
|
|
225
|
-
dynamicQuestions.push({
|
|
226
|
-
type: 'input',
|
|
227
|
-
name: 'gmailClientId',
|
|
228
|
-
message: 'Enter Gmail OAuth Client ID:',
|
|
229
|
-
default: config.gmailClientId
|
|
230
|
-
});
|
|
231
|
-
dynamicQuestions.push({
|
|
232
|
-
type: 'input',
|
|
233
|
-
name: 'gmailClientSecret',
|
|
234
|
-
message: 'Enter Gmail OAuth Client Secret:',
|
|
235
|
-
default: config.gmailClientSecret
|
|
236
|
-
});
|
|
237
|
-
dynamicQuestions.push({
|
|
238
|
-
type: 'input',
|
|
239
|
-
name: 'gmailRefreshToken',
|
|
240
|
-
message: 'Enter Gmail Refresh Token:',
|
|
241
|
-
default: config.gmailRefreshToken
|
|
242
|
-
});
|
|
243
|
-
dynamicQuestions.push({
|
|
244
|
-
type: 'input',
|
|
245
|
-
name: 'gmailUserId',
|
|
246
|
-
message: 'Enter Gmail User ID:',
|
|
247
|
-
default: config.gmailUserId || 'me'
|
|
248
|
-
});
|
|
249
|
-
config.pluginGmailEnabled = true;
|
|
250
|
-
} else {
|
|
251
|
-
config.pluginGmailEnabled = false;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
if (selections.includes('notion')) {
|
|
255
|
-
dynamicQuestions.push({
|
|
256
|
-
type: 'input',
|
|
257
|
-
name: 'notionApiKey',
|
|
258
|
-
message: 'Enter Notion Internal Integration Secret:',
|
|
259
|
-
default: config.notionApiKey
|
|
260
|
-
});
|
|
261
|
-
dynamicQuestions.push({
|
|
262
|
-
type: 'input',
|
|
263
|
-
name: 'notionDatabaseId',
|
|
264
|
-
message: 'Enter default Notion Database ID (optional):',
|
|
265
|
-
default: config.notionDatabaseId
|
|
266
|
-
});
|
|
267
|
-
dynamicQuestions.push({
|
|
268
|
-
type: 'input',
|
|
269
|
-
name: 'notionPageId',
|
|
270
|
-
message: 'Enter default Notion Page ID (optional):',
|
|
271
|
-
default: config.notionPageId
|
|
272
|
-
});
|
|
273
|
-
dynamicQuestions.push({
|
|
274
|
-
type: 'input',
|
|
275
|
-
name: 'notionTitleProperty',
|
|
276
|
-
message: 'Enter database title property name:',
|
|
277
|
-
default: config.notionTitleProperty || 'Name'
|
|
278
|
-
});
|
|
279
|
-
config.pluginNotionEnabled = true;
|
|
280
|
-
} else {
|
|
281
|
-
config.pluginNotionEnabled = false;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
if (selections.includes('anthropic')) {
|
|
285
|
-
dynamicQuestions.push({
|
|
286
|
-
type: 'input',
|
|
287
|
-
name: 'anthropicApiKey',
|
|
288
|
-
message: 'Enter Anthropic API Key:',
|
|
289
|
-
default: config.anthropicApiKey,
|
|
290
|
-
validate: (input) => input.trim().length > 0 ? true : 'Anthropic API Key is required when Anthropic is selected.'
|
|
291
|
-
});
|
|
292
|
-
dynamicQuestions.push({
|
|
293
|
-
type: 'list',
|
|
294
|
-
name: 'anthropicModel',
|
|
295
|
-
message: 'Select Anthropic model:',
|
|
296
|
-
choices: buildModelChoices(ANTHROPIC_MODEL_CHOICES, config.anthropicModel),
|
|
297
|
-
default: config.anthropicModel || 'claude-3-5-sonnet-latest'
|
|
298
|
-
});
|
|
299
|
-
dynamicQuestions.push({
|
|
300
|
-
type: 'input',
|
|
301
|
-
name: 'anthropicModelCustom',
|
|
302
|
-
message: 'Enter custom Anthropic model:',
|
|
303
|
-
default: config.anthropicModel || 'claude-3-5-sonnet-latest',
|
|
304
|
-
when: (answers) => answers.anthropicModel === CUSTOM_MODEL_VALUE,
|
|
305
|
-
validate: (input) => input.trim().length > 0 ? true : 'Model name is required.'
|
|
306
|
-
});
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
if (selections.includes('openai')) {
|
|
310
|
-
dynamicQuestions.push({
|
|
311
|
-
type: 'input',
|
|
312
|
-
name: 'openaiApiKey',
|
|
313
|
-
message: 'Enter OpenAI API Key:',
|
|
314
|
-
default: config.openaiApiKey,
|
|
315
|
-
validate: (input) => input.trim().length > 0 ? true : 'OpenAI API Key is required when OpenAI is selected.'
|
|
316
|
-
});
|
|
317
|
-
dynamicQuestions.push({
|
|
318
|
-
type: 'list',
|
|
319
|
-
name: 'openaiModel',
|
|
320
|
-
message: 'Select OpenAI model:',
|
|
321
|
-
choices: buildModelChoices(OPENAI_MODEL_CHOICES, config.openaiModel),
|
|
322
|
-
default: config.openaiModel || 'gpt-4o'
|
|
323
|
-
});
|
|
324
|
-
dynamicQuestions.push({
|
|
325
|
-
type: 'input',
|
|
326
|
-
name: 'openaiModelCustom',
|
|
327
|
-
message: 'Enter custom OpenAI model:',
|
|
328
|
-
default: config.openaiModel || 'gpt-4o',
|
|
329
|
-
when: (answers) => answers.openaiModel === CUSTOM_MODEL_VALUE,
|
|
330
|
-
validate: (input) => input.trim().length > 0 ? true : 'Model name is required.'
|
|
331
|
-
});
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
if (selections.includes('hf')) {
|
|
335
|
-
dynamicQuestions.push({
|
|
336
|
-
type: 'input',
|
|
337
|
-
name: 'hfApiKey',
|
|
338
|
-
message: 'Enter Hugging Face API Key:',
|
|
339
|
-
default: config.hfApiKey
|
|
340
|
-
});
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
if (selections.includes('local')) {
|
|
344
|
-
dynamicQuestions.push({
|
|
345
|
-
type: 'input',
|
|
346
|
-
name: 'localApiBaseUrl',
|
|
347
|
-
message: 'Enter Local AI Base URL:',
|
|
348
|
-
default: config.localApiBaseUrl || 'http://localhost:1234/v1'
|
|
349
|
-
});
|
|
350
|
-
dynamicQuestions.push({
|
|
351
|
-
type: 'input',
|
|
352
|
-
name: 'localModelName',
|
|
353
|
-
message: 'Enter Local Model Name:',
|
|
354
|
-
default: config.localModelName || 'local-model'
|
|
355
|
-
});
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
if (dynamicQuestions.length > 0) {
|
|
360
|
-
const extraAnswers = await inquirer.prompt(dynamicQuestions);
|
|
361
|
-
resolveCustomModelSelection(extraAnswers, 'anthropicModel', 'anthropicModelCustom', config.anthropicModel || 'claude-3-5-sonnet-latest');
|
|
362
|
-
resolveCustomModelSelection(extraAnswers, 'openaiModel', 'openaiModelCustom', config.openaiModel || 'gpt-4o');
|
|
363
|
-
config = { ...config, ...extraAnswers };
|
|
364
|
-
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
// Onboarding treats Gemini as the primary AI. Other providers are optional
|
|
368
|
-
// configured backends that become available only when credentials are set.
|
|
369
|
-
config.aiProvider = 'gemini';
|
|
370
|
-
|
|
371
|
-
// Save configuration
|
|
372
|
-
writeConfig(config);
|
|
373
|
-
console.log('\n✅ Configuration saved successfully!');
|
|
374
|
-
|
|
375
|
-
if (!selections.includes('skip') && selections.includes('gmail') && !config.gmailRefreshToken) {
|
|
376
|
-
const { runGmailAuthNow } = await inquirer.prompt([
|
|
377
|
-
{
|
|
378
|
-
type: 'confirm',
|
|
379
|
-
name: 'runGmailAuthNow',
|
|
380
|
-
message: 'Gmail Refresh Token is empty. Start Gmail OAuth now?',
|
|
381
|
-
default: true
|
|
382
|
-
}
|
|
383
|
-
]);
|
|
384
|
-
|
|
385
|
-
if (runGmailAuthNow) {
|
|
386
|
-
console.log('\n🔐 Starting Gmail OAuth. Open the link below, sign in, and approve access.');
|
|
387
|
-
try {
|
|
388
|
-
const result = await runGmailAuth({
|
|
389
|
-
logger: console,
|
|
390
|
-
openBrowser: false
|
|
391
|
-
});
|
|
392
|
-
console.log(`✅ Gmail connected for ${result.userId}. Refresh token saved.`);
|
|
393
|
-
} catch (err) {
|
|
394
|
-
console.error(`❌ Gmail OAuth failed: ${err.message}`);
|
|
395
|
-
console.log('You can retry later with: mint gmail auth');
|
|
396
|
-
}
|
|
397
|
-
} else {
|
|
398
|
-
console.log('You can connect Gmail later with: mint gmail auth');
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
// Install Daemon if requested
|
|
403
|
-
if (options.installDaemon) {
|
|
404
|
-
console.log('\n🚀 Installing Mint Background Agent (Daemon)...');
|
|
405
|
-
try {
|
|
406
|
-
const result = await installDaemon();
|
|
407
|
-
console.log(`✅ ${result}`);
|
|
408
|
-
} catch (err) {
|
|
409
|
-
console.error(`❌ Failed to install daemon: ${err.message}`);
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
console.log('\nAll set! You can now use "mint chat" to start talking to me.\n');
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
module.exports = { runOnboarding };
|