@geminilight/mindos 0.5.1 → 0.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/app/app/api/health/route.ts +6 -0
- package/app/app/api/mcp/agents/route.ts +1 -49
- package/app/app/api/mcp/install/route.ts +1 -24
- package/app/app/api/restart/route.ts +22 -0
- package/app/app/api/setup/check-path/route.ts +35 -0
- package/app/app/api/setup/check-port/route.ts +21 -5
- package/app/app/api/setup/ls/route.ts +38 -0
- package/app/app/api/setup/route.ts +49 -0
- package/app/app/setup/page.tsx +3 -2
- package/app/components/HomeContent.tsx +2 -0
- package/app/components/SettingsModal.tsx +9 -0
- package/app/components/SetupWizard.tsx +344 -46
- package/app/components/WelcomeBanner.tsx +63 -0
- package/app/lib/i18n.ts +40 -2
- package/app/lib/mcp-agents.ts +48 -0
- package/app/lib/settings.ts +1 -1
- package/bin/lib/mcp-agents.js +16 -0
- package/bin/lib/mcp-install.js +2 -11
- package/package.json +1 -1
- package/scripts/setup.js +195 -86
- package/skills/human-insights/SKILL.md +143 -0
- package/skills/mindos/SKILL.md +7 -6
- package/skills/mindos-zh/SKILL.md +7 -7
package/app/lib/i18n.ts
CHANGED
|
@@ -225,6 +225,7 @@ export const messages = {
|
|
|
225
225
|
save: 'Save',
|
|
226
226
|
saved: 'Saved',
|
|
227
227
|
saveFailed: 'Save failed',
|
|
228
|
+
reconfigure: 'Reconfigure',
|
|
228
229
|
},
|
|
229
230
|
onboarding: {
|
|
230
231
|
subtitle: 'Your knowledge base is empty. Pick a starter template to get going.',
|
|
@@ -275,7 +276,8 @@ export const messages = {
|
|
|
275
276
|
// Step 1
|
|
276
277
|
kbPath: 'Knowledge base path',
|
|
277
278
|
kbPathHint: 'Absolute path to your notes directory.',
|
|
278
|
-
kbPathDefault: '~/MindOS',
|
|
279
|
+
kbPathDefault: '~/MindOS/mind',
|
|
280
|
+
kbPathExists: (n: number) => `Directory already has ${n} file(s) — template will not be applied.`,
|
|
279
281
|
template: 'Starter template',
|
|
280
282
|
templateSkip: 'Skip (directory already has files)',
|
|
281
283
|
// Step 2
|
|
@@ -294,11 +296,14 @@ export const messages = {
|
|
|
294
296
|
portInUse: (p: number) => `Port ${p} is already in use.`,
|
|
295
297
|
portSuggest: (p: number) => `Use ${p}`,
|
|
296
298
|
portChecking: 'Checking…',
|
|
299
|
+
portSelf: 'Current port',
|
|
297
300
|
portConflict: 'Web UI and MCP ports must be different.',
|
|
298
301
|
portVerifyHint: 'Click outside each field to verify, or wait for auto-check.',
|
|
299
302
|
// Step 4
|
|
300
303
|
authToken: 'Auth Token',
|
|
301
304
|
authTokenHint: 'Bearer token for MCP / API clients. Auto-generated.',
|
|
305
|
+
authTokenUsage: 'Used for MCP connections and API clients. When configuring an Agent, this token is written automatically — no manual steps needed.',
|
|
306
|
+
authTokenUsageWhat: 'What is this?',
|
|
302
307
|
authTokenSeed: 'Custom seed (optional)',
|
|
303
308
|
authTokenSeedHint: 'Enter a passphrase to derive a deterministic token.',
|
|
304
309
|
generateToken: 'Generate',
|
|
@@ -314,6 +319,7 @@ export const messages = {
|
|
|
314
319
|
agentToolsLoading: 'Loading agents…',
|
|
315
320
|
agentToolsEmpty: 'No supported agents detected.',
|
|
316
321
|
agentNoneSelected: 'No agents selected — you can configure later in Settings → MCP.',
|
|
322
|
+
agentSkipLater: 'Skip — configure later',
|
|
317
323
|
agentNotInstalled: 'not installed',
|
|
318
324
|
agentStatusOk: 'configured',
|
|
319
325
|
agentStatusError: 'failed',
|
|
@@ -324,8 +330,15 @@ export const messages = {
|
|
|
324
330
|
// Step 6 — Review
|
|
325
331
|
reviewHint: 'Verify your settings before completing setup.',
|
|
326
332
|
reviewInstallResults: 'Agent configuration results:',
|
|
333
|
+
retryAgent: 'Retry',
|
|
334
|
+
agentFailureNote: 'Agent failures are non-blocking — you can enter MindOS and retry from Settings → MCP.',
|
|
327
335
|
portAvailable: 'Available',
|
|
328
336
|
portChanged: 'Port changed — please restart the server for it to take effect.',
|
|
337
|
+
restartRequired: 'Server restart required for these changes to take effect.',
|
|
338
|
+
restartNow: 'Restart now',
|
|
339
|
+
restarting: 'Restarting…',
|
|
340
|
+
restartDone: 'Server is restarting. Redirecting shortly…',
|
|
341
|
+
restartManual: 'Restart manually:',
|
|
329
342
|
// Buttons
|
|
330
343
|
back: 'Back',
|
|
331
344
|
next: 'Next',
|
|
@@ -334,6 +347,12 @@ export const messages = {
|
|
|
334
347
|
completing: 'Saving...',
|
|
335
348
|
completeDone: 'Setup complete!',
|
|
336
349
|
completeFailed: 'Setup failed. Please try again.',
|
|
350
|
+
// Welcome banner (shown after first onboard)
|
|
351
|
+
welcomeTitle: 'Welcome to MindOS!',
|
|
352
|
+
welcomeDesc: 'Setup is complete. Start by asking AI a question, browsing your knowledge base, or configuring MCP agents.',
|
|
353
|
+
welcomeLinkReconfigure: 'Reconfigure',
|
|
354
|
+
welcomeLinkAskAI: 'Ask AI',
|
|
355
|
+
welcomeLinkMCP: 'MCP Settings',
|
|
337
356
|
},
|
|
338
357
|
},
|
|
339
358
|
zh: {
|
|
@@ -560,6 +579,7 @@ export const messages = {
|
|
|
560
579
|
save: '保存',
|
|
561
580
|
saved: '已保存',
|
|
562
581
|
saveFailed: '保存失败',
|
|
582
|
+
reconfigure: '重新配置',
|
|
563
583
|
},
|
|
564
584
|
onboarding: {
|
|
565
585
|
subtitle: '知识库为空,选择一个模板快速开始。',
|
|
@@ -610,7 +630,8 @@ export const messages = {
|
|
|
610
630
|
// Step 1
|
|
611
631
|
kbPath: '知识库路径',
|
|
612
632
|
kbPathHint: '笔记目录的绝对路径。',
|
|
613
|
-
kbPathDefault: '~/MindOS',
|
|
633
|
+
kbPathDefault: '~/MindOS/mind',
|
|
634
|
+
kbPathExists: (n: number) => `目录已有 ${n} 个文件 — 将不会应用模板。`,
|
|
614
635
|
template: '初始模板',
|
|
615
636
|
templateSkip: '跳过(目录已有文件)',
|
|
616
637
|
// Step 2
|
|
@@ -629,11 +650,14 @@ export const messages = {
|
|
|
629
650
|
portInUse: (p: number) => `端口 ${p} 已被占用。`,
|
|
630
651
|
portSuggest: (p: number) => `使用 ${p}`,
|
|
631
652
|
portChecking: '检测中…',
|
|
653
|
+
portSelf: '当前端口',
|
|
632
654
|
portConflict: 'Web UI 端口和 MCP 端口不能相同。',
|
|
633
655
|
portVerifyHint: '点击输入框外部验证,或等待自动检测。',
|
|
634
656
|
// Step 4
|
|
635
657
|
authToken: 'Auth Token',
|
|
636
658
|
authTokenHint: 'MCP / API 客户端使用的 Bearer Token,自动生成。',
|
|
659
|
+
authTokenUsage: '用于 MCP 连接和 API 客户端身份验证。配置 Agent 时会自动写入,无需手动填写。',
|
|
660
|
+
authTokenUsageWhat: '这是什么?',
|
|
637
661
|
authTokenSeed: '自定义种子(可选)',
|
|
638
662
|
authTokenSeedHint: '输入口令短语生成确定性 Token。',
|
|
639
663
|
generateToken: '生成',
|
|
@@ -649,6 +673,7 @@ export const messages = {
|
|
|
649
673
|
agentToolsLoading: '正在加载 Agent…',
|
|
650
674
|
agentToolsEmpty: '未检测到受支持的 Agent。',
|
|
651
675
|
agentNoneSelected: '未选择 agent — 可稍后在 设置 → MCP 中配置。',
|
|
676
|
+
agentSkipLater: '跳过 — 稍后配置',
|
|
652
677
|
agentNotInstalled: '未安装',
|
|
653
678
|
agentStatusOk: '已配置',
|
|
654
679
|
agentStatusError: '失败',
|
|
@@ -659,8 +684,15 @@ export const messages = {
|
|
|
659
684
|
// Step 6 — Review
|
|
660
685
|
reviewHint: '完成设置前请确认以下信息。',
|
|
661
686
|
reviewInstallResults: 'Agent 配置结果:',
|
|
687
|
+
retryAgent: '重试',
|
|
688
|
+
agentFailureNote: 'Agent 安装失败不影响进入 MindOS — 可稍后在 设置 → MCP 中重试。',
|
|
662
689
|
portAvailable: '可用',
|
|
663
690
|
portChanged: '端口已变更 — 请重启服务以使其生效。',
|
|
691
|
+
restartRequired: '以下变更需要重启服务后生效。',
|
|
692
|
+
restartNow: '立即重启',
|
|
693
|
+
restarting: '重启中…',
|
|
694
|
+
restartDone: '服务正在重启,稍后自动跳转…',
|
|
695
|
+
restartManual: '手动重启命令:',
|
|
664
696
|
// Buttons
|
|
665
697
|
back: '上一步',
|
|
666
698
|
next: '下一步',
|
|
@@ -670,6 +702,12 @@ export const messages = {
|
|
|
670
702
|
completing: '保存中...',
|
|
671
703
|
completeDone: '设置完成!',
|
|
672
704
|
completeFailed: '设置失败,请重试。',
|
|
705
|
+
// Welcome banner
|
|
706
|
+
welcomeTitle: '欢迎使用 MindOS!',
|
|
707
|
+
welcomeDesc: '初始化完成。可以开始向 AI 提问、浏览知识库,或配置 MCP Agent。',
|
|
708
|
+
welcomeLinkReconfigure: '重新配置',
|
|
709
|
+
welcomeLinkAskAI: '问 AI',
|
|
710
|
+
welcomeLinkMCP: 'MCP 设置',
|
|
673
711
|
},
|
|
674
712
|
},
|
|
675
713
|
} as const;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import os from 'os';
|
|
4
|
+
|
|
5
|
+
export function expandHome(p: string): string {
|
|
6
|
+
return p.startsWith('~/') ? path.resolve(os.homedir(), p.slice(2)) : p;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface AgentDef {
|
|
10
|
+
name: string;
|
|
11
|
+
project: string | null;
|
|
12
|
+
global: string;
|
|
13
|
+
key: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const MCP_AGENTS: Record<string, AgentDef> = {
|
|
17
|
+
'claude-code': { name: 'Claude Code', project: '.mcp.json', global: '~/.claude.json', key: 'mcpServers' },
|
|
18
|
+
'claude-desktop': { name: 'Claude Desktop', project: null, global: process.platform === 'darwin' ? '~/Library/Application Support/Claude/claude_desktop_config.json' : '~/.config/Claude/claude_desktop_config.json', key: 'mcpServers' },
|
|
19
|
+
'cursor': { name: 'Cursor', project: '.cursor/mcp.json', global: '~/.cursor/mcp.json', key: 'mcpServers' },
|
|
20
|
+
'windsurf': { name: 'Windsurf', project: null, global: '~/.codeium/windsurf/mcp_config.json', key: 'mcpServers' },
|
|
21
|
+
'cline': { name: 'Cline', project: null, global: process.platform === 'darwin' ? '~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json' : '~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json', key: 'mcpServers' },
|
|
22
|
+
'trae': { name: 'Trae', project: '.trae/mcp.json', global: '~/.trae/mcp.json', key: 'mcpServers' },
|
|
23
|
+
'gemini-cli': { name: 'Gemini CLI', project: '.gemini/settings.json', global: '~/.gemini/settings.json', key: 'mcpServers' },
|
|
24
|
+
'openclaw': { name: 'OpenClaw', project: null, global: '~/.openclaw/mcp.json', key: 'mcpServers' },
|
|
25
|
+
'codebuddy': { name: 'CodeBuddy', project: null, global: '~/.claude-internal/.claude.json', key: 'mcpServers' },
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export function detectInstalled(agentKey: string): { installed: boolean; scope?: string; transport?: string; configPath?: string } {
|
|
29
|
+
const agent = MCP_AGENTS[agentKey];
|
|
30
|
+
if (!agent) return { installed: false };
|
|
31
|
+
|
|
32
|
+
for (const [scope, cfgPath] of [['global', agent.global], ['project', agent.project]] as const) {
|
|
33
|
+
if (!cfgPath) continue;
|
|
34
|
+
const absPath = expandHome(cfgPath);
|
|
35
|
+
if (!fs.existsSync(absPath)) continue;
|
|
36
|
+
try {
|
|
37
|
+
const config = JSON.parse(fs.readFileSync(absPath, 'utf-8'));
|
|
38
|
+
const servers = config[agent.key];
|
|
39
|
+
if (servers?.mindos) {
|
|
40
|
+
const entry = servers.mindos;
|
|
41
|
+
const transport = entry.type === 'stdio' ? 'stdio' : entry.url ? 'http' : 'unknown';
|
|
42
|
+
return { installed: true, scope, transport, configPath: cfgPath };
|
|
43
|
+
}
|
|
44
|
+
} catch { /* ignore parse errors */ }
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return { installed: false };
|
|
48
|
+
}
|
package/app/lib/settings.ts
CHANGED
|
@@ -160,5 +160,5 @@ export function effectiveAiConfig() {
|
|
|
160
160
|
/** Effective MIND_ROOT — settings file can override, env var is fallback */
|
|
161
161
|
export function effectiveSopRoot(): string {
|
|
162
162
|
const s = readSettings();
|
|
163
|
-
return s.mindRoot || process.env.MIND_ROOT || path.join(os.homedir(), 'MindOS');
|
|
163
|
+
return s.mindRoot || process.env.MIND_ROOT || path.join(os.homedir(), 'MindOS', 'mind');
|
|
164
164
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared MCP agent definitions for CLI tools.
|
|
3
|
+
* Mirrors app/lib/mcp-agents.ts — keep in sync manually.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export const MCP_AGENTS = {
|
|
7
|
+
'claude-code': { name: 'Claude Code', project: '.mcp.json', global: '~/.claude.json', key: 'mcpServers' },
|
|
8
|
+
'claude-desktop': { name: 'Claude Desktop', project: null, global: process.platform === 'darwin' ? '~/Library/Application Support/Claude/claude_desktop_config.json' : '~/.config/Claude/claude_desktop_config.json', key: 'mcpServers' },
|
|
9
|
+
'cursor': { name: 'Cursor', project: '.cursor/mcp.json', global: '~/.cursor/mcp.json', key: 'mcpServers' },
|
|
10
|
+
'windsurf': { name: 'Windsurf', project: null, global: '~/.codeium/windsurf/mcp_config.json', key: 'mcpServers' },
|
|
11
|
+
'cline': { name: 'Cline', project: null, global: process.platform === 'darwin' ? '~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json' : '~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json', key: 'mcpServers' },
|
|
12
|
+
'trae': { name: 'Trae', project: '.trae/mcp.json', global: '~/.trae/mcp.json', key: 'mcpServers' },
|
|
13
|
+
'gemini-cli': { name: 'Gemini CLI', project: '.gemini/settings.json', global: '~/.gemini/settings.json', key: 'mcpServers' },
|
|
14
|
+
'openclaw': { name: 'OpenClaw', project: null, global: '~/.openclaw/mcp.json', key: 'mcpServers' },
|
|
15
|
+
'codebuddy': { name: 'CodeBuddy', project: null, global: '~/.claude-internal/.claude.json', key: 'mcpServers' },
|
|
16
|
+
};
|
package/bin/lib/mcp-install.js
CHANGED
|
@@ -3,18 +3,9 @@ import { resolve } from 'node:path';
|
|
|
3
3
|
import { CONFIG_PATH } from './constants.js';
|
|
4
4
|
import { bold, dim, cyan, green, red, yellow } from './colors.js';
|
|
5
5
|
import { expandHome } from './utils.js';
|
|
6
|
+
import { MCP_AGENTS } from './mcp-agents.js';
|
|
6
7
|
|
|
7
|
-
export
|
|
8
|
-
'claude-code': { name: 'Claude Code', project: '.mcp.json', global: '~/.claude.json', key: 'mcpServers' },
|
|
9
|
-
'claude-desktop': { name: 'Claude Desktop', project: null, global: process.platform === 'darwin' ? '~/Library/Application Support/Claude/claude_desktop_config.json' : '~/.config/Claude/claude_desktop_config.json', key: 'mcpServers' },
|
|
10
|
-
'cursor': { name: 'Cursor', project: '.cursor/mcp.json', global: '~/.cursor/mcp.json', key: 'mcpServers' },
|
|
11
|
-
'windsurf': { name: 'Windsurf', project: null, global: '~/.codeium/windsurf/mcp_config.json', key: 'mcpServers' },
|
|
12
|
-
'cline': { name: 'Cline', project: null, global: process.platform === 'darwin' ? '~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json' : '~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json', key: 'mcpServers' },
|
|
13
|
-
'trae': { name: 'Trae', project: '.trae/mcp.json', global: '~/.trae/mcp.json', key: 'mcpServers' },
|
|
14
|
-
'gemini-cli': { name: 'Gemini CLI', project: '.gemini/settings.json', global: '~/.gemini/settings.json', key: 'mcpServers' },
|
|
15
|
-
'openclaw': { name: 'OpenClaw', project: null, global: '~/.openclaw/mcp.json', key: 'mcpServers' },
|
|
16
|
-
'codebuddy': { name: 'CodeBuddy', project: null, global: '~/.claude-internal/.claude.json', key: 'mcpServers' },
|
|
17
|
-
};
|
|
8
|
+
export { MCP_AGENTS };
|
|
18
9
|
|
|
19
10
|
// ─── Interactive select (arrow keys) ──────────────────────────────────────────
|
|
20
11
|
|
package/package.json
CHANGED