@bangdao-ai/acw-tools 1.13.49 → 1.13.50
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/chatGrabState.js +1 -1
- package/claudeCodeParser.js +1 -1
- package/codexParser.js +1 -1
- package/codexRepair.js +1 -1
- package/cursorCliParser.js +1 -1
- package/cursorConversationParser.js +1 -1
- package/index.js +1 -1
- package/manifest.json +1 -1
- package/package.json +1 -1
- package/postinstall.js +1 -1
package/manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ACW工具集",
|
|
3
3
|
"description": "ACW平台工具集:智能下载规则/技能到项目、上传技能到Skills广场、搜索技能、检查技能更新、上传/下载/检索个人知识库",
|
|
4
|
-
"version": "1.13.
|
|
4
|
+
"version": "1.13.50",
|
|
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
package/postinstall.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
function _0x20da(){const _0x3bfdf5=['[步骤]\x20OSS\x20预编译\x20+\x20子进程校验:\x20成功','[提示]\x20【为什么会编译失败】better-sqlite3\x20含\x20C++\x20扩展(.node\x20文件)。常见原因:','better-sqlite3','[OK]\x20安装完成','close','slice','includes','3026EpOWsY','[INFO]\x20检测到原生模块加载异常,尝试从\x20OSS\x20拉取匹配当前\x20ABI\x20的预编译包...','[提示]\x20━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━','[ERROR]\x20better-sqlite3\x20模块加载失败,安装中止','[提示]\x20【你当前的情况】当前为\x20','────────────────────────────────────────────','未找到','[原因]\x20better-sqlite3\x20未安装到位(多为\x20optional\x20依赖下载或编译失败);在\x20Node\x20低于\x2022.5\x20且无内置\x20SQLite\x20时会导致本步失败。','toString',',未检测到可用的内置\x20node:sqlite(或运行时被禁用),因此走可选依赖\x20better-sqlite3。','warn','」执行\x20npm\x20rebuild\x20better-sqlite3','toFixed','54UcAaze','[INFO]\x20下载成功\x20(','MODULE_NOT_FOUND','utf8','\x20|\x20Node\x20','[INFO]\x20预编译包已安装,重新测试...','env','replace','127','[提示]\x20说明:检测通过但主版本号低于文档推荐的\x2022.5+,若日后升级\x20Node,请以实际是否仍含\x20node:sqlite\x20为准。','-node-v','。优先将\x20Node\x20升到\x2022.5+。否则\x20sudo\x20apt-get\x20install\x20build-essential\x20后\x20npm\x20install\x20-g\x20@bangdao-ai/acw-tools\x20重装。','split','acwInstallNote','catch','137','forEach','...',',映射\x20ABI=','我的\x20ACW\x20MCP\x20安装失败(better-sqlite3\x20/\x20原生模块),错误:','get','489531kSlXRR','[提示]\x20\x20\x20该版本起\x20Node\x20内置「node:sqlite」,安装时无需\x20better-sqlite3,Windows\x20上可避免出现「模块编译失败」。','length','cwd','1497555NBQRHW','[步骤]\x20OSS\x20预编译后子进程校验仍失败:\x20','━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━','statusCode','version','194190ShResl','dlopen','ACW\x20Tools\x20MCP\x20安装后检查...','[INFO]\x20尝试从\x20OSS\x20下载预编译包:\x20','string','stdout','platform','[提示]\x20','https','633088oFQvRb','[OK]\x20better-sqlite3\x20修复成功(OSS\x20预编译)','\x20\x201)\x20终端执行\x20node\x20-v\x20与\x20Cursor\x20调起\x20MCP\x20用的是否为同一\x20Node;','join','exit','ERR_MODULE_NOT_FOUND','[提示]\x20\x20\x20·\x20Windows:未安装\x20Visual\x20Studio\x20Build\x20Tools(缺\x20cl.exe),node-gyp\x20无法编译;','basename','──────────\x20给用户的说明(安装失败)──────────','[WARN]\x20OSS\x20预编译包下载或解压失败:\x20','[INFO]\x20better-sqlite3\x20原生加载失败:\x20','40IifDyW','arch','[WARN]\x20无法确定\x20npm\x20包根目录,跳过\x20npm\x20rebuild','startsWith','package.json','首错原文:\x20','。优先将\x20Node\x20升到\x2022.5+。否则\x20xcode-select\x20--install\x20后\x20npm\x20install\x20-g\x20@bangdao-ai/acw-tools\x20重装。',':memory:','log','\x20KB)','existsSync','ceil','error','versions','mkdirSync','1788290DkiqjW','better_sqlite3','[提示]\x20\x20\x20·\x20任意系统:执行\x20npx\x20的\x20Node\x20版本与当初编译该模块的\x20Node\x20ABI\x20不一致(报\x20NODE_MODULE_VERSION\x20/\x20was\x20compiled\x20against);','darwin','push','50YnYyjh','108','dirname','建议:将运行「npx\x20@bangdao-ai/acw-tools」的\x20Node\x20升级到\x2022.5\x20及以上,本包将改用内置\x20SQLite,一般不再需要编译。','[提示]\x20【解决办法优先级】①\x20将运行\x20npx\x20的\x20Node\x20升级到\x2022.5+(最省事);②\x20安装对应系统的\x20C++\x20编译环境后再装本包;③\x20确保\x20Cursor\x20/\x20终端使用同一份\x20Node,避免\x20ABI\x20混用。','test','inherit','.tar.gz','node_modules','message','[WARN]\x20npm\x20rebuild\x20未成功:\x20','[环境]\x20better-sqlite3\x20路径=','12.4.1','[OK]\x20better-sqlite3\x20加载成功','[INFO]\x20当前\x20Node\x20','[INFO]\x20━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━','10DmTzzY','package.json\x20中\x20engines\x20为\x20node>=20;要免编译、少踩坑,请以\x2022.5+\x20为准。','[WARN]\x20预编译包安装后测试失败:\x20','[ERROR]\x20postinstall\x20脚本执行出错:','[步骤]\x20OSS\x20下载或解压失败:\x20','win32','(ABI\x20v','[原因]\x20首次加载失败(动态\x20import):\x20','342529alZiBJ','unshift','[提示]\x20当前通过\x20better-sqlite3\x20完成检查。若希望免去原生依赖,可将\x20Node\x20升级到\x2022.5\x20及以上。'];_0x20da=function(){return _0x3bfdf5;};return _0x20da();}const _0x36d94b=_0x68d2;(function(_0x245821,_0x43e2a5){const _0x230ae0=_0x68d2,_0x29f339=_0x245821();while(!![]){try{const _0x258101=-parseInt(_0x230ae0(0xfc))/0x1*(parseInt(_0x230ae0(0x164))/0x2)+-parseInt(_0x230ae0(0x111))/0x3+-parseInt(_0x230ae0(0x123))/0x4+-parseInt(_0x230ae0(0x142))/0x5*(-parseInt(_0x230ae0(0x11a))/0x6)+-parseInt(_0x230ae0(0x13d))/0x7+-parseInt(_0x230ae0(0x12e))/0x8*(-parseInt(_0x230ae0(0x115))/0x9)+-parseInt(_0x230ae0(0x152))/0xa*(parseInt(_0x230ae0(0x15a))/0xb);if(_0x258101===_0x43e2a5)break;else _0x29f339['push'](_0x29f339['shift']());}catch(_0x1d27d4){_0x29f339['push'](_0x29f339['shift']());}}}(_0x20da,0x71bc9));function _0x68d2(_0x3d1888,_0x1c5a49){_0x3d1888=_0x3d1888-0xf2;const _0x20dad5=_0x20da();let _0x68d249=_0x20dad5[_0x3d1888];return _0x68d249;}import _0x46394f from'fs';import _0x482d19 from'path';import{fileURLToPath as _0x1f1ee8}from'url';import{execSync as _0x5d47ff}from'child_process';import _0x23eca2 from'https';import _0x47821d from'http';import _0x1a7b49 from'zlib';var C=_0x36d94b(0x14e),L='https://bd-acw.oss-cn-beijing.aliyuncs.com/prebuilds/better-sqlite3',F={0x12:_0x36d94b(0x143),0x13:'111',0x14:'115',0x15:'120',0x16:_0x36d94b(0x104),0x17:'131',0x18:_0x36d94b(0x10b),0x19:_0x36d94b(0x10b)},$=['115','127','131',_0x36d94b(0x10b)],I=parseInt(process[_0x36d94b(0x119)][_0x36d94b(0x162)](0x1)['split']('.')[0x0],0xa),T=((()=>{const _0x4d73b1=_0x36d94b;let _0x22eefe=process[_0x4d73b1(0x119)]['slice'](0x1)[_0x4d73b1(0x108)]('.');return parseInt(_0x22eefe[0x1]||'0',0xa);})());function x(){return I>0x16||I===0x16&&T>=0x5;}function P(){const _0x1c4cea=_0x36d94b;console[_0x1c4cea(0x136)](''),console['log']('[提示]\x20━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'),console[_0x1c4cea(0x136)]('[提示]\x20【本包为什么要动\x20SQLite】需要读取\x20Cursor\x20本地的\x20state.vscdb(对话与\x20composer\x20数据)。'),console['log']('[提示]\x20【推荐环境】请使用\x20Node.js\x2022.5\x20及以上(LTS\x2022\x20的最新小版本即可)。'),console['log'](_0x1c4cea(0x112)),console['log'](_0x1c4cea(0xf3)+process['version']+_0x1c4cea(0xf8)),console[_0x1c4cea(0x136)](_0x1c4cea(0x15e)),console['log'](_0x1c4cea(0x129)),console[_0x1c4cea(0x136)](_0x1c4cea(0x13f)),console['log']('[提示]\x20\x20\x20·\x20公司网络拦截导致预编译包下载失败,被迫本地编译但本机无工具链。'),console[_0x1c4cea(0x136)](_0x1c4cea(0x146)),console['log'](_0x1c4cea(0x166)),console[_0x1c4cea(0x136)]('');}function y(){const _0x18203f=_0x36d94b;console['error'](''),console[_0x18203f(0x13a)](_0x18203f(0x12b)),console[_0x18203f(0x13a)]('本步骤失败,几乎总是「可选依赖\x20better-sqlite3」的原生模块无法在您当前环境加载或编译。'),console[_0x18203f(0x13a)]('根因:它需要与本机\x20Node\x20版本匹配的\x20C++\x20二进制;Windows\x20上缺\x20VS\x20Build\x20Tools\x20时极易报错。'),console[_0x18203f(0x13a)](_0x18203f(0x145)),console['error'](_0x18203f(0x153)),console[_0x18203f(0x13a)](_0x18203f(0xf4));}function b(){const _0xd0bf92=_0x36d94b;let _0x4533f6=parseInt(process[_0xd0bf92(0x119)][_0xd0bf92(0x162)](0x1)[_0xd0bf92(0x108)]('.')[0x0],0xa);return F[_0x4533f6]||process[_0xd0bf92(0x13b)]['modules'];}function E(){const _0xd39a72=_0x36d94b;let _0x499499=C,_0x3fd850=b(),_0x97b900=process[_0xd39a72(0x120)],_0x5ae958=process['arch'];return'better-sqlite3-v'+_0x499499+_0xd39a72(0x106)+_0x3fd850+'-'+_0x97b900+'-'+_0x5ae958+_0xd39a72(0x149);}function v(_0x1ac072){return new Promise((_0x4a32e5,_0x50a7a0)=>{const _0x88ee2f=_0x68d2;let _0x39a700=(_0x1ac072[_0x88ee2f(0x131)](_0x88ee2f(0x122))?_0x23eca2:_0x47821d)[_0x88ee2f(0x110)](_0x1ac072,{'timeout':0x7530},_0x59df85=>{const _0x4dcd54=_0x88ee2f;if(_0x59df85[_0x4dcd54(0x118)]===0x12d||_0x59df85[_0x4dcd54(0x118)]===0x12e){v(_0x59df85['headers']['location'])['then'](_0x4a32e5)[_0x4dcd54(0x10a)](_0x50a7a0);return;}if(_0x59df85['statusCode']!==0xc8){_0x50a7a0(new Error('HTTP\x20'+_0x59df85[_0x4dcd54(0x118)]));return;}let _0x147db6=[];_0x59df85['on']('data',_0x3344c3=>_0x147db6['push'](_0x3344c3)),_0x59df85['on']('end',()=>_0x4a32e5(Buffer['concat'](_0x147db6))),_0x59df85['on']('error',_0x50a7a0);});_0x39a700['on'](_0x88ee2f(0x13a),_0x50a7a0),_0x39a700['on']('timeout',()=>{_0x39a700['destroy'](),_0x50a7a0(new Error('Request\x20timeout'));});});}async function D(_0xaf9d3a,_0x37f59a){const _0x21bb7c=_0x36d94b;let _0x524d03=_0x1a7b49['gunzipSync'](_0xaf9d3a),_0x3e1347=0x200,_0x3b17ae=0x0;for(;_0x3b17ae<_0x524d03[_0x21bb7c(0x113)]-_0x3e1347;){let _0x2cb4f6=_0x524d03['slice'](_0x3b17ae,_0x3b17ae+_0x3e1347);if(_0x2cb4f6[0x0]===0x0)break;let _0x532522=_0x2cb4f6['slice'](0x0,0x64)[_0x21bb7c(0xf7)](_0x21bb7c(0xff))[_0x21bb7c(0x103)](/\0/g,'')['trim'](),_0x17b3dd=_0x2cb4f6['slice'](0x7c,0x88)[_0x21bb7c(0xf7)](_0x21bb7c(0xff))['replace'](/\0/g,'')['trim'](),_0x5634cd=parseInt(_0x17b3dd,0x8)||0x0,_0x4c0f0a=String['fromCharCode'](_0x2cb4f6[0x9c]);if(_0x3b17ae+=_0x3e1347,_0x532522&&_0x4c0f0a==='0'||_0x4c0f0a==='\x00'){let _0x1c0e58=_0x524d03['slice'](_0x3b17ae,_0x3b17ae+_0x5634cd),_0x14ead4=_0x482d19[_0x21bb7c(0x126)](_0x37f59a,_0x482d19[_0x21bb7c(0x12a)](_0x532522));_0x46394f[_0x21bb7c(0x13c)](_0x482d19[_0x21bb7c(0x144)](_0x14ead4),{'recursive':!0x0}),_0x46394f['writeFileSync'](_0x14ead4,_0x1c0e58);}_0x3b17ae+=Math[_0x21bb7c(0x139)](_0x5634cd/_0x3e1347)*_0x3e1347;}}function h(){const _0x2ae432=_0x36d94b;let _0x1f3527=[_0x482d19[_0x2ae432(0x126)](process[_0x2ae432(0x114)](),_0x2ae432(0x14a),_0x2ae432(0x15f)),_0x482d19[_0x2ae432(0x126)](_0x1f1ee8(import.meta.url),'..',_0x2ae432(0x14a),'better-sqlite3')];try{let _0x4db32d=import.meta.resolve(_0x2ae432(0x15f));if(_0x4db32d){let _0x32e4db=_0x1f1ee8(_0x4db32d);_0x1f3527[_0x2ae432(0x15b)](_0x482d19['dirname'](_0x482d19['dirname'](_0x32e4db)));}}catch{}for(let _0x7e3cbc of _0x1f3527)if(_0x46394f['existsSync'](_0x482d19[_0x2ae432(0x126)](_0x7e3cbc,_0x2ae432(0x132))))return _0x7e3cbc;return null;}function N(_0x301f7f){const _0x3c42fd=_0x36d94b;if(!_0x301f7f)return null;let _0x2b9030=_0x482d19['dirname'](_0x301f7f);return _0x482d19[_0x3c42fd(0x12a)](_0x2b9030)==='node_modules'?_0x482d19[_0x3c42fd(0x144)](_0x2b9030):null;}function B(_0x24f00d){_0x5d47ff('node\x20-e\x20\x22require(\x27better-sqlite3\x27)(\x27:memory:\x27).close()\x22',{'cwd':_0x24f00d||process['cwd'](),'stdio':'pipe','env':{...process['env']}});}function k(_0x1f2a10){const _0x52fdcf=_0x36d94b;let _0x4cb2b8=N(_0x1f2a10);if(!_0x4cb2b8||!_0x46394f[_0x52fdcf(0x138)](_0x482d19[_0x52fdcf(0x126)](_0x4cb2b8,'package.json')))return console[_0x52fdcf(0xf9)](_0x52fdcf(0x130)),!0x1;console['log'](''),console[_0x52fdcf(0x136)]('[INFO]\x20━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'),console[_0x52fdcf(0x136)]('[INFO]\x20自动尝试本地编译:\x20在「'+_0x4cb2b8+_0x52fdcf(0xfa)),console['log']('[INFO]\x20(需本机已有\x20C++\x20构建环境;Windows\x20为\x20VS\x20Build\x20Tools,macOS\x20为\x20Xcode\x20CLT,Linux\x20为\x20build-essential)'),console[_0x52fdcf(0x136)](_0x52fdcf(0x151));try{return _0x5d47ff('npm\x20rebuild\x20better-sqlite3\x20--foreground-scripts',{'cwd':_0x4cb2b8,'stdio':_0x52fdcf(0x148),'env':{...process[_0x52fdcf(0x102)]}}),B(_0x4cb2b8),console[_0x52fdcf(0x136)]('[OK]\x20npm\x20rebuild\x20成功,better-sqlite3\x20已可加载'),!0x0;}catch(_0x1b5404){let _0x3bb649=_0x1b5404&&typeof _0x1b5404=='object'?_0x1b5404:{},_0x5256ff=_0x3bb649['stderr']?String(_0x3bb649['stderr']):'',_0x19d756=_0x3bb649['stdout']?String(_0x3bb649[_0x52fdcf(0x11f)]):'',_0x1b904f=_0x5256ff||_0x19d756||(_0x1b5404&&_0x1b5404[_0x52fdcf(0x14b)]?String(_0x1b5404['message']):String(_0x1b5404));return console['warn'](_0x52fdcf(0x14c)+_0x1b904f['slice'](0x0,0x4b0)+(_0x1b904f[_0x52fdcf(0x113)]>0x4b0?_0x52fdcf(0x10d):'')),!0x1;}}async function M(){const _0x81554c=_0x36d94b;let _0x35e98c=E(),_0x5dcc6c=L+'/v'+C+'/'+_0x35e98c;console['log'](_0x81554c(0x11d)+_0x35e98c);let _0x279c6f=await v(_0x5dcc6c);console[_0x81554c(0x136)](_0x81554c(0xfd)+(_0x279c6f[_0x81554c(0x113)]/0x400)[_0x81554c(0xfb)](0x1)+_0x81554c(0x137));let _0x3bb4ad=h();if(!_0x3bb4ad)throw new Error('无法找到\x20better-sqlite3\x20模块路径');let _0x2d9e1d=_0x482d19['join'](_0x3bb4ad,'prebuilds',process['platform']+'-'+process['arch']);return _0x46394f[_0x81554c(0x13c)](_0x2d9e1d,{'recursive':!0x0}),await D(_0x279c6f,_0x2d9e1d),console[_0x81554c(0x136)]('[INFO]\x20预编译包已安装到:\x20'+_0x2d9e1d),!0x0;}async function W(){const _0x34d7d4=_0x36d94b;let _0x44517d=(await import('better-sqlite3'))['default'];return new _0x44517d(_0x34d7d4(0x135))['close'](),!0x0;}async function V(){const _0x49a893=_0x36d94b;try{let {DatabaseSync:_0x5c69b2}=await import('node:sqlite');return new _0x5c69b2(':memory:')[_0x49a893(0x161)](),!0x0;}catch{return!0x1;}}((async()=>{const _0xc2e8b8=_0x36d94b;try{let _0x88c9fd=_0x1f1ee8(import.meta.url),_0x5dc569=_0x482d19['dirname'](_0x88c9fd),_0x7407a0='unknown',_0x2a20bb='';try{let _0x150934=_0x482d19[_0xc2e8b8(0x126)](_0x5dc569,'package.json');if(_0x46394f['existsSync'](_0x150934)){let _0x428f6c=JSON['parse'](_0x46394f['readFileSync'](_0x150934,'utf8'));_0x7407a0=_0x428f6c[_0xc2e8b8(0x119)]||'unknown',_0x2a20bb=typeof _0x428f6c['acwInstallNote']==_0xc2e8b8(0x11e)?_0x428f6c[_0xc2e8b8(0x109)]:'';}}catch{}console['log'](_0xc2e8b8(0x11c)),console[_0xc2e8b8(0x136)]('v'+_0x7407a0+_0xc2e8b8(0x100)+process[_0xc2e8b8(0x119)]+'\x20(ABI\x20'+b()+')\x20|\x20'+process['platform']+'/'+process['arch']),_0x2a20bb&&console[_0xc2e8b8(0x136)](_0xc2e8b8(0x121)+_0x2a20bb),await V()&&(console['log']('[OK]\x20已检测到\x20Node\x20内置\x20node:sqlite,安装检查通过。'),console[_0xc2e8b8(0x136)]('[提示]\x20当前\x20'+process['version']+'\x20满足「内置\x20SQLite」路径:对话抓取不依赖\x20better-sqlite3,Windows\x20上无需\x20VS\x20Build\x20Tools\x20即可避免「模块编译失败」。'),x()||console[_0xc2e8b8(0x136)](_0xc2e8b8(0x105)),console[_0xc2e8b8(0x136)]('[OK]\x20安装完成'),process['exit'](0x0)),P();let _0x3f8de6=!0x1,_0x5f9ece=null,_0x2f61dd=[];try{await W(),console[_0xc2e8b8(0x136)](_0xc2e8b8(0x14f)),_0x3f8de6=!0x0;}catch(_0x1c6b94){_0x5f9ece=_0x1c6b94;let _0x50f24f=_0x1c6b94&&_0x1c6b94['message']?String(_0x1c6b94['message']):'',_0x255ef7=_0x50f24f['toLowerCase']();console['log'](_0xc2e8b8(0x12d)+_0x50f24f),_0x2f61dd[_0xc2e8b8(0x141)](_0xc2e8b8(0x159)+_0x50f24f['slice'](0x0,0x1f4)+(_0x50f24f['length']>0x1f4?_0xc2e8b8(0x10d):'')),(_0x50f24f[_0xc2e8b8(0x163)]('Cannot\x20find\x20package')||_0x50f24f[_0xc2e8b8(0x163)](_0xc2e8b8(0x128))||_0x50f24f[_0xc2e8b8(0x163)](_0xc2e8b8(0xfe)))&&_0x2f61dd['push'](_0xc2e8b8(0xf6));let _0x12a67a=_0x50f24f['includes']('NODE_MODULE_VERSION')||_0x50f24f[_0xc2e8b8(0x163)]('was\x20compiled\x20against')||/\.node\b/[_0xc2e8b8(0x147)](_0x50f24f)||_0x255ef7['includes'](_0xc2e8b8(0x13e))||_0x255ef7['includes'](_0xc2e8b8(0x15f))||_0x255ef7['includes'](_0xc2e8b8(0x11b))||_0x255ef7[_0xc2e8b8(0x163)]('invalid\x20ELF')||_0x255ef7[_0xc2e8b8(0x163)]('not\x20a\x20valid\x20win32'),_0x327a1e=h(),_0x248f90=N(_0x327a1e);if(_0x2f61dd[_0xc2e8b8(0x141)]('[环境]\x20Node='+process[_0xc2e8b8(0x119)]+',process.versions.modules='+process['versions']['modules']+_0xc2e8b8(0x10e)+b()+',平台='+process[_0xc2e8b8(0x120)]+'/'+process[_0xc2e8b8(0x12f)]),_0x2f61dd[_0xc2e8b8(0x141)](_0xc2e8b8(0x14d)+(_0x327a1e||_0xc2e8b8(0xf5))+',npm\x20包根='+(_0x248f90||'未解析')),!_0x12a67a)_0x2f61dd[_0xc2e8b8(0x141)]('[结论]\x20报错形态不像典型原生模块加载问题,未自动执行\x20OSS\x20/\x20rebuild,请根据完整堆栈排查。');else{let _0x3950fd=b();if(!$[_0xc2e8b8(0x163)](_0x3950fd))_0x2f61dd[_0xc2e8b8(0x141)]('[原因]\x20当前\x20ABI\x20'+_0x3950fd+'\x20不在\x20OSS\x20预编译列表\x20['+$[_0xc2e8b8(0x126)](',\x20')+'],不会下载预编译包(避免错配二进制)。将尝试本机\x20npm\x20rebuild。'),console['log'](_0xc2e8b8(0x150)+process[_0xc2e8b8(0x119)]+_0xc2e8b8(0x158)+_0x3950fd+')无对应\x20OSS\x20预编译包,跳过\x20OSS,将尝试本机编译');else{_0x2f61dd[_0xc2e8b8(0x141)]('[步骤]\x20ABI\x20'+_0x3950fd+'\x20在预编译列表内,尝试\x20OSS:\x20'+E()),console[_0xc2e8b8(0x136)](_0xc2e8b8(0x165));try{await M(),console['log'](_0xc2e8b8(0x101));try{let _0x4fb6c5=N(h())||_0x248f90||process['cwd']();B(_0x4fb6c5),console[_0xc2e8b8(0x136)](_0xc2e8b8(0x124)),_0x3f8de6=!0x0,_0x2f61dd[_0xc2e8b8(0x141)](_0xc2e8b8(0x15d));}catch(_0x3c9971){_0x2f61dd[_0xc2e8b8(0x141)](_0xc2e8b8(0x116)+(_0x3c9971[_0xc2e8b8(0x14b)]||_0x3c9971)),console[_0xc2e8b8(0xf9)](_0xc2e8b8(0x154)+_0x3c9971[_0xc2e8b8(0x14b)]);}}catch(_0x1c030b){_0x2f61dd[_0xc2e8b8(0x141)](_0xc2e8b8(0x156)+(_0x1c030b[_0xc2e8b8(0x14b)]||_0x1c030b)),console[_0xc2e8b8(0xf9)](_0xc2e8b8(0x12c)+_0x1c030b[_0xc2e8b8(0x14b)]);}}!_0x3f8de6&&_0x327a1e?(_0x2f61dd[_0xc2e8b8(0x141)]('[步骤]\x20执行自动\x20npm\x20rebuild\x20better-sqlite3(本机源码编译)'),k(_0x327a1e)?(_0x3f8de6=!0x0,_0x2f61dd[_0xc2e8b8(0x141)]('[步骤]\x20npm\x20rebuild:\x20成功')):_0x2f61dd['push']('[步骤]\x20npm\x20rebuild:\x20失败(见上方日志,多为缺少\x20cl.exe\x20/\x20Xcode\x20Command\x20Line\x20Tools\x20/\x20build-essential)')):!_0x3f8de6&&!_0x327a1e&&_0x2f61dd[_0xc2e8b8(0x141)]('[步骤]\x20未找到\x20better-sqlite3\x20目录,无法执行\x20npm\x20rebuild');}}if(!_0x3f8de6){let _0x2fee86=_0x5f9ece?.[_0xc2e8b8(0x14b)]||'未知错误';if(y(),console['error'](''),console[_0xc2e8b8(0x13a)]('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'),console['error'](_0xc2e8b8(0xf2)),console[_0xc2e8b8(0x13a)](_0xc2e8b8(0x117)),console[_0xc2e8b8(0x13a)](''),console['error']('──────────\x20诊断摘要(请整段复制给支持人员或\x20Cursor)──────────'),_0x2f61dd[_0xc2e8b8(0x10c)](_0x280939=>console['error'](_0x280939)),console['error']('────────────────────────────────────────────────────────────'),console['error'](''),console[_0xc2e8b8(0x13a)](_0xc2e8b8(0x133)+_0x2fee86),console['error'](''),console[_0xc2e8b8(0x13a)]('说明:\x20已尝试\x20OSS\x20预编译与\x20npm\x20rebuild。仍失败时:务必把运行\x20npx\x20的\x20Node\x20升到\x2022.5+(内置\x20SQLite,从根上避免本问题)。其余检查:'),console['error'](_0xc2e8b8(0x125)),console[_0xc2e8b8(0x13a)]('\x20\x202)\x20若必须留在旧\x20Node:安装\x20C++\x20工具链后在包根目录执行\x20npm\x20rebuild\x20better-sqlite3\x20--foreground-scripts;'),console[_0xc2e8b8(0x13a)]('\x20\x203)\x20再执行\x20npm\x20install\x20-g\x20@bangdao-ai/acw-tools。'),console['error'](''),console[_0xc2e8b8(0x13a)]('复制以下提示词发送给\x20Cursor,让\x20AI\x20帮你修复:'),console[_0xc2e8b8(0x13a)](''),process['platform']===_0xc2e8b8(0x157)){let _0x290b3a=!0x1;try{_0x5d47ff('where\x20cl.exe',{'stdio':'pipe'}),_0x290b3a=!0x0;}catch{}console[_0xc2e8b8(0x13a)](_0x290b3a?_0xc2e8b8(0x10f)+_0x2fee86+'。优先请把运行\x20npx\x20的\x20Node\x20升级到\x2022.5\x20以上以使用内置\x20SQLite、避免编译。若暂不能升级:已装\x20VS\x20仍失败则执行\x20npm\x20cache\x20clean\x20--force\x20后\x20npm\x20install\x20-g\x20@bangdao-ai/acw-tools\x20重装。':_0xc2e8b8(0x10f)+_0x2fee86+'。优先请把运行\x20npx\x20的\x20Node\x20升级到\x2022.5\x20以上(免装\x20VS\x20Build\x20Tools)。否则请安装\x20Visual\x20Studio\x20Build\x20Tools\x20后再\x20npm\x20install\x20-g\x20@bangdao-ai/acw-tools。');}else process[_0xc2e8b8(0x120)]===_0xc2e8b8(0x140)?console[_0xc2e8b8(0x13a)](_0xc2e8b8(0x10f)+_0x2fee86+_0xc2e8b8(0x134)):console[_0xc2e8b8(0x13a)](_0xc2e8b8(0x10f)+_0x2fee86+_0xc2e8b8(0x107));console[_0xc2e8b8(0x13a)](''),console[_0xc2e8b8(0x13a)](_0xc2e8b8(0x117)),process['exit'](0x1);}console[_0xc2e8b8(0x136)](_0xc2e8b8(0x15c)),console['log'](_0xc2e8b8(0x160));}catch(_0x12c163){y(),console['error'](_0xc2e8b8(0x155),_0x12c163[_0xc2e8b8(0x14b)]),process[_0xc2e8b8(0x127)](0x1);}})());
|
|
2
|
+
const _0x581b25=_0x1d5e;(function(_0x2031bc,_0x58b43b){const _0x4429f6=_0x1d5e,_0x353210=_0x2031bc();while(!![]){try{const _0x15e40f=parseInt(_0x4429f6(0x201))/0x1*(parseInt(_0x4429f6(0x232))/0x2)+-parseInt(_0x4429f6(0x216))/0x3*(-parseInt(_0x4429f6(0x1de))/0x4)+parseInt(_0x4429f6(0x1f9))/0x5*(parseInt(_0x4429f6(0x222))/0x6)+parseInt(_0x4429f6(0x1d1))/0x7*(-parseInt(_0x4429f6(0x220))/0x8)+-parseInt(_0x4429f6(0x23b))/0x9*(parseInt(_0x4429f6(0x1f8))/0xa)+-parseInt(_0x4429f6(0x1ba))/0xb*(-parseInt(_0x4429f6(0x21c))/0xc)+-parseInt(_0x4429f6(0x1d6))/0xd*(parseInt(_0x4429f6(0x212))/0xe);if(_0x15e40f===_0x58b43b)break;else _0x353210['push'](_0x353210['shift']());}catch(_0x2b820b){_0x353210['push'](_0x353210['shift']());}}}(_0x32f2,0xade1e));import _0x393163 from'fs';import _0x1a8386 from'path';import{fileURLToPath as _0x51700b}from'url';import{execSync as _0x2e7dc1}from'child_process';import _0x1ec869 from'https';import _0x4f29d8 from'http';import _0x43c127 from'zlib';var C=_0x581b25(0x200),L=_0x581b25(0x235),F={0x12:_0x581b25(0x1e8),0x13:'111',0x14:'115',0x15:_0x581b25(0x214),0x16:'127',0x17:'131',0x18:_0x581b25(0x21f),0x19:'137'},$=[_0x581b25(0x20e),_0x581b25(0x231),'131','137'],I=parseInt(process['version'][_0x581b25(0x1b9)](0x1)['split']('.')[0x0],0xa),T=((()=>{let _0x5d80b6=process['version']['slice'](0x1)['split']('.');return parseInt(_0x5d80b6[0x1]||'0',0xa);})());function x(){return I>0x16||I===0x16&&T>=0x5;}function P(){const _0x329ce0=_0x581b25;console[_0x329ce0(0x1e5)](''),console[_0x329ce0(0x1e5)]('[提示]\x20━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'),console['log']('[提示]\x20【本包为什么要动\x20SQLite】需要读取\x20Cursor\x20本地的\x20state.vscdb(对话与\x20composer\x20数据)。'),console[_0x329ce0(0x1e5)]('[提示]\x20【推荐环境】请使用\x20Node.js\x2022.5\x20及以上(LTS\x2022\x20的最新小版本即可)。'),console[_0x329ce0(0x1e5)]('[提示]\x20\x20\x20该版本起\x20Node\x20内置「node:sqlite」,安装时无需\x20better-sqlite3,Windows\x20上可避免出现「模块编译失败」。'),console['log']('[提示]\x20【你当前的情况】当前为\x20'+process[_0x329ce0(0x215)]+',未检测到可用的内置\x20node:sqlite(或运行时被禁用),因此走可选依赖\x20better-sqlite3。'),console['log']('[提示]\x20【为什么会编译失败】better-sqlite3\x20含\x20C++\x20扩展(.node\x20文件)。常见原因:'),console['log'](_0x329ce0(0x1da)),console['log'](_0x329ce0(0x1dd)),console['log']('[提示]\x20\x20\x20·\x20公司网络拦截导致预编译包下载失败,被迫本地编译但本机无工具链。'),console[_0x329ce0(0x1e5)](_0x329ce0(0x22a)),console['log'](_0x329ce0(0x1ec)),console[_0x329ce0(0x1e5)]('');}function y(){const _0x27bbe5=_0x581b25;console[_0x27bbe5(0x230)](''),console[_0x27bbe5(0x230)]('──────────\x20给用户的说明(安装失败)──────────'),console[_0x27bbe5(0x230)]('本步骤失败,几乎总是「可选依赖\x20better-sqlite3」的原生模块无法在您当前环境加载或编译。'),console[_0x27bbe5(0x230)](_0x27bbe5(0x23c)),console[_0x27bbe5(0x230)]('建议:将运行「npx\x20@bangdao-ai/acw-tools」的\x20Node\x20升级到\x2022.5\x20及以上,本包将改用内置\x20SQLite,一般不再需要编译。'),console[_0x27bbe5(0x230)](_0x27bbe5(0x208)),console[_0x27bbe5(0x230)](_0x27bbe5(0x1bb));}function b(){const _0x14c4e2=_0x581b25;let _0x5b7e0c=parseInt(process[_0x14c4e2(0x215)][_0x14c4e2(0x1b9)](0x1)['split']('.')[0x0],0xa);return F[_0x5b7e0c]||process[_0x14c4e2(0x1c0)][_0x14c4e2(0x217)];}function E(){const _0xe5e8d7=_0x581b25;let _0x75c56a=C,_0x1a49c4=b(),_0x27affe=process[_0xe5e8d7(0x227)],_0xecb5b6=process['arch'];return _0xe5e8d7(0x1be)+_0x75c56a+'-node-v'+_0x1a49c4+'-'+_0x27affe+'-'+_0xecb5b6+_0xe5e8d7(0x1c6);}function v(_0x291985){return new Promise((_0x3af60c,_0x1ef99a)=>{const _0x4936b7=_0x1d5e;let _0x5a3532=(_0x291985[_0x4936b7(0x22f)]('https')?_0x1ec869:_0x4f29d8)[_0x4936b7(0x1e7)](_0x291985,{'timeout':0x7530},_0x2a98fe=>{const _0x458e2d=_0x4936b7;if(_0x2a98fe[_0x458e2d(0x1ef)]===0x12d||_0x2a98fe['statusCode']===0x12e){v(_0x2a98fe[_0x458e2d(0x22b)][_0x458e2d(0x1c3)])[_0x458e2d(0x1c8)](_0x3af60c)['catch'](_0x1ef99a);return;}if(_0x2a98fe['statusCode']!==0xc8){_0x1ef99a(new Error(_0x458e2d(0x234)+_0x2a98fe[_0x458e2d(0x1ef)]));return;}let _0x4f5b2f=[];_0x2a98fe['on'](_0x458e2d(0x219),_0x242ece=>_0x4f5b2f[_0x458e2d(0x1fe)](_0x242ece)),_0x2a98fe['on'](_0x458e2d(0x1fc),()=>_0x3af60c(Buffer[_0x458e2d(0x22c)](_0x4f5b2f))),_0x2a98fe['on']('error',_0x1ef99a);});_0x5a3532['on']('error',_0x1ef99a),_0x5a3532['on']('timeout',()=>{const _0x14c58e=_0x4936b7;_0x5a3532[_0x14c58e(0x1ee)](),_0x1ef99a(new Error('Request\x20timeout'));});});}async function D(_0xb9e0aa,_0x2968d3){const _0x33e49b=_0x581b25;let _0x499668=_0x43c127[_0x33e49b(0x1fb)](_0xb9e0aa),_0x6586a1=0x200,_0x5b0ce6=0x0;for(;_0x5b0ce6<_0x499668[_0x33e49b(0x20a)]-_0x6586a1;){let _0x45e718=_0x499668[_0x33e49b(0x1b9)](_0x5b0ce6,_0x5b0ce6+_0x6586a1);if(_0x45e718[0x0]===0x0)break;let _0x5ecefb=_0x45e718['slice'](0x0,0x64)[_0x33e49b(0x213)](_0x33e49b(0x205))['replace'](/\0/g,'')['trim'](),_0x2db0b2=_0x45e718['slice'](0x7c,0x88)[_0x33e49b(0x213)]('utf8')[_0x33e49b(0x21a)](/\0/g,'')['trim'](),_0x568c26=parseInt(_0x2db0b2,0x8)||0x0,_0x9ae1e2=String[_0x33e49b(0x237)](_0x45e718[0x9c]);if(_0x5b0ce6+=_0x6586a1,_0x5ecefb&&_0x9ae1e2==='0'||_0x9ae1e2==='\x00'){let _0x394085=_0x499668[_0x33e49b(0x1b9)](_0x5b0ce6,_0x5b0ce6+_0x568c26),_0x500b45=_0x1a8386[_0x33e49b(0x1cb)](_0x2968d3,_0x1a8386['basename'](_0x5ecefb));_0x393163[_0x33e49b(0x1eb)](_0x1a8386['dirname'](_0x500b45),{'recursive':!0x0}),_0x393163['writeFileSync'](_0x500b45,_0x394085);}_0x5b0ce6+=Math[_0x33e49b(0x1e4)](_0x568c26/_0x6586a1)*_0x6586a1;}}function _0x1d5e(_0x15f6bf,_0x4301bd){_0x15f6bf=_0x15f6bf-0x1b8;const _0x32f29f=_0x32f2();let _0x1d5e79=_0x32f29f[_0x15f6bf];return _0x1d5e79;}function h(){const _0xacfcf1=_0x581b25;let _0x372cb8=[_0x1a8386[_0xacfcf1(0x1cb)](process['cwd'](),_0xacfcf1(0x1c2),_0xacfcf1(0x22d)),_0x1a8386[_0xacfcf1(0x1cb)](_0x51700b(import.meta.url),'..',_0xacfcf1(0x1c2),_0xacfcf1(0x22d))];try{let _0x1230f9=import.meta.resolve('better-sqlite3');if(_0x1230f9){let _0x10af64=_0x51700b(_0x1230f9);_0x372cb8[_0xacfcf1(0x1bf)](_0x1a8386['dirname'](_0x1a8386['dirname'](_0x10af64)));}}catch{}for(let _0x17d898 of _0x372cb8)if(_0x393163['existsSync'](_0x1a8386['join'](_0x17d898,_0xacfcf1(0x233))))return _0x17d898;return null;}function N(_0x537008){const _0x5e2238=_0x581b25;if(!_0x537008)return null;let _0x5320b3=_0x1a8386[_0x5e2238(0x20c)](_0x537008);return _0x1a8386[_0x5e2238(0x1c7)](_0x5320b3)==='node_modules'?_0x1a8386['dirname'](_0x5320b3):null;}function B(_0x377561){const _0x409f1e=_0x581b25;_0x2e7dc1('node\x20-e\x20\x22require(\x27better-sqlite3\x27)(\x27:memory:\x27).close()\x22',{'cwd':_0x377561||process[_0x409f1e(0x1ed)](),'stdio':_0x409f1e(0x23a),'env':{...process[_0x409f1e(0x1b8)]}});}function k(_0x54e571){const _0x2e3caf=_0x581b25;let _0x5e54cc=N(_0x54e571);if(!_0x5e54cc||!_0x393163[_0x2e3caf(0x204)](_0x1a8386[_0x2e3caf(0x1cb)](_0x5e54cc,_0x2e3caf(0x233))))return console['warn'](_0x2e3caf(0x1ff)),!0x1;console[_0x2e3caf(0x1e5)](''),console[_0x2e3caf(0x1e5)](_0x2e3caf(0x1e0)),console['log']('[INFO]\x20自动尝试本地编译:\x20在「'+_0x5e54cc+'」执行\x20npm\x20rebuild\x20better-sqlite3'),console['log'](_0x2e3caf(0x21e)),console[_0x2e3caf(0x1e5)]('[INFO]\x20━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');try{return _0x2e7dc1(_0x2e3caf(0x1cd),{'cwd':_0x5e54cc,'stdio':_0x2e3caf(0x1f5),'env':{...process['env']}}),B(_0x5e54cc),console[_0x2e3caf(0x1e5)](_0x2e3caf(0x1f7)),!0x0;}catch(_0x4e361c){let _0x33f792=_0x4e361c&&typeof _0x4e361c==_0x2e3caf(0x210)?_0x4e361c:{},_0x38eafa=_0x33f792['stderr']?String(_0x33f792['stderr']):'',_0x3a15ab=_0x33f792[_0x2e3caf(0x1fd)]?String(_0x33f792[_0x2e3caf(0x1fd)]):'',_0x60f918=_0x38eafa||_0x3a15ab||(_0x4e361c&&_0x4e361c[_0x2e3caf(0x1ce)]?String(_0x4e361c['message']):String(_0x4e361c));return console[_0x2e3caf(0x223)](_0x2e3caf(0x1d2)+_0x60f918['slice'](0x0,0x4b0)+(_0x60f918['length']>0x4b0?'...':'')),!0x1;}}async function M(){const _0x47192e=_0x581b25;let _0xfee599=E(),_0x394073=L+'/v'+C+'/'+_0xfee599;console[_0x47192e(0x1e5)]('[INFO]\x20尝试从\x20OSS\x20下载预编译包:\x20'+_0xfee599);let _0x58044c=await v(_0x394073);console[_0x47192e(0x1e5)](_0x47192e(0x229)+(_0x58044c['length']/0x400)['toFixed'](0x1)+_0x47192e(0x1d0));let _0x3954db=h();if(!_0x3954db)throw new Error('无法找到\x20better-sqlite3\x20模块路径');let _0x3ed577=_0x1a8386['join'](_0x3954db,'prebuilds',process[_0x47192e(0x227)]+'-'+process[_0x47192e(0x1d3)]);return _0x393163[_0x47192e(0x1eb)](_0x3ed577,{'recursive':!0x0}),await D(_0x58044c,_0x3ed577),console[_0x47192e(0x1e5)]('[INFO]\x20预编译包已安装到:\x20'+_0x3ed577),!0x0;}async function W(){const _0x2130b7=_0x581b25;let _0x3ecab5=(await import(_0x2130b7(0x22d)))['default'];return new _0x3ecab5(_0x2130b7(0x1d5))['close'](),!0x0;}function _0x32f2(){const _0x3afd1c=['[ERROR]\x20better-sqlite3\x20模块加载失败,安装中止','\x20(ABI\x20','[提示]\x20\x20\x20·\x20Windows:未安装\x20Visual\x20Studio\x20Build\x20Tools(缺\x20cl.exe),node-gyp\x20无法编译;','[OK]\x20better-sqlite3\x20修复成功(OSS\x20预编译)','[ERROR]\x20postinstall\x20脚本执行出错:','[提示]\x20\x20\x20·\x20任意系统:执行\x20npx\x20的\x20Node\x20版本与当初编译该模块的\x20Node\x20ABI\x20不一致(报\x20NODE_MODULE_VERSION\x20/\x20was\x20compiled\x20against);','3467148BOatPO','(ABI\x20v','[INFO]\x20━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━','\x20\x203)\x20再执行\x20npm\x20install\x20-g\x20@bangdao-ai/acw-tools。','\x20不在\x20OSS\x20预编译列表\x20[','[环境]\x20better-sqlite3\x20路径=','ceil','log','[OK]\x20已检测到\x20Node\x20内置\x20node:sqlite,安装检查通过。','get','108','toLowerCase','\x20\x202)\x20若必须留在旧\x20Node:安装\x20C++\x20工具链后在包根目录执行\x20npm\x20rebuild\x20better-sqlite3\x20--foreground-scripts;','mkdirSync','[提示]\x20━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━','cwd','destroy','statusCode','首错原文:\x20','[提示]\x20说明:检测通过但主版本号低于文档推荐的\x2022.5+,若日后升级\x20Node,请以实际是否仍含\x20node:sqlite\x20为准。','[步骤]\x20执行自动\x20npm\x20rebuild\x20better-sqlite3(本机源码编译)','includes','close','inherit','NODE_MODULE_VERSION','[OK]\x20npm\x20rebuild\x20成功,better-sqlite3\x20已可加载','20YLbdPf','5mweqBR','node:sqlite','gunzipSync','end','stdout','push','[WARN]\x20无法确定\x20npm\x20包根目录,跳过\x20npm\x20rebuild','12.4.1','313238YQdLuH','unknown','acwInstallNote','existsSync','utf8','ACW\x20Tools\x20MCP\x20安装后检查...','[原因]\x20首次加载失败(动态\x20import):\x20','package.json\x20中\x20engines\x20为\x20node>=20;要免编译、少踩坑,请以\x2022.5+\x20为准。','──────────\x20诊断摘要(请整段复制给支持人员或\x20Cursor)──────────','length','我的\x20ACW\x20MCP\x20安装失败(better-sqlite3\x20/\x20原生模块),错误:','dirname','parse','115','[INFO]\x20当前\x20Node\x20','object',',process.versions.modules=','14ddGFcc','toString','120','version','3SdXKdv','modules','[步骤]\x20OSS\x20下载或解压失败:\x20','data','replace','string','1602948KXdphi',')\x20|\x20','[INFO]\x20(需本机已有\x20C++\x20构建环境;Windows\x20为\x20VS\x20Build\x20Tools,macOS\x20为\x20Xcode\x20CLT,Linux\x20为\x20build-essential)','137','368KicKuU','。优先请把运行\x20npx\x20的\x20Node\x20升级到\x2022.5\x20以上以使用内置\x20SQLite、避免编译。若暂不能升级:已装\x20VS\x20仍失败则执行\x20npm\x20cache\x20clean\x20--force\x20后\x20npm\x20install\x20-g\x20@bangdao-ai/acw-tools\x20重装。','6751434sTDJnK','warn','[WARN]\x20OSS\x20预编译包下载或解压失败:\x20','[提示]\x20当前通过\x20better-sqlite3\x20完成检查。若希望免去原生依赖,可将\x20Node\x20升级到\x2022.5\x20及以上。','。优先将\x20Node\x20升到\x2022.5+。否则\x20sudo\x20apt-get\x20install\x20build-essential\x20后\x20npm\x20install\x20-g\x20@bangdao-ai/acw-tools\x20重装。','platform','Cannot\x20find\x20package','[INFO]\x20下载成功\x20(','[提示]\x20【解决办法优先级】①\x20将运行\x20npx\x20的\x20Node\x20升级到\x2022.5+(最省事);②\x20安装对应系统的\x20C++\x20编译环境后再装本包;③\x20确保\x20Cursor\x20/\x20终端使用同一份\x20Node,避免\x20ABI\x20混用。','headers','concat','better-sqlite3','[步骤]\x20ABI\x20','startsWith','error','127','8KkygLY','package.json','HTTP\x20','https://bd-acw.oss-cn-beijing.aliyuncs.com/prebuilds/better-sqlite3','[OK]\x20安装完成','fromCharCode','exit','。优先请把运行\x20npx\x20的\x20Node\x20升级到\x2022.5\x20以上(免装\x20VS\x20Build\x20Tools)。否则请安装\x20Visual\x20Studio\x20Build\x20Tools\x20后再\x20npm\x20install\x20-g\x20@bangdao-ai/acw-tools。','pipe','2981970iiweum','根因:它需要与本机\x20Node\x20版本匹配的\x20C++\x20二进制;Windows\x20上缺\x20VS\x20Build\x20Tools\x20时极易报错。','env','slice','44tFuiVQ','────────────────────────────────────────────','darwin',',npm\x20包根=','better-sqlite3-v','unshift','versions','未解析','node_modules','location','[OK]\x20better-sqlite3\x20加载成功','[INFO]\x20检测到原生模块加载异常,尝试从\x20OSS\x20拉取匹配当前\x20ABI\x20的预编译包...','.tar.gz','basename','then',')无对应\x20OSS\x20预编译包,跳过\x20OSS,将尝试本机编译','[结论]\x20报错形态不像典型原生模块加载问题,未自动执行\x20OSS\x20/\x20rebuild,请根据完整堆栈排查。','join','[步骤]\x20npm\x20rebuild:\x20失败(见上方日志,多为缺少\x20cl.exe\x20/\x20Xcode\x20Command\x20Line\x20Tools\x20/\x20build-essential)','npm\x20rebuild\x20better-sqlite3\x20--foreground-scripts','message','\x20\x201)\x20终端执行\x20node\x20-v\x20与\x20Cursor\x20调起\x20MCP\x20用的是否为同一\x20Node;','\x20KB)','58191MfyYNu','[WARN]\x20npm\x20rebuild\x20未成功:\x20','arch','[WARN]\x20预编译包安装后测试失败:\x20',':memory:','26286182xohakB','[INFO]\x20better-sqlite3\x20原生加载失败:\x20'];_0x32f2=function(){return _0x3afd1c;};return _0x32f2();}async function V(){const _0x284917=_0x581b25;try{let {DatabaseSync:_0x19391b}=await import(_0x284917(0x1fa));return new _0x19391b(_0x284917(0x1d5))[_0x284917(0x1f4)](),!0x0;}catch{return!0x1;}}((async()=>{const _0x20669c=_0x581b25;try{let _0x4e76ef=_0x51700b(import.meta.url),_0x202cd3=_0x1a8386['dirname'](_0x4e76ef),_0x200bd3='unknown',_0x1f11eb='';try{let _0x3a13b5=_0x1a8386[_0x20669c(0x1cb)](_0x202cd3,'package.json');if(_0x393163[_0x20669c(0x204)](_0x3a13b5)){let _0x1739ce=JSON[_0x20669c(0x20d)](_0x393163['readFileSync'](_0x3a13b5,_0x20669c(0x205)));_0x200bd3=_0x1739ce[_0x20669c(0x215)]||_0x20669c(0x202),_0x1f11eb=typeof _0x1739ce['acwInstallNote']==_0x20669c(0x21b)?_0x1739ce[_0x20669c(0x203)]:'';}}catch{}console[_0x20669c(0x1e5)](_0x20669c(0x206)),console['log']('v'+_0x200bd3+'\x20|\x20Node\x20'+process[_0x20669c(0x215)]+_0x20669c(0x1d9)+b()+_0x20669c(0x21d)+process['platform']+'/'+process['arch']),_0x1f11eb&&console['log']('[提示]\x20'+_0x1f11eb),await V()&&(console['log'](_0x20669c(0x1e6)),console[_0x20669c(0x1e5)]('[提示]\x20当前\x20'+process['version']+'\x20满足「内置\x20SQLite」路径:对话抓取不依赖\x20better-sqlite3,Windows\x20上无需\x20VS\x20Build\x20Tools\x20即可避免「模块编译失败」。'),x()||console['log'](_0x20669c(0x1f1)),console['log'](_0x20669c(0x236)),process[_0x20669c(0x238)](0x0)),P();let _0x3402cd=!0x1,_0x4095ce=null,_0x9043a=[];try{await W(),console['log'](_0x20669c(0x1c4)),_0x3402cd=!0x0;}catch(_0x4e8a97){_0x4095ce=_0x4e8a97;let _0x998f20=_0x4e8a97&&_0x4e8a97[_0x20669c(0x1ce)]?String(_0x4e8a97[_0x20669c(0x1ce)]):'',_0xadc0dc=_0x998f20[_0x20669c(0x1e9)]();console[_0x20669c(0x1e5)](_0x20669c(0x1d7)+_0x998f20),_0x9043a['push'](_0x20669c(0x207)+_0x998f20['slice'](0x0,0x1f4)+(_0x998f20['length']>0x1f4?'...':'')),(_0x998f20['includes'](_0x20669c(0x228))||_0x998f20['includes']('ERR_MODULE_NOT_FOUND')||_0x998f20[_0x20669c(0x1f3)]('MODULE_NOT_FOUND'))&&_0x9043a['push']('[原因]\x20better-sqlite3\x20未安装到位(多为\x20optional\x20依赖下载或编译失败);在\x20Node\x20低于\x2022.5\x20且无内置\x20SQLite\x20时会导致本步失败。');let _0x2d2e41=_0x998f20[_0x20669c(0x1f3)](_0x20669c(0x1f6))||_0x998f20[_0x20669c(0x1f3)]('was\x20compiled\x20against')||/\.node\b/['test'](_0x998f20)||_0xadc0dc['includes']('better_sqlite3')||_0xadc0dc['includes'](_0x20669c(0x22d))||_0xadc0dc[_0x20669c(0x1f3)]('dlopen')||_0xadc0dc[_0x20669c(0x1f3)]('invalid\x20ELF')||_0xadc0dc[_0x20669c(0x1f3)]('not\x20a\x20valid\x20win32'),_0x5b9c50=h(),_0x324b25=N(_0x5b9c50);if(_0x9043a['push']('[环境]\x20Node='+process[_0x20669c(0x215)]+_0x20669c(0x211)+process['versions']['modules']+',映射\x20ABI='+b()+',平台='+process[_0x20669c(0x227)]+'/'+process['arch']),_0x9043a['push'](_0x20669c(0x1e3)+(_0x5b9c50||'未找到')+_0x20669c(0x1bd)+(_0x324b25||_0x20669c(0x1c1))),!_0x2d2e41)_0x9043a[_0x20669c(0x1fe)](_0x20669c(0x1ca));else{let _0x57d2c1=b();if(!$['includes'](_0x57d2c1))_0x9043a[_0x20669c(0x1fe)]('[原因]\x20当前\x20ABI\x20'+_0x57d2c1+_0x20669c(0x1e2)+$[_0x20669c(0x1cb)](',\x20')+'],不会下载预编译包(避免错配二进制)。将尝试本机\x20npm\x20rebuild。'),console['log'](_0x20669c(0x20f)+process[_0x20669c(0x215)]+_0x20669c(0x1df)+_0x57d2c1+_0x20669c(0x1c9));else{_0x9043a['push'](_0x20669c(0x22e)+_0x57d2c1+'\x20在预编译列表内,尝试\x20OSS:\x20'+E()),console[_0x20669c(0x1e5)](_0x20669c(0x1c5));try{await M(),console['log']('[INFO]\x20预编译包已安装,重新测试...');try{let _0xb5e004=N(h())||_0x324b25||process['cwd']();B(_0xb5e004),console[_0x20669c(0x1e5)](_0x20669c(0x1db)),_0x3402cd=!0x0,_0x9043a[_0x20669c(0x1fe)]('[步骤]\x20OSS\x20预编译\x20+\x20子进程校验:\x20成功');}catch(_0x2e2442){_0x9043a['push']('[步骤]\x20OSS\x20预编译后子进程校验仍失败:\x20'+(_0x2e2442['message']||_0x2e2442)),console['warn'](_0x20669c(0x1d4)+_0x2e2442[_0x20669c(0x1ce)]);}}catch(_0x1781db){_0x9043a['push'](_0x20669c(0x218)+(_0x1781db['message']||_0x1781db)),console['warn'](_0x20669c(0x224)+_0x1781db[_0x20669c(0x1ce)]);}}!_0x3402cd&&_0x5b9c50?(_0x9043a[_0x20669c(0x1fe)](_0x20669c(0x1f2)),k(_0x5b9c50)?(_0x3402cd=!0x0,_0x9043a[_0x20669c(0x1fe)]('[步骤]\x20npm\x20rebuild:\x20成功')):_0x9043a['push'](_0x20669c(0x1cc))):!_0x3402cd&&!_0x5b9c50&&_0x9043a['push']('[步骤]\x20未找到\x20better-sqlite3\x20目录,无法执行\x20npm\x20rebuild');}}if(!_0x3402cd){let _0x38d305=_0x4095ce?.[_0x20669c(0x1ce)]||'未知错误';if(y(),console[_0x20669c(0x230)](''),console['error']('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'),console['error'](_0x20669c(0x1d8)),console[_0x20669c(0x230)]('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'),console['error'](''),console['error'](_0x20669c(0x209)),_0x9043a['forEach'](_0x195bad=>console['error'](_0x195bad)),console[_0x20669c(0x230)]('────────────────────────────────────────────────────────────'),console['error'](''),console[_0x20669c(0x230)](_0x20669c(0x1f0)+_0x38d305),console['error'](''),console['error']('说明:\x20已尝试\x20OSS\x20预编译与\x20npm\x20rebuild。仍失败时:务必把运行\x20npx\x20的\x20Node\x20升到\x2022.5+(内置\x20SQLite,从根上避免本问题)。其余检查:'),console['error'](_0x20669c(0x1cf)),console['error'](_0x20669c(0x1ea)),console['error'](_0x20669c(0x1e1)),console[_0x20669c(0x230)](''),console['error']('复制以下提示词发送给\x20Cursor,让\x20AI\x20帮你修复:'),console['error'](''),process[_0x20669c(0x227)]==='win32'){let _0x5b4038=!0x1;try{_0x2e7dc1('where\x20cl.exe',{'stdio':_0x20669c(0x23a)}),_0x5b4038=!0x0;}catch{}console['error'](_0x5b4038?'我的\x20ACW\x20MCP\x20安装失败(better-sqlite3\x20/\x20原生模块),错误:'+_0x38d305+_0x20669c(0x221):'我的\x20ACW\x20MCP\x20安装失败(better-sqlite3\x20/\x20原生模块),错误:'+_0x38d305+_0x20669c(0x239));}else process['platform']===_0x20669c(0x1bc)?console[_0x20669c(0x230)](_0x20669c(0x20b)+_0x38d305+'。优先将\x20Node\x20升到\x2022.5+。否则\x20xcode-select\x20--install\x20后\x20npm\x20install\x20-g\x20@bangdao-ai/acw-tools\x20重装。'):console['error'](_0x20669c(0x20b)+_0x38d305+_0x20669c(0x226));console['error'](''),console[_0x20669c(0x230)]('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'),process['exit'](0x1);}console['log'](_0x20669c(0x225)),console['log']('[OK]\x20安装完成');}catch(_0x4df3a3){y(),console['error'](_0x20669c(0x1dc),_0x4df3a3[_0x20669c(0x1ce)]),process[_0x20669c(0x238)](0x1);}})());
|