@synthetic-ai/ae-mcp 2.7.1 → 2.8.2

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/dist/bridge.mjs CHANGED
@@ -1 +1 @@
1
- function _0x3289(_0x5c60ff,_0x23f39c){_0x5c60ff=_0x5c60ff-0xa7;const _0xabfad4=_0xabfa();let _0x3289c4=_0xabfad4[_0x5c60ff];if(_0x3289['gVMmzc']===undefined){var _0x575acd=function(_0x1126cc){const _0x4befe8='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x40bb7c='',_0x550349='';for(let _0x1e74fe=0x0,_0x49dac2,_0xede30,_0x39df8f=0x0;_0xede30=_0x1126cc['charAt'](_0x39df8f++);~_0xede30&&(_0x49dac2=_0x1e74fe%0x4?_0x49dac2*0x40+_0xede30:_0xede30,_0x1e74fe++%0x4)?_0x40bb7c+=String['fromCharCode'](0xff&_0x49dac2>>(-0x2*_0x1e74fe&0x6)):0x0){_0xede30=_0x4befe8['indexOf'](_0xede30);}for(let _0xaac4eb=0x0,_0x428321=_0x40bb7c['length'];_0xaac4eb<_0x428321;_0xaac4eb++){_0x550349+='%'+('00'+_0x40bb7c['charCodeAt'](_0xaac4eb)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x550349);};_0x3289['qvcKxV']=_0x575acd,_0x3289['eLHMWA']={},_0x3289['gVMmzc']=!![];}const _0x2538d3=_0xabfad4[0x0],_0x554419=_0x5c60ff+_0x2538d3,_0x5e13e1=_0x3289['eLHMWA'][_0x554419];return!_0x5e13e1?(_0x3289c4=_0x3289['qvcKxV'](_0x3289c4),_0x3289['eLHMWA'][_0x554419]=_0x3289c4):_0x3289c4=_0x5e13e1,_0x3289c4;}(function(_0x35f4f5,_0x3bb19c){const _0x5ec197={_0x2c33c8:0x1e9,_0x2e2bcc:0x454,_0x6b4f66:0x1e3,_0x4edd50:0x1ce,_0x462965:0x46b,_0x28f10d:0x467,_0x5ed879:0x1e0,_0x3c0764:0x452,_0x1e639e:0x462,_0x5dc976:0x1df},_0x34f06b={_0x1cdf33:0x2a9},_0x50afcf=_0x35f4f5();function _0x4c37d7(_0x2cb79c,_0x590453){return _0x3289(_0x2cb79c- -_0x34f06b._0x1cdf33,_0x590453);}function _0x2f2208(_0xa29079,_0x4011b1){return _0x3289(_0x4011b1-0x3b6,_0xa29079);}while(!![]){try{const _0x4b1907=parseInt(_0x2f2208(0x471,0x46d))/0x1*(-parseInt(_0x4c37d7(-_0x5ec197._0x2c33c8,-0x1fc))/0x2)+parseInt(_0x2f2208(_0x5ec197._0x2e2bcc,0x45f))/0x3*(-parseInt(_0x4c37d7(-_0x5ec197._0x6b4f66,-0x1e4))/0x4)+-parseInt(_0x4c37d7(-0x1de,-_0x5ec197._0x4edd50))/0x5+-parseInt(_0x2f2208(_0x5ec197._0x462965,_0x5ec197._0x28f10d))/0x6+parseInt(_0x4c37d7(-_0x5ec197._0x5ed879,-0x1d2))/0x7*(-parseInt(_0x4c37d7(-0x1f9,-0x1ef))/0x8)+parseInt(_0x2f2208(_0x5ec197._0x3c0764,_0x5ec197._0x1e639e))/0x9*(-parseInt(_0x4c37d7(-0x1fe,-0x1fe))/0xa)+parseInt(_0x4c37d7(-_0x5ec197._0x5dc976,-0x1d6))/0xb;if(_0x4b1907===_0x3bb19c)break;else _0x50afcf['push'](_0x50afcf['shift']());}catch(_0x2db2d4){_0x50afcf['push'](_0x50afcf['shift']());}}}(_0xabfa,0xf3b81));import{mkdirSync,writeFileSync,readFileSync,unlinkSync,existsSync,readdirSync,renameSync}from'node:fs';import{join}from'node:path';import{tmpdir}from'node:os';function _0x4aa854(_0x482ff9,_0x3c5555){return _0x3289(_0x482ff9-0x35f,_0x3c5555);}const DEFAULT_TEMP_DIR=join(tmpdir(),_0x4aa854(0x427,0x42b)),POLL_INTERVAL_MS=0x64,DEFAULT_TIMEOUT_MS=0x1d4c0,MAX_SCRIPT_SIZE=0x1f4*0x400;let _counter=0x0;function ensureDir(_0x40bb7c){if(!existsSync(_0x40bb7c))mkdirSync(_0x40bb7c,{'recursive':!![],'mode':0x1c0});}export function getTempDir(_0x550349){const _0x474307={_0xd6f295:0x250};function _0x3569c7(_0x24839a,_0x132ab6){return _0x4aa854(_0x24839a- -0x667,_0x132ab6);}return _0x550349&&_0x550349[_0x3569c7(-_0x474307._0xd6f295,-0x245)]||process.env.AE_MCP_TEMP_DIR||DEFAULT_TEMP_DIR;}export async function sendCommand(_0x1e74fe,_0x49dac2){const _0xf7bca6={_0x32e073:0x18f,_0x17f245:0x190,_0x265e6a:0x10,_0x56a40b:0x6,_0x212bbf:0x12,_0x12848b:0x7,_0x1621f5:0x180,_0x55cfad:0x18d};if(Buffer[_0x437ef8(-_0xf7bca6._0x32e073,-0x18f)](_0x1e74fe,_0x1969ab(0x10,0x7))>MAX_SCRIPT_SIZE)throw new Error(_0x437ef8(-0x19c,-0x196));const _0xede30=getTempDir(_0x49dac2),_0x39df8f=_0x49dac2&&_0x49dac2[_0x437ef8(-_0xf7bca6._0x17f245,-0x17e)]||DEFAULT_TIMEOUT_MS;ensureDir(_0xede30);const _0xaac4eb=Date[_0x1969ab(-_0xf7bca6._0x265e6a,-0x13)]()+'_'+ ++_counter;function _0x437ef8(_0x29873b,_0x3237ab){return _0x4aa854(_0x29873b- -0x5a3,_0x3237ab);}const _0x428321=join(_0xede30,'tmp_'+_0xaac4eb+_0x437ef8(-0x181,-0x182)),_0x349b00=_0xaac4eb+'_t'+_0x39df8f,_0xc31ad2=join(_0xede30,_0x1969ab(-0xf,-0x16)+_0x349b00+_0x1969ab(0x2,_0xf7bca6._0x56a40b)),_0x227c92=join(_0xede30,'res_'+_0x349b00+_0x1969ab(-_0xf7bca6._0x212bbf,-_0xf7bca6._0x12848b));writeFileSync(_0x428321,_0x1e74fe,_0x437ef8(-_0xf7bca6._0x1621f5,-_0xf7bca6._0x55cfad)),renameSync(_0x428321,_0xc31ad2);const _0x3d306e=await poll(_0x227c92,_0x39df8f);safeUnlink(_0xc31ad2);function _0x1969ab(_0x54e5dc,_0x1745b5){return _0x4aa854(_0x1745b5- -0x41c,_0x54e5dc);}return safeUnlink(_0x227c92),_0x3d306e;}function _0xabfa(){const _0x19fa96=['xsaHpt0GiMz1BMn0Aw9UiIKGEWOGicaGicaGihjLDhvYBIbku09olNn0CMLUz2LMEsH7ihn1y2nLC3m6igzHBhnLlcbLCNjVCJOGiLrVB2WGjW','mJGWnJG4vKnqtgrc','mJm1otu2ELPzuu9M','C3rYAw5N','BxmUievPDgHLCIb0AguGu3LUDgHLDgLJieffie1ducbWyw5LBcbPC24NDcbYDw5UAw5NicHxAw5KB3CGpIbfEhrLBNnPB25Zid4Gu3LUDgHLDgLJieffie1duca+ifn0yxj0iejYAwrNzsKSig9YihrOzsbfEhrLBMrty3jPChqGB3aGzxHJzwvKzwqGDgHLihbHBMvSj3mGCgvYlwnHBgWGDgLTzw91Dc4GrM9Yig9WCYbVBIbODw5KCMvKCYbVzIbJB21WCYWGywXZBYbYzs1PBNn0ywXSihrOzsbSyxrLC3qGC2LNBMvKic56EhaGzNjVBsbODhrWCZOVl3n5BNrOzxrPyY5JB20UyxiVzgfZAgjVyxjKl2rVD25SB2fKCYdIGjqGB2XKzxiGCgfUzwXZignHChbLzcbWzxiTy2fSBcbLEgvJDxrPB24GyxqGmJuGCYbYzwDHCMrSzxnZig9MihrOAxmGC2v0DgLUzY4','DgLTzw91De1Z','yNL0zuXLBMD0Aa','lMPZB24','mtaZmJmYmxj3BLLczW','DgvTCerPCG','yM9VBgvHBG','jYbUB3qGCMvNAxn0zxjLzcbVBIb0AguGquuGyNjPzgDLlIbjCYb0AguGCgfUzwWGC3rHCNrLzd8Iih0PoWOGicaGicb9cIaGicaGihjLDhvYBIaKlMDSB2jHBc5Fx1nztL9brvS','lIbsyxCGkgzPCNn0idmWmcbJAgfYCYK6ia','CgfYC2u','ktSkicaGih0Gy2f0y2GGkguPihSkicaGicaGCMv0DxjUiePtt04UC3rYAw5NAwz5khSGC3vJy2vZCZOGzMfSC2uSigvYCM9YoIbtDhjPBMCOzsaMjIbLlM1LC3nHz2uGFhWGzsKGFsK7cIaGicb9cIaGFsKOktS','C3rYAw5NAwz5','C3vJy2vZCW','mLnTwK52DG','C3rHCNrZv2L0Aa','qNjPzgDLihjLDhvYBMvKig5VBI1ku09ooIa','lMPZEa','DxrMltG','Dg1WxW','mJC5mZjpr21OufG','CMvZxW','ywuTBwnWlwjYAwrNzq','mteYz0vsthz4','nJm0mJm2ntDIqM9KquO','ndG2nZCZmeP1wKD4uW','y21KxW','u2nYAxb0igv4y2vLzhmGntaWs0iGC2L6zsbSAw1PDa','mtC3qwvwCgnI','BM93','mJb0whzlDMq','nZG3mdi2nLH2rvjSEa','zgf0yq','C2XPy2u'];_0xabfa=function(){return _0x19fa96;};return _0xabfa();}export async function callPanelTool(_0x4e272c,_0xc50818,_0x301545){const _0x23c6fb={_0x4ab30f:0x1b3,_0x4f837b:0x1c1,_0x3c521f:0x1b2,_0x5c76e4:0x17c,_0x1fe8f6:0x181,_0x485f2f:0x1b4,_0x23294c:0x170,_0x170800:0x171},_0xb3c4cd={_0x15031b:0x29d},_0x593dba={_0xb4d7a:0x5c0};function _0x1098be(_0xccd0ee,_0x3316f2){return _0x4aa854(_0x3316f2- -_0x593dba._0xb4d7a,_0xccd0ee);}const _0x476cdc=JSON[_0x1098be(-_0x23c6fb._0x4ab30f,-0x1a3)](_0xc50818||{}),_0x381549='(function(){\x0a\x20\x20\x20\x20try\x20{\x0a\x20\x20\x20\x20\x20\x20if\x20(typeof\x20$.global.__SYN_AE\x20===\x20\x22undefined\x22\x20||\x20typeof\x20$.global.__SYN_AE['+JSON['stringify'](_0x4e272c)+_0x1098be(-_0x23c6fb._0x4f837b,-_0x23c6fb._0x3c521f)+_0x4e272c+_0x38afc3(_0x23c6fb._0x5c76e4,0x17f)+JSON[_0x1098be(-0x1b0,-0x1a3)](_0x4e272c)+']('+_0x476cdc+_0x1098be(-0x1a9,-0x1a4),_0x556d0b=await sendCommand(_0x381549,_0x301545);if(!_0x556d0b[_0x38afc3(_0x23c6fb._0x1fe8f6,0x17f)])return _0x556d0b;function _0x38afc3(_0x223e16,_0xe1015e){return _0x4aa854(_0x223e16- -_0xb3c4cd._0x15031b,_0xe1015e);}try{if(typeof _0x556d0b['data']===_0x38afc3(0x174,0x186))return JSON['parse'](_0x556d0b['data']);return _0x556d0b;}catch(_0x53286a){return{'success':![],'error':_0x38afc3(0x184,0x17c)+String(_0x556d0b[_0x1098be(-0x1bf,-_0x23c6fb._0x485f2f)])[_0x38afc3(_0x23c6fb._0x23294c,_0x23c6fb._0x170800)](0x0,0xc8)};}}function normalizeBridgeResponse(_0x584acb){const _0x1287ed={_0x350d45:0x2c3,_0x547dc8:0x2b3},_0xd5da60={_0x351940:0x20a};function _0x58d621(_0x1903e0,_0x50882d){return _0x4aa854(_0x1903e0- -_0xd5da60._0x351940,_0x50882d);}function _0x37a674(_0x3da133,_0x17475f){return _0x4aa854(_0x17475f- -0x165,_0x3da133);}if(_0x584acb!==null&&typeof _0x584acb==='object'&&typeof _0x584acb['success']===_0x37a674(_0x1287ed._0x350d45,_0x1287ed._0x547dc8))return _0x584acb;return{'success':!![],'data':JSON[_0x37a674(0x2ab,0x2b8)](_0x584acb)};}function poll(_0x136518,_0x473a53){const _0x2b4aab={_0xe4be31:0x477,_0x4cffb4:0x47c,_0x4efe32:0x23e,_0x327daf:0x46e,_0x47378c:0x240,_0x49b942:0x23b},_0x1872d0=Date['now']();return new Promise(_0x3e244f=>{const _0x3f90ae=()=>{const _0xd8bc3e={_0x18e931:0x2ee};if(existsSync(_0x136518)){let _0x5a68c5='';try{_0x5a68c5=readFileSync(_0x136518,'utf-8');const _0x509fdf=JSON[_0x57da7d(_0x2b4aab._0xe4be31,_0x2b4aab._0x4cffb4)](_0x5a68c5);_0x3e244f(normalizeBridgeResponse(_0x509fdf));}catch(_0x77db22){_0x3e244f({'success':![],'error':'Failed\x20to\x20parse\x20panel\x20response:\x20'+_0x77db22['message']+_0x352b9c(-_0x2b4aab._0x4efe32,-0x233)+String(_0x5a68c5)[_0x57da7d(0x47b,_0x2b4aab._0x327daf)](0x0,0x12c)});}return;}function _0x57da7d(_0x3b5744,_0x4884fa){return _0x3289(_0x4884fa-0x3c0,_0x3b5744);}if(Date['now']()-_0x1872d0>_0x473a53){_0x3e244f({'success':![],'error':'Bridge\x20timed\x20out\x20after\x20'+_0x473a53+_0x352b9c(-_0x2b4aab._0x47378c,-_0x2b4aab._0x49b942)});return;}function _0x352b9c(_0x1e8b78,_0x1a0b08){return _0x3289(_0x1a0b08- -_0xd8bc3e._0x18e931,_0x1e8b78);}setTimeout(_0x3f90ae,POLL_INTERVAL_MS);};_0x3f90ae();});}function safeUnlink(_0x1322b2){try{if(existsSync(_0x1322b2))unlinkSync(_0x1322b2);}catch(_0x2e1eb8){}}export function cleanupTempDir(_0x5ae976){const _0x42dc5a={_0x276dd2:0x1b3,_0x1def01:0x1b9,_0x2f1e8a:0x1be,_0x30fefd:0x3c0,_0x38eab1:0x3c6,_0x2016f9:0x1b7},_0x2e946a={_0x5a6ed9:0x5a},_0x4ae367=getTempDir(_0x5ae976);function _0x240c3f(_0x5ebe2a,_0x3cd8ce){return _0x4aa854(_0x5ebe2a- -0x26d,_0x3cd8ce);}if(!existsSync(_0x4ae367))return;function _0x4fa7a4(_0x2a746b,_0x133ac4){return _0x4aa854(_0x133ac4- -_0x2e946a._0x5a6ed9,_0x2a746b);}try{for(const _0x4de54f of readdirSync(_0x4ae367)){(_0x4de54f[_0x240c3f(_0x42dc5a._0x276dd2,0x1b2)](_0x240c3f(0x199,0x1a2))||_0x4de54f[_0x240c3f(0x1b3,0x1c5)](_0x240c3f(_0x42dc5a._0x1def01,_0x42dc5a._0x2f1e8a))||_0x4de54f[_0x4fa7a4(_0x42dc5a._0x30fefd,_0x42dc5a._0x38eab1)](_0x240c3f(_0x42dc5a._0x2016f9,0x1c5)))&&safeUnlink(join(_0x4ae367,_0x4de54f));}}catch(_0x2ebdae){}}
1
+ function _0x5e8127(_0x32ff32,_0xa6d3e){const _0x39649e={_0x47e8c8:0x2a6};return _0x1c53(_0x32ff32-_0x39649e._0x47e8c8,_0xa6d3e);}(function(_0x33ebee,_0x1183a4){const _0xd1b88d={_0x306a67:0x194,_0xbfb4c9:0x10b,_0x1724f5:0x103,_0x3298d5:0x188,_0x267644:0xf9,_0x2d4e9a:0x17e,_0x33e317:0x113,_0x99ee3b:0x190,_0x22b858:0x18d,_0xc94df9:0xf6,_0x2074fb:0x110,_0x5e151c:0x114,_0x2f691b:0xea},_0x5de756={_0x41fc64:0x2af};function _0x29763f(_0x213416,_0x4a5500){return _0x1c53(_0x4a5500- -_0x5de756._0x41fc64,_0x213416);}function _0x1b0041(_0x452420,_0x1a2287){return _0x1c53(_0x452420- -0x1f,_0x1a2287);}const _0x423a6f=_0x33ebee();while(!![]){try{const _0x2a9520=-parseInt(_0x1b0041(0x112,0x10c))/0x1*(-parseInt(_0x29763f(-0x190,-_0xd1b88d._0x306a67))/0x2)+parseInt(_0x1b0041(_0xd1b88d._0xbfb4c9,_0xd1b88d._0x1724f5))/0x3*(parseInt(_0x29763f(-0x180,-_0xd1b88d._0x3298d5))/0x4)+parseInt(_0x1b0041(0xf5,_0xd1b88d._0x267644))/0x5+parseInt(_0x29763f(-_0xd1b88d._0x2d4e9a,-0x184))/0x6*(-parseInt(_0x1b0041(_0xd1b88d._0x33e317,0x112))/0x7)+parseInt(_0x29763f(-_0xd1b88d._0x99ee3b,-_0xd1b88d._0x22b858))/0x8+-parseInt(_0x1b0041(_0xd1b88d._0xc94df9,0xef))/0x9*(parseInt(_0x1b0041(_0xd1b88d._0x2074fb,_0xd1b88d._0x5e151c))/0xa)+-parseInt(_0x1b0041(0xf4,_0xd1b88d._0x2f691b))/0xb;if(_0x2a9520===_0x1183a4)break;else _0x423a6f['push'](_0x423a6f['shift']());}catch(_0x241fa4){_0x423a6f['push'](_0x423a6f['shift']());}}}(_0xf228,0x56ece));import{mkdirSync,writeFileSync,readFileSync,unlinkSync,existsSync,readdirSync,renameSync}from'node:fs';import{join}from'node:path';import{tmpdir}from'node:os';function _0xf228(){const _0x310197=['nejZyvH0uq','lMPZB24','qNjPzgDLihjLDhvYBMvKig5VBI1ku09ooIa','mJa0odi4nMjxzfLYEq','mtaYz1LyvfbS','DxrMltG','CgfYC2u','BM93','mtqWz3fjEgH6','yM9VBgvHBG','muXyDeLtqG','mtu3mtCXsg1nEKPK','C3rHCNrZv2L0Aa','C2XPy2u','zgf0yq','ntKYodCXng9tAwTyCq','mtGZnJK0nvvbshbwsG','mJeWotC4vxzZvhn5','lMPZEa','ywuTBwnWlwjYAwrNzq','C3rYAw5NAwz5','u2nYAxb0igv4y2vLzhmGntaWs0iGC2L6zsbSAw1PDa','y21KxW','mJiXntu4wfHABMLj','xsaHpt0GiMz1BMn0Aw9UiIKGEWOGicaGicaGihjLDhvYBIbku09olNn0CMLUz2LMEsH7ihn1y2nLC3m6igzHBhnLlcbLCNjVCJOGiLrVB2WGjW','B2jQzwn0','rMfPBgvKihrVihbHCNnLihbHBMvSihjLC3bVBNnLoIa','CMvZxW','DgvTCerPCG','C3vJy2vZCW','mZu1mtGZmK5PtMD1uG','jYbUB3qGCMvNAxn0zxjLzcbVBIb0AguGquuGyNjPzgDLlIbjCYb0AguGCgfUzwWGC3rHCNrLzd8Iih0PoWOGicaGicb9cIaGicaGihjLDhvYBIaKlMDSB2jHBc5Fx1nztL9brvS','qNjPzgDLihrPBwvKig91DcbHzNrLCIa','BxmUievPDgHLCIb0AguGu3LUDgHLDgLJieffie1ducbWyw5LBcbPC24NDcbYDw5UAw5NicHxAw5KB3CGpIbfEhrLBNnPB25Zid4Gu3LUDgHLDgLJieffie1duca+ifn0yxj0iejYAwrNzsKSig9YihrOzsbfEhrLBMrty3jPChqGB3aGzxHJzwvKzwqGDgHLihbHBMvSj3mGCgvYlwnHBgWGDgLTzw91Dc4GrM9Yig9WCYbVBIbODw5KCMvKCYbVzIbJB21WCYWGywXZBYbYzs1PBNn0ywXSihrOzsbSyxrLC3qGC2LNBMvKic56EhaGzNjVBsbODhrWCZOVl3n5BNrOzxrPyY5JB20UyxiVzgfZAgjVyxjKl2rVD25SB2fKCYdIGjqGB2XKzxiGCgfUzwXZignHChbLzcbWzxiTy2fSBcbLEgvJDxrPB24GyxqGmJuGCYbYzwDHCMrSzxnZig9MihrOAxmGC2v0DgLUzY4','kgz1BMn0Aw9UkcL7cIaGicb0CNKGEWOGicaGicbPzIaODhLWzw9MicqUz2XVyMfSlL9Fu1Lox0ffid09psaIDw5KzwzPBMvKiIb8Fcb0ExbLB2yGjc5NBg9IywWUx19twu5FquvB'];_0xf228=function(){return _0x310197;};return _0xf228();}const DEFAULT_TEMP_DIR=join(tmpdir(),_0x5e8127(0x3bd,0x3bd)),POLL_INTERVAL_MS=0x64,DEFAULT_TIMEOUT_MS=0x1d4c0,MAX_SCRIPT_SIZE=0x1f4*0x400;let _counter=0x0;function ensureDir(_0x13e3d5){if(!existsSync(_0x13e3d5))mkdirSync(_0x13e3d5,{'recursive':!![],'mode':0x1c0});}function _0x1c53(_0x333d26,_0x2da82d){_0x333d26=_0x333d26-0x110;const _0xf228bd=_0xf228();let _0x1c537d=_0xf228bd[_0x333d26];if(_0x1c53['koQAKH']===undefined){var _0x18b743=function(_0x149c1c){const _0x96cc15='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x13e3d5='',_0x3df424='';for(let _0x1f0e2f=0x0,_0x2a414a,_0x46be72,_0x16d8a9=0x0;_0x46be72=_0x149c1c['charAt'](_0x16d8a9++);~_0x46be72&&(_0x2a414a=_0x1f0e2f%0x4?_0x2a414a*0x40+_0x46be72:_0x46be72,_0x1f0e2f++%0x4)?_0x13e3d5+=String['fromCharCode'](0xff&_0x2a414a>>(-0x2*_0x1f0e2f&0x6)):0x0){_0x46be72=_0x96cc15['indexOf'](_0x46be72);}for(let _0x36c150=0x0,_0x690862=_0x13e3d5['length'];_0x36c150<_0x690862;_0x36c150++){_0x3df424+='%'+('00'+_0x13e3d5['charCodeAt'](_0x36c150)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3df424);};_0x1c53['XPGQgO']=_0x18b743,_0x1c53['qQgsoM']={},_0x1c53['koQAKH']=!![];}const _0x5d0ac2=_0xf228bd[0x0],_0x3e5f47=_0x333d26+_0x5d0ac2,_0x157f51=_0x1c53['qQgsoM'][_0x3e5f47];return!_0x157f51?(_0x1c537d=_0x1c53['XPGQgO'](_0x1c537d),_0x1c53['qQgsoM'][_0x3e5f47]=_0x1c537d):_0x1c537d=_0x157f51,_0x1c537d;}export function getTempDir(_0x3df424){const _0x44c2a6={_0x363d8b:0x3ae,_0x1e054f:0x3b6},_0xa6a6a={_0x5af567:0x10};function _0x2de085(_0x1a4302,_0x1447a8){return _0x5e8127(_0x1447a8- -_0xa6a6a._0x5af567,_0x1a4302);}return _0x3df424&&_0x3df424[_0x2de085(_0x44c2a6._0x363d8b,_0x44c2a6._0x1e054f)]||process.env.AE_MCP_TEMP_DIR||DEFAULT_TEMP_DIR;}export async function sendCommand(_0x1f0e2f,_0x2a414a){const _0x1c5c2d={_0x28f965:0x27b,_0x2874c9:0x254,_0x1f91bc:0x26d,_0x48239f:0x26b,_0x420e78:0x246,_0x5212ab:0x300,_0x1b4549:0x30d,_0x4e92a6:0x265,_0x479110:0x26c},_0x192ffd={_0x5c3876:0xbc};if(Buffer['byteLength'](_0x1f0e2f,_0x57f4d0(_0x1c5c2d._0x28f965,0x269))>MAX_SCRIPT_SIZE)throw new Error(_0x57f4d0(_0x1c5c2d._0x2874c9,0x256));const _0x46be72=getTempDir(_0x2a414a),_0x16d8a9=_0x2a414a&&_0x2a414a['timeoutMs']||DEFAULT_TIMEOUT_MS;ensureDir(_0x46be72);const _0x36c150=Date[_0x57f4d0(_0x1c5c2d._0x1f91bc,_0x1c5c2d._0x48239f)]()+'_'+ ++_counter,_0x690862=join(_0x46be72,'tmp_'+_0x36c150+'.jsx'),_0x174cff=_0x36c150+'_t'+_0x16d8a9,_0x27079a=join(_0x46be72,_0x57f4d0(_0x1c5c2d._0x420e78,0x257)+_0x174cff+_0x1c9d9c(_0x1c5c2d._0x5212ab,_0x1c5c2d._0x1b4549)),_0x2b87eb=join(_0x46be72,'res_'+_0x174cff+_0x57f4d0(0x256,_0x1c5c2d._0x4e92a6));writeFileSync(_0x690862,_0x1f0e2f,_0x57f4d0(_0x1c5c2d._0x479110,0x269)),renameSync(_0x690862,_0x27079a);function _0x57f4d0(_0x1fd3e0,_0x54dcaf){return _0x5e8127(_0x54dcaf- -0x169,_0x1fd3e0);}const _0x565ab8=await poll(_0x2b87eb,_0x16d8a9);function _0x1c9d9c(_0x49012f,_0x118f81){return _0x5e8127(_0x49012f- -_0x192ffd._0x5c3876,_0x118f81);}return safeUnlink(_0x27079a),safeUnlink(_0x2b87eb),_0x565ab8;}export async function callPanelTool(_0x18d881,_0x1f3350,_0x4a134f){const _0x5602ef={_0x49352b:0x2a0,_0x4c6903:0x2a0,_0x2f8192:0xb1,_0x592722:0x2a1,_0x307aef:0xb2,_0x3dfb5a:0x2a6,_0x46a06c:0x298,_0x2816e:0x2a5},_0x37a329={_0x186d1a:0x65e},_0x1e7e01={_0x10e406:0x476},_0x33b708=JSON[_0x1195e7(-_0x5602ef._0x49352b,-0x2a9)](_0x1f3350||{});function _0x5841a4(_0x42e3a7,_0x3a6688){return _0x5e8127(_0x3a6688- -_0x1e7e01._0x10e406,_0x42e3a7);}function _0x1195e7(_0x53ebfb,_0x2424e0){return _0x5e8127(_0x53ebfb- -_0x37a329._0x186d1a,_0x2424e0);}const _0x485bec=_0x1195e7(-0x292,-0x2a1)+JSON[_0x1195e7(-_0x5602ef._0x4c6903,-0x2ac)](_0x18d881)+_0x5841a4(-_0x5602ef._0x2f8192,-0xb4)+_0x18d881+_0x1195e7(-0x295,-_0x5602ef._0x592722)+JSON['stringify'](_0x18d881)+']('+_0x33b708+');\x0a\x20\x20\x20\x20}\x20catch\x20(e)\x20{\x0a\x20\x20\x20\x20\x20\x20return\x20JSON.stringify({\x20success:\x20false,\x20error:\x20String(e\x20&&\x20e.message\x20||\x20e)\x20});\x0a\x20\x20\x20\x20}\x0a\x20\x20})();',_0x58b751=await sendCommand(_0x485bec,_0x4a134f);if(!_0x58b751[_0x5841a4(-_0x5602ef._0x307aef,-0xaf)])return _0x58b751;try{if(typeof _0x58b751[_0x1195e7(-_0x5602ef._0x3dfb5a,-0x2ab)]==='string')return JSON['parse'](_0x58b751[_0x5841a4(-0xb0,-0xbe)]);return _0x58b751;}catch(_0x564d74){return{'success':![],'error':_0x1195e7(-0x28f,-_0x5602ef._0x46a06c)+String(_0x58b751[_0x1195e7(-0x2a6,-0x2ae)])[_0x1195e7(-0x2a7,-_0x5602ef._0x2816e)](0x0,0xc8)};}}function normalizeBridgeResponse(_0x222bfb){const _0x291817={_0x5e6266:0x242};if(_0x222bfb!==null&&typeof _0x222bfb===_0x8654f(0x23e,0x246)&&typeof _0x222bfb['success']===_0x3a3bce(0x254,_0x291817._0x5e6266))return _0x222bfb;function _0x3a3bce(_0x47f008,_0x30c9ad){return _0x5e8127(_0x30c9ad- -0x194,_0x47f008);}function _0x8654f(_0x58f6b0,_0x1983e9){return _0x5e8127(_0x58f6b0- -0x185,_0x1983e9);}return{'success':!![],'data':JSON['stringify'](_0x222bfb)};}function poll(_0x447b2a,_0x22e784){const _0x5ca361={_0x3cd244:0x65},_0x4f02dd={_0x44b1ef:0x427,_0x1781bc:0x40e,_0x3e92cf:0x51,_0x156c44:0x3d},_0x3a09d1=Date[_0x111092(-_0x5ca361._0x3cd244,-0x65)]();function _0x111092(_0x45a244,_0x3e475c){return _0x5e8127(_0x3e475c- -0x439,_0x45a244);}return new Promise(_0x11d922=>{const _0x2174d2=()=>{if(existsSync(_0x447b2a)){let _0x485fc9='';try{_0x485fc9=readFileSync(_0x447b2a,_0x5d7a9c(0x41c,0x427));const _0x45babc=JSON[_0x5d7a9c(0x41d,_0x4f02dd._0x44b1ef)](_0x485fc9);_0x11d922(normalizeBridgeResponse(_0x45babc));}catch(_0x3435bc){_0x11d922({'success':![],'error':_0x5d7a9c(_0x4f02dd._0x1781bc,0x411)+_0x3435bc['message']+'.\x20Raw\x20(first\x20300\x20chars):\x20'+String(_0x485fc9)[_0x12fcfd(0x2a,0x38)](0x0,0x12c)});}return;}function _0x5d7a9c(_0x1fa82f,_0x405379){return _0x1c53(_0x1fa82f-0x2f0,_0x405379);}if(Date[_0x12fcfd(0x47,_0x4f02dd._0x3e92cf)]()-_0x3a09d1>_0x22e784){_0x11d922({'success':![],'error':_0x12fcfd(_0x4f02dd._0x156c44,0x46)+_0x22e784+_0x5d7a9c(0x415,0x40a)});return;}function _0x12fcfd(_0x387026,_0x2c45df){return _0x1c53(_0x387026- -0xe7,_0x2c45df);}setTimeout(_0x2174d2,POLL_INTERVAL_MS);};_0x2174d2();});}function safeUnlink(_0x15e398){try{if(existsSync(_0x15e398))unlinkSync(_0x15e398);}catch(_0x27a46b){}}export function cleanupTempDir(_0x9af346){const _0x431a7f={_0x46d239:0x78,_0x4189b0:0x14f,_0x940763:0x148,_0x42ad99:0x8b},_0xafc32f={_0x275351:0x33a};function _0x5c0407(_0x1e3c7a,_0x4b99fd){return _0x5e8127(_0x4b99fd- -_0xafc32f._0x275351,_0x1e3c7a);}function _0x231b6a(_0x2b2c89,_0x4c6810){return _0x5e8127(_0x2b2c89- -0x260,_0x4c6810);}const _0x55c926=getTempDir(_0x9af346);if(!existsSync(_0x55c926))return;try{for(const _0x24e632 of readdirSync(_0x55c926)){(_0x24e632[_0x5c0407(_0x431a7f._0x46d239,0x7c)](_0x231b6a(0x160,_0x431a7f._0x4189b0))||_0x24e632[_0x231b6a(0x156,_0x431a7f._0x940763)](_0x5c0407(_0x431a7f._0x42ad99,0x8b))||_0x24e632['startsWith']('tmp_'))&&safeUnlink(join(_0x55c926,_0x24e632));}}catch(_0x535c5e){}}
@@ -0,0 +1,78 @@
1
+ // Real per-artboard/per-group bounds for a PSD, read directly from the file
2
+ // (never via After Effects). AE's own ImportOptions API only exposes a
3
+ // synthesized precomp per top-level layer group, always sized to the full
4
+ // document canvas — it does not preserve the group's original position/size
5
+ // within the document, so a multi-artboard PSD can't be split correctly using
6
+ // AE data alone. ag-psd reads the PSD's own layer records directly, including
7
+ // the "artb" artboard resource Photoshop writes for each artboard, which is
8
+ // the ground truth Photoshop itself uses when exporting that artboard.
9
+ import { createRequire } from "node:module";
10
+ import { readFileSync } from "node:fs";
11
+
12
+ const _require = createRequire(import.meta.url);
13
+
14
+ function isGroup(layer) {
15
+ return Array.isArray(layer.children);
16
+ }
17
+
18
+ function boundsOf(layer) {
19
+ if (layer.left == null) return null;
20
+ return { x: layer.left, y: layer.top, width: layer.right - layer.left, height: layer.bottom - layer.top };
21
+ }
22
+
23
+ // Bounding box of a group's own content, computed from its leaf descendants.
24
+ // Used as a fallback for groups that aren't real Photoshop artboards.
25
+ function contentBoundsOf(group) {
26
+ let x1 = Infinity, y1 = Infinity, x2 = -Infinity, y2 = -Infinity;
27
+ (function walk(node) {
28
+ if (!node.children) return;
29
+ for (const child of node.children) {
30
+ if (child.children) { walk(child); continue; }
31
+ const b = boundsOf(child);
32
+ if (!b || (b.width === 0 && b.height === 0)) continue;
33
+ x1 = Math.min(x1, b.x);
34
+ y1 = Math.min(y1, b.y);
35
+ x2 = Math.max(x2, b.x + b.width);
36
+ y2 = Math.max(y2, b.y + b.height);
37
+ }
38
+ })(group);
39
+ if (!isFinite(x1)) return null;
40
+ return { x: Math.round(x1), y: Math.round(y1), width: Math.round(x2 - x1), height: Math.round(y2 - y1) };
41
+ }
42
+
43
+ /**
44
+ * Returns the real, document-space bounds of every top-level layer group in
45
+ * a PSD: { name, x, y, width, height, isArtboard }[]. Prefers each group's
46
+ * own Photoshop artboard rect when present; otherwise falls back to the
47
+ * bounding box of its actual content (still document-space, unlike anything
48
+ * AE's importer exposes).
49
+ */
50
+ export function getPsdTopLevelGroupBounds(filePath) {
51
+ const { readPsd } = _require("ag-psd");
52
+ const buffer = readFileSync(filePath);
53
+ const psd = readPsd(buffer, {
54
+ skipCompositeImageData: true,
55
+ skipThumbnail: true,
56
+ skipLayerImageData: true,
57
+ });
58
+ const out = [];
59
+ for (const layer of psd.children || []) {
60
+ if (!isGroup(layer)) continue;
61
+ const name = (layer.name || "").trim();
62
+ const ab = layer.artboard && layer.artboard.rect;
63
+ if (ab && ab.right > ab.left && ab.bottom > ab.top) {
64
+ out.push({
65
+ name,
66
+ x: Math.round(ab.left),
67
+ y: Math.round(ab.top),
68
+ width: Math.round(ab.right - ab.left),
69
+ height: Math.round(ab.bottom - ab.top),
70
+ isArtboard: true,
71
+ });
72
+ continue;
73
+ }
74
+ const bounds = contentBoundsOf(layer);
75
+ if (bounds) out.push({ name, ...bounds, isArtboard: false });
76
+ }
77
+ return out;
78
+ }