@uni-helper/mcp 0.0.1 → 0.0.2-beta.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 +2 -4
- package/dist/index.mjs +1 -1
- package/package.json +15 -20
- package/scripts/download-model.cjs +22 -0
package/README.md
CHANGED
|
@@ -11,13 +11,11 @@ pnpm add @uni-helper/mcp -D
|
|
|
11
11
|
在 `vite.config.ts` 中添加如下配置:
|
|
12
12
|
|
|
13
13
|
```ts
|
|
14
|
-
import { defineConfig } from 'vite'
|
|
15
|
-
import uni from '@dcloudio/vite-plugin-uni'
|
|
16
14
|
import mcp from '@uni-helper/mcp'
|
|
15
|
+
import uni from '@uni-helper/plugin-uni'
|
|
16
|
+
import { defineConfig } from 'vite'
|
|
17
17
|
|
|
18
18
|
export default defineConfig({
|
|
19
19
|
plugins: [uni(), mcp()],
|
|
20
20
|
})
|
|
21
21
|
```
|
|
22
|
-
|
|
23
|
-
|
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uni-helper/mcp",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.1",
|
|
5
|
-
"packageManager": "pnpm@10.6.2",
|
|
4
|
+
"version": "0.0.2-beta.1",
|
|
6
5
|
"description": "mcp - uniapp也得有ai开发体验",
|
|
7
6
|
"author": "FliPPeDround <flippedround@qq.com>",
|
|
8
7
|
"license": "MIT",
|
|
9
|
-
"publishConfig": {
|
|
10
|
-
"access": "public"
|
|
11
|
-
},
|
|
12
8
|
"funding": "https://afdian.com/a/flippedround",
|
|
13
9
|
"homepage": "https://github.com/uni-helper/mcp#readme",
|
|
14
10
|
"repository": {
|
|
@@ -35,22 +31,9 @@
|
|
|
35
31
|
"types": "./dist/index.d.mts",
|
|
36
32
|
"files": [
|
|
37
33
|
"dist",
|
|
34
|
+
"scripts",
|
|
38
35
|
"vectorStore"
|
|
39
36
|
],
|
|
40
|
-
"scripts": {
|
|
41
|
-
"build": "tsdown",
|
|
42
|
-
"dev": "tsdown --watch ./src",
|
|
43
|
-
"lint": "eslint",
|
|
44
|
-
"task": "tsx ./tasks/uniappDocs/index.ts",
|
|
45
|
-
"play": "cd playground && pnpm dev",
|
|
46
|
-
"lint:fix": "eslint --fix",
|
|
47
|
-
"inspect": "mcp-inspector",
|
|
48
|
-
"prepublishOnly": "pnpm build",
|
|
49
|
-
"release": "bumpp",
|
|
50
|
-
"test": "vitest",
|
|
51
|
-
"prepare": "simple-git-hooks",
|
|
52
|
-
"postinstall": "node scripts/download-model.cjs"
|
|
53
|
-
},
|
|
54
37
|
"peerDependencies": {
|
|
55
38
|
"uniapp": "*",
|
|
56
39
|
"vite": ">=3.1.0"
|
|
@@ -102,5 +85,17 @@
|
|
|
102
85
|
},
|
|
103
86
|
"lint-staged": {
|
|
104
87
|
"*": "eslint --fix"
|
|
88
|
+
},
|
|
89
|
+
"scripts": {
|
|
90
|
+
"build": "tsdown",
|
|
91
|
+
"dev": "tsdown --watch ./src",
|
|
92
|
+
"lint": "eslint",
|
|
93
|
+
"task": "tsx ./tasks/uniappDocs/index.ts",
|
|
94
|
+
"play": "cd playground && pnpm dev",
|
|
95
|
+
"lint:fix": "eslint --fix",
|
|
96
|
+
"inspect": "mcp-inspector",
|
|
97
|
+
"release": "bumpp",
|
|
98
|
+
"test": "vitest",
|
|
99
|
+
"postinstall": "node scripts/download-model.cjs"
|
|
105
100
|
}
|
|
106
|
-
}
|
|
101
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const process = require('node:process')
|
|
2
|
+
const { env } = require('@huggingface/transformers')
|
|
3
|
+
const { HuggingFaceTransformersEmbeddings } = require('@langchain/community/embeddings/huggingface_transformers')
|
|
4
|
+
|
|
5
|
+
async function downloadModel() {
|
|
6
|
+
env.remoteHost = 'https://hf-mirror.com'
|
|
7
|
+
|
|
8
|
+
const embeddings = new HuggingFaceTransformersEmbeddings({
|
|
9
|
+
model: 'onnx-community/Qwen3-Embedding-0.6B-ONNX',
|
|
10
|
+
pretrainedOptions: {
|
|
11
|
+
dtype: 'int8',
|
|
12
|
+
device: 'cpu',
|
|
13
|
+
},
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
await embeddings.embedQuery('warmup')
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
downloadModel().catch((err) => {
|
|
20
|
+
console.error(err)
|
|
21
|
+
process.exit(1)
|
|
22
|
+
})
|