@synthetic-ai/ae-mcp 2.8.0 → 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 _0x5329(){const _0x55f267=['DxrMltG','lIbsyxCGkgzPCNn0idmWmcbJAgfYCYK6ia','C3rYAw5NAwz5','mJa2oduZnxPvEw1hCq','B2jQzwn0','rMfPBgvKihrVihbHCNnLihbHBMvSihjLC3bVBNnLoIa','mJKYmdK0mxH4z2nmtG','C2XPy2u','kgz1BMn0Aw9UkcL7cIaGicb0CNKGEWOGicaGicbPzIaODhLWzw9MicqUz2XVyMfSlL9Fu1Lox0ffid09psaIDw5KzwzPBMvKiIb8Fcb0ExbLB2yGjc5NBg9IywWUx19twu5FquvB','ktSkicaGih0Gy2f0y2GGkguPihSkicaGicaGCMv0DxjUiePtt04UC3rYAw5NAwz5khSGC3vJy2vZCZOGzMfSC2uSigvYCM9YoIbtDhjPBMCOzsaMjIbLlM1LC3nHz2uGFhWGzsKGFsK7cIaGicb9cIaGFsKOktS','qNjPzgDLihrPBwvKig91DcbHzNrLCIa','C3rYAw5N','nJv2uezoAxq','BM93','zgf0yq','lMPZEa','DgLTzw91De1Z','ywuTBwnWlwjYAwrNzq','yM9VBgvHBG','BxmUievPDgHLCIb0AguGu3LUDgHLDgLJieffie1ducbWyw5LBcbPC24NDcbYDw5UAw5NicHxAw5KB3CGpIbfEhrLBNnPB25Zid4Gu3LUDgHLDgLJieffie1duca+ifn0yxj0iejYAwrNzsKSig9YihrOzsbfEhrLBMrty3jPChqGB3aGzxHJzwvKzwqGDgHLihbHBMvSj3mGCgvYlwnHBgWGDgLTzw91Dc4GrM9Yig9WCYbVBIbODw5KCMvKCYbVzIbJB21WCYWGywXZBYbYzs1PBNn0ywXSihrOzsbSyxrLC3qGC2LNBMvKic56EhaGzNjVBsbODhrWCZOVl3n5BNrOzxrPyY5JB20UyxiVzgfZAgjVyxjKl2rVD25SB2fKCYdIGjqGB2XKzxiGCgfUzwXZignHChbLzcbWzxiTy2fSBcbLEgvJDxrPB24GyxqGmJuGCYbYzwDHCMrSzxnZig9MihrOAxmGC2v0DgLUzY4','mJfkC0TnzMW','DgvTCerPCG','otm5mdm3nNPLEMLQwG','C3rHCNrZv2L0Aa','jYbUB3qGCMvNAxn0zxjLzcbVBIb0AguGquuGyNjPzgDLlIbjCYb0AguGCgfUzwWGC3rHCNrLzd8Iih0PoWOGicaGicb9cIaGicaGihjLDhvYBIaKlMDSB2jHBc5Fx1nztL9brvS','lMPZB24','mtq1ntCWmJnds0L6uu8','CMvZxW','nteZntmYyKflCKzc','mti4mZi4v2nqv0fl','Dg1WxW','xsaHpt0GiMz1BMn0Aw9UiIKGEWOGicaGicaGihjLDhvYBIbku09olNn0CMLUz2LMEsH7ihn1y2nLC3m6igzHBhnLlcbLCNjVCJOGiLrVB2WGjW','mtG3mZbetK1vuuO','qNjPzgDLihjLDhvYBMvKig5VBI1ku09ooIa','y21KxW'];_0x5329=function(){return _0x55f267;};return _0x5329();}(function(_0x52c7f3,_0x2d4ac5){const _0x1f00d5={_0xdc00a3:0x12f,_0x17c8db:0x130,_0xe0d4cb:0x1f5,_0x59befe:0x134,_0x359f31:0x1f2,_0x5f3eb7:0x1fb,_0x4db185:0x1e9,_0x15b3cc:0x1f8,_0x2b5b52:0x111,_0x4d3c6c:0x119,_0x1cf39f:0x205,_0x1efe87:0x119,_0x481cd0:0x113},_0x234639={_0x180806:0x1c4},_0x5941bf=_0x52c7f3();function _0x10ce30(_0x458452,_0x3e1dd4){return _0x3d96(_0x3e1dd4- -_0x234639._0x180806,_0x458452);}function _0xf46808(_0x59bf09,_0x53b286){return _0x3d96(_0x59bf09-0x158,_0x53b286);}while(!![]){try{const _0x1ad520=parseInt(_0xf46808(0x1fb,0x1f3))/0x1*(-parseInt(_0x10ce30(-_0x1f00d5._0xdc00a3,-_0x1f00d5._0x17c8db))/0x2)+-parseInt(_0xf46808(_0x1f00d5._0xe0d4cb,0x1f0))/0x3+-parseInt(_0x10ce30(-0x131,-_0x1f00d5._0x59befe))/0x4+-parseInt(_0xf46808(_0x1f00d5._0x359f31,_0x1f00d5._0x5f3eb7))/0x5+-parseInt(_0xf46808(_0x1f00d5._0x4db185,_0x1f00d5._0x15b3cc))/0x6*(parseInt(_0x10ce30(-_0x1f00d5._0x2b5b52,-_0x1f00d5._0x4d3c6c))/0x7)+parseInt(_0xf46808(_0x1f00d5._0x1cf39f,0x202))/0x8+parseInt(_0x10ce30(-_0x1f00d5._0x1efe87,-_0x1f00d5._0x481cd0))/0x9;if(_0x1ad520===_0x2d4ac5)break;else _0x5941bf['push'](_0x5941bf['shift']());}catch(_0x5b6e56){_0x5941bf['push'](_0x5941bf['shift']());}}}(_0x5329,0x931fa));import{mkdirSync,writeFileSync,readFileSync,unlinkSync,existsSync,readdirSync,renameSync}from'node:fs';import{join}from'node:path';function _0x3d96(_0x4b9d21,_0x58d616){_0x4b9d21=_0x4b9d21-0x8f;const _0x53292c=_0x5329();let _0x3d96ca=_0x53292c[_0x4b9d21];if(_0x3d96['BGCokE']===undefined){var _0x386368=function(_0x1fbe24){const _0x4a4dca='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2c23e3='',_0x5a26de='';for(let _0x5a0753=0x0,_0x29e1c2,_0x5f187d,_0x4d6a48=0x0;_0x5f187d=_0x1fbe24['charAt'](_0x4d6a48++);~_0x5f187d&&(_0x29e1c2=_0x5a0753%0x4?_0x29e1c2*0x40+_0x5f187d:_0x5f187d,_0x5a0753++%0x4)?_0x2c23e3+=String['fromCharCode'](0xff&_0x29e1c2>>(-0x2*_0x5a0753&0x6)):0x0){_0x5f187d=_0x4a4dca['indexOf'](_0x5f187d);}for(let _0x3c4ccf=0x0,_0x5c9a12=_0x2c23e3['length'];_0x3c4ccf<_0x5c9a12;_0x3c4ccf++){_0x5a26de+='%'+('00'+_0x2c23e3['charCodeAt'](_0x3c4ccf)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5a26de);};_0x3d96['YjafPI']=_0x386368,_0x3d96['HuHMlG']={},_0x3d96['BGCokE']=!![];}const _0x160d92=_0x53292c[0x0],_0x57200c=_0x4b9d21+_0x160d92,_0x38e382=_0x3d96['HuHMlG'][_0x57200c];return!_0x38e382?(_0x3d96ca=_0x3d96['YjafPI'](_0x3d96ca),_0x3d96['HuHMlG'][_0x57200c]=_0x3d96ca):_0x3d96ca=_0x38e382,_0x3d96ca;}import{tmpdir}from'node:os';const DEFAULT_TEMP_DIR=join(tmpdir(),_0x1586c0(0x2c6,0x2c2)),POLL_INTERVAL_MS=0x64,DEFAULT_TIMEOUT_MS=0x1d4c0,MAX_SCRIPT_SIZE=0x1f4*0x400;let _counter=0x0;function ensureDir(_0x2c23e3){if(!existsSync(_0x2c23e3))mkdirSync(_0x2c23e3,{'recursive':!![],'mode':0x1c0});}export function getTempDir(_0x5a26de){const _0x40f9d0={_0x4d480a:0x1eb};function _0x127890(_0x27f7e5,_0x2f5283){return _0x1586c0(_0x2f5283,_0x27f7e5- -0xdb);}return _0x5a26de&&_0x5a26de[_0x127890(_0x40f9d0._0x4d480a,0x1f3)]||process.env.AE_MCP_TEMP_DIR||DEFAULT_TEMP_DIR;}export async function sendCommand(_0x5a0753,_0x29e1c2){const _0x1e874f={_0x2d202f:0x19b,_0x500252:0x192,_0x4e3ac1:0x216,_0x1dfa5e:0x223,_0x271c7f:0x218,_0x31896c:0x220},_0x76a89c={_0x29311f:0x89},_0x4c0140={_0x2d6bc8:0x45c};if(Buffer['byteLength'](_0x5a0753,_0x9e14a5(-0x1ab,-0x1ae))>MAX_SCRIPT_SIZE)throw new Error('Script\x20exceeds\x20500KB\x20size\x20limit');const _0x5f187d=getTempDir(_0x29e1c2),_0x4d6a48=_0x29e1c2&&_0x29e1c2[_0x9e14a5(-_0x1e874f._0x2d202f,-_0x1e874f._0x500252)]||DEFAULT_TIMEOUT_MS;function _0x9e14a5(_0x13078b,_0x5ed0d5){return _0x1586c0(_0x5ed0d5,_0x13078b- -_0x4c0140._0x2d6bc8);}ensureDir(_0x5f187d);const _0x3c4ccf=Date[_0x9e14a5(-0x19e,-0x1a7)]()+'_'+ ++_counter,_0x5c9a12=join(_0x5f187d,_0x42e09c(_0x1e874f._0x4e3ac1,_0x1e874f._0x1dfa5e)+_0x3c4ccf+'.jsx'),_0x5b085e=_0x3c4ccf+'_t'+_0x4d6a48,_0x48f65b=join(_0x5f187d,_0x42e09c(0x238,0x227)+_0x5b085e+_0x42e09c(0x243,0x237));function _0x42e09c(_0x4043a9,_0x5446cd){return _0x1586c0(_0x4043a9,_0x5446cd- -_0x76a89c._0x29311f);}const _0x485327=join(_0x5f187d,_0x42e09c(_0x1e874f._0x271c7f,_0x1e874f._0x31896c)+_0x5b085e+_0x9e14a5(-0x192,-0x189));writeFileSync(_0x5c9a12,_0x5a0753,_0x42e09c(0x229,0x228)),renameSync(_0x5c9a12,_0x48f65b);const _0x376cdc=await poll(_0x485327,_0x4d6a48);return safeUnlink(_0x48f65b),safeUnlink(_0x485327),_0x376cdc;}function _0x1586c0(_0x22a936,_0x53d836){const _0x5cfe01={_0x1f82f3:0x21a};return _0x3d96(_0x53d836-_0x5cfe01._0x1f82f3,_0x22a936);}export async function callPanelTool(_0x4ea378,_0x41c938,_0x179486){const _0x2f6586={_0x317259:0x44f,_0x3c51ec:0x364,_0x4e7673:0x358,_0x480879:0x357,_0x3eb551:0x352,_0x321664:0x34e,_0x1f0692:0x340,_0x2a10f1:0x34e,_0x7dd8cf:0x34f,_0x174384:0x357},_0x491132={_0x14e9a9:0x19c},_0x358142={_0x3cc284:0x9f},_0x1c31be=JSON[_0x198d8c(_0x2f6586._0x317259,0x43f)](_0x41c938||{}),_0x1d2472=_0x509862(_0x2f6586._0x3c51ec,_0x2f6586._0x4e7673)+JSON['stringify'](_0x4ea378)+_0x198d8c(0x449,0x457)+_0x4ea378+_0x509862(_0x2f6586._0x480879,0x368)+JSON[_0x509862(0x35d,_0x2f6586._0x3eb551)](_0x4ea378)+']('+_0x1c31be+_0x198d8c(0x456,0x44a);function _0x509862(_0x4836d8,_0x1e02a1){return _0x1586c0(_0x4836d8,_0x1e02a1-_0x358142._0x3cc284);}const _0xb6d0ff=await sendCommand(_0x1d2472,_0x179486);function _0x198d8c(_0x398aba,_0x2ebb90){return _0x1586c0(_0x2ebb90,_0x398aba-_0x491132._0x14e9a9);}if(!_0xb6d0ff['success'])return _0xb6d0ff;try{if(typeof _0xb6d0ff[_0x198d8c(0x45b,0x469)]===_0x198d8c(0x458,0x457))return JSON['parse'](_0xb6d0ff[_0x509862(_0x2f6586._0x321664,0x35e)]);return _0xb6d0ff;}catch(_0x4ceb9c){return{'success':![],'error':_0x509862(_0x2f6586._0x1f0692,_0x2f6586._0x2a10f1)+String(_0xb6d0ff[_0x509862(_0x2f6586._0x7dd8cf,0x35e)])[_0x509862(0x367,_0x2f6586._0x174384)](0x0,0xc8)};}}function normalizeBridgeResponse(_0x4c4b1b){const _0x4badf4={_0x4a9dcc:0x1dc,_0x580722:0x1e6,_0x4f7312:0x1df,_0x57882b:0x82,_0x5e38a0:0x75},_0xcd92b9={_0x120be7:0xe4};if(_0x4c4b1b!==null&&typeof _0x4c4b1b===_0x393823(_0x4badf4._0x4a9dcc,0x1d1)&&typeof _0x4c4b1b['success']===_0x393823(_0x4badf4._0x580722,_0x4badf4._0x4f7312))return _0x4c4b1b;function _0xb4c058(_0x346d66,_0x208d9b){return _0x1586c0(_0x208d9b,_0x346d66- -0x231);}function _0x393823(_0x1650ff,_0x52f077){return _0x1586c0(_0x1650ff,_0x52f077- -_0xcd92b9._0x120be7);}return{'success':!![],'data':JSON[_0xb4c058(_0x4badf4._0x57882b,_0x4badf4._0x5e38a0)](_0x4c4b1b)};}function poll(_0xfd9b6,_0x13a060){const _0x18700e={_0x502dcb:0x1a3,_0x3f890b:0x1a7,_0x239305:0x1a1,_0x252c0f:0x1a4,_0x53a7d8:0x1fd,_0x3e1c5c:0x214};function _0x10b796(_0xbe88b0,_0x8c066a){return _0x1586c0(_0x8c066a,_0xbe88b0- -0x32c);}const _0x2b3cf5=Date[_0x10b796(-0x6e,-0x6e)]();return new Promise(_0x24c9c5=>{const _0x3fb2ab={_0x55d19f:0x23f},_0x5aeb49=()=>{if(existsSync(_0xfd9b6)){let _0x97c75f='';try{_0x97c75f=readFileSync(_0xfd9b6,_0x4857ac(-0x1a8,-0x197));const _0x212f04=JSON['parse'](_0x97c75f);_0x24c9c5(normalizeBridgeResponse(_0x212f04));}catch(_0x5c69b5){_0x24c9c5({'success':![],'error':_0x4857ac(-_0x18700e._0x502dcb,-0x195)+_0x5c69b5['message']+_0x4857ac(-_0x18700e._0x3f890b,-_0x18700e._0x239305)+String(_0x97c75f)[_0x4857ac(-_0x18700e._0x239305,-0x194)](0x0,0x12c)});}return;}function _0x4857ac(_0x13ae39,_0xfc6d13){return _0x3d96(_0x13ae39- -_0x3fb2ab._0x55d19f,_0xfc6d13);}if(Date[_0x4857ac(-0x19b,-_0x18700e._0x252c0f)]()-_0x2b3cf5>_0x13a060){_0x24c9c5({'success':![],'error':_0x205147(_0x18700e._0x53a7d8,0x207)+_0x13a060+_0x205147(_0x18700e._0x3e1c5c,0x210)});return;}function _0x205147(_0x504e6d,_0x2e743b){return _0x3d96(_0x2e743b-0x166,_0x504e6d);}setTimeout(_0x5aeb49,POLL_INTERVAL_MS);};_0x5aeb49();});}function safeUnlink(_0x2d5d02){try{if(existsSync(_0x2d5d02))unlinkSync(_0x2d5d02);}catch(_0x9ab717){}}export function cleanupTempDir(_0x2780e1){const _0x589f73={_0x44d92b:0x425,_0x38c36c:0xb2,_0x1599c5:0x421},_0x52815e={_0x4dbd78:0x175};function _0x35ad14(_0x5b46d3,_0x312b5e){return _0x1586c0(_0x312b5e,_0x5b46d3- -0x216);}function _0x4911dc(_0x15a07a,_0x524479){return _0x1586c0(_0x15a07a,_0x524479-_0x52815e._0x4dbd78);}const _0xeb43bb=getTempDir(_0x2780e1);if(!existsSync(_0xeb43bb))return;try{for(const _0xc18fbc of readdirSync(_0xeb43bb)){(_0xc18fbc['startsWith'](_0x4911dc(0x422,_0x589f73._0x44d92b))||_0xc18fbc[_0x35ad14(0xb2,0xb4)]('res_')||_0xc18fbc[_0x35ad14(_0x589f73._0x38c36c,0xb1)](_0x4911dc(_0x589f73._0x1599c5,0x421)))&&safeUnlink(join(_0xeb43bb,_0xc18fbc));}}catch(_0x4b90d2){}}
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
+ }