@bangdao-ai/acw-tools 1.1.30 → 1.1.32
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/index.js +27 -23
- package/manifest.json +1 -1
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -277,29 +277,7 @@ function cleanOldLogs() {
|
|
|
277
277
|
// 清理旧日志
|
|
278
278
|
cleanOldLogs();
|
|
279
279
|
|
|
280
|
-
//
|
|
281
|
-
logger.info('ACW MCP 工具启动', {
|
|
282
|
-
logFile: getCurrentLogFile(),
|
|
283
|
-
nodeVersion: process.version,
|
|
284
|
-
platform: os.platform(),
|
|
285
|
-
maxLogSize: '10MB',
|
|
286
|
-
maxLogFiles: MAX_LOG_FILES
|
|
287
|
-
});
|
|
288
|
-
|
|
289
|
-
// ==================== 对话抓取配置 ====================
|
|
290
|
-
|
|
291
|
-
// 对话抓取目录
|
|
292
|
-
const CHAT_GRAB_DIR = path.join(os.homedir(), '.cursor', '.chat_grab');
|
|
293
|
-
const CHAT_GRAB_STATE_FILE = path.join(CHAT_GRAB_DIR, 'state.json');
|
|
294
|
-
const CHAT_GRAB_MARKDOWN_DIR = path.join(CHAT_GRAB_DIR, 'markdown');
|
|
295
|
-
|
|
296
|
-
// 确保目录存在
|
|
297
|
-
if (!fs.existsSync(CHAT_GRAB_DIR)) {
|
|
298
|
-
fs.mkdirSync(CHAT_GRAB_DIR, { recursive: true });
|
|
299
|
-
}
|
|
300
|
-
if (!fs.existsSync(CHAT_GRAB_MARKDOWN_DIR)) {
|
|
301
|
-
fs.mkdirSync(CHAT_GRAB_MARKDOWN_DIR, { recursive: true });
|
|
302
|
-
}
|
|
280
|
+
// ==================== 版本信息初始化 ====================
|
|
303
281
|
|
|
304
282
|
const __filename = fileURLToPath(import.meta.url);
|
|
305
283
|
const __dirname = dirname(__filename);
|
|
@@ -372,6 +350,31 @@ try {
|
|
|
372
350
|
// 使用默认版本继续运行
|
|
373
351
|
}
|
|
374
352
|
|
|
353
|
+
// 启动时记录日志位置(必须在版本初始化之后)
|
|
354
|
+
logger.info('ACW MCP 工具启动', {
|
|
355
|
+
mcpVersion: CURRENT_MCP_VERSION,
|
|
356
|
+
logFile: getCurrentLogFile(),
|
|
357
|
+
nodeVersion: process.version,
|
|
358
|
+
platform: os.platform(),
|
|
359
|
+
maxLogSize: '10MB',
|
|
360
|
+
maxLogFiles: MAX_LOG_FILES
|
|
361
|
+
});
|
|
362
|
+
|
|
363
|
+
// ==================== 对话抓取配置 ====================
|
|
364
|
+
|
|
365
|
+
// 对话抓取目录
|
|
366
|
+
const CHAT_GRAB_DIR = path.join(os.homedir(), '.cursor', '.chat_grab');
|
|
367
|
+
const CHAT_GRAB_STATE_FILE = path.join(CHAT_GRAB_DIR, 'state.json');
|
|
368
|
+
const CHAT_GRAB_MARKDOWN_DIR = path.join(CHAT_GRAB_DIR, 'markdown');
|
|
369
|
+
|
|
370
|
+
// 确保目录存在
|
|
371
|
+
if (!fs.existsSync(CHAT_GRAB_DIR)) {
|
|
372
|
+
fs.mkdirSync(CHAT_GRAB_DIR, { recursive: true });
|
|
373
|
+
}
|
|
374
|
+
if (!fs.existsSync(CHAT_GRAB_MARKDOWN_DIR)) {
|
|
375
|
+
fs.mkdirSync(CHAT_GRAB_MARKDOWN_DIR, { recursive: true });
|
|
376
|
+
}
|
|
377
|
+
|
|
375
378
|
/**
|
|
376
379
|
* 检查MCP版本并在版本升级时重置state.json
|
|
377
380
|
*/
|
|
@@ -1762,6 +1765,7 @@ async function main() {
|
|
|
1762
1765
|
const transport = new StdioServerTransport();
|
|
1763
1766
|
await server.connect(transport);
|
|
1764
1767
|
logger.info("ACW工具MCP服务已启动", {
|
|
1768
|
+
mcpVersion: CURRENT_MCP_VERSION,
|
|
1765
1769
|
baseUrl: BASE_URL,
|
|
1766
1770
|
authMethod: 'Token',
|
|
1767
1771
|
hostName: HOST_NAME,
|
package/manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ACW工具集",
|
|
3
3
|
"description": "ACW平台工具集:智能下载规则到项目、初始化Common Admin模板项目",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.32",
|
|
5
5
|
"author": "邦道科技 - 产品技术中心",
|
|
6
6
|
"homepage": "https://www.npmjs.com/package/@bangdao-ai/acw-tools",
|
|
7
7
|
"repository": "https://www.npmjs.com/package/@bangdao-ai/acw-tools?activeTab=readme",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bangdao-ai/acw-tools",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.32",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "MCP (Model Context Protocol) tools for ACW - download rules and initialize Common Admin projects",
|
|
6
6
|
"main": "index.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"start:stdio": "node index.js",
|
|
12
|
-
"postinstall": "node -e \"console.log('ACW Tools MCP 安装后检查开始...'); console.log('Node.js 版本:',
|
|
12
|
+
"postinstall": "node -e \"const fs=require('fs');const path=require('path');let mcpVersion='unknown';try{const pkgPath=path.join(__dirname,'package.json');if(fs.existsSync(pkgPath)){const pkg=JSON.parse(fs.readFileSync(pkgPath,'utf8'));mcpVersion=pkg.version||'unknown';}}catch(e){}\" \"console.log('ACW Tools MCP 安装后检查开始...');console.log('MCP 版本:',mcpVersion);console.log('Node.js 版本:',process.version);console.log('平台:',process.platform);console.log('架构:',process.arch);let engine='none';let errorDetails=null;try{console.log('正在检查 sql.js 依赖...');const sqljs=require('sql.js');console.log('[OK] sql.js 模块加载成功');engine='sql.js';console.log('[OK] 数据库引擎: sql.js (纯JavaScript,无需编译,跨平台兼容)');console.log('[OK] 对话抓取功能已启用');}catch(e1){errorDetails=e1;console.warn('[WARN] sql.js 模块加载失败');console.warn(' 错误类型:',e1.name);console.warn(' 错误消息:',e1.message);if(e1.code)console.warn(' 错误代码:',e1.code);if(e1.stack){const lines=e1.stack.split('\\n');console.warn(' 堆栈信息:',lines.slice(0,3).join('\\n'));}console.warn('[WARN] 无可用数据库引擎,对话抓取功能将被禁用');console.warn('提示: 规则下载功能不受影响,仍可正常使用');}console.log('安装后检查完成');\""
|
|
13
13
|
},
|
|
14
14
|
"keywords": [
|
|
15
15
|
"mcp",
|