@geminilight/mindos 0.5.1 → 0.5.3

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/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
+ }
@@ -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
  }
package/bin/cli.js CHANGED
@@ -550,7 +550,9 @@ ${dim('Shortcut: mindos start --daemon → install + start in one step')}
550
550
  await runGatewayCommand('stop');
551
551
  await runGatewayCommand('install');
552
552
  await runGatewayCommand('start');
553
- const webPort = process.env.MINDOS_WEB_PORT || '3000';
553
+ const webPort = (() => {
554
+ try { return JSON.parse(readFileSync(CONFIG_PATH, 'utf-8')).port ?? 3000; } catch { return 3000; }
555
+ })();
554
556
  console.log(dim(' (Waiting for Web UI to come back up...)'));
555
557
  const ready = await waitForHttp(Number(webPort), { retries: 120, intervalMs: 2000, label: 'Web UI' });
556
558
  if (ready) {
@@ -31,7 +31,7 @@ export async function waitForHttp(port, { retries = 120, intervalMs = 2000, labe
31
31
  try {
32
32
  const { request } = await import('node:http');
33
33
  const ok = await new Promise((resolve) => {
34
- const req = request({ hostname: '127.0.0.1', port, path: '/', method: 'HEAD', timeout: 1500 },
34
+ const req = request({ hostname: '127.0.0.1', port, path: '/api/health', method: 'GET', timeout: 1500 },
35
35
  (res) => { res.resume(); resolve(res.statusCode < 500); });
36
36
  req.on('error', () => resolve(false));
37
37
  req.on('timeout', () => { req.destroy(); resolve(false); });
@@ -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
+ };
@@ -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 const MCP_AGENTS = {
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geminilight/mindos",
3
- "version": "0.5.1",
3
+ "version": "0.5.3",
4
4
  "description": "MindOS — Human-Agent Collaborative Mind System. Local-first knowledge base that syncs your mind to all AI Agents via MCP.",
5
5
  "keywords": [
6
6
  "mindos",