@mebular/mcp 0.0.0-stage → 0.1.0
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/bin/mebular.mjs +1133 -0
- package/package.json +30 -4
- package/scripts/publish-manifest.mjs +44 -0
- package/src/admin.mjs +1320 -0
- package/src/apply-supervisor.mjs +48 -0
- package/src/build-sha.mjs +36 -0
- package/src/client.mjs +49 -0
- package/src/clients.mjs +1242 -0
- package/src/cloud-switch.mjs +258 -0
- package/src/config-apply.mjs +251 -0
- package/src/config-schema.mjs +690 -0
- package/src/config.mjs +265 -0
- package/src/fleet-events.mjs +207 -0
- package/src/home.mjs +16 -0
- package/src/jointoken.mjs +31 -0
- package/src/lan-host.mjs +36 -0
- package/src/profiles.mjs +681 -0
- package/src/provision.mjs +673 -0
- package/src/qr.mjs +4 -0
- package/src/runtime-file.mjs +91 -0
- package/src/serve.mjs +3478 -0
- package/src/server.mjs +416 -0
- package/src/service-control.mjs +107 -0
- package/src/service-facade.mjs +43 -0
- package/src/task-tools.mjs +45 -0
- package/src/tool-envelope.mjs +50 -0
- package/src/tools.mjs +397 -0
- package/README.md +0 -3
package/package.json
CHANGED
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mebular/mcp",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Mebular MCP server(stdio + Streamable HTTP):把 Mebular 记忆能力暴露给任意 MCP client",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"private": false,
|
|
7
|
+
"type": "module",
|
|
8
|
+
"bin": {
|
|
9
|
+
"mebular": "./bin/mebular.mjs"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"bin",
|
|
13
|
+
"src",
|
|
14
|
+
"scripts"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"prepack": "node ../../scripts/publish-manifest.mjs set",
|
|
18
|
+
"postpack": "node ../../scripts/publish-manifest.mjs restore"
|
|
19
|
+
},
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=20"
|
|
22
|
+
},
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@mebular/core": "^0.1.0",
|
|
28
|
+
"@modelcontextprotocol/server": "^2.3.1",
|
|
29
|
+
"zod": "^4.6.7",
|
|
30
|
+
"@mebular/fleet": "^0.1.0"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// G6.5 / D41:發布期改寫 @mebular/core 依賴。
|
|
3
|
+
//
|
|
4
|
+
// 開發期以 `file:../..` 本地連結(根包非 workspace 成員、本環境 npm 不支援 `workspace:`);
|
|
5
|
+
// `npm pack`/`npm publish` 的 prepack 階段改為 `^0.1.0`,postpack 還原。
|
|
6
|
+
//
|
|
7
|
+
// 用法:node scripts/publish-manifest.mjs set|restore
|
|
8
|
+
|
|
9
|
+
import { existsSync } from 'node:fs';
|
|
10
|
+
import { readFile, rename, writeFile } from 'node:fs/promises';
|
|
11
|
+
import { dirname, join } from 'node:path';
|
|
12
|
+
import { fileURLToPath } from 'node:url';
|
|
13
|
+
|
|
14
|
+
const pkgDir = join(dirname(fileURLToPath(import.meta.url)), '..');
|
|
15
|
+
const pkgFile = join(pkgDir, 'package.json');
|
|
16
|
+
const backupFile = `${pkgFile}.packbak`;
|
|
17
|
+
const PUBLISH_RANGE = '^0.1.0';
|
|
18
|
+
|
|
19
|
+
const action = process.argv[2];
|
|
20
|
+
|
|
21
|
+
async function writeJson(file, data) {
|
|
22
|
+
await writeFile(file, `${JSON.stringify(data, null, 2)}\n`, 'utf-8');
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (action === 'set') {
|
|
26
|
+
const original = await readFile(pkgFile, 'utf-8');
|
|
27
|
+
if (!existsSync(backupFile)) await writeFile(backupFile, original, 'utf-8');
|
|
28
|
+
const pkg = JSON.parse(original);
|
|
29
|
+
pkg.dependencies = pkg.dependencies ?? {};
|
|
30
|
+
// F-UNI:統一入口复用 fleet 的任務 handler/令牌原語 → 發布時一併宣告
|
|
31
|
+
for (const dep of ['@mebular/core', '@mebular/fleet']) {
|
|
32
|
+
if (pkg.dependencies[dep] !== undefined) pkg.dependencies[dep] = PUBLISH_RANGE;
|
|
33
|
+
}
|
|
34
|
+
await writeJson(pkgFile, pkg);
|
|
35
|
+
console.error(`[publish-manifest] @mebular/{core,fleet} -> ${PUBLISH_RANGE}(備份 ${backupFile})`);
|
|
36
|
+
} else if (action === 'restore') {
|
|
37
|
+
if (existsSync(backupFile)) {
|
|
38
|
+
await rename(backupFile, pkgFile);
|
|
39
|
+
console.error('[publish-manifest] 已還原本地 file: 依賴');
|
|
40
|
+
}
|
|
41
|
+
} else {
|
|
42
|
+
console.error('用法:node scripts/publish-manifest.mjs set|restore');
|
|
43
|
+
process.exit(2);
|
|
44
|
+
}
|