@geminilight/mindos 0.5.5 → 0.5.7
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 +21 -8
- package/README_zh.md +20 -7
- package/app/app/api/mcp/agents/route.ts +3 -1
- package/app/app/api/mcp/install-skill/route.ts +70 -39
- package/app/app/api/restart/route.ts +28 -4
- package/app/app/view/[...path]/ViewPageClient.tsx +37 -7
- package/app/components/HomeContent.tsx +3 -1
- package/app/components/SetupWizard.tsx +12 -5
- package/app/components/renderers/graph/manifest.ts +3 -2
- package/app/components/settings/McpTab.tsx +4 -1
- package/app/lib/i18n.ts +8 -0
- package/app/lib/mcp-agents.ts +110 -9
- package/app/lib/renderers/index.ts +2 -2
- package/app/package-lock.json +311 -2
- package/app/proxy.ts +3 -2
- package/app/vitest.config.ts +1 -1
- package/assets/images/wechat-qr.png +0 -0
- package/bin/cli.js +35 -2
- package/bin/lib/mcp-agents.js +112 -9
- package/bin/lib/stop.js +86 -33
- package/mcp/src/index.ts +5 -0
- package/package.json +1 -1
- package/scripts/gen-renderer-index.js +9 -2
- package/scripts/setup.js +33 -23
package/app/lib/mcp-agents.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import os from 'os';
|
|
4
|
+
import { execSync } from 'child_process';
|
|
4
5
|
|
|
5
6
|
export function expandHome(p: string): string {
|
|
6
7
|
return p.startsWith('~/') ? path.resolve(os.homedir(), p.slice(2)) : p;
|
|
@@ -12,20 +13,100 @@ export interface AgentDef {
|
|
|
12
13
|
global: string;
|
|
13
14
|
key: string;
|
|
14
15
|
preferredTransport: 'stdio' | 'http';
|
|
16
|
+
/** CLI binary name for presence detection (e.g. 'claude'). Optional. */
|
|
17
|
+
presenceCli?: string;
|
|
18
|
+
/** Data directories for presence detection. Any one existing → present. */
|
|
19
|
+
presenceDirs?: string[];
|
|
15
20
|
}
|
|
16
21
|
|
|
17
22
|
export const MCP_AGENTS: Record<string, AgentDef> = {
|
|
18
|
-
'claude-code':
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
'claude-code': {
|
|
24
|
+
name: 'Claude Code',
|
|
25
|
+
project: '.mcp.json',
|
|
26
|
+
global: '~/.claude.json',
|
|
27
|
+
key: 'mcpServers',
|
|
28
|
+
preferredTransport: 'stdio',
|
|
29
|
+
presenceCli: 'claude',
|
|
30
|
+
presenceDirs: ['~/.claude/'],
|
|
31
|
+
},
|
|
32
|
+
'claude-desktop': {
|
|
33
|
+
name: 'Claude Desktop',
|
|
34
|
+
project: null,
|
|
35
|
+
global: process.platform === 'darwin'
|
|
36
|
+
? '~/Library/Application Support/Claude/claude_desktop_config.json'
|
|
37
|
+
: '~/.config/Claude/claude_desktop_config.json',
|
|
38
|
+
key: 'mcpServers',
|
|
39
|
+
preferredTransport: 'http',
|
|
40
|
+
presenceDirs: ['~/Library/Application Support/Claude/', '~/.config/Claude/'],
|
|
41
|
+
},
|
|
42
|
+
'cursor': {
|
|
43
|
+
name: 'Cursor',
|
|
44
|
+
project: '.cursor/mcp.json',
|
|
45
|
+
global: '~/.cursor/mcp.json',
|
|
46
|
+
key: 'mcpServers',
|
|
47
|
+
preferredTransport: 'stdio',
|
|
48
|
+
presenceDirs: ['~/.cursor/'],
|
|
49
|
+
},
|
|
50
|
+
'windsurf': {
|
|
51
|
+
name: 'Windsurf',
|
|
52
|
+
project: null,
|
|
53
|
+
global: '~/.codeium/windsurf/mcp_config.json',
|
|
54
|
+
key: 'mcpServers',
|
|
55
|
+
preferredTransport: 'stdio',
|
|
56
|
+
presenceDirs: ['~/.codeium/windsurf/'],
|
|
57
|
+
},
|
|
58
|
+
'cline': {
|
|
59
|
+
name: 'Cline',
|
|
60
|
+
project: null,
|
|
61
|
+
global: process.platform === 'darwin'
|
|
62
|
+
? '~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json'
|
|
63
|
+
: '~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json',
|
|
64
|
+
key: 'mcpServers',
|
|
65
|
+
preferredTransport: 'stdio',
|
|
66
|
+
presenceDirs: [
|
|
67
|
+
'~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/',
|
|
68
|
+
'~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/',
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
'trae': {
|
|
72
|
+
name: 'Trae',
|
|
73
|
+
project: '.trae/mcp.json',
|
|
74
|
+
global: '~/.trae/mcp.json',
|
|
75
|
+
key: 'mcpServers',
|
|
76
|
+
preferredTransport: 'stdio',
|
|
77
|
+
presenceDirs: ['~/.trae/'],
|
|
78
|
+
},
|
|
79
|
+
'gemini-cli': {
|
|
80
|
+
name: 'Gemini CLI',
|
|
81
|
+
project: '.gemini/settings.json',
|
|
82
|
+
global: '~/.gemini/settings.json',
|
|
83
|
+
key: 'mcpServers',
|
|
84
|
+
preferredTransport: 'stdio',
|
|
85
|
+
presenceCli: 'gemini',
|
|
86
|
+
presenceDirs: ['~/.gemini/'],
|
|
87
|
+
},
|
|
88
|
+
'openclaw': {
|
|
89
|
+
name: 'OpenClaw',
|
|
90
|
+
project: null,
|
|
91
|
+
global: '~/.openclaw/mcp.json',
|
|
92
|
+
key: 'mcpServers',
|
|
93
|
+
preferredTransport: 'stdio',
|
|
94
|
+
presenceCli: 'openclaw',
|
|
95
|
+
presenceDirs: ['~/.openclaw/'],
|
|
96
|
+
},
|
|
97
|
+
'codebuddy': {
|
|
98
|
+
name: 'CodeBuddy',
|
|
99
|
+
project: null,
|
|
100
|
+
global: '~/.claude-internal/.claude.json',
|
|
101
|
+
key: 'mcpServers',
|
|
102
|
+
preferredTransport: 'stdio',
|
|
103
|
+
presenceCli: 'claude-internal',
|
|
104
|
+
presenceDirs: ['~/.claude-internal/'],
|
|
105
|
+
},
|
|
27
106
|
};
|
|
28
107
|
|
|
108
|
+
/* ── MindOS MCP Install Detection ──────────────────────────────────────── */
|
|
109
|
+
|
|
29
110
|
export function detectInstalled(agentKey: string): { installed: boolean; scope?: string; transport?: string; configPath?: string } {
|
|
30
111
|
const agent = MCP_AGENTS[agentKey];
|
|
31
112
|
if (!agent) return { installed: false };
|
|
@@ -47,3 +128,23 @@ export function detectInstalled(agentKey: string): { installed: boolean; scope?:
|
|
|
47
128
|
|
|
48
129
|
return { installed: false };
|
|
49
130
|
}
|
|
131
|
+
|
|
132
|
+
/* ── Agent Presence Detection ──────────────────────────────────────────── */
|
|
133
|
+
|
|
134
|
+
export function detectAgentPresence(agentKey: string): boolean {
|
|
135
|
+
const agent = MCP_AGENTS[agentKey];
|
|
136
|
+
if (!agent) return false;
|
|
137
|
+
// 1. CLI check
|
|
138
|
+
if (agent.presenceCli) {
|
|
139
|
+
try {
|
|
140
|
+
execSync(
|
|
141
|
+
process.platform === 'win32' ? `where ${agent.presenceCli}` : `which ${agent.presenceCli}`,
|
|
142
|
+
{ stdio: 'pipe' },
|
|
143
|
+
);
|
|
144
|
+
return true;
|
|
145
|
+
} catch { /* not found */ }
|
|
146
|
+
}
|
|
147
|
+
// 2. Dir check
|
|
148
|
+
if (agent.presenceDirs?.some(d => fs.existsSync(expandHome(d)))) return true;
|
|
149
|
+
return false;
|
|
150
|
+
}
|
|
@@ -8,14 +8,14 @@ import { manifest as backlinks } from '@/components/renderers/backlinks/manifest
|
|
|
8
8
|
import { manifest as config } from '@/components/renderers/config/manifest';
|
|
9
9
|
import { manifest as csv } from '@/components/renderers/csv/manifest';
|
|
10
10
|
import { manifest as diff } from '@/components/renderers/diff/manifest';
|
|
11
|
-
import { manifest as graph } from '@/components/renderers/graph/manifest';
|
|
12
11
|
import { manifest as summary } from '@/components/renderers/summary/manifest';
|
|
13
12
|
import { manifest as timeline } from '@/components/renderers/timeline/manifest';
|
|
14
13
|
import { manifest as todo } from '@/components/renderers/todo/manifest';
|
|
15
14
|
import { manifest as workflow } from '@/components/renderers/workflow/manifest';
|
|
15
|
+
import { manifest as graph } from '@/components/renderers/graph/manifest';
|
|
16
16
|
|
|
17
17
|
const manifests = [
|
|
18
|
-
agentInspector, backlinks, config, csv, diff,
|
|
18
|
+
agentInspector, backlinks, config, csv, diff, summary, timeline, todo, workflow, graph,
|
|
19
19
|
];
|
|
20
20
|
|
|
21
21
|
for (const m of manifests) {
|