@geminilight/mindos 0.1.0 → 0.1.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/README.md +10 -10
- package/README_zh.md +10 -10
- package/app/next.config.ts +3 -0
- package/bin/cli.js +16 -16
- package/package.json +13 -3
- package/scripts/setup.js +10 -4
package/README.md
CHANGED
|
@@ -132,14 +132,13 @@ The setup wizard will guide you through:
|
|
|
132
132
|
4. Configure AI Provider (Anthropic / OpenAI) + API Key — or choose **skip** to configure later via `mindos config set`
|
|
133
133
|
5. Config saved to `~/.mindos/config.json` automatically
|
|
134
134
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
> Or skip the wizard and edit `~/.mindos/config.json` manually (see Config Reference below).
|
|
135
|
+
<!-- For Agents: Before running setup, if the user has not provided LLM configuration, ask them:
|
|
136
|
+
1. AI Provider — `anthropic` or `openai` (compatible)?
|
|
137
|
+
2. API Key — the key for the chosen provider
|
|
138
|
+
3. Custom Base URL? — only needed for proxies or OpenAI-compatible endpoints; skip if using official API
|
|
139
|
+
4. Model ID — or use the default
|
|
140
|
+
Or skip the wizard and edit `~/.mindos/config.json` manually (see Config Reference below).
|
|
141
|
+
-->
|
|
143
142
|
|
|
144
143
|
<details>
|
|
145
144
|
<summary>Config Reference (~/.mindos/config.json)</summary>
|
|
@@ -191,7 +190,7 @@ mindos start # start app + MCP server (production, auto-rebuilds when a new v
|
|
|
191
190
|
On startup, MindOS prints your Web UI URL, MCP config snippet, and auth token — ready to copy into your Agent.
|
|
192
191
|
|
|
193
192
|
> [!TIP]
|
|
194
|
-
> **Upgrading?** Run `mindos update`
|
|
193
|
+
> **Upgrading?** Run `mindos update` to install the latest version.
|
|
195
194
|
|
|
196
195
|
> [!TIP]
|
|
197
196
|
> If the port is already in use, set a different port during `mindos onboard` or update `~/.mindos/config.json`:
|
|
@@ -213,8 +212,9 @@ On startup, MindOS prints your Web UI URL, MCP config snippet, and auth token
|
|
|
213
212
|
|
|
214
213
|
#### 5.1 Configure MindOS MCP
|
|
215
214
|
|
|
215
|
+
<!-- For Agents: Register MindOS MCP as global (user-level) config by default, so all projects share the same knowledge base. -->
|
|
216
|
+
|
|
216
217
|
> [!TIP]
|
|
217
|
-
> **For Agents:** Register MindOS MCP as global (user-level) config by default, so all projects share the same knowledge base.
|
|
218
218
|
> Each Agent stores MCP config in a different file — see the **MCP Config Path** column in the [Supported Agents](#-supported-agents) table below for exact paths.
|
|
219
219
|
|
|
220
220
|
Register the MindOS MCP Server in your Agent client:
|
package/README_zh.md
CHANGED
|
@@ -132,14 +132,13 @@ mindos onboard --install-daemon # 初始化 + 安装并启动后台服务
|
|
|
132
132
|
4. 配置 AI Provider(Anthropic / OpenAI)+ API Key — 或选择 **skip**,稍后通过 `mindos config set` 补填
|
|
133
133
|
5. 配置自动保存到 `~/.mindos/config.json`
|
|
134
134
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
> 或跳过向导,手动编辑 `~/.mindos/config.json`(参考下方配置参考)。
|
|
135
|
+
<!-- For Agents: 运行 onboard 前,如果用户未提供 LLM 配置,请询问:
|
|
136
|
+
1. AI Provider — `anthropic` 还是 `openai`(兼容)?
|
|
137
|
+
2. API Key — 对应 Provider 的密钥
|
|
138
|
+
3. 自定义 Base URL?— 仅代理或 OpenAI 兼容端点需要;使用官方 API 则跳过
|
|
139
|
+
4. Model ID — 或使用默认值
|
|
140
|
+
或跳过向导,手动编辑 `~/.mindos/config.json`(参考下方配置参考)。
|
|
141
|
+
-->
|
|
143
142
|
|
|
144
143
|
<details>
|
|
145
144
|
<summary>配置参考(~/.mindos/config.json)</summary>
|
|
@@ -191,7 +190,7 @@ mindos start # 启动 app + MCP 服务(生产模式,检测到新版本时
|
|
|
191
190
|
启动后,MindOS 会自动打印 Web UI 地址、MCP 配置片段和 Auth token,直接复制到你的 Agent 即可。
|
|
192
191
|
|
|
193
192
|
> [!TIP]
|
|
194
|
-
> **升级?** 运行 `mindos update`
|
|
193
|
+
> **升级?** 运行 `mindos update` 安装最新版本。
|
|
195
194
|
|
|
196
195
|
> [!TIP]
|
|
197
196
|
> 如果端口被占用,在 `mindos onboard` 时指定其他端口,或更新 `~/.mindos/config.json`,也可通过环境变量临时覆盖:
|
|
@@ -213,8 +212,9 @@ mindos start # 启动 app + MCP 服务(生产模式,检测到新版本时
|
|
|
213
212
|
|
|
214
213
|
#### 5.1 配置 MindOS MCP
|
|
215
214
|
|
|
215
|
+
<!-- For Agents: MindOS MCP 默认注册为全局(user-level)配置,使所有项目共享同一知识库。-->
|
|
216
|
+
|
|
216
217
|
> [!TIP]
|
|
217
|
-
> **For Agents:** MindOS MCP 默认注册为全局(user-level)配置,使所有项目共享同一知识库。
|
|
218
218
|
> 每个 Agent 的 MCP 配置文件路径不同——详见下方 [支持的 Agent](#-支持的-agent) 表格中的 **MCP 配置文件路径** 列。
|
|
219
219
|
|
|
220
220
|
将 MindOS MCP Server 注册到你的 Agent 客户端:
|
package/app/next.config.ts
CHANGED
|
@@ -5,6 +5,9 @@ const nextConfig: NextConfig = {
|
|
|
5
5
|
transpilePackages: ['github-slugger'],
|
|
6
6
|
serverExternalPackages: ['pdfjs-dist', 'pdf-parse'],
|
|
7
7
|
outputFileTracingRoot: path.join(__dirname),
|
|
8
|
+
turbopack: {
|
|
9
|
+
root: path.join(__dirname),
|
|
10
|
+
},
|
|
8
11
|
};
|
|
9
12
|
|
|
10
13
|
export default nextConfig;
|
package/bin/cli.js
CHANGED
|
@@ -119,6 +119,13 @@ function writeBuildStamp() {
|
|
|
119
119
|
writeFileSync(BUILD_STAMP, version, 'utf-8');
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
+
function clearBuildLock() {
|
|
123
|
+
const lockFile = resolve(ROOT, 'app', '.next', 'lock');
|
|
124
|
+
if (existsSync(lockFile)) {
|
|
125
|
+
rmSync(lockFile, { force: true });
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
122
129
|
// ── Port check ────────────────────────────────────────────────────────────────
|
|
123
130
|
|
|
124
131
|
function isPortInUse(port) {
|
|
@@ -443,21 +450,8 @@ const extra = process.argv.slice(3).filter(a => a !== '--daemon' && a !== '-
|
|
|
443
450
|
const commands = {
|
|
444
451
|
// ── onboard ────────────────────────────────────────────────────────────────
|
|
445
452
|
onboard: async () => {
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
const platform = getPlatform();
|
|
449
|
-
if (!platform) {
|
|
450
|
-
console.warn(yellow('Warning: daemon mode not supported on this platform. Skipping service install.'));
|
|
451
|
-
return;
|
|
452
|
-
}
|
|
453
|
-
console.log(cyan(`\nInstalling MindOS as a background service (${platform})...`));
|
|
454
|
-
await runGatewayCommand('install');
|
|
455
|
-
await runGatewayCommand('start');
|
|
456
|
-
console.log(`\n${green('✔ MindOS is running as a background service')}`);
|
|
457
|
-
console.log(dim(' View logs: mindos logs'));
|
|
458
|
-
console.log(dim(' Stop: mindos gateway stop'));
|
|
459
|
-
console.log(dim(' Uninstall: mindos gateway uninstall\n'));
|
|
460
|
-
}
|
|
453
|
+
const daemonFlag = process.argv.includes('--install-daemon') ? ' --install-daemon' : '';
|
|
454
|
+
run(`node ${resolve(ROOT, 'scripts/setup.js')}${daemonFlag}`);
|
|
461
455
|
},
|
|
462
456
|
init: () => run(`node ${resolve(ROOT, 'scripts/setup.js')}`),
|
|
463
457
|
setup: () => run(`node ${resolve(ROOT, 'scripts/setup.js')}`),
|
|
@@ -501,10 +495,14 @@ const commands = {
|
|
|
501
495
|
if (!platform) {
|
|
502
496
|
console.warn(yellow('Warning: daemon mode not supported on this platform. Falling back to foreground.'));
|
|
503
497
|
} else {
|
|
498
|
+
loadConfig();
|
|
499
|
+
const webPort = process.env.MINDOS_WEB_PORT || '3000';
|
|
500
|
+
const mcpPort = process.env.MINDOS_MCP_PORT || '8787';
|
|
504
501
|
console.log(cyan(`Installing MindOS as a background service (${platform})...`));
|
|
505
502
|
await runGatewayCommand('install');
|
|
506
503
|
await runGatewayCommand('start');
|
|
507
|
-
|
|
504
|
+
printStartupInfo(webPort, mcpPort);
|
|
505
|
+
console.log(`${green('✔ MindOS is running as a background service')}`);
|
|
508
506
|
console.log(dim(' View logs: mindos logs'));
|
|
509
507
|
console.log(dim(' Stop: mindos gateway stop'));
|
|
510
508
|
console.log(dim(' Uninstall: mindos gateway uninstall\n'));
|
|
@@ -518,6 +516,7 @@ const commands = {
|
|
|
518
516
|
await assertPortFree(Number(mcpPort), 'mcp');
|
|
519
517
|
if (needsBuild()) {
|
|
520
518
|
console.log(yellow('Building MindOS (first run or new version detected)...\n'));
|
|
519
|
+
clearBuildLock();
|
|
521
520
|
run('npx next build', resolve(ROOT, 'app'));
|
|
522
521
|
writeBuildStamp();
|
|
523
522
|
}
|
|
@@ -530,6 +529,7 @@ const commands = {
|
|
|
530
529
|
|
|
531
530
|
// ── build ──────────────────────────────────────────────────────────────────
|
|
532
531
|
build: () => {
|
|
532
|
+
clearBuildLock();
|
|
533
533
|
run(`npx next build ${extra}`, resolve(ROOT, 'app'));
|
|
534
534
|
writeBuildStamp();
|
|
535
535
|
},
|
package/package.json
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geminilight/mindos",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "MindOS — Human-Agent Collaborative Mind System. Local-first knowledge base that syncs your mind to all AI Agents via MCP.",
|
|
5
|
-
"keywords": [
|
|
5
|
+
"keywords": [
|
|
6
|
+
"mindos",
|
|
7
|
+
"mcp",
|
|
8
|
+
"knowledge-base",
|
|
9
|
+
"ai-agent",
|
|
10
|
+
"local-first",
|
|
11
|
+
"second-brain"
|
|
12
|
+
],
|
|
6
13
|
"type": "module",
|
|
7
14
|
"license": "MIT",
|
|
8
15
|
"author": "GeminiLight",
|
|
@@ -13,7 +20,10 @@
|
|
|
13
20
|
"bin": {
|
|
14
21
|
"mindos": "bin/cli.js"
|
|
15
22
|
},
|
|
16
|
-
"workspaces": [
|
|
23
|
+
"workspaces": [
|
|
24
|
+
"app",
|
|
25
|
+
"mcp"
|
|
26
|
+
],
|
|
17
27
|
"files": [
|
|
18
28
|
"app/",
|
|
19
29
|
"mcp/",
|
package/scripts/setup.js
CHANGED
|
@@ -642,7 +642,8 @@ async function main() {
|
|
|
642
642
|
writeFileSync(CONFIG_PATH, JSON.stringify(config, null, 2) + '\n');
|
|
643
643
|
console.log(`\n${c.green(t('cfgSaved'))}: ${c.dim(CONFIG_PATH)}`);
|
|
644
644
|
|
|
645
|
-
|
|
645
|
+
const installDaemon = process.argv.includes('--install-daemon');
|
|
646
|
+
finish(mindDir, config.startMode, config.mcpPort, config.authToken, installDaemon);
|
|
646
647
|
}
|
|
647
648
|
|
|
648
649
|
function getLocalIP() {
|
|
@@ -654,8 +655,8 @@ function getLocalIP() {
|
|
|
654
655
|
return null;
|
|
655
656
|
}
|
|
656
657
|
|
|
657
|
-
async function finish(mindDir, startMode = 'start', mcpPort = 8787, authToken = '') {
|
|
658
|
-
const startCmd = startMode === 'dev' ? 'mindos dev' : 'mindos start';
|
|
658
|
+
async function finish(mindDir, startMode = 'start', mcpPort = 8787, authToken = '', installDaemon = false) {
|
|
659
|
+
const startCmd = installDaemon ? 'mindos start --daemon' : (startMode === 'dev' ? 'mindos dev' : 'mindos start');
|
|
659
660
|
const lines = T.nextSteps[uiLang](startCmd);
|
|
660
661
|
console.log('');
|
|
661
662
|
lines.forEach((l) => console.log(l));
|
|
@@ -664,7 +665,12 @@ async function finish(mindDir, startMode = 'start', mcpPort = 8787, authToken =
|
|
|
664
665
|
if (doStart) {
|
|
665
666
|
const { execSync } = await import('node:child_process');
|
|
666
667
|
const cliPath = resolve(__dirname, '../bin/cli.js');
|
|
667
|
-
|
|
668
|
+
if (installDaemon) {
|
|
669
|
+
// Install and start as background service — returns immediately
|
|
670
|
+
execSync(`node "${cliPath}" start --daemon`, { stdio: 'inherit' });
|
|
671
|
+
} else {
|
|
672
|
+
execSync(`node "${cliPath}" ${startMode}`, { stdio: 'inherit' });
|
|
673
|
+
}
|
|
668
674
|
}
|
|
669
675
|
}
|
|
670
676
|
|