@aocoding/acw-tools-go 1.0.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/README.md +47 -0
- package/bin/run.js +75 -0
- package/index.js +11 -0
- package/manifest.json +22 -0
- package/package.json +42 -0
package/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# @bangdao-ai/acw-tools-go
|
|
2
|
+
|
|
3
|
+
ACW MCP 工具集 - Go 语言实现版本
|
|
4
|
+
|
|
5
|
+
## 特性
|
|
6
|
+
|
|
7
|
+
- 🚀 **无原生依赖** - 不需要 C++ 编译工具链
|
|
8
|
+
- 🌍 **跨平台** - 支持 macOS、Linux、Windows
|
|
9
|
+
- ⚡ **快速启动** - 预编译二进制,无需等待
|
|
10
|
+
- 🔧 **低版本兼容** - 仅需 Node.js 14+
|
|
11
|
+
|
|
12
|
+
## 安装
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install -g @bangdao-ai/acw-tools-go
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Cursor 配置
|
|
19
|
+
|
|
20
|
+
```json
|
|
21
|
+
{
|
|
22
|
+
"mcpServers": {
|
|
23
|
+
"acw-tools": {
|
|
24
|
+
"command": "npx",
|
|
25
|
+
"args": ["-y", "@bangdao-ai/acw-tools-go@latest"],
|
|
26
|
+
"env": {
|
|
27
|
+
"ACW_BASE_URL": "https://acw.bangdao-tech.com",
|
|
28
|
+
"ACW_TOKEN": "your-token-here"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## 可用工具
|
|
36
|
+
|
|
37
|
+
- `download_rule` - 下载 ACW 规则
|
|
38
|
+
- `list_rules` - 列出可用规则
|
|
39
|
+
- `init_common_admin` - 初始化模板项目
|
|
40
|
+
- `get_system_info` - 获取系统信息
|
|
41
|
+
- `get_recent_conversations` - 获取 Cursor 对话
|
|
42
|
+
- `search_conversations` - 搜索对话记录
|
|
43
|
+
- `check_cursor_db` - 检查数据库状态
|
|
44
|
+
|
|
45
|
+
## 许可证
|
|
46
|
+
|
|
47
|
+
MIT
|
package/bin/run.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* npm 包入口脚本
|
|
5
|
+
* 启动对应平台的 Go 二进制文件
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const { spawn } = require('child_process');
|
|
9
|
+
const path = require('path');
|
|
10
|
+
const fs = require('fs');
|
|
11
|
+
|
|
12
|
+
// 平台映射
|
|
13
|
+
const PLATFORM_MAP = {
|
|
14
|
+
darwin: 'darwin',
|
|
15
|
+
win32: 'windows',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const ARCH_MAP = {
|
|
19
|
+
x64: 'amd64',
|
|
20
|
+
arm64: 'arm64',
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// 获取二进制文件路径
|
|
24
|
+
function getBinaryPath() {
|
|
25
|
+
const platform = PLATFORM_MAP[process.platform];
|
|
26
|
+
const arch = ARCH_MAP[process.arch];
|
|
27
|
+
const ext = process.platform === 'win32' ? '.exe' : '';
|
|
28
|
+
|
|
29
|
+
if (!platform || !arch) {
|
|
30
|
+
console.error(`不支持的平台: ${process.platform}-${process.arch}`);
|
|
31
|
+
console.error('支持的平台: darwin-x64, darwin-arm64, win32-x64');
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// 查找顺序:平台特定文件 -> 通用文件
|
|
36
|
+
const candidates = [
|
|
37
|
+
path.join(__dirname, `acw-tools-${platform}-${arch}${ext}`),
|
|
38
|
+
path.join(__dirname, `acw-tools${ext}`),
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
for (const candidate of candidates) {
|
|
42
|
+
if (fs.existsSync(candidate)) {
|
|
43
|
+
return candidate;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function main() {
|
|
51
|
+
const binaryPath = getBinaryPath();
|
|
52
|
+
|
|
53
|
+
if (!binaryPath) {
|
|
54
|
+
console.error('错误: ACW Tools 二进制文件未找到');
|
|
55
|
+
console.error('请重新安装: npm install @bangdao-ai/acw-tools-go');
|
|
56
|
+
process.exit(1);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// 启动二进制文件
|
|
60
|
+
const child = spawn(binaryPath, process.argv.slice(2), {
|
|
61
|
+
stdio: 'inherit',
|
|
62
|
+
env: process.env,
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
child.on('error', (err) => {
|
|
66
|
+
console.error('启动失败:', err.message);
|
|
67
|
+
process.exit(1);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
child.on('exit', (code) => {
|
|
71
|
+
process.exit(code || 0);
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
main();
|
package/index.js
ADDED
package/manifest.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ACW工具集 (Go版)",
|
|
3
|
+
"description": "ACW平台工具集 Go 实现:无需 Node.js 原生依赖,支持跨平台",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"author": "邦道科技 - 产品技术中心",
|
|
6
|
+
"homepage": "https://www.npmjs.com/package/@bangdao-ai/acw-tools-go",
|
|
7
|
+
"repository": "https://github.com/bangdao-ai/acw-tools-go",
|
|
8
|
+
"capabilities": [
|
|
9
|
+
"download_rule",
|
|
10
|
+
"list_rules",
|
|
11
|
+
"init_common_admin",
|
|
12
|
+
"get_system_info",
|
|
13
|
+
"get_recent_conversations",
|
|
14
|
+
"search_conversations",
|
|
15
|
+
"check_cursor_db"
|
|
16
|
+
],
|
|
17
|
+
"entry_point": {
|
|
18
|
+
"command": "acw-tools",
|
|
19
|
+
"args": [],
|
|
20
|
+
"stdio": true
|
|
21
|
+
}
|
|
22
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aocoding/acw-tools-go",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "ACW MCP 工具集 (Go 实现) - 无需 Node.js 原生依赖,跨平台支持",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"acw-tools": "bin/run.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {},
|
|
10
|
+
"keywords": [
|
|
11
|
+
"mcp",
|
|
12
|
+
"model-context-protocol",
|
|
13
|
+
"acw",
|
|
14
|
+
"cursor",
|
|
15
|
+
"ai",
|
|
16
|
+
"go"
|
|
17
|
+
],
|
|
18
|
+
"author": "bangdao-ai",
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/bangdao-ai/acw-tools-go.git"
|
|
23
|
+
},
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">=14.0.0"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"index.js",
|
|
29
|
+
"bin/run.js",
|
|
30
|
+
"bin/acw-tools-*",
|
|
31
|
+
"manifest.json",
|
|
32
|
+
"README.md"
|
|
33
|
+
],
|
|
34
|
+
"os": [
|
|
35
|
+
"darwin",
|
|
36
|
+
"win32"
|
|
37
|
+
],
|
|
38
|
+
"cpu": [
|
|
39
|
+
"x64",
|
|
40
|
+
"arm64"
|
|
41
|
+
]
|
|
42
|
+
}
|