@bangdao-ai/acw-tools 1.13.39 → 1.13.41

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/manifest.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ACW工具集",
3
3
  "description": "ACW平台工具集:智能下载规则/技能到项目、上传技能到Skills广场、搜索技能、检查技能更新、上传/下载/检索个人知识库",
4
- "version": "1.13.39",
4
+ "version": "1.13.41",
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.13.39",
3
+ "version": "1.13.41",
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",
package/postinstall.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const _0x5ad66a=_0x5c9e;(function(_0x40371b,_0x142418){const _0x43234f=_0x5c9e,_0x432468=_0x40371b();while(!![]){try{const _0x262e8a=parseInt(_0x43234f(0x124))/0x1*(parseInt(_0x43234f(0x10f))/0x2)+parseInt(_0x43234f(0x118))/0x3+parseInt(_0x43234f(0x14b))/0x4+-parseInt(_0x43234f(0x11b))/0x5*(parseInt(_0x43234f(0xe5))/0x6)+parseInt(_0x43234f(0xfc))/0x7*(parseInt(_0x43234f(0xf5))/0x8)+-parseInt(_0x43234f(0x11a))/0x9*(parseInt(_0x43234f(0xf4))/0xa)+-parseInt(_0x43234f(0xed))/0xb*(parseInt(_0x43234f(0x131))/0xc);if(_0x262e8a===_0x142418)break;else _0x432468['push'](_0x432468['shift']());}catch(_0x5e1331){_0x432468['push'](_0x432468['shift']());}}}(_0x15ac,0x79da7));import _0x38ba6d from'fs';import _0x364724 from'path';import{fileURLToPath as _0xf10279}from'url';import{execSync as _0x115f44}from'child_process';import _0x5f0c90 from'https';import _0x8c6dc6 from'http';function _0x15ac(){const _0x10a23b=['──────────\x20诊断摘要(请整段复制给支持人员或\x20Cursor)──────────','4260130EoNsrV','6722472UNMStx','headers','replace','\x20不在\x20OSS\x20预编译列表\x20[','。优先将\x20Node\x20升到\x2022.5+。否则\x20xcode-select\x20--install\x20后\x20npm\x20install\x20-g\x20@bangdao-ai/acw-tools\x20重装。','location','\x20KB)','7tjtlJF','length','toString','\x20在预编译列表内,尝试\x20OSS:\x20','我的\x20ACW\x20MCP\x20安装失败(better-sqlite3\x20/\x20原生模块),错误:','131','https','log','Request\x20timeout','137','join','[原因]\x20当前\x20ABI\x20','versions','package.json','statusCode','exit','。优先将\x20Node\x20升到\x2022.5+。否则\x20sudo\x20apt-get\x20install\x20build-essential\x20后\x20npm\x20install\x20-g\x20@bangdao-ai/acw-tools\x20重装。',')无对应\x20OSS\x20预编译包,跳过\x20OSS,将尝试本机编译','catch','6716RCYidv','ACW\x20Tools\x20MCP\x20安装后检查...','stdout','[步骤]\x20npm\x20rebuild:\x20成功','[提示]\x20\x20\x20·\x20公司网络拦截导致预编译包下载失败,被迫本地编译但本机无工具链。','本步骤失败,几乎总是「可选依赖\x20better-sqlite3」的原生模块无法在您当前环境加载或编译。','未知错误','127','[提示]\x20说明:检测通过但主版本号低于文档推荐的\x2022.5+,若日后升级\x20Node,请以实际是否仍含\x20node:sqlite\x20为准。','2016453qIuZqM','(ABI\x20v','9otCZeL','5LOMzUO','无法找到\x20better-sqlite3\x20模块路径','...',',平台=','toLowerCase','platform','\x20满足「内置\x20SQLite」路径:对话抓取不依赖\x20better-sqlite3,Windows\x20上无需\x20VS\x20Build\x20Tools\x20即可避免「模块编译失败」。','test','includes','274opQWnS','then','fromCharCode','version','gunzipSync','[提示]\x20━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━','slice','destroy','\x20\x202)\x20若必须留在旧\x20Node:安装\x20C++\x20工具链后在包根目录执行\x20npm\x20rebuild\x20better-sqlite3\x20--foreground-scripts;','better-sqlite3-v','115','warn','未找到','2411832SfyCFZ','dirname','modules','[OK]\x20npm\x20rebuild\x20成功,better-sqlite3\x20已可加载','建议:将运行「npx\x20@bangdao-ai/acw-tools」的\x20Node\x20升级到\x2022.5\x20及以上,本包将改用内置\x20SQLite,一般不再需要编译。','acwInstallNote','message','[OK]\x20已检测到\x20Node\x20内置\x20node:sqlite,安装检查通过。','[INFO]\x20━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━','。优先请把运行\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重装。','prebuilds','cwd','[INFO]\x20当前\x20Node\x20','basename','[原因]\x20better-sqlite3\x20未安装到位(多为\x20optional\x20依赖下载或编译失败);在\x20Node\x20低于\x2022.5\x20且无内置\x20SQLite\x20时会导致本步失败。','not\x20a\x20valid\x20win32','node_modules','[提示]\x20当前通过\x20better-sqlite3\x20完成检查。若希望免去原生依赖,可将\x20Node\x20升级到\x2022.5\x20及以上。','[原因]\x20首次加载失败(动态\x20import):\x20','error',':memory:','[提示]\x20当前\x20',',未检测到可用的内置\x20node:sqlite(或运行时被禁用),因此走可选依赖\x20better-sqlite3。','pipe','dlopen','env','3907832Qpbacj','utf8','[ERROR]\x20better-sqlite3\x20模块加载失败,安装中止','push','[INFO]\x20尝试从\x20OSS\x20下载预编译包:\x20','ERR_MODULE_NOT_FOUND','arch','[步骤]\x20OSS\x20预编译后子进程校验仍失败:\x20','[环境]\x20Node=','existsSync','trim','5258988pclrFM','[INFO]\x20(需本机已有\x20C++\x20构建环境;Windows\x20为\x20VS\x20Build\x20Tools,macOS\x20为\x20Xcode\x20CLT,Linux\x20为\x20build-essential)','──────────\x20给用户的说明(安装失败)──────────','\x20|\x20Node\x20','stderr','inherit','12.4.1','better-sqlite3','88RQwNVO','[提示]\x20\x20\x20·\x20任意系统:执行\x20npx\x20的\x20Node\x20版本与当初编译该模块的\x20Node\x20ABI\x20不一致(报\x20NODE_MODULE_VERSION\x20/\x20was\x20compiled\x20against);','],不会下载预编译包(避免错配二进制)。将尝试本机\x20npm\x20rebuild。','NODE_MODULE_VERSION','timeout','[提示]\x20【为什么会编译失败】better-sqlite3\x20含\x20C++\x20扩展(.node\x20文件)。常见原因:'];_0x15ac=function(){return _0x10a23b;};return _0x15ac();}import _0x2ec799 from'zlib';var C=_0x5ad66a(0xeb),L='https://bd-acw.oss-cn-beijing.aliyuncs.com/prebuilds/better-sqlite3',F={0x12:'108',0x13:'111',0x14:_0x5ad66a(0x12e),0x15:'120',0x16:_0x5ad66a(0x116),0x17:_0x5ad66a(0x101),0x18:_0x5ad66a(0x105),0x19:_0x5ad66a(0x105)},$=[_0x5ad66a(0x12e),_0x5ad66a(0x116),_0x5ad66a(0x101),'137'],I=parseInt(process[_0x5ad66a(0x127)][_0x5ad66a(0x12a)](0x1)['split']('.')[0x0],0xa),T=((()=>{const _0x320ad8=_0x5ad66a;let _0x2d8d80=process[_0x320ad8(0x127)][_0x320ad8(0x12a)](0x1)['split']('.');return parseInt(_0x2d8d80[0x1]||'0',0xa);})());function x(){return I>0x16||I===0x16&&T>=0x5;}function P(){const _0x281be1=_0x5ad66a;console[_0x281be1(0x103)](''),console['log'](_0x281be1(0x129)),console['log']('[提示]\x20【本包为什么要动\x20SQLite】需要读取\x20Cursor\x20本地的\x20state.vscdb(对话与\x20composer\x20数据)。'),console[_0x281be1(0x103)]('[提示]\x20【推荐环境】请使用\x20Node.js\x2022.5\x20及以上(LTS\x2022\x20的最新小版本即可)。'),console['log']('[提示]\x20\x20\x20该版本起\x20Node\x20内置「node:sqlite」,安装时无需\x20better-sqlite3,Windows\x20上可避免出现「模块编译失败」。'),console['log']('[提示]\x20【你当前的情况】当前为\x20'+process[_0x281be1(0x127)]+_0x281be1(0x147)),console['log'](_0x281be1(0xf2)),console['log']('[提示]\x20\x20\x20·\x20Windows:未安装\x20Visual\x20Studio\x20Build\x20Tools(缺\x20cl.exe),node-gyp\x20无法编译;'),console['log'](_0x281be1(0xee)),console['log'](_0x281be1(0x113)),console[_0x281be1(0x103)]('[提示]\x20【解决办法优先级】①\x20将运行\x20npx\x20的\x20Node\x20升级到\x2022.5+(最省事);②\x20安装对应系统的\x20C++\x20编译环境后再装本包;③\x20确保\x20Cursor\x20/\x20终端使用同一份\x20Node,避免\x20ABI\x20混用。'),console['log']('[提示]\x20━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'),console[_0x281be1(0x103)]('');}function y(){const _0x4fc8ae=_0x5ad66a;console[_0x4fc8ae(0x144)](''),console['error'](_0x4fc8ae(0xe7)),console[_0x4fc8ae(0x144)](_0x4fc8ae(0x114)),console[_0x4fc8ae(0x144)]('根因:它需要与本机\x20Node\x20版本匹配的\x20C++\x20二进制;Windows\x20上缺\x20VS\x20Build\x20Tools\x20时极易报错。'),console[_0x4fc8ae(0x144)](_0x4fc8ae(0x135)),console[_0x4fc8ae(0x144)]('package.json\x20中\x20engines\x20为\x20node>=20;要免编译、少踩坑,请以\x2022.5+\x20为准。'),console['error']('────────────────────────────────────────────');}function b(){const _0x69119a=_0x5ad66a;let _0x5c6303=parseInt(process['version']['slice'](0x1)['split']('.')[0x0],0xa);return F[_0x5c6303]||process[_0x69119a(0x108)][_0x69119a(0x133)];}function E(){const _0x208c9d=_0x5ad66a;let _0x5118f7=C,_0x5c815c=b(),_0x3584ed=process[_0x208c9d(0x120)],_0x3a255c=process['arch'];return _0x208c9d(0x12d)+_0x5118f7+'-node-v'+_0x5c815c+'-'+_0x3584ed+'-'+_0x3a255c+'.tar.gz';}function v(_0x44fd94){return new Promise((_0x261ac5,_0x2260e9)=>{const _0x4c3f80=_0x5c9e;let _0x2ac634=(_0x44fd94['startsWith'](_0x4c3f80(0x102))?_0x5f0c90:_0x8c6dc6)['get'](_0x44fd94,{'timeout':0x7530},_0x71fe5e=>{const _0x13177c=_0x4c3f80;if(_0x71fe5e[_0x13177c(0x10a)]===0x12d||_0x71fe5e[_0x13177c(0x10a)]===0x12e){v(_0x71fe5e[_0x13177c(0xf6)][_0x13177c(0xfa)])[_0x13177c(0x125)](_0x261ac5)[_0x13177c(0x10e)](_0x2260e9);return;}if(_0x71fe5e['statusCode']!==0xc8){_0x2260e9(new Error('HTTP\x20'+_0x71fe5e[_0x13177c(0x10a)]));return;}let _0x500764=[];_0x71fe5e['on']('data',_0x4961b6=>_0x500764[_0x13177c(0xdd)](_0x4961b6)),_0x71fe5e['on']('end',()=>_0x261ac5(Buffer['concat'](_0x500764))),_0x71fe5e['on']('error',_0x2260e9);});_0x2ac634['on']('error',_0x2260e9),_0x2ac634['on'](_0x4c3f80(0xf1),()=>{const _0x5c5a56=_0x4c3f80;_0x2ac634[_0x5c5a56(0x12b)](),_0x2260e9(new Error(_0x5c5a56(0x104)));});});}async function D(_0x1a4f55,_0x5f3125){const _0x3a84ed=_0x5ad66a;let _0x57ad05=_0x2ec799[_0x3a84ed(0x128)](_0x1a4f55),_0x47e5e6=0x200,_0x4d9b75=0x0;for(;_0x4d9b75<_0x57ad05[_0x3a84ed(0xfd)]-_0x47e5e6;){let _0x1e7656=_0x57ad05['slice'](_0x4d9b75,_0x4d9b75+_0x47e5e6);if(_0x1e7656[0x0]===0x0)break;let _0x5a2df7=_0x1e7656['slice'](0x0,0x64)[_0x3a84ed(0xfe)](_0x3a84ed(0x14c))[_0x3a84ed(0xf7)](/\0/g,'')['trim'](),_0x61963d=_0x1e7656[_0x3a84ed(0x12a)](0x7c,0x88)['toString'](_0x3a84ed(0x14c))['replace'](/\0/g,'')[_0x3a84ed(0xe4)](),_0x364fca=parseInt(_0x61963d,0x8)||0x0,_0x552b93=String[_0x3a84ed(0x126)](_0x1e7656[0x9c]);if(_0x4d9b75+=_0x47e5e6,_0x5a2df7&&_0x552b93==='0'||_0x552b93==='\x00'){let _0x3e04f9=_0x57ad05[_0x3a84ed(0x12a)](_0x4d9b75,_0x4d9b75+_0x364fca),_0x511d19=_0x364724['join'](_0x5f3125,_0x364724[_0x3a84ed(0x13e)](_0x5a2df7));_0x38ba6d['mkdirSync'](_0x364724[_0x3a84ed(0x132)](_0x511d19),{'recursive':!0x0}),_0x38ba6d['writeFileSync'](_0x511d19,_0x3e04f9);}_0x4d9b75+=Math['ceil'](_0x364fca/_0x47e5e6)*_0x47e5e6;}}function h(){const _0x4b8594=_0x5ad66a;let _0x33c8d4=[_0x364724[_0x4b8594(0x106)](process[_0x4b8594(0x13c)](),_0x4b8594(0x141),_0x4b8594(0xec)),_0x364724['join'](_0xf10279(import.meta.url),'..','node_modules',_0x4b8594(0xec))];try{let _0xa75b3b=import.meta.resolve(_0x4b8594(0xec));if(_0xa75b3b){let _0x5cfb8b=_0xf10279(_0xa75b3b);_0x33c8d4['unshift'](_0x364724['dirname'](_0x364724[_0x4b8594(0x132)](_0x5cfb8b)));}}catch{}for(let _0x346da0 of _0x33c8d4)if(_0x38ba6d[_0x4b8594(0xe3)](_0x364724[_0x4b8594(0x106)](_0x346da0,'package.json')))return _0x346da0;return null;}function N(_0xfdd366){const _0x58a759=_0x5ad66a;if(!_0xfdd366)return null;let _0x193705=_0x364724['dirname'](_0xfdd366);return _0x364724[_0x58a759(0x13e)](_0x193705)==='node_modules'?_0x364724['dirname'](_0x193705):null;}function B(_0x7e1151){const _0x2177cc=_0x5ad66a;_0x115f44('node\x20-e\x20\x22require(\x27better-sqlite3\x27)(\x27:memory:\x27).close()\x22',{'cwd':_0x7e1151||process['cwd'](),'stdio':_0x2177cc(0x148),'env':{...process['env']}});}function _0x5c9e(_0x2f468a,_0x45c4ad){_0x2f468a=_0x2f468a-0xdd;const _0x15acf7=_0x15ac();let _0x5c9e98=_0x15acf7[_0x2f468a];return _0x5c9e98;}function k(_0x579083){const _0x547f47=_0x5ad66a;let _0x211930=N(_0x579083);if(!_0x211930||!_0x38ba6d[_0x547f47(0xe3)](_0x364724['join'](_0x211930,_0x547f47(0x109))))return console[_0x547f47(0x12f)]('[WARN]\x20无法确定\x20npm\x20包根目录,跳过\x20npm\x20rebuild'),!0x1;console['log'](''),console['log'](_0x547f47(0x139)),console[_0x547f47(0x103)]('[INFO]\x20自动尝试本地编译:\x20在「'+_0x211930+'」执行\x20npm\x20rebuild\x20better-sqlite3'),console[_0x547f47(0x103)](_0x547f47(0xe6)),console['log'](_0x547f47(0x139));try{return _0x115f44('npm\x20rebuild\x20better-sqlite3\x20--foreground-scripts',{'cwd':_0x211930,'stdio':_0x547f47(0xea),'env':{...process[_0x547f47(0x14a)]}}),B(_0x211930),console['log'](_0x547f47(0x134)),!0x0;}catch(_0x5a717a){let _0x962fc3=_0x5a717a&&typeof _0x5a717a=='object'?_0x5a717a:{},_0x300818=_0x962fc3[_0x547f47(0xe9)]?String(_0x962fc3['stderr']):'',_0x4159a4=_0x962fc3['stdout']?String(_0x962fc3[_0x547f47(0x111)]):'',_0x20cd5e=_0x300818||_0x4159a4||(_0x5a717a&&_0x5a717a['message']?String(_0x5a717a['message']):String(_0x5a717a));return console['warn']('[WARN]\x20npm\x20rebuild\x20未成功:\x20'+_0x20cd5e[_0x547f47(0x12a)](0x0,0x4b0)+(_0x20cd5e['length']>0x4b0?_0x547f47(0x11d):'')),!0x1;}}async function M(){const _0x4a412a=_0x5ad66a;let _0x10d9bc=E(),_0x452890=L+'/v'+C+'/'+_0x10d9bc;console[_0x4a412a(0x103)](_0x4a412a(0xde)+_0x10d9bc);let _0x56e236=await v(_0x452890);console[_0x4a412a(0x103)]('[INFO]\x20下载成功\x20('+(_0x56e236[_0x4a412a(0xfd)]/0x400)['toFixed'](0x1)+_0x4a412a(0xfb));let _0x16b2cc=h();if(!_0x16b2cc)throw new Error(_0x4a412a(0x11c));let _0x46ec96=_0x364724['join'](_0x16b2cc,_0x4a412a(0x13b),process[_0x4a412a(0x120)]+'-'+process[_0x4a412a(0xe0)]);return _0x38ba6d['mkdirSync'](_0x46ec96,{'recursive':!0x0}),await D(_0x56e236,_0x46ec96),console['log']('[INFO]\x20预编译包已安装到:\x20'+_0x46ec96),!0x0;}async function W(){let _0x192806=(await import('better-sqlite3'))['default'];return new _0x192806(':memory:')['close'](),!0x0;}async function V(){const _0x4053f2=_0x5ad66a;try{let {DatabaseSync:_0x32af33}=await import('node:sqlite');return new _0x32af33(_0x4053f2(0x145))['close'](),!0x0;}catch{return!0x1;}}((async()=>{const _0x346e34=_0x5ad66a;try{let _0xff2257=_0xf10279(import.meta.url),_0x2a6410=_0x364724['dirname'](_0xff2257),_0x223af5='unknown',_0x18e040='';try{let _0x5eaece=_0x364724[_0x346e34(0x106)](_0x2a6410,'package.json');if(_0x38ba6d[_0x346e34(0xe3)](_0x5eaece)){let _0x807842=JSON['parse'](_0x38ba6d['readFileSync'](_0x5eaece,'utf8'));_0x223af5=_0x807842['version']||'unknown',_0x18e040=typeof _0x807842['acwInstallNote']=='string'?_0x807842[_0x346e34(0x136)]:'';}}catch{}console[_0x346e34(0x103)](_0x346e34(0x110)),console['log']('v'+_0x223af5+_0x346e34(0xe8)+process['version']+'\x20(ABI\x20'+b()+')\x20|\x20'+process['platform']+'/'+process['arch']),_0x18e040&&console[_0x346e34(0x103)]('[提示]\x20'+_0x18e040),await V()&&(console['log'](_0x346e34(0x138)),console[_0x346e34(0x103)](_0x346e34(0x146)+process['version']+_0x346e34(0x121)),x()||console[_0x346e34(0x103)](_0x346e34(0x117)),console['log']('[OK]\x20安装完成'),process[_0x346e34(0x10b)](0x0)),P();let _0x251392=!0x1,_0x1fbb0d=null,_0x3ed96a=[];try{await W(),console['log']('[OK]\x20better-sqlite3\x20加载成功'),_0x251392=!0x0;}catch(_0x49ff34){_0x1fbb0d=_0x49ff34;let _0x39092d=_0x49ff34&&_0x49ff34['message']?String(_0x49ff34[_0x346e34(0x137)]):'',_0x34bc80=_0x39092d[_0x346e34(0x11f)]();console[_0x346e34(0x103)]('[INFO]\x20better-sqlite3\x20原生加载失败:\x20'+_0x39092d),_0x3ed96a['push'](_0x346e34(0x143)+_0x39092d['slice'](0x0,0x1f4)+(_0x39092d[_0x346e34(0xfd)]>0x1f4?'...':'')),(_0x39092d['includes']('Cannot\x20find\x20package')||_0x39092d['includes'](_0x346e34(0xdf))||_0x39092d[_0x346e34(0x123)]('MODULE_NOT_FOUND'))&&_0x3ed96a['push'](_0x346e34(0x13f));let _0x10ecec=_0x39092d['includes'](_0x346e34(0xf0))||_0x39092d['includes']('was\x20compiled\x20against')||/\.node\b/[_0x346e34(0x122)](_0x39092d)||_0x34bc80['includes']('better_sqlite3')||_0x34bc80['includes']('better-sqlite3')||_0x34bc80['includes'](_0x346e34(0x149))||_0x34bc80['includes']('invalid\x20ELF')||_0x34bc80['includes'](_0x346e34(0x140)),_0x13bb2a=h(),_0x57828c=N(_0x13bb2a);if(_0x3ed96a['push'](_0x346e34(0xe2)+process['version']+',process.versions.modules='+process['versions']['modules']+',映射\x20ABI='+b()+_0x346e34(0x11e)+process['platform']+'/'+process[_0x346e34(0xe0)]),_0x3ed96a[_0x346e34(0xdd)]('[环境]\x20better-sqlite3\x20路径='+(_0x13bb2a||_0x346e34(0x130))+',npm\x20包根='+(_0x57828c||'未解析')),!_0x10ecec)_0x3ed96a[_0x346e34(0xdd)]('[结论]\x20报错形态不像典型原生模块加载问题,未自动执行\x20OSS\x20/\x20rebuild,请根据完整堆栈排查。');else{let _0x52be08=b();if(!$['includes'](_0x52be08))_0x3ed96a['push'](_0x346e34(0x107)+_0x52be08+_0x346e34(0xf8)+$[_0x346e34(0x106)](',\x20')+_0x346e34(0xef)),console[_0x346e34(0x103)](_0x346e34(0x13d)+process['version']+_0x346e34(0x119)+_0x52be08+_0x346e34(0x10d));else{_0x3ed96a[_0x346e34(0xdd)]('[步骤]\x20ABI\x20'+_0x52be08+_0x346e34(0xff)+E()),console[_0x346e34(0x103)]('[INFO]\x20检测到原生模块加载异常,尝试从\x20OSS\x20拉取匹配当前\x20ABI\x20的预编译包...');try{await M(),console['log']('[INFO]\x20预编译包已安装,重新测试...');try{let _0x8a6671=N(h())||_0x57828c||process['cwd']();B(_0x8a6671),console[_0x346e34(0x103)]('[OK]\x20better-sqlite3\x20修复成功(OSS\x20预编译)'),_0x251392=!0x0,_0x3ed96a[_0x346e34(0xdd)]('[步骤]\x20OSS\x20预编译\x20+\x20子进程校验:\x20成功');}catch(_0xb4e8f4){_0x3ed96a[_0x346e34(0xdd)](_0x346e34(0xe1)+(_0xb4e8f4[_0x346e34(0x137)]||_0xb4e8f4)),console[_0x346e34(0x12f)]('[WARN]\x20预编译包安装后测试失败:\x20'+_0xb4e8f4['message']);}}catch(_0x4a5953){_0x3ed96a[_0x346e34(0xdd)]('[步骤]\x20OSS\x20下载或解压失败:\x20'+(_0x4a5953['message']||_0x4a5953)),console[_0x346e34(0x12f)]('[WARN]\x20OSS\x20预编译包下载或解压失败:\x20'+_0x4a5953['message']);}}!_0x251392&&_0x13bb2a?(_0x3ed96a['push']('[步骤]\x20执行自动\x20npm\x20rebuild\x20better-sqlite3(本机源码编译)'),k(_0x13bb2a)?(_0x251392=!0x0,_0x3ed96a['push'](_0x346e34(0x112))):_0x3ed96a[_0x346e34(0xdd)]('[步骤]\x20npm\x20rebuild:\x20失败(见上方日志,多为缺少\x20cl.exe\x20/\x20Xcode\x20Command\x20Line\x20Tools\x20/\x20build-essential)')):!_0x251392&&!_0x13bb2a&&_0x3ed96a['push']('[步骤]\x20未找到\x20better-sqlite3\x20目录,无法执行\x20npm\x20rebuild');}}if(!_0x251392){let _0x1614e7=_0x1fbb0d?.[_0x346e34(0x137)]||_0x346e34(0x115);if(y(),console[_0x346e34(0x144)](''),console[_0x346e34(0x144)]('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'),console[_0x346e34(0x144)](_0x346e34(0x14d)),console['error']('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'),console['error'](''),console['error'](_0x346e34(0xf3)),_0x3ed96a['forEach'](_0x162896=>console['error'](_0x162896)),console['error']('────────────────────────────────────────────────────────────'),console['error'](''),console[_0x346e34(0x144)]('首错原文:\x20'+_0x1614e7),console['error'](''),console['error']('说明:\x20已尝试\x20OSS\x20预编译与\x20npm\x20rebuild。仍失败时:务必把运行\x20npx\x20的\x20Node\x20升到\x2022.5+(内置\x20SQLite,从根上避免本问题)。其余检查:'),console['error']('\x20\x201)\x20终端执行\x20node\x20-v\x20与\x20Cursor\x20调起\x20MCP\x20用的是否为同一\x20Node;'),console['error'](_0x346e34(0x12c)),console['error']('\x20\x203)\x20再执行\x20npm\x20install\x20-g\x20@bangdao-ai/acw-tools。'),console[_0x346e34(0x144)](''),console['error']('复制以下提示词发送给\x20Cursor,让\x20AI\x20帮你修复:'),console['error'](''),process['platform']==='win32'){let _0x332159=!0x1;try{_0x115f44('where\x20cl.exe',{'stdio':'pipe'}),_0x332159=!0x0;}catch{}console[_0x346e34(0x144)](_0x332159?_0x346e34(0x100)+_0x1614e7+_0x346e34(0x13a):'我的\x20ACW\x20MCP\x20安装失败(better-sqlite3\x20/\x20原生模块),错误:'+_0x1614e7+'。优先请把运行\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['platform']==='darwin'?console[_0x346e34(0x144)]('我的\x20ACW\x20MCP\x20安装失败(better-sqlite3\x20/\x20原生模块),错误:'+_0x1614e7+_0x346e34(0xf9)):console[_0x346e34(0x144)]('我的\x20ACW\x20MCP\x20安装失败(better-sqlite3\x20/\x20原生模块),错误:'+_0x1614e7+_0x346e34(0x10c));console[_0x346e34(0x144)](''),console[_0x346e34(0x144)]('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'),process['exit'](0x1);}console[_0x346e34(0x103)](_0x346e34(0x142)),console[_0x346e34(0x103)]('[OK]\x20安装完成');}catch(_0x1dd1cc){y(),console[_0x346e34(0x144)]('[ERROR]\x20postinstall\x20脚本执行出错:',_0x1dd1cc[_0x346e34(0x137)]),process['exit'](0x1);}})());
2
+ const _0x268db8=_0x56be;(function(_0x42c966,_0x22d048){const _0x37332d=_0x56be,_0x12fa0b=_0x42c966();while(!![]){try{const _0x33d271=parseInt(_0x37332d(0x1a6))/0x1*(parseInt(_0x37332d(0x1be))/0x2)+-parseInt(_0x37332d(0x154))/0x3+parseInt(_0x37332d(0x18e))/0x4+parseInt(_0x37332d(0x1af))/0x5+parseInt(_0x37332d(0x156))/0x6*(parseInt(_0x37332d(0x16d))/0x7)+-parseInt(_0x37332d(0x18f))/0x8*(parseInt(_0x37332d(0x199))/0x9)+-parseInt(_0x37332d(0x160))/0xa;if(_0x33d271===_0x22d048)break;else _0x12fa0b['push'](_0x12fa0b['shift']());}catch(_0x2c7384){_0x12fa0b['push'](_0x12fa0b['shift']());}}}(_0x407c,0x26e7a));import _0x2f0cf0 from'fs';import _0x7544a8 from'path';import{fileURLToPath as _0x565a0e}from'url';import{execSync as _0x367262}from'child_process';import _0x3f45db from'https';import _0x1650df from'http';import _0x31cd94 from'zlib';var C=_0x268db8(0x1ae),L='https://bd-acw.oss-cn-beijing.aliyuncs.com/prebuilds/better-sqlite3',F={0x12:_0x268db8(0x16e),0x13:_0x268db8(0x191),0x14:'115',0x15:'120',0x16:'127',0x17:'131',0x18:'137',0x19:'137'},$=[_0x268db8(0x198),_0x268db8(0x18b),_0x268db8(0x1a9),_0x268db8(0x17a)],I=parseInt(process[_0x268db8(0x194)][_0x268db8(0x19f)](0x1)['split']('.')[0x0],0xa),T=((()=>{const _0x2df8c3=_0x268db8;let _0x35804b=process[_0x2df8c3(0x194)]['slice'](0x1)[_0x2df8c3(0x1ac)]('.');return parseInt(_0x35804b[0x1]||'0',0xa);})());function x(){return I>0x16||I===0x16&&T>=0x5;}function P(){const _0x5e8a9a=_0x268db8;console['log'](''),console[_0x5e8a9a(0x155)](_0x5e8a9a(0x197)),console['log'](_0x5e8a9a(0x195)),console[_0x5e8a9a(0x155)]('[提示]\x20【推荐环境】请使用\x20Node.js\x2022.5\x20及以上(LTS\x2022\x20的最新小版本即可)。'),console[_0x5e8a9a(0x155)]('[提示]\x20\x20\x20该版本起\x20Node\x20内置「node:sqlite」,安装时无需\x20better-sqlite3,Windows\x20上可避免出现「模块编译失败」。'),console[_0x5e8a9a(0x155)]('[提示]\x20【你当前的情况】当前为\x20'+process[_0x5e8a9a(0x194)]+_0x5e8a9a(0x161)),console['log']('[提示]\x20【为什么会编译失败】better-sqlite3\x20含\x20C++\x20扩展(.node\x20文件)。常见原因:'),console[_0x5e8a9a(0x155)](_0x5e8a9a(0x185)),console['log']('[提示]\x20\x20\x20·\x20任意系统:执行\x20npx\x20的\x20Node\x20版本与当初编译该模块的\x20Node\x20ABI\x20不一致(报\x20NODE_MODULE_VERSION\x20/\x20was\x20compiled\x20against);'),console[_0x5e8a9a(0x155)](_0x5e8a9a(0x1c4)),console[_0x5e8a9a(0x155)](_0x5e8a9a(0x1b5)),console['log']('[提示]\x20━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'),console['log']('');}function y(){const _0x163826=_0x268db8;console['error'](''),console[_0x163826(0x1c0)]('──────────\x20给用户的说明(安装失败)──────────'),console['error']('本步骤失败,几乎总是「可选依赖\x20better-sqlite3」的原生模块无法在您当前环境加载或编译。'),console['error']('根因:它需要与本机\x20Node\x20版本匹配的\x20C++\x20二进制;Windows\x20上缺\x20VS\x20Build\x20Tools\x20时极易报错。'),console['error']('建议:将运行「npx\x20@bangdao-ai/acw-tools」的\x20Node\x20升级到\x2022.5\x20及以上,本包将改用内置\x20SQLite,一般不再需要编译。'),console[_0x163826(0x1c0)]('package.json\x20中\x20engines\x20为\x20node>=20;要免编译、少踩坑,请以\x2022.5+\x20为准。'),console[_0x163826(0x1c0)]('────────────────────────────────────────────');}function _0x56be(_0x1c82fb,_0x578eb2){_0x1c82fb=_0x1c82fb-0x151;const _0x407c53=_0x407c();let _0x56be9b=_0x407c53[_0x1c82fb];return _0x56be9b;}function b(){const _0x2f4e73=_0x268db8;let _0x12089e=parseInt(process[_0x2f4e73(0x194)]['slice'](0x1)['split']('.')[0x0],0xa);return F[_0x12089e]||process['versions']['modules'];}function E(){const _0x53e1f0=_0x268db8;let _0x466279=C,_0x233392=b(),_0x279298=process[_0x53e1f0(0x152)],_0x354ad0=process['arch'];return'better-sqlite3-v'+_0x466279+_0x53e1f0(0x1bf)+_0x233392+'-'+_0x279298+'-'+_0x354ad0+'.tar.gz';}function v(_0x323bf9){return new Promise((_0x356950,_0x47819b)=>{const _0x47e8c5=_0x56be;let _0x29081c=(_0x323bf9[_0x47e8c5(0x15a)](_0x47e8c5(0x15e))?_0x3f45db:_0x1650df)['get'](_0x323bf9,{'timeout':0x7530},_0x2a3cd3=>{const _0x4e464b=_0x47e8c5;if(_0x2a3cd3['statusCode']===0x12d||_0x2a3cd3['statusCode']===0x12e){v(_0x2a3cd3[_0x4e464b(0x1aa)]['location'])['then'](_0x356950)[_0x4e464b(0x18c)](_0x47819b);return;}if(_0x2a3cd3[_0x4e464b(0x171)]!==0xc8){_0x47819b(new Error(_0x4e464b(0x1c1)+_0x2a3cd3['statusCode']));return;}let _0x288817=[];_0x2a3cd3['on'](_0x4e464b(0x184),_0x1f195e=>_0x288817[_0x4e464b(0x162)](_0x1f195e)),_0x2a3cd3['on']('end',()=>_0x356950(Buffer['concat'](_0x288817))),_0x2a3cd3['on'](_0x4e464b(0x1c0),_0x47819b);});_0x29081c['on']('error',_0x47819b),_0x29081c['on'](_0x47e8c5(0x1a8),()=>{const _0x53e63e=_0x47e8c5;_0x29081c[_0x53e63e(0x1a4)](),_0x47819b(new Error('Request\x20timeout'));});});}async function D(_0x36d306,_0x407751){const _0xbcb39e=_0x268db8;let _0x354d4f=_0x31cd94['gunzipSync'](_0x36d306),_0x51f56a=0x200,_0x12d3e3=0x0;for(;_0x12d3e3<_0x354d4f[_0xbcb39e(0x176)]-_0x51f56a;){let _0x4b92d3=_0x354d4f[_0xbcb39e(0x19f)](_0x12d3e3,_0x12d3e3+_0x51f56a);if(_0x4b92d3[0x0]===0x0)break;let _0x243e88=_0x4b92d3[_0xbcb39e(0x19f)](0x0,0x64)['toString'](_0xbcb39e(0x177))['replace'](/\0/g,'')['trim'](),_0x5ce806=_0x4b92d3[_0xbcb39e(0x19f)](0x7c,0x88)['toString']('utf8')['replace'](/\0/g,'')[_0xbcb39e(0x1b8)](),_0x4ed250=parseInt(_0x5ce806,0x8)||0x0,_0x2fa7e9=String[_0xbcb39e(0x187)](_0x4b92d3[0x9c]);if(_0x12d3e3+=_0x51f56a,_0x243e88&&_0x2fa7e9==='0'||_0x2fa7e9==='\x00'){let _0x5419ee=_0x354d4f[_0xbcb39e(0x19f)](_0x12d3e3,_0x12d3e3+_0x4ed250),_0x47817c=_0x7544a8['join'](_0x407751,_0x7544a8[_0xbcb39e(0x182)](_0x243e88));_0x2f0cf0[_0xbcb39e(0x1bc)](_0x7544a8['dirname'](_0x47817c),{'recursive':!0x0}),_0x2f0cf0[_0xbcb39e(0x190)](_0x47817c,_0x5419ee);}_0x12d3e3+=Math['ceil'](_0x4ed250/_0x51f56a)*_0x51f56a;}}function h(){const _0x4faec6=_0x268db8;let _0x4b82a2=[_0x7544a8['join'](process[_0x4faec6(0x188)](),_0x4faec6(0x18d),'better-sqlite3'),_0x7544a8['join'](_0x565a0e(import.meta.url),'..','node_modules','better-sqlite3')];try{let _0x8eec56=import.meta.resolve(_0x4faec6(0x1a2));if(_0x8eec56){let _0x57fde0=_0x565a0e(_0x8eec56);_0x4b82a2[_0x4faec6(0x15f)](_0x7544a8['dirname'](_0x7544a8['dirname'](_0x57fde0)));}}catch{}for(let _0x399df2 of _0x4b82a2)if(_0x2f0cf0['existsSync'](_0x7544a8[_0x4faec6(0x1c2)](_0x399df2,_0x4faec6(0x1a1))))return _0x399df2;return null;}function N(_0x2a7864){const _0x14eade=_0x268db8;if(!_0x2a7864)return null;let _0x43dcf6=_0x7544a8[_0x14eade(0x157)](_0x2a7864);return _0x7544a8['basename'](_0x43dcf6)===_0x14eade(0x18d)?_0x7544a8['dirname'](_0x43dcf6):null;}function B(_0x48146c){const _0x505b05=_0x268db8;_0x367262(_0x505b05(0x1ad),{'cwd':_0x48146c||process[_0x505b05(0x188)](),'stdio':_0x505b05(0x1a3),'env':{...process['env']}});}function k(_0x35ba5a){const _0x5a3e30=_0x268db8;let _0x1712ae=N(_0x35ba5a);if(!_0x1712ae||!_0x2f0cf0[_0x5a3e30(0x1b1)](_0x7544a8[_0x5a3e30(0x1c2)](_0x1712ae,_0x5a3e30(0x1a1))))return console[_0x5a3e30(0x1a0)](_0x5a3e30(0x186)),!0x1;console['log'](''),console['log'](_0x5a3e30(0x19d)),console['log'](_0x5a3e30(0x192)+_0x1712ae+'」执行\x20npm\x20rebuild\x20better-sqlite3'),console[_0x5a3e30(0x155)]('[INFO]\x20(需本机已有\x20C++\x20构建环境;Windows\x20为\x20VS\x20Build\x20Tools,macOS\x20为\x20Xcode\x20CLT,Linux\x20为\x20build-essential)'),console['log'](_0x5a3e30(0x19d));try{return _0x367262('npm\x20rebuild\x20better-sqlite3\x20--foreground-scripts',{'cwd':_0x1712ae,'stdio':'inherit','env':{...process['env']}}),B(_0x1712ae),console[_0x5a3e30(0x155)](_0x5a3e30(0x16a)),!0x0;}catch(_0x2f848d){let _0x587d6c=_0x2f848d&&typeof _0x2f848d==_0x5a3e30(0x183)?_0x2f848d:{},_0x566797=_0x587d6c['stderr']?String(_0x587d6c['stderr']):'',_0xee0790=_0x587d6c[_0x5a3e30(0x1c3)]?String(_0x587d6c[_0x5a3e30(0x1c3)]):'',_0x59b55a=_0x566797||_0xee0790||(_0x2f848d&&_0x2f848d[_0x5a3e30(0x158)]?String(_0x2f848d['message']):String(_0x2f848d));return console[_0x5a3e30(0x1a0)]('[WARN]\x20npm\x20rebuild\x20未成功:\x20'+_0x59b55a[_0x5a3e30(0x19f)](0x0,0x4b0)+(_0x59b55a[_0x5a3e30(0x176)]>0x4b0?'...':'')),!0x1;}}async function M(){const _0x5e4902=_0x268db8;let _0x1bc37d=E(),_0x464773=L+'/v'+C+'/'+_0x1bc37d;console[_0x5e4902(0x155)](_0x5e4902(0x16c)+_0x1bc37d);let _0x1dabd6=await v(_0x464773);console[_0x5e4902(0x155)]('[INFO]\x20下载成功\x20('+(_0x1dabd6[_0x5e4902(0x176)]/0x400)['toFixed'](0x1)+_0x5e4902(0x169));let _0x2479ce=h();if(!_0x2479ce)throw new Error(_0x5e4902(0x189));let _0x4603cd=_0x7544a8[_0x5e4902(0x1c2)](_0x2479ce,_0x5e4902(0x1b3),process['platform']+'-'+process['arch']);return _0x2f0cf0[_0x5e4902(0x1bc)](_0x4603cd,{'recursive':!0x0}),await D(_0x1dabd6,_0x4603cd),console[_0x5e4902(0x155)](_0x5e4902(0x1ab)+_0x4603cd),!0x0;}async function W(){const _0x38c4d8=_0x268db8;let _0x49f387=(await import('better-sqlite3'))[_0x38c4d8(0x15c)];return new _0x49f387(':memory:')['close'](),!0x0;}async function V(){const _0xed323e=_0x268db8;try{let {DatabaseSync:_0x411936}=await import(_0xed323e(0x19b));return new _0x411936(':memory:')['close'](),!0x0;}catch{return!0x1;}}((async()=>{const _0x131841=_0x268db8;try{let _0x2c19cb=_0x565a0e(import.meta.url),_0x49d64b=_0x7544a8['dirname'](_0x2c19cb),_0x2e9b6d=_0x131841(0x179),_0x1249b6='';try{let _0x510649=_0x7544a8[_0x131841(0x1c2)](_0x49d64b,'package.json');if(_0x2f0cf0['existsSync'](_0x510649)){let _0x272440=JSON[_0x131841(0x17c)](_0x2f0cf0['readFileSync'](_0x510649,'utf8'));_0x2e9b6d=_0x272440[_0x131841(0x194)]||_0x131841(0x179),_0x1249b6=typeof _0x272440['acwInstallNote']==_0x131841(0x18a)?_0x272440[_0x131841(0x181)]:'';}}catch{}console[_0x131841(0x155)]('ACW\x20Tools\x20MCP\x20安装后检查...'),console[_0x131841(0x155)]('v'+_0x2e9b6d+'\x20|\x20Node\x20'+process[_0x131841(0x194)]+_0x131841(0x1b7)+b()+')\x20|\x20'+process[_0x131841(0x152)]+'/'+process['arch']),_0x1249b6&&console['log'](_0x131841(0x17b)+_0x1249b6),await V()&&(console['log'](_0x131841(0x1b9)),console['log']('[提示]\x20当前\x20'+process[_0x131841(0x194)]+_0x131841(0x17e)),x()||console[_0x131841(0x155)](_0x131841(0x151)),console['log']('[OK]\x20安装完成'),process[_0x131841(0x166)](0x0)),P();let _0x32adbc=!0x1,_0x580bac=null,_0x5d8061=[];try{await W(),console[_0x131841(0x155)]('[OK]\x20better-sqlite3\x20加载成功'),_0x32adbc=!0x0;}catch(_0x3f55d2){_0x580bac=_0x3f55d2;let _0x5ca17c=_0x3f55d2&&_0x3f55d2[_0x131841(0x158)]?String(_0x3f55d2[_0x131841(0x158)]):'',_0x11cde1=_0x5ca17c[_0x131841(0x175)]();console[_0x131841(0x155)]('[INFO]\x20better-sqlite3\x20原生加载失败:\x20'+_0x5ca17c),_0x5d8061['push']('[原因]\x20首次加载失败(动态\x20import):\x20'+_0x5ca17c['slice'](0x0,0x1f4)+(_0x5ca17c[_0x131841(0x176)]>0x1f4?'...':'')),(_0x5ca17c['includes']('Cannot\x20find\x20package')||_0x5ca17c[_0x131841(0x167)]('ERR_MODULE_NOT_FOUND')||_0x5ca17c['includes'](_0x131841(0x1b0)))&&_0x5d8061['push']('[原因]\x20better-sqlite3\x20未安装到位(多为\x20optional\x20依赖下载或编译失败);在\x20Node\x20低于\x2022.5\x20且无内置\x20SQLite\x20时会导致本步失败。');let _0x2181b6=_0x5ca17c[_0x131841(0x167)]('NODE_MODULE_VERSION')||_0x5ca17c['includes'](_0x131841(0x1a5))||/\.node\b/['test'](_0x5ca17c)||_0x11cde1[_0x131841(0x167)](_0x131841(0x172))||_0x11cde1['includes'](_0x131841(0x1a2))||_0x11cde1['includes']('dlopen')||_0x11cde1['includes'](_0x131841(0x1b2))||_0x11cde1['includes']('not\x20a\x20valid\x20win32'),_0x482c1b=h(),_0x3037f5=N(_0x482c1b);if(_0x5d8061['push']('[环境]\x20Node='+process['version']+_0x131841(0x1a7)+process[_0x131841(0x1c5)][_0x131841(0x1b6)]+',映射\x20ABI='+b()+_0x131841(0x17f)+process['platform']+'/'+process[_0x131841(0x15b)]),_0x5d8061[_0x131841(0x162)]('[环境]\x20better-sqlite3\x20路径='+(_0x482c1b||_0x131841(0x1bb))+',npm\x20包根='+(_0x3037f5||'未解析')),!_0x2181b6)_0x5d8061[_0x131841(0x162)](_0x131841(0x153));else{let _0x83f0cb=b();if(!$[_0x131841(0x167)](_0x83f0cb))_0x5d8061[_0x131841(0x162)]('[原因]\x20当前\x20ABI\x20'+_0x83f0cb+'\x20不在\x20OSS\x20预编译列表\x20['+$[_0x131841(0x1c2)](',\x20')+_0x131841(0x168)),console['log']('[INFO]\x20当前\x20Node\x20'+process[_0x131841(0x194)]+'(ABI\x20v'+_0x83f0cb+_0x131841(0x19c));else{_0x5d8061['push'](_0x131841(0x16f)+_0x83f0cb+_0x131841(0x19e)+E()),console[_0x131841(0x155)](_0x131841(0x196));try{await M(),console['log'](_0x131841(0x1bd));try{let _0x72929c=N(h())||_0x3037f5||process[_0x131841(0x188)]();B(_0x72929c),console[_0x131841(0x155)](_0x131841(0x1b4)),_0x32adbc=!0x0,_0x5d8061['push']('[步骤]\x20OSS\x20预编译\x20+\x20子进程校验:\x20成功');}catch(_0x20083d){_0x5d8061[_0x131841(0x162)]('[步骤]\x20OSS\x20预编译后子进程校验仍失败:\x20'+(_0x20083d[_0x131841(0x158)]||_0x20083d)),console[_0x131841(0x1a0)]('[WARN]\x20预编译包安装后测试失败:\x20'+_0x20083d['message']);}}catch(_0x16e4ff){_0x5d8061[_0x131841(0x162)]('[步骤]\x20OSS\x20下载或解压失败:\x20'+(_0x16e4ff['message']||_0x16e4ff)),console['warn'](_0x131841(0x164)+_0x16e4ff['message']);}}!_0x32adbc&&_0x482c1b?(_0x5d8061['push']('[步骤]\x20执行自动\x20npm\x20rebuild\x20better-sqlite3(本机源码编译)'),k(_0x482c1b)?(_0x32adbc=!0x0,_0x5d8061['push']('[步骤]\x20npm\x20rebuild:\x20成功')):_0x5d8061['push'](_0x131841(0x1ba))):!_0x32adbc&&!_0x482c1b&&_0x5d8061[_0x131841(0x162)](_0x131841(0x180));}}if(!_0x32adbc){let _0x1d9e38=_0x580bac?.[_0x131841(0x158)]||'未知错误';if(y(),console[_0x131841(0x1c0)](''),console[_0x131841(0x1c0)](_0x131841(0x174)),console['error'](_0x131841(0x163)),console['error']('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'),console['error'](''),console['error'](_0x131841(0x170)),_0x5d8061[_0x131841(0x19a)](_0x3f4441=>console['error'](_0x3f4441)),console[_0x131841(0x1c0)]('────────────────────────────────────────────────────────────'),console['error'](''),console['error'](_0x131841(0x178)+_0x1d9e38),console[_0x131841(0x1c0)](''),console[_0x131841(0x1c0)]('说明:\x20已尝试\x20OSS\x20预编译与\x20npm\x20rebuild。仍失败时:务必把运行\x20npx\x20的\x20Node\x20升到\x2022.5+(内置\x20SQLite,从根上避免本问题)。其余检查:'),console['error']('\x20\x201)\x20终端执行\x20node\x20-v\x20与\x20Cursor\x20调起\x20MCP\x20用的是否为同一\x20Node;'),console['error'](_0x131841(0x17d)),console[_0x131841(0x1c0)](_0x131841(0x173)),console['error'](''),console[_0x131841(0x1c0)]('复制以下提示词发送给\x20Cursor,让\x20AI\x20帮你修复:'),console[_0x131841(0x1c0)](''),process['platform']==='win32'){let _0xd8b60=!0x1;try{_0x367262('where\x20cl.exe',{'stdio':'pipe'}),_0xd8b60=!0x0;}catch{}console[_0x131841(0x1c0)](_0xd8b60?'我的\x20ACW\x20MCP\x20安装失败(better-sqlite3\x20/\x20原生模块),错误:'+_0x1d9e38+_0x131841(0x16b):_0x131841(0x159)+_0x1d9e38+_0x131841(0x15d));}else process[_0x131841(0x152)]===_0x131841(0x165)?console['error'](_0x131841(0x159)+_0x1d9e38+'。优先将\x20Node\x20升到\x2022.5+。否则\x20xcode-select\x20--install\x20后\x20npm\x20install\x20-g\x20@bangdao-ai/acw-tools\x20重装。'):console['error']('我的\x20ACW\x20MCP\x20安装失败(better-sqlite3\x20/\x20原生模块),错误:'+_0x1d9e38+'。优先将\x20Node\x20升到\x2022.5+。否则\x20sudo\x20apt-get\x20install\x20build-essential\x20后\x20npm\x20install\x20-g\x20@bangdao-ai/acw-tools\x20重装。');console['error'](''),console[_0x131841(0x1c0)](_0x131841(0x174)),process['exit'](0x1);}console['log'](_0x131841(0x193)),console['log']('[OK]\x20安装完成');}catch(_0x1cb7a3){y(),console['error']('[ERROR]\x20postinstall\x20脚本执行出错:',_0x1cb7a3[_0x131841(0x158)]),process['exit'](0x1);}})());function _0x407c(){const _0x478666=['join','stdout','[提示]\x20\x20\x20·\x20公司网络拦截导致预编译包下载失败,被迫本地编译但本机无工具链。','versions','[提示]\x20说明:检测通过但主版本号低于文档推荐的\x2022.5+,若日后升级\x20Node,请以实际是否仍含\x20node:sqlite\x20为准。','platform','[结论]\x20报错形态不像典型原生模块加载问题,未自动执行\x20OSS\x20/\x20rebuild,请根据完整堆栈排查。','697875NFTVbd','log','6bHIJTt','dirname','message','我的\x20ACW\x20MCP\x20安装失败(better-sqlite3\x20/\x20原生模块),错误:','startsWith','arch','default','。优先请把运行\x20npx\x20的\x20Node\x20升级到\x2022.5\x20以上(免装\x20VS\x20Build\x20Tools)。否则请安装\x20Visual\x20Studio\x20Build\x20Tools\x20后再\x20npm\x20install\x20-g\x20@bangdao-ai/acw-tools。','https','unshift','3052680croGPn',',未检测到可用的内置\x20node:sqlite(或运行时被禁用),因此走可选依赖\x20better-sqlite3。','push','[ERROR]\x20better-sqlite3\x20模块加载失败,安装中止','[WARN]\x20OSS\x20预编译包下载或解压失败:\x20','darwin','exit','includes','],不会下载预编译包(避免错配二进制)。将尝试本机\x20npm\x20rebuild。','\x20KB)','[OK]\x20npm\x20rebuild\x20成功,better-sqlite3\x20已可加载','。优先请把运行\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重装。','[INFO]\x20尝试从\x20OSS\x20下载预编译包:\x20','1385209NntcKA','108','[步骤]\x20ABI\x20','──────────\x20诊断摘要(请整段复制给支持人员或\x20Cursor)──────────','statusCode','better_sqlite3','\x20\x203)\x20再执行\x20npm\x20install\x20-g\x20@bangdao-ai/acw-tools。','━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━','toLowerCase','length','utf8','首错原文:\x20','unknown','137','[提示]\x20','parse','\x20\x202)\x20若必须留在旧\x20Node:安装\x20C++\x20工具链后在包根目录执行\x20npm\x20rebuild\x20better-sqlite3\x20--foreground-scripts;','\x20满足「内置\x20SQLite」路径:对话抓取不依赖\x20better-sqlite3,Windows\x20上无需\x20VS\x20Build\x20Tools\x20即可避免「模块编译失败」。',',平台=','[步骤]\x20未找到\x20better-sqlite3\x20目录,无法执行\x20npm\x20rebuild','acwInstallNote','basename','object','data','[提示]\x20\x20\x20·\x20Windows:未安装\x20Visual\x20Studio\x20Build\x20Tools(缺\x20cl.exe),node-gyp\x20无法编译;','[WARN]\x20无法确定\x20npm\x20包根目录,跳过\x20npm\x20rebuild','fromCharCode','cwd','无法找到\x20better-sqlite3\x20模块路径','string','127','catch','node_modules','771392NRWJRz','288008AbEpDg','writeFileSync','111','[INFO]\x20自动尝试本地编译:\x20在「','[提示]\x20当前通过\x20better-sqlite3\x20完成检查。若希望免去原生依赖,可将\x20Node\x20升级到\x2022.5\x20及以上。','version','[提示]\x20【本包为什么要动\x20SQLite】需要读取\x20Cursor\x20本地的\x20state.vscdb(对话与\x20composer\x20数据)。','[INFO]\x20检测到原生模块加载异常,尝试从\x20OSS\x20拉取匹配当前\x20ABI\x20的预编译包...','[提示]\x20━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━','115','27jffjFv','forEach','node:sqlite',')无对应\x20OSS\x20预编译包,跳过\x20OSS,将尝试本机编译','[INFO]\x20━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━','\x20在预编译列表内,尝试\x20OSS:\x20','slice','warn','package.json','better-sqlite3','pipe','destroy','was\x20compiled\x20against','1cBHwBV',',process.versions.modules=','timeout','131','headers','[INFO]\x20预编译包已安装到:\x20','split','node\x20-e\x20\x22require(\x27better-sqlite3\x27)(\x27:memory:\x27).close()\x22','12.4.1','976355oMOwQz','MODULE_NOT_FOUND','existsSync','invalid\x20ELF','prebuilds','[OK]\x20better-sqlite3\x20修复成功(OSS\x20预编译)','[提示]\x20【解决办法优先级】①\x20将运行\x20npx\x20的\x20Node\x20升级到\x2022.5+(最省事);②\x20安装对应系统的\x20C++\x20编译环境后再装本包;③\x20确保\x20Cursor\x20/\x20终端使用同一份\x20Node,避免\x20ABI\x20混用。','modules','\x20(ABI\x20','trim','[OK]\x20已检测到\x20Node\x20内置\x20node:sqlite,安装检查通过。','[步骤]\x20npm\x20rebuild:\x20失败(见上方日志,多为缺少\x20cl.exe\x20/\x20Xcode\x20Command\x20Line\x20Tools\x20/\x20build-essential)','未找到','mkdirSync','[INFO]\x20预编译包已安装,重新测试...','438488kfLQIX','-node-v','error','HTTP\x20'];_0x407c=function(){return _0x478666;};return _0x407c();}