@bangdao-ai/acw-tools 1.13.72 → 1.13.78
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/DISCLOSURE +9 -5
- package/README.md +4 -3
- 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/launcher.js +1 -1
- package/manifest.json +1 -1
- package/package.json +2 -4
- package/postinstall.js +0 -2
package/postinstall.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
const _0x4e77a6=_0x2cf3;(function(_0x12fd0a,_0x4c215e){const _0x42c30c=_0x2cf3,_0xc819f0=_0x12fd0a();while(!![]){try{const _0x59aca0=parseInt(_0x42c30c(0x136))/0x1*(parseInt(_0x42c30c(0x12f))/0x2)+parseInt(_0x42c30c(0x197))/0x3*(-parseInt(_0x42c30c(0x14c))/0x4)+-parseInt(_0x42c30c(0x18e))/0x5*(parseInt(_0x42c30c(0x12b))/0x6)+parseInt(_0x42c30c(0x128))/0x7+-parseInt(_0x42c30c(0x153))/0x8+parseInt(_0x42c30c(0x15d))/0x9+parseInt(_0x42c30c(0x130))/0xa*(parseInt(_0x42c30c(0x170))/0xb);if(_0x59aca0===_0x4c215e)break;else _0xc819f0['push'](_0xc819f0['shift']());}catch(_0x181c4e){_0xc819f0['push'](_0xc819f0['shift']());}}}(_0x5e0d,0x6e935));import _0x71d583 from'fs';import _0x52ca28 from'path';function _0x2cf3(_0x3e3325,_0x524431){_0x3e3325=_0x3e3325-0x127;const _0x5e0d54=_0x5e0d();let _0x2cf30e=_0x5e0d54[_0x3e3325];return _0x2cf30e;}import{fileURLToPath as _0x495965}from'url';import{execSync as _0x2af334}from'child_process';import _0x4d64b4 from'https';import _0x5055dc from'http';import _0x5bdfcd from'zlib';var C='12.4.1',L=_0x4e77a6(0x148),F={0x12:_0x4e77a6(0x17c),0x13:_0x4e77a6(0x163),0x14:'115',0x15:_0x4e77a6(0x194),0x16:_0x4e77a6(0x12c),0x17:'131',0x18:_0x4e77a6(0x133),0x19:_0x4e77a6(0x133)},$=[_0x4e77a6(0x169),_0x4e77a6(0x12c),'131',_0x4e77a6(0x133)],I=parseInt(process[_0x4e77a6(0x189)]['slice'](0x1)[_0x4e77a6(0x12e)]('.')[0x0],0xa),T=((()=>{const _0x236682=_0x4e77a6;let _0x44048e=process['version'][_0x236682(0x174)](0x1)[_0x236682(0x12e)]('.');return parseInt(_0x44048e[0x1]||'0',0xa);})());function x(){return I>0x16||I===0x16&&T>=0x5;}function P(){const _0x34a85d=_0x4e77a6;console[_0x34a85d(0x164)](''),console[_0x34a85d(0x164)]('[提示]\x20━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'),console['log']('[提示]\x20【本包为什么要动\x20SQLite】需要读取\x20Cursor\x20本地的\x20state.vscdb(对话与\x20composer\x20数据)。'),console['log'](_0x34a85d(0x173)),console['log']('[提示]\x20\x20\x20该版本起\x20Node\x20内置「node:sqlite」,安装时无需\x20better-sqlite3,Windows\x20上可避免出现「模块编译失败」。'),console['log']('[提示]\x20【你当前的情况】当前为\x20'+process['version']+',未检测到可用的内置\x20node:sqlite(或运行时被禁用),因此走可选依赖\x20better-sqlite3。'),console[_0x34a85d(0x164)](_0x34a85d(0x161)),console[_0x34a85d(0x164)]('[提示]\x20\x20\x20·\x20Windows:未安装\x20Visual\x20Studio\x20Build\x20Tools(缺\x20cl.exe),node-gyp\x20无法编译;'),console[_0x34a85d(0x164)](_0x34a85d(0x178)),console[_0x34a85d(0x164)](_0x34a85d(0x18a)),console['log'](_0x34a85d(0x183)),console['log'](_0x34a85d(0x181)),console[_0x34a85d(0x164)]('');}function y(){const _0x55bbcd=_0x4e77a6;console[_0x55bbcd(0x188)](''),console[_0x55bbcd(0x188)]('──────────\x20给用户的说明(安装失败)──────────'),console['error'](_0x55bbcd(0x137)),console['error'](_0x55bbcd(0x15a)),console[_0x55bbcd(0x188)]('建议:将运行「npx\x20@bangdao-ai/acw-tools」的\x20Node\x20升级到\x2022.5\x20及以上,本包将改用内置\x20SQLite,一般不再需要编译。'),console[_0x55bbcd(0x188)]('package.json\x20中\x20engines\x20为\x20node>=20;要免编译、少踩坑,请以\x2022.5+\x20为准。'),console[_0x55bbcd(0x188)](_0x55bbcd(0x14e));}function b(){const _0x5ae100=_0x4e77a6;let _0x323617=parseInt(process[_0x5ae100(0x189)][_0x5ae100(0x174)](0x1)[_0x5ae100(0x12e)]('.')[0x0],0xa);return F[_0x323617]||process['versions'][_0x5ae100(0x134)];}function E(){const _0x38b155=_0x4e77a6;let _0x43e7e4=C,_0x1982a5=b(),_0x102a88=process[_0x38b155(0x196)],_0x387670=process[_0x38b155(0x149)];return'better-sqlite3-v'+_0x43e7e4+_0x38b155(0x176)+_0x1982a5+'-'+_0x102a88+'-'+_0x387670+_0x38b155(0x143);}function v(_0x371e84){return new Promise((_0x4a5e04,_0x256ac5)=>{const _0x37409c=_0x2cf3;let _0x3b0bef=(_0x371e84['startsWith'](_0x37409c(0x185))?_0x4d64b4:_0x5055dc)['get'](_0x371e84,{'timeout':0x7530},_0x556129=>{const _0x4ea507=_0x37409c;if(_0x556129['statusCode']===0x12d||_0x556129[_0x4ea507(0x18c)]===0x12e){v(_0x556129[_0x4ea507(0x146)]['location'])['then'](_0x4a5e04)['catch'](_0x256ac5);return;}if(_0x556129[_0x4ea507(0x18c)]!==0xc8){_0x256ac5(new Error(_0x4ea507(0x16f)+_0x556129[_0x4ea507(0x18c)]));return;}let _0x4b6f09=[];_0x556129['on'](_0x4ea507(0x150),_0x1a524b=>_0x4b6f09['push'](_0x1a524b)),_0x556129['on']('end',()=>_0x4a5e04(Buffer['concat'](_0x4b6f09))),_0x556129['on'](_0x4ea507(0x188),_0x256ac5);});_0x3b0bef['on'](_0x37409c(0x188),_0x256ac5),_0x3b0bef['on']('timeout',()=>{const _0x50d7f6=_0x37409c;_0x3b0bef[_0x50d7f6(0x15c)](),_0x256ac5(new Error(_0x50d7f6(0x18d)));});});}async function D(_0x2fb1c3,_0x94d254){const _0x350b30=_0x4e77a6;let _0x4e1d12=_0x5bdfcd['gunzipSync'](_0x2fb1c3),_0x358a55=0x200,_0x45b923=0x0;for(;_0x45b923<_0x4e1d12[_0x350b30(0x138)]-_0x358a55;){let _0x4c9c1d=_0x4e1d12['slice'](_0x45b923,_0x45b923+_0x358a55);if(_0x4c9c1d[0x0]===0x0)break;let _0x45451e=_0x4c9c1d[_0x350b30(0x174)](0x0,0x64)['toString'](_0x350b30(0x16a))[_0x350b30(0x14f)](/\0/g,'')[_0x350b30(0x15e)](),_0x2dfabc=_0x4c9c1d['slice'](0x7c,0x88)['toString']('utf8')['replace'](/\0/g,'')[_0x350b30(0x15e)](),_0x3a607b=parseInt(_0x2dfabc,0x8)||0x0,_0x2f259f=String[_0x350b30(0x162)](_0x4c9c1d[0x9c]);if(_0x45b923+=_0x358a55,_0x45451e&&_0x2f259f==='0'||_0x2f259f==='\x00'){let _0x2eb25e=_0x4e1d12[_0x350b30(0x174)](_0x45b923,_0x45b923+_0x3a607b),_0x1264b6=_0x52ca28['join'](_0x94d254,_0x52ca28[_0x350b30(0x156)](_0x45451e));_0x71d583['mkdirSync'](_0x52ca28[_0x350b30(0x167)](_0x1264b6),{'recursive':!0x0}),_0x71d583['writeFileSync'](_0x1264b6,_0x2eb25e);}_0x45b923+=Math[_0x350b30(0x131)](_0x3a607b/_0x358a55)*_0x358a55;}}function h(){const _0x52c838=_0x4e77a6;let _0x5ef0e1=[_0x52ca28['join'](process[_0x52c838(0x14a)](),'node_modules',_0x52c838(0x18f)),_0x52ca28[_0x52c838(0x17f)](_0x495965(import.meta.url),'..',_0x52c838(0x155),_0x52c838(0x18f))];try{let _0x3e773=import.meta.resolve('better-sqlite3');if(_0x3e773){let _0x9cdb07=_0x495965(_0x3e773);_0x5ef0e1[_0x52c838(0x184)](_0x52ca28[_0x52c838(0x167)](_0x52ca28[_0x52c838(0x167)](_0x9cdb07)));}}catch{}for(let _0x30fe4b of _0x5ef0e1)if(_0x71d583['existsSync'](_0x52ca28['join'](_0x30fe4b,'package.json')))return _0x30fe4b;return null;}function N(_0x2c4683){const _0xe88dfa=_0x4e77a6;if(!_0x2c4683)return null;let _0x336099=_0x52ca28['dirname'](_0x2c4683);return _0x52ca28[_0xe88dfa(0x156)](_0x336099)==='node_modules'?_0x52ca28[_0xe88dfa(0x167)](_0x336099):null;}function B(_0xf4ce5c){const _0x2fc7c1=_0x4e77a6;_0x2af334(_0x2fc7c1(0x16d),{'cwd':_0xf4ce5c||process[_0x2fc7c1(0x14a)](),'stdio':_0x2fc7c1(0x159),'env':{...process['env']}});}function k(_0x4f2238){const _0x5d5c33=_0x4e77a6;let _0x1773f2=N(_0x4f2238);if(!_0x1773f2||!_0x71d583['existsSync'](_0x52ca28[_0x5d5c33(0x17f)](_0x1773f2,'package.json')))return console[_0x5d5c33(0x15b)]('[WARN]\x20无法确定\x20npm\x20包根目录,跳过\x20npm\x20rebuild'),!0x1;console['log'](''),console['log'](_0x5d5c33(0x17d)),console['log'](_0x5d5c33(0x140)+_0x1773f2+_0x5d5c33(0x190)),console['log']('[INFO]\x20(需本机已有\x20C++\x20构建环境;Windows\x20为\x20VS\x20Build\x20Tools,macOS\x20为\x20Xcode\x20CLT,Linux\x20为\x20build-essential)'),console[_0x5d5c33(0x164)]('[INFO]\x20━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');try{return _0x2af334('npm\x20rebuild\x20better-sqlite3\x20--foreground-scripts',{'cwd':_0x1773f2,'stdio':'inherit','env':{...process[_0x5d5c33(0x127)]}}),B(_0x1773f2),console['log'](_0x5d5c33(0x129)),!0x0;}catch(_0x52ebe6){let _0x375361=_0x52ebe6&&typeof _0x52ebe6=='object'?_0x52ebe6:{},_0x203e12=_0x375361['stderr']?String(_0x375361['stderr']):'',_0x398f98=_0x375361[_0x5d5c33(0x172)]?String(_0x375361['stdout']):'',_0x28e5b3=_0x203e12||_0x398f98||(_0x52ebe6&&_0x52ebe6['message']?String(_0x52ebe6['message']):String(_0x52ebe6));return console['warn'](_0x5d5c33(0x147)+_0x28e5b3[_0x5d5c33(0x174)](0x0,0x4b0)+(_0x28e5b3[_0x5d5c33(0x138)]>0x4b0?'...':'')),!0x1;}}async function M(){const _0x4880c9=_0x4e77a6;let _0x47a143=E(),_0x4718f7=L+'/v'+C+'/'+_0x47a143;console['log']('[INFO]\x20尝试从\x20OSS\x20下载预编译包:\x20'+_0x47a143);let _0x2599ad=await v(_0x4718f7);console[_0x4880c9(0x164)]('[INFO]\x20下载成功\x20('+(_0x2599ad['length']/0x400)['toFixed'](0x1)+'\x20KB)');let _0x3d067f=h();if(!_0x3d067f)throw new Error(_0x4880c9(0x13a));let _0x38bf12=_0x52ca28[_0x4880c9(0x17f)](_0x3d067f,_0x4880c9(0x16e),process[_0x4880c9(0x196)]+'-'+process['arch']);return _0x71d583[_0x4880c9(0x13f)](_0x38bf12,{'recursive':!0x0}),await D(_0x2599ad,_0x38bf12),console['log']('[INFO]\x20预编译包已安装到:\x20'+_0x38bf12),!0x0;}async function W(){const _0x5380fe=_0x4e77a6;let _0x646d3=(await import(_0x5380fe(0x18f)))[_0x5380fe(0x193)];return new _0x646d3(_0x5380fe(0x154))[_0x5380fe(0x18b)](),!0x0;}async function V(){const _0x2aa4c1=_0x4e77a6;try{let {DatabaseSync:_0x6c7e33}=await import(_0x2aa4c1(0x199));return new _0x6c7e33(':memory:')[_0x2aa4c1(0x18b)](),!0x0;}catch{return!0x1;}}((async()=>{const _0x1b8300=_0x4e77a6;try{let _0x1cff6f=_0x495965(import.meta.url),_0x270998=_0x52ca28[_0x1b8300(0x167)](_0x1cff6f),_0x19f04b=_0x1b8300(0x177),_0x5a254='';try{let _0x26ace6=_0x52ca28[_0x1b8300(0x17f)](_0x270998,_0x1b8300(0x144));if(_0x71d583['existsSync'](_0x26ace6)){let _0x109099=JSON['parse'](_0x71d583['readFileSync'](_0x26ace6,_0x1b8300(0x16a)));_0x19f04b=_0x109099['version']||_0x1b8300(0x177),_0x5a254=typeof _0x109099['acwInstallNote']==_0x1b8300(0x17e)?_0x109099['acwInstallNote']:'';}}catch{}console['log']('ACW\x20Tools\x20MCP\x20安装后检查...'),console[_0x1b8300(0x164)]('v'+_0x19f04b+'\x20|\x20Node\x20'+process['version']+'\x20(ABI\x20'+b()+')\x20|\x20'+process['platform']+'/'+process['arch']),_0x5a254&&console[_0x1b8300(0x164)]('[提示]\x20'+_0x5a254),await V()&&(console['log'](_0x1b8300(0x151)),console[_0x1b8300(0x164)](_0x1b8300(0x13e)+process[_0x1b8300(0x189)]+'\x20满足「内置\x20SQLite」路径:对话抓取不依赖\x20better-sqlite3,Windows\x20上无需\x20VS\x20Build\x20Tools\x20即可避免「模块编译失败」。'),x()||console[_0x1b8300(0x164)]('[提示]\x20说明:检测通过但主版本号低于文档推荐的\x2022.5+,若日后升级\x20Node,请以实际是否仍含\x20node:sqlite\x20为准。'),console[_0x1b8300(0x164)](_0x1b8300(0x13d)),process['exit'](0x0)),P();let _0x20467d=!0x1,_0x18f298=null,_0x11f275=[];try{await W(),console[_0x1b8300(0x164)](_0x1b8300(0x157)),_0x20467d=!0x0;}catch(_0x206b7a){_0x18f298=_0x206b7a;let _0x1689cd=_0x206b7a&&_0x206b7a['message']?String(_0x206b7a['message']):'',_0x543654=_0x1689cd[_0x1b8300(0x165)]();console[_0x1b8300(0x164)]('[INFO]\x20better-sqlite3\x20原生加载失败:\x20'+_0x1689cd),_0x11f275['push'](_0x1b8300(0x187)+_0x1689cd[_0x1b8300(0x174)](0x0,0x1f4)+(_0x1689cd[_0x1b8300(0x138)]>0x1f4?'...':'')),(_0x1689cd['includes']('Cannot\x20find\x20package')||_0x1689cd['includes']('ERR_MODULE_NOT_FOUND')||_0x1689cd['includes']('MODULE_NOT_FOUND'))&&_0x11f275[_0x1b8300(0x17a)](_0x1b8300(0x16c));let _0x5d143e=_0x1689cd['includes'](_0x1b8300(0x179))||_0x1689cd[_0x1b8300(0x180)]('was\x20compiled\x20against')||/\.node\b/[_0x1b8300(0x13c)](_0x1689cd)||_0x543654['includes']('better_sqlite3')||_0x543654[_0x1b8300(0x180)](_0x1b8300(0x18f))||_0x543654[_0x1b8300(0x180)](_0x1b8300(0x152))||_0x543654['includes']('invalid\x20ELF')||_0x543654[_0x1b8300(0x180)](_0x1b8300(0x132)),_0x5e13f1=h(),_0x216098=N(_0x5e13f1);if(_0x11f275['push'](_0x1b8300(0x135)+process['version']+_0x1b8300(0x139)+process[_0x1b8300(0x19a)][_0x1b8300(0x134)]+',映射\x20ABI='+b()+',平台='+process['platform']+'/'+process['arch']),_0x11f275['push'](_0x1b8300(0x198)+(_0x5e13f1||_0x1b8300(0x13b))+',npm\x20包根='+(_0x216098||_0x1b8300(0x186))),!_0x5d143e)_0x11f275[_0x1b8300(0x17a)](_0x1b8300(0x191));else{let _0x461f16=b();if(!$[_0x1b8300(0x180)](_0x461f16))_0x11f275[_0x1b8300(0x17a)]('[原因]\x20当前\x20ABI\x20'+_0x461f16+'\x20不在\x20OSS\x20预编译列表\x20['+$[_0x1b8300(0x17f)](',\x20')+'],不会下载预编译包(避免错配二进制)。将尝试本机\x20npm\x20rebuild。'),console['log'](_0x1b8300(0x160)+process['version']+_0x1b8300(0x12a)+_0x461f16+')无对应\x20OSS\x20预编译包,跳过\x20OSS,将尝试本机编译');else{_0x11f275['push']('[步骤]\x20ABI\x20'+_0x461f16+'\x20在预编译列表内,尝试\x20OSS:\x20'+E()),console[_0x1b8300(0x164)]('[INFO]\x20检测到原生模块加载异常,尝试从\x20OSS\x20拉取匹配当前\x20ABI\x20的预编译包...');try{await M(),console[_0x1b8300(0x164)]('[INFO]\x20预编译包已安装,重新测试...');try{let _0x28892a=N(h())||_0x216098||process['cwd']();B(_0x28892a),console[_0x1b8300(0x164)]('[OK]\x20better-sqlite3\x20修复成功(OSS\x20预编译)'),_0x20467d=!0x0,_0x11f275[_0x1b8300(0x17a)]('[步骤]\x20OSS\x20预编译\x20+\x20子进程校验:\x20成功');}catch(_0x442f3b){_0x11f275[_0x1b8300(0x17a)]('[步骤]\x20OSS\x20预编译后子进程校验仍失败:\x20'+(_0x442f3b[_0x1b8300(0x192)]||_0x442f3b)),console[_0x1b8300(0x15b)](_0x1b8300(0x141)+_0x442f3b[_0x1b8300(0x192)]);}}catch(_0x5d4d65){_0x11f275[_0x1b8300(0x17a)](_0x1b8300(0x166)+(_0x5d4d65['message']||_0x5d4d65)),console['warn']('[WARN]\x20OSS\x20预编译包下载或解压失败:\x20'+_0x5d4d65['message']);}}!_0x20467d&&_0x5e13f1?(_0x11f275[_0x1b8300(0x17a)](_0x1b8300(0x15f)),k(_0x5e13f1)?(_0x20467d=!0x0,_0x11f275['push'](_0x1b8300(0x195))):_0x11f275[_0x1b8300(0x17a)](_0x1b8300(0x14d))):!_0x20467d&&!_0x5e13f1&&_0x11f275[_0x1b8300(0x17a)](_0x1b8300(0x168));}}if(!_0x20467d){let _0x250222=_0x18f298?.[_0x1b8300(0x192)]||_0x1b8300(0x145);if(y(),console['error'](''),console['error']('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'),console[_0x1b8300(0x188)]('[ERROR]\x20better-sqlite3\x20模块加载失败,安装中止'),console[_0x1b8300(0x188)]('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'),console['error'](''),console[_0x1b8300(0x188)](_0x1b8300(0x142)),_0x11f275['forEach'](_0x37ccfd=>console[_0x1b8300(0x188)](_0x37ccfd)),console[_0x1b8300(0x188)]('────────────────────────────────────────────────────────────'),console['error'](''),console[_0x1b8300(0x188)]('首错原文:\x20'+_0x250222),console[_0x1b8300(0x188)](''),console['error'](_0x1b8300(0x171)),console['error']('\x20\x201)\x20终端执行\x20node\x20-v\x20与\x20Cursor\x20调起\x20MCP\x20用的是否为同一\x20Node;'),console['error']('\x20\x202)\x20若必须留在旧\x20Node:安装\x20C++\x20工具链后在包根目录执行\x20npm\x20rebuild\x20better-sqlite3\x20--foreground-scripts;'),console[_0x1b8300(0x188)]('\x20\x203)\x20再执行\x20npm\x20install\x20-g\x20@bangdao-ai/acw-tools。'),console['error'](''),console[_0x1b8300(0x188)](_0x1b8300(0x158)),console['error'](''),process[_0x1b8300(0x196)]==='win32'){let _0x3e173d=!0x1;try{_0x2af334(_0x1b8300(0x16b),{'stdio':_0x1b8300(0x159)}),_0x3e173d=!0x0;}catch{}console[_0x1b8300(0x188)](_0x3e173d?'我的\x20ACW\x20MCP\x20安装失败(better-sqlite3\x20/\x20原生模块),错误:'+_0x250222+'。优先请把运行\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重装。':_0x1b8300(0x182)+_0x250222+'。优先请把运行\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[_0x1b8300(0x196)]==='darwin'?console[_0x1b8300(0x188)](_0x1b8300(0x182)+_0x250222+_0x1b8300(0x14b)):console[_0x1b8300(0x188)]('我的\x20ACW\x20MCP\x20安装失败(better-sqlite3\x20/\x20原生模块),错误:'+_0x250222+'。优先将\x20Node\x20升到\x2022.5+。否则\x20sudo\x20apt-get\x20install\x20build-essential\x20后\x20npm\x20install\x20-g\x20@bangdao-ai/acw-tools\x20重装。');console['error'](''),console[_0x1b8300(0x188)](_0x1b8300(0x12d)),process[_0x1b8300(0x175)](0x1);}console[_0x1b8300(0x164)]('[提示]\x20当前通过\x20better-sqlite3\x20完成检查。若希望免去原生依赖,可将\x20Node\x20升级到\x2022.5\x20及以上。'),console['log'](_0x1b8300(0x13d));}catch(_0x3f64a3){y(),console['error'](_0x1b8300(0x17b),_0x3f64a3['message']),process['exit'](0x1);}})());function _0x5e0d(){const _0x2252ad=['──────────\x20诊断摘要(请整段复制给支持人员或\x20Cursor)──────────','.tar.gz','package.json','未知错误','headers','[WARN]\x20npm\x20rebuild\x20未成功:\x20','https://bd-acw.oss-cn-beijing.aliyuncs.com/prebuilds/better-sqlite3','arch','cwd','。优先将\x20Node\x20升到\x2022.5+。否则\x20xcode-select\x20--install\x20后\x20npm\x20install\x20-g\x20@bangdao-ai/acw-tools\x20重装。','4IpOCgu','[步骤]\x20npm\x20rebuild:\x20失败(见上方日志,多为缺少\x20cl.exe\x20/\x20Xcode\x20Command\x20Line\x20Tools\x20/\x20build-essential)','────────────────────────────────────────────','replace','data','[OK]\x20已检测到\x20Node\x20内置\x20node:sqlite,安装检查通过。','dlopen','6582600SiIFmH',':memory:','node_modules','basename','[OK]\x20better-sqlite3\x20加载成功','复制以下提示词发送给\x20Cursor,让\x20AI\x20帮你修复:','pipe','根因:它需要与本机\x20Node\x20版本匹配的\x20C++\x20二进制;Windows\x20上缺\x20VS\x20Build\x20Tools\x20时极易报错。','warn','destroy','7103763LxBQwb','trim','[步骤]\x20执行自动\x20npm\x20rebuild\x20better-sqlite3(本机源码编译)','[INFO]\x20当前\x20Node\x20','[提示]\x20【为什么会编译失败】better-sqlite3\x20含\x20C++\x20扩展(.node\x20文件)。常见原因:','fromCharCode','111','log','toLowerCase','[步骤]\x20OSS\x20下载或解压失败:\x20','dirname','[步骤]\x20未找到\x20better-sqlite3\x20目录,无法执行\x20npm\x20rebuild','115','utf8','where\x20cl.exe','[原因]\x20better-sqlite3\x20未安装到位(多为\x20optional\x20依赖下载或编译失败);在\x20Node\x20低于\x2022.5\x20且无内置\x20SQLite\x20时会导致本步失败。','node\x20-e\x20\x22require(\x27better-sqlite3\x27)(\x27:memory:\x27).close()\x22','prebuilds','HTTP\x20','907753IxqRnq','说明:\x20已尝试\x20OSS\x20预编译与\x20npm\x20rebuild。仍失败时:务必把运行\x20npx\x20的\x20Node\x20升到\x2022.5+(内置\x20SQLite,从根上避免本问题)。其余检查:','stdout','[提示]\x20【推荐环境】请使用\x20Node.js\x2022.5\x20及以上(LTS\x2022\x20的最新小版本即可)。','slice','exit','-node-v','unknown','[提示]\x20\x20\x20·\x20任意系统:执行\x20npx\x20的\x20Node\x20版本与当初编译该模块的\x20Node\x20ABI\x20不一致(报\x20NODE_MODULE_VERSION\x20/\x20was\x20compiled\x20against);','NODE_MODULE_VERSION','push','[ERROR]\x20postinstall\x20脚本执行出错:','108','[INFO]\x20━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━','string','join','includes','[提示]\x20━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━','我的\x20ACW\x20MCP\x20安装失败(better-sqlite3\x20/\x20原生模块),错误:','[提示]\x20【解决办法优先级】①\x20将运行\x20npx\x20的\x20Node\x20升级到\x2022.5+(最省事);②\x20安装对应系统的\x20C++\x20编译环境后再装本包;③\x20确保\x20Cursor\x20/\x20终端使用同一份\x20Node,避免\x20ABI\x20混用。','unshift','https','未解析','[原因]\x20首次加载失败(动态\x20import):\x20','error','version','[提示]\x20\x20\x20·\x20公司网络拦截导致预编译包下载失败,被迫本地编译但本机无工具链。','close','statusCode','Request\x20timeout','20365RhYPqn','better-sqlite3','」执行\x20npm\x20rebuild\x20better-sqlite3','[结论]\x20报错形态不像典型原生模块加载问题,未自动执行\x20OSS\x20/\x20rebuild,请根据完整堆栈排查。','message','default','120','[步骤]\x20npm\x20rebuild:\x20成功','platform','2603604tiWsjt','[环境]\x20better-sqlite3\x20路径=','node:sqlite','versions','env','1700783zcyPNB','[OK]\x20npm\x20rebuild\x20成功,better-sqlite3\x20已可加载','(ABI\x20v','498jsMFdC','127','━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━','split','8cWgtVl','70qODGEH','ceil','not\x20a\x20valid\x20win32','137','modules','[环境]\x20Node=','217933pmzreZ','本步骤失败,几乎总是「可选依赖\x20better-sqlite3」的原生模块无法在您当前环境加载或编译。','length',',process.versions.modules=','无法找到\x20better-sqlite3\x20模块路径','未找到','test','[OK]\x20安装完成','[提示]\x20当前\x20','mkdirSync','[INFO]\x20自动尝试本地编译:\x20在「','[WARN]\x20预编译包安装后测试失败:\x20'];_0x5e0d=function(){return _0x2252ad;};return _0x5e0d();}
|