@nuvin/agent-core 0.0.0-rc.15 → 0.0.0-rc.16

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.
@@ -1 +1 @@
1
- function _0x1531(_0x3ae6e0,_0x4ac9f2){_0x3ae6e0=_0x3ae6e0-0x188;const _0x203408=_0x2034();let _0x153156=_0x203408[_0x3ae6e0];if(_0x1531['TevQRT']===undefined){var _0x487aa4=function(_0x48d945){const _0xe32dd3='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2c6685='',_0x2dbead='';for(let _0x5686ae=0x0,_0x5aa212,_0x461ac7,_0x255274=0x0;_0x461ac7=_0x48d945['charAt'](_0x255274++);~_0x461ac7&&(_0x5aa212=_0x5686ae%0x4?_0x5aa212*0x40+_0x461ac7:_0x461ac7,_0x5686ae++%0x4)?_0x2c6685+=String['fromCharCode'](0xff&_0x5aa212>>(-0x2*_0x5686ae&0x6)):0x0){_0x461ac7=_0xe32dd3['indexOf'](_0x461ac7);}for(let _0x2f8dab=0x0,_0x513c65=_0x2c6685['length'];_0x2f8dab<_0x513c65;_0x2f8dab++){_0x2dbead+='%'+('00'+_0x2c6685['charCodeAt'](_0x2f8dab)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2dbead);};_0x1531['BaAHwv']=_0x487aa4,_0x1531['VKhBfs']={},_0x1531['TevQRT']=!![];}const _0x197a83=_0x203408[0x0],_0x56eb3d=_0x3ae6e0+_0x197a83,_0x4bd7cf=_0x1531['VKhBfs'][_0x56eb3d];return!_0x4bd7cf?(_0x153156=_0x1531['BaAHwv'](_0x153156),_0x1531['VKhBfs'][_0x56eb3d]=_0x153156):_0x153156=_0x4bd7cf,_0x153156;}(function(_0x1d13b2,_0x42f083){const _0x28cf41={_0x114920:0x193,_0x28140d:0x199,_0xd7158d:0x1c5,_0x32a198:0x1a6,_0x4b1c93:0x30b,_0x5d0a94:0x320,_0x391f3d:0x1a0,_0x3202f6:0x1a5,_0x5aa432:0x315,_0x2b0ea3:0x2f0,_0x59c06c:0x19c,_0x37e64a:0x17c,_0x59e651:0x17b,_0x247c98:0x189,_0x5c2482:0x18d,_0x9f6ad8:0x19b,_0x2835d5:0x334,_0x4dd4e7:0x319,_0x505f9e:0x339,_0x160b7a:0x19d,_0x5aa12a:0x17d,_0x3bb9a0:0x2ed,_0x46e7c1:0x30a,_0x1f354b:0x2d5},_0x3eb78b={_0x3df12b:0x34d};function _0x3a9608(_0x42f1dc,_0x715efe,_0x3c3da8,_0x2d9264){return _0x1531(_0x2d9264- -_0x3eb78b._0x3df12b,_0x42f1dc);}const _0x64bf9b=_0x1d13b2();function _0x31e55b(_0x257e78,_0x375990,_0x5b8aa0,_0x40a590){return _0x1531(_0x5b8aa0-0x160,_0x257e78);}while(!![]){try{const _0x3eda73=parseInt(_0x3a9608(-_0x28cf41._0x114920,-_0x28cf41._0x28140d,-_0x28cf41._0xd7158d,-_0x28cf41._0x32a198))/0x1*(parseInt(_0x31e55b(_0x28cf41._0x4b1c93,0x310,_0x28cf41._0x5d0a94,0x306))/0x2)+-parseInt(_0x3a9608(-_0x28cf41._0x391f3d,-_0x28cf41._0x3202f6,-0x1b8,-0x1c0))/0x3+-parseInt(_0x31e55b(_0x28cf41._0x5aa432,_0x28cf41._0x2b0ea3,0x2fd,0x2e3))/0x4*(-parseInt(_0x3a9608(-_0x28cf41._0x59c06c,-0x183,-0x18b,-0x197))/0x5)+-parseInt(_0x3a9608(-_0x28cf41._0x37e64a,-_0x28cf41._0x59e651,-_0x28cf41._0x247c98,-0x194))/0x6+parseInt(_0x3a9608(-0x17b,-_0x28cf41._0x5c2482,-0x1a0,-_0x28cf41._0x9f6ad8))/0x7+-parseInt(_0x31e55b(_0x28cf41._0x2835d5,_0x28cf41._0x4dd4e7,0x322,_0x28cf41._0x505f9e))/0x8+-parseInt(_0x3a9608(-0x174,-_0x28cf41._0x160b7a,-_0x28cf41._0x5aa12a,-0x18e))/0x9*(-parseInt(_0x31e55b(_0x28cf41._0x3bb9a0,_0x28cf41._0x46e7c1,0x2f2,_0x28cf41._0x1f354b))/0xa);if(_0x3eda73===_0x42f083)break;else _0x64bf9b['push'](_0x64bf9b['shift']());}catch(_0x47027d){_0x64bf9b['push'](_0x64bf9b['shift']());}}}(_0x2034,0xbf7c3));import{spawn}from'child_process';var DEFAULT_TIMEOUT_S=0x3c;async function executeCommandHook(_0x2c6685,_0x2dbead,_0x5686ae=DEFAULT_TIMEOUT_S,_0x5aa212){const _0xb13ac3={_0x35581f:0x175,_0x576f6d:0x188},_0x14e47d={_0x3f0275:0x20,_0x218d24:0x9,_0x5e8113:0x3,_0x68ed47:0x12,_0x28967b:0x178,_0xcb7096:0x15e,_0xa5a6:0x31,_0x17cc61:0x3a,_0x1ad5ee:0x38,_0x337279:0x26,_0x404581:0x166,_0x73e74b:0x177,_0x1bc915:0x17e,_0x23cc85:0x192,_0x1186b9:0x192,_0x4e9db3:0x30,_0x3c1d4d:0x17a,_0x73f059:0x17d,_0x4e9a40:0x19a,_0x38d9c9:0x2e,_0x5708aa:0x195,_0x225093:0x19c,_0x58a38e:0x199},_0x313665={_0x413e3a:0xaf,_0x1ccc3b:0xd7,_0xe88ec9:0xc0,_0x50962b:0xb5,_0xfbb962:0xeb},_0x582b33={_0x5ebcfe:0x30},_0x5c83ec={_0x274be:0x1a4,_0x57bea6:0xc6},_0xa366b={_0x3bba84:0x148,_0x2fcbf7:0x12b},_0x38cc98={_0x475274:0x121,_0x45fbe4:0x118,_0x532f3f:0x10a};function _0x3ee5b2(_0x1e2080,_0x3a9c1d,_0x1aaa82,_0x27eb4b){return _0x1531(_0x3a9c1d- -0x21,_0x27eb4b);}const _0x461ac7=Date[_0x3ee5b2(_0xb13ac3._0x35581f,0x177,0x16b,_0xb13ac3._0x576f6d)]();return new Promise(_0x255274=>{const _0x4b3f06={_0x30011c:0x67,_0x13c2b5:0x79,_0x578136:0x6c,_0x1ca36d:0x3ff,_0x4c3e2b:0x40e,_0x1fa3e3:0x3fb,_0x302c9a:0x407,_0x2a0f6:0x3f3,_0x52dd89:0x3dc,_0x2ae971:0x3e8,_0x270c0c:0x3e5,_0x358c05:0x412,_0x1d6728:0x86,_0x55ecc4:0xa4,_0x21826f:0x94,_0xfb9fae:0x68,_0x53d2e6:0x85,_0x4f7e50:0x3e4,_0xd1b117:0x3c8},_0x1dd72b={_0x5baf34:0xfb,_0x4da4d5:0x413,_0x277443:0x9c},_0x386f53={_0x179bea:0x2d,_0x109347:0x213},_0x49f588={_0x321437:0x216,_0x2c38b:0x1f1,_0x2ea262:0x1f8},_0x2e634d={_0x3a54da:0xed},_0x2a31a4={_0x461f1c:0xea,_0x1f1aa8:0xbb},_0x2f8dab=spawn('sh',['-c',_0x2c6685],{'stdio':[_0xeff669(0x10,-0x4,-0x9,-0x18),_0xeff669(-_0x14e47d._0x3f0275,-0x23,-_0x14e47d._0x218d24,-0xa),_0xeff669(_0x14e47d._0x5e8113,-0x12,-_0x14e47d._0x218d24,-_0x14e47d._0x68ed47)],'env':{...process[_0x1f41d3(-_0x14e47d._0x28967b,-_0x14e47d._0xcb7096,-0x170,-0x17b)],'CLAUDE_PROJECT_DIR':_0x5aa212??process[_0xeff669(-_0x14e47d._0xa5a6,-0x32,-_0x14e47d._0x17cc61,-_0x14e47d._0x1ad5ee)]()}});let _0x513c65='',_0xfe920='';_0x2f8dab['stdout']['on'](_0xeff669(-0x10,-_0x14e47d._0x68ed47,-_0x14e47d._0x337279,-0x16),_0x4ad396=>{_0x513c65+=_0x4ad396['toString']();}),_0x2f8dab[_0x1f41d3(-_0x14e47d._0x404581,-0x197,-0x187,-_0x14e47d._0x73e74b)]['on'](_0xeff669(-0x16,-0x13,-0x26,-0x17),_0x5f2b5d=>{const _0x2f97e6={_0x1698cd:0x1c3};function _0x41a607(_0xba82eb,_0x5db34b,_0x997b24,_0x2d2343){return _0x1f41d3(_0xba82eb-_0x2f97e6._0x1698cd,_0x5db34b,_0x997b24-0x184,_0x2d2343-0xac);}_0xfe920+=_0x5f2b5d[_0x41a607(-0x124,-_0x38cc98._0x475274,-_0x38cc98._0x45fbe4,-_0x38cc98._0x532f3f)]();}),_0x2f8dab[_0x1f41d3(-_0x14e47d._0x1bc915,-0x1a2,-_0x14e47d._0x23cc85,-_0x14e47d._0x1186b9)]['on'](_0xeff669(-0xc,-_0x14e47d._0x4e9db3,-_0x14e47d._0x3f0275,-0x3a),_0x1d6e6c=>{function _0x2ce66f(_0x1d07b7,_0x5de937,_0x4834d1,_0x9d9dd2){return _0x1f41d3(_0x1d07b7-_0x2a31a4._0x461f1c,_0x9d9dd2,_0x4834d1-_0x2a31a4._0x1f1aa8,_0x5de937-0x2c1);}if(_0x1d6e6c[_0x2ce66f(0x13d,_0xa366b._0x3bba84,0x143,_0xa366b._0x2fcbf7)]!=='EPIPE')throw _0x1d6e6c;}),_0x2f8dab['stdin'][_0x1f41d3(-0x170,-_0x14e47d._0x3c1d4d,-0x165,-_0x14e47d._0x73f059)](JSON[_0x1f41d3(-_0x14e47d._0x4e9a40,-0x198,-0x1b7,-0x1a9)](_0x2dbead)),_0x2f8dab['stdin']['end']();function _0xeff669(_0x53dcbe,_0x48456d,_0x41a2b7,_0x2c15cf){return _0x3ee5b2(_0x53dcbe-0x1ba,_0x41a2b7- -_0x5c83ec._0x274be,_0x41a2b7-_0x5c83ec._0x57bea6,_0x53dcbe);}const _0x50f49a=setTimeout(()=>{const _0x237a3e={_0x35e10b:0x142,_0x2bf393:0x17d,_0x2d574a:0x77};function _0x374535(_0x7d238,_0x290f1b,_0x1be863,_0x26098f){return _0x1f41d3(_0x7d238-_0x237a3e._0x35e10b,_0x290f1b,_0x1be863-_0x237a3e._0x2bf393,_0x26098f- -_0x237a3e._0x2d574a);}function _0x438a5e(_0x3b98f2,_0x3fd0b3,_0x158c49,_0x4b24b9){return _0xeff669(_0x3b98f2,_0x3fd0b3-_0x2e634d._0x3a54da,_0x4b24b9- -0x65,_0x4b24b9-0x188);}_0x2f8dab[_0x438a5e(-0x5a,-0x85,-0x76,-0x6f)]('SIGKILL'),_0x255274({'status':'error','error':_0x374535(-_0x49f588._0x321437,-0x1fc,-_0x49f588._0x2c38b,-_0x49f588._0x2ea262)+_0x5686ae+'s','duration_ms':Date['now']()-_0x461ac7});},_0x5686ae*0x3e8);_0x2f8dab['on'](_0xeff669(0x0,-0x13,-0x1c,-_0x14e47d._0x38d9c9),_0x6de020=>{clearTimeout(_0x50f49a);function _0x3ecce5(_0x413aba,_0x83b1a6,_0x300f09,_0x4ecc63){return _0x1f41d3(_0x413aba-_0x386f53._0x179bea,_0x413aba,_0x300f09-0xeb,_0x83b1a6-_0x386f53._0x109347);}function _0x5bff85(_0x270b18,_0x1c599d,_0x352e19,_0x1fa430){return _0xeff669(_0x352e19,_0x1c599d-_0x1dd72b._0x5baf34,_0x270b18-_0x1dd72b._0x4da4d5,_0x1fa430-_0x1dd72b._0x277443);}const _0x364bcb=Date['now']()-_0x461ac7;if(_0x6de020===0x2){_0x255274({'status':_0x3ecce5(_0x4b3f06._0x30011c,_0x4b3f06._0x13c2b5,0x72,_0x4b3f06._0x578136),'output':{'decision':'block','reason':_0xfe920[_0x5bff85(_0x4b3f06._0x1ca36d,0x41d,_0x4b3f06._0x4c3e2b,_0x4b3f06._0x1fa3e3)]()||_0x5bff85(0x412,0x3f2,0x400,_0x4b3f06._0x302c9a)},'duration_ms':_0x364bcb});return;}if(_0x6de020!==0x0){_0x255274({'status':_0x5bff85(_0x4b3f06._0x2a0f6,_0x4b3f06._0x52dd89,_0x4b3f06._0x2ae971,_0x4b3f06._0x270c0c),'error':'Hook\x20exited\x20with\x20code\x20'+_0x6de020+(_0xfe920[_0x3ecce5(0x67,0x86,0x70,0x92)]()?':\x20'+_0xfe920[_0x5bff85(0x3ff,0x3e6,_0x4b3f06._0x358c05,0x3f2)]():''),'duration_ms':_0x364bcb});return;}const _0x55b2c1=_0x513c65[_0x3ecce5(0x8d,_0x4b3f06._0x1d6728,_0x4b3f06._0x55ecc4,_0x4b3f06._0x21826f)]();if(_0x55b2c1[_0x3ecce5(0x82,0x77,0x94,0x7b)]===0x0){_0x255274({'status':_0x3ecce5(0x6b,_0x4b3f06._0xfb9fae,0x5d,_0x4b3f06._0x53d2e6),'duration_ms':_0x364bcb});return;}try{const _0x101f23=JSON['parse'](_0x55b2c1);_0x255274({'status':_0x5bff85(0x3e1,_0x4b3f06._0x4f7e50,0x3d0,_0x4b3f06._0xd1b117),'output':_0x101f23,'duration_ms':_0x364bcb});}catch{_0x255274({'status':'pass','duration_ms':_0x364bcb});}});function _0x1f41d3(_0x41c15a,_0x2ef2ca,_0x1704d7,_0x498369){return _0x3ee5b2(_0x41c15a-_0x582b33._0x5ebcfe,_0x498369- -0x31d,_0x1704d7-0xb5,_0x2ef2ca);}_0x2f8dab['on'](_0x1f41d3(-0x1a5,-_0x14e47d._0x5708aa,-_0x14e47d._0x225093,-_0x14e47d._0x58a38e),_0x11f8c2=>{const _0x41a1b9={_0x20463d:0xcb,_0x1cbb0d:0xd9},_0x116304={_0xd7bde:0xd,_0x1ac7e7:0x600};function _0x4e928e(_0x371580,_0x98faf3,_0x25473c,_0x5c848d){return _0x1f41d3(_0x371580-0xe1,_0x25473c,_0x25473c-_0x116304._0xd7bde,_0x5c848d-_0x116304._0x1ac7e7);}function _0x156080(_0x5f12d4,_0x57292c,_0x25912d,_0x12afc7){return _0x1f41d3(_0x5f12d4-0x177,_0x57292c,_0x25912d-_0x41a1b9._0x20463d,_0x12afc7-_0x41a1b9._0x1cbb0d);}clearTimeout(_0x50f49a),_0x255274({'status':_0x156080(-_0x313665._0x413e3a,-_0x313665._0x1ccc3b,-0xb5,-_0x313665._0xe88ec9),'error':_0x11f8c2[_0x156080(-0x9a,-0xcd,-0xb2,-_0x313665._0x50962b)],'duration_ms':Date[_0x156080(-0xb2,-_0x313665._0xfbb962,-0xd1,-0xcd)]()-_0x461ac7});});});}function createHookExtensions(_0x4e10d9,_0x3acb50,_0x5b66a2={}){const _0x4111b3={_0x1ae384:0x4b1,_0x88e7e0:0xcb,_0x14caf8:0xd4,_0x54f481:0xc1,_0xbcd343:0xaf,_0x4b14ff:0x9d,_0x77d15:0xb9,_0x12278e:0x84,_0x145792:0xa9,_0x5704cc:0xb5,_0xfc7546:0x4c3,_0xc711bc:0x4aa},_0x127ce9={_0x214869:0x254,_0x429d75:0x24d,_0x51f93e:0x256,_0x12f2a7:0x248,_0x3fdb38:0x1f2,_0x41a8dc:0x203,_0x5ac661:0x252,_0x29fc54:0x231,_0xed5364:0x236,_0xb2b8d9:0x237,_0x1f2771:0x231,_0x4acbc7:0x23f},_0x554361={_0x13a04f:0x2a8,_0x41cfa0:0x2a7,_0x15b173:0x2b5,_0x4dad17:0x2b6,_0x502e99:0x2c7,_0x11a722:0x25d,_0x1957b1:0x253,_0xcf0b72:0x24c,_0x286b73:0x261,_0x17c464:0x25b},_0x4f7f3a={_0x584cb0:0x227,_0x5e4d38:0x22c,_0x3b3645:0x1df,_0x68a068:0x1c9,_0x49a7e3:0x251,_0x3b9f42:0x220,_0x1bd719:0x244,_0x4e6d0d:0x1ed},_0x1e6ca6={_0xc9807:0x2a2},_0xf159d9=[],{sessionId:_0x30f1da,projectDir:_0x597533}=_0x5b66a2,_0x512c27=_0x339e31=>_0x4e10d9[_0x38be7e(-0xd1,-0xb8,-0x9c,-0xa7)]?_0x4e10d9['hasHooks'](_0x339e31):_0x4e10d9['getHooks'](_0x339e31)[_0x439220(0x4ce,0x4b5,0x4ad,0x4a3)]>0x0;_0x512c27(_0x439220(0x4ce,_0x4111b3._0x1ae384,0x49a,0x49b))&&_0xf159d9['push']({'id':_0x38be7e(-_0x4111b3._0x88e7e0,-_0x4111b3._0x14caf8,-0xcf,-0xd3),'stage':'afterToolResult','kind':_0x38be7e(-0xc5,-0xbb,-_0x4111b3._0x54f481,-0xcb),'order':0x0,'enabled':!![],'run':async(_0x4be79a,_0x169e72)=>{function _0x243963(_0x34045c,_0x10f027,_0x4440cd,_0x19aa03){return _0x38be7e(_0x34045c-0x12f,_0x19aa03-_0x1e6ca6._0xc9807,_0x34045c,_0x19aa03-0x137);}function _0x2c00b8(_0x215fff,_0x37cf56,_0x314654,_0x2b4a29){return _0x439220(_0x314654,_0x2b4a29- -0x6e2,_0x314654-0x16c,_0x2b4a29-0x119);}const _0x346169=_0x4e10d9['getHooks']('PostToolUse',_0x4be79a[_0x2c00b8(-0x242,-0x222,-_0x4f7f3a._0x584cb0,-_0x4f7f3a._0x5e4d38)]);for(const _0x46f130 of _0x346169){const _0x45248a={'tool_name':_0x4be79a['toolName'],'tool_input':void 0x0,'tool_output':_0x4be79a['output'],'tool_result_status':_0x4be79a[_0x243963(0x1be,0x1cb,_0x4f7f3a._0x3b3645,_0x4f7f3a._0x68a068)],'session_id':_0x30f1da??_0x169e72[_0x2c00b8(-_0x4f7f3a._0x49a7e3,-_0x4f7f3a._0x3b9f42,-_0x4f7f3a._0x1bd719,-0x235)]['sessionId']};await _0x3acb50(_0x46f130[_0x243963(0x1e9,0x1d2,_0x4f7f3a._0x4e6d0d,0x1ed)],_0x45248a,_0x46f130['timeout'],_0x597533);}}});function _0x439220(_0x252c0e,_0x55efca,_0x16bc20,_0x98cf4e){return _0x1531(_0x55efca-0x313,_0x252c0e);}_0x512c27(_0x38be7e(-_0x4111b3._0xbcd343,-_0x4111b3._0x4b14ff,-_0x4111b3._0x77d15,-_0x4111b3._0x12278e))&&_0xf159d9['push']({'id':'hook:Stop','stage':'beforeFinalOutput','kind':'observer','order':0x0,'enabled':!![],'run':async(_0x41f67c,_0x39e5ea)=>{const _0x1c09f5={_0x43fb05:0x26d,_0x48ef39:0x1c8};function _0x2b7850(_0x40093a,_0x5b6e7c,_0x45a153,_0x15ac87){return _0x439220(_0x15ac87,_0x40093a- -_0x1c09f5._0x43fb05,_0x45a153-_0x1c09f5._0x48ef39,_0x15ac87-0x1df);}const _0x354689=_0x4e10d9[_0x5b0e3b(_0x554361._0x13a04f,0x2b6,_0x554361._0x41cfa0,0x2bb)]('Stop');function _0x5b0e3b(_0x487b04,_0x4c6a47,_0x3b691e,_0x1b6ff1){return _0x439220(_0x4c6a47,_0x487b04- -0x1f4,_0x3b691e-0xf2,_0x1b6ff1-0x46);}for(const _0x59ac10 of _0x354689){const _0x1ed037={'stop_reason':_0x5b0e3b(_0x554361._0x15b173,0x2cd,_0x554361._0x4dad17,_0x554361._0x502e99),'session_id':_0x30f1da??_0x39e5ea[_0x2b7850(0x240,_0x554361._0x11a722,_0x554361._0x1957b1,0x226)][_0x2b7850(_0x554361._0xcf0b72,0x24f,_0x554361._0x286b73,_0x554361._0x17c464)]};await _0x3acb50(_0x59ac10[_0x5b0e3b(0x2cd,0x2e7,0x2ad,0x2d9)],_0x1ed037,_0x59ac10['timeout'],_0x597533);}}});_0x512c27(_0x38be7e(-0xb4,-_0x4111b3._0x145792,-_0x4111b3._0x5704cc,-0x8d))&&_0xf159d9[_0x439220(_0x4111b3._0xfc7546,0x4a7,0x4ab,_0x4111b3._0xc711bc)]({'id':'hook:Notification','stage':'afterTurnComplete','kind':'observer','order':0x0,'enabled':!![],'run':async(_0x372855,_0x3107c4)=>{const _0x3e0ad3={_0x2b4344:0x30},_0x45104f=_0x4e10d9['getHooks'](_0x3e6336(-0x22b,-0x242,-0x212,-0x24a));function _0x23b4d6(_0x4a5d5d,_0x3bdc35,_0x51b512,_0x161009){return _0x439220(_0x161009,_0x51b512- -0x2c7,_0x51b512-0x1ba,_0x161009-0xe4);}function _0x3e6336(_0x33f02e,_0x55917d,_0x56ac9e,_0x2a1e68){return _0x38be7e(_0x33f02e-_0x3e0ad3._0x2b4344,_0x33f02e- -0x182,_0x2a1e68,_0x2a1e68-0xad);}for(const _0x513ad8 of _0x45104f){const _0x3a9de7={'message':_0x3e6336(-_0x127ce9._0x214869,-_0x127ce9._0x429d75,-_0x127ce9._0x51f93e,-_0x127ce9._0x12f2a7),'session_id':_0x30f1da??_0x372855[_0x23b4d6(0x1fd,0x1e4,_0x127ce9._0x3fdb38,_0x127ce9._0x41a8dc)]};await _0x3acb50(_0x513ad8[_0x3e6336(-0x237,-_0x127ce9._0x5ac661,-_0x127ce9._0x29fc54,-0x23f)],_0x3a9de7,_0x513ad8[_0x3e6336(-_0x127ce9._0xed5364,-_0x127ce9._0xb2b8d9,-_0x127ce9._0x1f2771,-_0x127ce9._0x4acbc7)],_0x597533);}}});function _0x38be7e(_0x504c96,_0xf3d931,_0x4b1cbf,_0x307e8e){return _0x1531(_0xf3d931- -0x263,_0x4b1cbf);}return _0xf159d9;}function createHookOnToolCallMiddleware(_0x44706d,_0x5265cd,_0xee1570,_0x23b4dd={}){const _0x6c2962={_0x540ece:0x31b,_0x32bb3b:0x312,_0x244d1c:0x257,_0x98901a:0x21b,_0x5af483:0x313,_0x13e010:0x207,_0x19aa62:0x22d,_0x3cb680:0x23b,_0x2e05bc:0x2ec,_0x4dd29b:0x210,_0x335d16:0x1f8,_0x4bb590:0x22f,_0x98be1d:0x22e,_0x6bb0ad:0x215,_0x3e55cf:0x2fe,_0x62fcb4:0x2ff,_0xf33e29:0x2f8,_0x19b3aa:0x223,_0x1f8034:0x21e,_0x13718c:0x20c,_0x544d7c:0x230,_0x1386f6:0x2ef,_0x10e4b8:0x209,_0x8ee971:0x224,_0x2f7409:0x31f,_0x3ed240:0x303,_0x43a0c8:0x2e6},_0x28d079={_0x3998de:0x163},{sessionId:_0x4dc17a,projectDir:_0x512cf4}=_0x23b4dd;return async(_0x993348,_0x330847)=>{const _0x3facb6={_0x24f974:0x79};function _0x380905(_0x49b4a3,_0x415464,_0x2a0e8a,_0x42744f){return _0x1531(_0x415464-_0x28d079._0x3998de,_0x42744f);}const _0x46ad7c=_0x44706d['getHooks'](_0x380905(0x337,_0x6c2962._0x540ece,0x336,_0x6c2962._0x32bb3b),_0x993348['name']);function _0x42e6a(_0x5a06c0,_0x304b5c,_0x3778fa,_0x34ed3b){return _0x1531(_0x5a06c0-_0x3facb6._0x24f974,_0x3778fa);}for(const _0x1f5700 of _0x46ad7c){const _0x945e7c={'tool_name':_0x993348['name'],'tool_input':_0x993348[_0x42e6a(0x237,_0x6c2962._0x244d1c,0x256,_0x6c2962._0x98901a)],'session_id':_0x4dc17a},_0x19be5c=await _0x5265cd(_0x1f5700['command'],_0x945e7c,_0x1f5700[_0x380905(0x32e,0x312,_0x6c2962._0x5af483,0x312)],_0x512cf4),_0x392203=_0x19be5c['output']?.[_0x42e6a(0x210,0x1f8,_0x6c2962._0x13e010,0x1f0)]?.[_0x42e6a(_0x6c2962._0x19aa62,0x221,_0x6c2962._0x3cb680,0x21f)];if(_0x392203==='allow')return{'action':_0x380905(0x320,0x318,0x322,0x313)};if(_0x392203==='deny')return{'action':_0x380905(0x303,0x2f3,0x2ee,_0x6c2962._0x2e05bc),'reason':_0x19be5c['output']?.[_0x42e6a(_0x6c2962._0x4dd29b,_0x6c2962._0x335d16,_0x6c2962._0x4bb590,0x202)]?.[_0x42e6a(0x226,0x245,_0x6c2962._0x98be1d,_0x6c2962._0x6bb0ad)]||_0x380905(0x314,_0x6c2962._0x3e55cf,0x2e3,0x2f6)+_0x993348[_0x380905(0x301,_0x6c2962._0x62fcb4,0x2ee,_0x6c2962._0xf33e29)]};if(_0x19be5c[_0x42e6a(0x203,_0x6c2962._0x19b3aa,_0x6c2962._0x1f8034,_0x6c2962._0x13718c)]==='block'||_0x19be5c[_0x42e6a(_0x6c2962._0x544d7c,0x240,0x215,_0x6c2962._0x6bb0ad)]?.[_0x380905(_0x6c2962._0x2e05bc,_0x6c2962._0x1386f6,0x2d6,0x30c)]==='block')return{'action':_0x42e6a(_0x6c2962._0x10e4b8,0x228,0x217,_0x6c2962._0x8ee971),'reason':_0x19be5c['output']?.['reason']||_0x380905(_0x6c2962._0x2f7409,_0x6c2962._0x3ed240,0x31a,_0x6c2962._0x3e55cf)+_0x993348[_0x380905(_0x6c2962._0x43a0c8,0x2ff,0x302,0x2f7)]};}return _0xee1570(_0x993348,_0x330847);};}function _0x2034(){const _0x2be18b=['B3v0Chv0','uhjLvg9VBfvZzq','nJu2mti4ofzWEKftAa','tM90AwzPy2f0Aw9U','A2LSBa','CgLWzq','sg9VAYb0Aw1LzcbVDxqGywz0zxiG','Aw5WDxq','oda4nZeZCgHwwezr','nKrLvNPbzG','D3jPDgu','nJi2nJu1mM1ICwXdEG','zw52','sg9VAYbIBg9JA2vKigv4zwn1DgLVBG','y29Kzq','u3rVCa','C3rKzxjY','Dg9tDhjPBMC','z2v0sg9VA3m','C3rHDhvZ','y3DK','zgvJAxnPB24','mtmZodqYm3fKrwH2sW','Ag9VA3m','Ag9VAZPqB3n0vg9VBfvZzq','CMvQzwn0','qwDLBNqGzMLUAxnOzwqGCMvZCg9UzgLUzW','mtKWu3zKDLbZ','CgfZCW','ChvZAa','C3rYAw5NAwz5','zw5Kx3r1CM4','Ag9VA1nWzwnPzMLJt3v0Chv0','BM93','DgvZDa','C3rHDgu','ugvYBwLZC2LVBIbKzw5PzwqGzM9Yia','BMfTzq','otzmAerzv3e','ug9ZDfrVB2XvC2u','zgf0yq','qMXVy2TLzcbIEsbqCMvuB29SvxnLigHVB2SGzM9Yia','BwfW','BgvUz3rO','Dg9VBe5HBwu','yMXVy2S','zxjYB3i','C2vZC2LVBKLK','mtK1nJy3qNvtsLvj','B2jZzxj2zxi','y2XVC2u','xIG/oG','AgfZsg9VA3m','C3rKAw4','CgvYBwLZC2LVBKrLy2LZAw9UuMvHC29U','y29TBwfUza','DgLTzw91Da','BwvZC2fNzq','DhjPBq','mJq1mZi5n0XeDvzJvq','Bwf0y2HLCG','CgvYBwLZC2LVBKrLy2LZAw9U','CNvU','otyZnZbjA3LvEwS'];_0x2034=function(){return _0x2be18b;};return _0x2034();}var DEFAULT_TIMEOUT_S2=0x3c;function createHookRegistry(_0x1b8e12){const _0x2459cd={_0x4b8d50:0x16d,_0x308aeb:0x170,_0x30b89b:0x567,_0xd2c11:0x553,_0x277872:0x582,_0x1cca8a:0x561,_0x3d36ae:0x570,_0x2b58f6:0x562,_0xbf7f4:0x567,_0x347285:0x580,_0x7d99d1:0x58d,_0x56c031:0x16f,_0x43ae8e:0x153,_0x186df1:0x15b,_0x5d39bf:0x167,_0x1e5f90:0x157,_0x43b6cb:0x182,_0x150066:0x163,_0x3d76d0:0x15e,_0x30846c:0x181,_0x1de789:0x193},_0x35eec3={_0x4df1a0:0x563,_0x1bc506:0x559,_0x5c0e47:0x54f},_0x1cf4d8={_0xce6fb2:0x3c9};return{'hasHooks'(_0x2367b8){function _0x545b59(_0x5a8c69,_0x433b7c,_0xaa4ba4,_0x10260b){return _0x1531(_0x5a8c69-_0x1cf4d8._0xce6fb2,_0x433b7c);}return(_0x1b8e12[_0x2367b8]?.[_0x545b59(0x56b,_0x35eec3._0x4df1a0,_0x35eec3._0x1bc506,_0x35eec3._0x5c0e47)]??0x0)>0x0;},'getHooks'(_0x1010ba,_0x4ec4ac){const _0x514e25={_0x310cb4:0x2a},_0x42f18b=_0x1b8e12[_0x1010ba];if(!_0x42f18b)return[];function _0x38501b(_0x3f3100,_0x26190d,_0x58eec0,_0x1337b0){return _0x1531(_0x3f3100-0x3c6,_0x58eec0);}function _0x1a59ba(_0xfe930f,_0x3e6048,_0x199cb1,_0x57d432){return _0x1531(_0xfe930f- -_0x514e25._0x310cb4,_0x3e6048);}const _0x3630b9=[];for(const _0x6c9b94 of _0x42f18b){if(!_0x6c9b94['matcher']||_0x6c9b94[_0x1a59ba(0x189,0x185,0x194,_0x2459cd._0x4b8d50)]==='*'){_0x3630b9[_0x1a59ba(0x16a,0x166,0x177,0x16d)](..._0x6c9b94[_0x1a59ba(0x164,0x171,0x15b,_0x2459cd._0x308aeb)][_0x38501b(_0x2459cd._0x30b89b,_0x2459cd._0xd2c11,_0x2459cd._0x277872,_0x2459cd._0x1cca8a)](_0x542a3e=>({'command':_0x542a3e[_0x1a59ba(0x184,0x19c,0x19c,0x196)],'timeout':_0x542a3e[_0x1a59ba(0x185,0x17a,0x16f,0x19e)]??DEFAULT_TIMEOUT_S2})));continue;}if(_0x4ec4ac===void 0x0)continue;const _0x243581=new RegExp(_0x38501b(_0x2459cd._0x3d36ae,0x562,0x574,_0x2459cd._0x2b58f6)+_0x6c9b94[_0x38501b(0x579,_0x2459cd._0xbf7f4,_0x2459cd._0x347285,_0x2459cd._0x7d99d1)]+')$');_0x243581[_0x1a59ba(_0x2459cd._0x56c031,_0x2459cd._0x43ae8e,_0x2459cd._0x186df1,_0x2459cd._0x5d39bf)](_0x4ec4ac)&&_0x3630b9[_0x1a59ba(0x16a,0x188,_0x2459cd._0x1e5f90,_0x2459cd._0x43b6cb)](..._0x6c9b94[_0x1a59ba(0x164,_0x2459cd._0x150066,_0x2459cd._0x3d76d0,_0x2459cd._0x308aeb)][_0x1a59ba(0x177,_0x2459cd._0x30846c,_0x2459cd._0x308aeb,_0x2459cd._0x1de789)](_0x4429f8=>({'command':_0x4429f8[_0x1a59ba(0x184,0x192,0x188,0x193)],'timeout':_0x4429f8['timeout']??DEFAULT_TIMEOUT_S2})));}return _0x3630b9;}};}export{createHookExtensions,createHookOnToolCallMiddleware,createHookRegistry,executeCommandHook};
1
+ (function(_0xb04382,_0x1ac968){const _0x140d75={_0x55c617:0x31a,_0x390e65:0x305,_0x3689ad:0x30e,_0x47e1c7:0x2e9,_0x2bf545:0x2f3,_0x4cfcb0:0x2f6,_0x425062:0x2f0,_0x1196f0:0x2f1,_0x2b61d4:0x2cb,_0x3aefe0:0x2e5,_0x295f27:0x308,_0x280513:0x2f6,_0x3515f1:0x2fb,_0x5eff07:0x30d,_0x233a80:0x2f4,_0x30581c:0x2e0,_0x32bc3a:0x2c5,_0x550e27:0x2e4,_0x41160e:0x1cb,_0x3aa854:0x1e5,_0x5e9fbd:0x322,_0x49dfb2:0x30f,_0x4d7861:0x312},_0x433d2f={_0xaec8bf:0xf5};function _0x524e0a(_0x2f10d6,_0x513b26,_0x121df2,_0x56d52c){return _0x200a(_0x513b26-_0x433d2f._0xaec8bf,_0x2f10d6);}function _0x377ee5(_0x3ded8c,_0x1697b5,_0x3dde65,_0x121418){return _0x200a(_0x121418-0x225,_0x3dde65);}const _0x37f898=_0xb04382();while(!![]){try{const _0x8d6604=-parseInt(_0x377ee5(0x327,_0x140d75._0x55c617,_0x140d75._0x390e65,_0x140d75._0x3689ad))/0x1+parseInt(_0x377ee5(0x30d,0x305,_0x140d75._0x47e1c7,0x2f3))/0x2+parseInt(_0x377ee5(_0x140d75._0x2bf545,_0x140d75._0x4cfcb0,_0x140d75._0x425062,0x303))/0x3+-parseInt(_0x377ee5(0x2e5,_0x140d75._0x1196f0,_0x140d75._0x2b61d4,0x2e3))/0x4*(-parseInt(_0x377ee5(_0x140d75._0x3aefe0,_0x140d75._0x2bf545,_0x140d75._0x295f27,_0x140d75._0x280513))/0x5)+-parseInt(_0x377ee5(_0x140d75._0x3515f1,_0x140d75._0x5eff07,0x2f2,0x2fd))/0x6*(parseInt(_0x377ee5(_0x140d75._0x233a80,0x2dd,0x2f6,0x2e1))/0x7)+-parseInt(_0x377ee5(_0x140d75._0x3aefe0,_0x140d75._0x30581c,_0x140d75._0x32bc3a,_0x140d75._0x550e27))/0x8*(-parseInt(_0x524e0a(0x1e2,_0x140d75._0x41160e,_0x140d75._0x3aa854,0x1c8))/0x9)+-parseInt(_0x377ee5(_0x140d75._0x5e9fbd,_0x140d75._0x49dfb2,0x30a,_0x140d75._0x4d7861))/0xa;if(_0x8d6604===_0x1ac968)break;else _0x37f898['push'](_0x37f898['shift']());}catch(_0x1a51ed){_0x37f898['push'](_0x37f898['shift']());}}}(_0xd9b8,0xddb1b));import{spawn}from'child_process';function _0x200a(_0x16aa25,_0xdd7735){_0x16aa25=_0x16aa25-0xaf;const _0xd9b8d8=_0xd9b8();let _0x200af3=_0xd9b8d8[_0x16aa25];if(_0x200a['iAWDne']===undefined){var _0xbe3654=function(_0x4710a9){const _0x2fbab6='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3d842f='',_0x4c321c='';for(let _0x55e001=0x0,_0x5cfb76,_0x181efc,_0x24cda1=0x0;_0x181efc=_0x4710a9['charAt'](_0x24cda1++);~_0x181efc&&(_0x5cfb76=_0x55e001%0x4?_0x5cfb76*0x40+_0x181efc:_0x181efc,_0x55e001++%0x4)?_0x3d842f+=String['fromCharCode'](0xff&_0x5cfb76>>(-0x2*_0x55e001&0x6)):0x0){_0x181efc=_0x2fbab6['indexOf'](_0x181efc);}for(let _0x4ca35c=0x0,_0xb11bc6=_0x3d842f['length'];_0x4ca35c<_0xb11bc6;_0x4ca35c++){_0x4c321c+='%'+('00'+_0x3d842f['charCodeAt'](_0x4ca35c)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4c321c);};_0x200a['TREASf']=_0xbe3654,_0x200a['rSYlUU']={},_0x200a['iAWDne']=!![];}const _0x584cdd=_0xd9b8d8[0x0],_0x5face1=_0x16aa25+_0x584cdd,_0x541964=_0x200a['rSYlUU'][_0x5face1];return!_0x541964?(_0x200af3=_0x200a['TREASf'](_0x200af3),_0x200a['rSYlUU'][_0x5face1]=_0x200af3):_0x200af3=_0x541964,_0x200af3;}var DEFAULT_TIMEOUT_S=0x3c;async function executeCommandHook(_0x3d842f,_0x4c321c,_0x55e001=DEFAULT_TIMEOUT_S,_0x5cfb76){const _0x50b2cd={_0x1ec410:0x6f,_0x501b37:0x77,_0x1b84d7:0x444,_0x594e50:0x455,_0x5f3302:0x450,_0xad769b:0x42f,_0x4c535a:0x451,_0x4e06ff:0x442,_0x39fbbe:0x6e,_0x22c628:0x7a,_0xb8813d:0x6a,_0x4ee67e:0x53,_0x16ff4b:0x464,_0xf400dc:0x453,_0x35d16e:0x45a,_0x4aa210:0x5a,_0x3688f0:0x47,_0x2301d6:0x450,_0x1067c6:0x45,_0x1bb777:0x25,_0x1903f0:0x46a,_0x2495f7:0x428,_0x4c5dc7:0x43c},_0x4c19d1={_0x48ad69:0x125,_0x3fc53b:0x12a,_0x47fc48:0x137,_0x26c7dd:0x120,_0x11de6c:0x296,_0x789008:0x279},_0x7eeb6e={_0xa96fc4:0x13a,_0x4652bb:0x147,_0x2c119c:0x13c,_0x395a4e:0x120,_0x4fe6e4:0x103,_0x10c60a:0x12b,_0x48329c:0x1ce,_0x4a6680:0x1d4},_0x5e7e03={_0x2f1bf7:0x2c0},_0x181efc=Date['now']();return new Promise(_0x24cda1=>{const _0x5b3efd={_0x4c6bb5:0x323,_0x58e177:0x181},_0x25b8cb={_0x456a08:0x199,_0x4e0cfd:0x180,_0x496581:0x17e,_0x24f212:0x165,_0xc4cc2e:0x176,_0xc7131e:0x159,_0x48367d:0x3e8,_0x5103ab:0x407,_0x2e1cac:0x43d,_0x5af10f:0x436,_0x8526c5:0x42f,_0x38a045:0x427,_0x3dabbc:0x1a6,_0x1d127c:0x411,_0x301c6c:0x41e,_0x19da81:0x41f,_0xbe7052:0x414,_0x44244b:0x420,_0x34b455:0x40e,_0x47d57f:0x191},_0x3698e1={_0xd2499c:0x13c,_0x12941e:0xb3,_0x360706:0x2f},_0x34942b={_0x5c3aab:0x97},_0x173360={_0x4a662a:0x283,_0x1a0338:0x15};function _0x3a6370(_0x490b3c,_0x1737a4,_0x25510c,_0x1fd05e){return _0x200a(_0x490b3c- -0x7d,_0x25510c);}const _0x4ca35c=spawn('sh',['-c',_0x3d842f],{'stdio':[_0x3a6370(0x65,0x74,_0x50b2cd._0x1ec410,0x69),_0x3a6370(0x65,_0x50b2cd._0x501b37,0x6b,0x84),_0x3c5652(_0x50b2cd._0x1b84d7,0x456,0x45f,0x45b)],'env':{...process['env'],'CLAUDE_PROJECT_DIR':_0x5cfb76??process[_0x3c5652(_0x50b2cd._0x594e50,0x446,_0x50b2cd._0x5f3302,_0x50b2cd._0xad769b)]()}});let _0xb11bc6='';function _0x3c5652(_0x2d2cbc,_0xdc63ce,_0x33d612,_0xff39d2){return _0x200a(_0xdc63ce-0x374,_0x33d612);}let _0x177b6c='';_0x4ca35c[_0x3c5652(0x43b,0x43a,_0x50b2cd._0x4c535a,_0x50b2cd._0x4e06ff)]['on'](_0x3a6370(_0x50b2cd._0x39fbbe,_0x50b2cd._0x22c628,0x66,_0x50b2cd._0xb8813d),_0x39b76d=>{function _0x96af4b(_0x208b65,_0x198480,_0x56def2,_0x98f69f){return _0x3a6370(_0x198480-_0x173360._0x4a662a,_0x198480-_0x173360._0x1a0338,_0x98f69f,_0x98f69f-0x132);}_0xb11bc6+=_0x39b76d[_0x96af4b(_0x5e7e03._0x2f1bf7,0x2d5,0x2ce,0x2ca)]();}),_0x4ca35c[_0x3a6370(0x35,0x2b,0x3b,0x21)]['on'](_0x3a6370(_0x50b2cd._0x39fbbe,0x72,_0x50b2cd._0x4ee67e,0x56),_0x50c45e=>{const _0x294627={_0x4525de:0x4da,_0x3409fa:0x196};function _0x980ef8(_0x129baf,_0x20f548,_0xdc6cf8,_0x8b1089){return _0x3c5652(_0x129baf-0x1c,_0x129baf- -_0x294627._0x4525de,_0x20f548,_0x8b1089-_0x294627._0x3409fa);}_0x177b6c+=_0x50c45e[_0x980ef8(-_0x34942b._0x5c3aab,-0x84,-0x83,-0xaa)]();}),_0x4ca35c[_0x3c5652(_0x50b2cd._0x16ff4b,_0x50b2cd._0x5f3302,_0x50b2cd._0xf400dc,_0x50b2cd._0x35d16e)]['on'](_0x3a6370(0x4b,_0x50b2cd._0x4aa210,0x58,_0x50b2cd._0x3688f0),_0x5d3d44=>{if(_0x5d3d44['code']!=='EPIPE')throw _0x5d3d44;}),_0x4ca35c['stdin']['write'](JSON['stringify'](_0x4c321c)),_0x4ca35c[_0x3c5652(0x46b,_0x50b2cd._0x2301d6,0x43f,0x44e)][_0x3a6370(_0x50b2cd._0x1067c6,0x33,0x38,_0x50b2cd._0x1bb777)]();const _0x25fe58=setTimeout(()=>{const _0x1364bb={_0x2ccc8b:0x180},_0x5eaae3={_0x415257:0xb7};function _0x378d3d(_0x3da6fa,_0x4134f7,_0x6e5801,_0x3592b6){return _0x3a6370(_0x4134f7-0x1a7,_0x4134f7-0x85,_0x6e5801,_0x3592b6-_0x5eaae3._0x415257);}function _0x3f2f4b(_0x396657,_0x253fd3,_0x3b3621,_0x2c2634){return _0x3a6370(_0x253fd3- -_0x1364bb._0x2ccc8b,_0x253fd3-0xed,_0x3b3621,_0x2c2634-0x135);}_0x4ca35c[_0x3f2f4b(-_0x7eeb6e._0xa96fc4,-_0x7eeb6e._0x4652bb,-_0x7eeb6e._0x2c119c,-0x147)](_0x3f2f4b(-0x110,-_0x7eeb6e._0x395a4e,-0x106,-_0x7eeb6e._0x4fe6e4)),_0x24cda1({'status':_0x3f2f4b(-0x128,-0x135,-_0x7eeb6e._0x10c60a,-0x116),'error':'Hook\x20timed\x20out\x20after\x20'+_0x55e001+'s','duration_ms':Date[_0x378d3d(0x1e3,0x1eb,_0x7eeb6e._0x48329c,_0x7eeb6e._0x4a6680)]()-_0x181efc});},_0x55e001*0x3e8);_0x4ca35c['on'](_0x3c5652(_0x50b2cd._0x1903f0,0x45b,0x43e,0x440),_0x4ed2c0=>{const _0x1a2188={_0xa8b4b7:0xf8};clearTimeout(_0x25fe58);const _0x54273b=Date[_0x3b0b35(_0x25b8cb._0x456a08,_0x25b8cb._0x4e0cfd,_0x25b8cb._0x496581,0x166)]()-_0x181efc;if(_0x4ed2c0===0x2){_0x24cda1({'status':'block','output':{'decision':'block','reason':_0x177b6c['trim']()||_0x3b0b35(_0x25b8cb._0x24f212,_0x25b8cb._0xc4cc2e,_0x25b8cb._0xc7131e,0x184)},'duration_ms':_0x54273b});return;}if(_0x4ed2c0!==0x0){_0x24cda1({'status':_0x5a2b5f(0x402,0x409,_0x25b8cb._0x48367d,_0x25b8cb._0x5103ab),'error':_0x5a2b5f(_0x25b8cb._0x2e1cac,_0x25b8cb._0x5af10f,_0x25b8cb._0x8526c5,_0x25b8cb._0x38a045)+_0x4ed2c0+(_0x177b6c[_0x3b0b35(_0x25b8cb._0x3dabbc,0x18a,0x188,0x170)]()?':\x20'+_0x177b6c['trim']():''),'duration_ms':_0x54273b});return;}const _0x1496d4=_0xb11bc6['trim']();function _0x3b0b35(_0x146be7,_0x58a175,_0x2e642c,_0xede477){return _0x3a6370(_0x58a175-_0x3698e1._0xd2499c,_0x58a175-_0x3698e1._0x12941e,_0x2e642c,_0xede477-_0x3698e1._0x360706);}function _0x5a2b5f(_0x20c560,_0x364456,_0x1378a3,_0x391f37){return _0x3c5652(_0x20c560-_0x1a2188._0xa8b4b7,_0x391f37- -0x35,_0x20c560,_0x391f37-0xe6);}if(_0x1496d4['length']===0x0){_0x24cda1({'status':_0x5a2b5f(_0x25b8cb._0x1d127c,_0x25b8cb._0x301c6c,_0x25b8cb._0x19da81,_0x25b8cb._0xbe7052),'duration_ms':_0x54273b});return;}try{const _0x59fe5f=JSON[_0x5a2b5f(0x414,0x40e,0x41e,0x403)](_0x1496d4);_0x24cda1({'status':_0x5a2b5f(_0x25b8cb._0x44244b,0x41c,_0x25b8cb._0x34b455,_0x25b8cb._0xbe7052),'output':_0x59fe5f,'duration_ms':_0x54273b});}catch{_0x24cda1({'status':_0x3b0b35(_0x25b8cb._0x47d57f,0x194,0x175,0x177),'duration_ms':_0x54273b});}}),_0x4ca35c['on'](_0x3c5652(_0x50b2cd._0x2495f7,_0x50b2cd._0x4c5dc7,0x453,0x448),_0x174d15=>{const _0x3002b3={_0x560649:0x7};clearTimeout(_0x25fe58);function _0xa5cb92(_0x40129f,_0x28317f,_0x334f8e,_0x178b85){return _0x3c5652(_0x40129f-0x1d7,_0x334f8e- -_0x5b3efd._0x4c6bb5,_0x178b85,_0x178b85-_0x5b3efd._0x58e177);}function _0x425bb9(_0x45683b,_0x152de6,_0x38df0,_0x3d846a){return _0x3c5652(_0x45683b-_0x3002b3._0x560649,_0x3d846a- -0x1bc,_0x45683b,_0x3d846a-0xea);}_0x24cda1({'status':'error','error':_0x174d15[_0xa5cb92(_0x4c19d1._0x48ad69,_0x4c19d1._0x3fc53b,_0x4c19d1._0x47fc48,_0x4c19d1._0x26c7dd)],'duration_ms':Date[_0x425bb9(0x25b,0x282,_0x4c19d1._0x11de6c,_0x4c19d1._0x789008)]()-_0x181efc});});});}function _0xd9b8(){const _0x41e429=['tM90AwzPy2f0Aw9U','ywz0zxjuB29SuMvZDwX0','mtC3mtuYohHmsfvtEa','Dg9tDhjPBMC','uhjLvg9VBfvZzq','nZyWAevuDKHi','y3DK','Ag9VAZPtDg9W','yMXVy2S','CgfZCW','mtmXotryt2DguuS','qMXVy2TLzcbIEsbqCMvuB29SvxnLigHVB2SGzM9Yia','nMTOwLbhCa','B3v0Chv0','C3rHDgu','yMvMB3jLrMLUywXpDxrWDxq','C3rKAw4','u0Lhs0Lmta','mJCWnda4nMziBuDHDq','C3rHDhvZ','z2v0sg9VA3m','y29TBwfUza','CgLWzq','zw5Kx3r1CM4','AgfZsg9VA3m','CMvQzwn0','BwvZC2fNzq','y2XVC2u','sg9VAYbLEgL0zwqGD2L0AcbJB2rLia','mJG4ntuWCLHNu0XV','Dg9VBe5HBwu','zgf0yq','zgvUEq','mZKYnda0mfvIywHRDa','B2jZzxj2zxi','Bwf0y2HLCG','u3rVCa','C3rKzxjY','BwfW','CgvYBwLZC2LVBKrLy2LZAw9UuMvHC29U','BgvUz3rO','A2LSBa','sg9VAYbIBg9JA2vKigv4zwn1DgLVBG','zgvJAxnPB24','Aw5WDxq','xIG/oG','Ag9VA3m','nJuZntCZowfNv3PKBq','ChvZAa','mtC0mJHJtKjWu2O','ndaWsMHwq3DK','BMfTzq','BM93','zw5K','C2vZC2LVBKLK','CgfYC2u','ywXSB3C','C3rKB3v0','CgvYBwLZC2LVBKrLy2LZAw9U','zxjYB3i','DgvZDa','ug9ZDfrVB2XvC2u','DhjPBq'];_0xd9b8=function(){return _0x41e429;};return _0xd9b8();}function createHookExtensions(_0x34e846,_0x39f4f2,_0x322661={}){const _0x3dc39a={_0xc5b5eb:0x25c,_0x49989a:0x20b,_0x11b1e6:0x1fb,_0x86eee3:0x1dc,_0x189ef4:0x21b,_0x513df7:0x217,_0x5bfe5b:0x211,_0x86bff9:0x235,_0x2e8255:0x227,_0x2e786a:0x23a,_0xc22483:0x1fe,_0x2fe480:0x1e5,_0x2504c9:0x1ed,_0x5babb5:0x22f,_0x2067c6:0x254,_0x453e22:0x243,_0x25c512:0x219,_0xcd0d4b:0x218,_0x44a2f1:0x205},_0x1b9abb={_0x299bbf:0x8b,_0xe21b9a:0xac,_0x57a5d3:0x95,_0x56532f:0xc5,_0x18b0e6:0xa9,_0x30bdc0:0xbd,_0x1651d7:0xc3},_0x347c19={_0x49e88e:0x15c},_0xf354b3={_0x2cdef9:0x131,_0x36bdfb:0x136,_0x50dbf7:0xfc,_0xaeef9b:0x11c,_0x131e53:0x107,_0x338028:0x12e,_0x2ffbb0:0x139,_0x30095a:0x12f,_0x5c59f7:0x12d,_0x514810:0x117,_0x59fbae:0x130,_0x10e5cc:0x118,_0x52e1bb:0x119,_0x12fb93:0x125},_0xcbcc4a={_0x4a3b8c:0x118,_0xc2a660:0x1cd},_0x526a7f={_0x594695:0xb0,_0x43ad29:0xaf,_0x257e31:0xb4,_0x291827:0x339,_0xf533e7:0x33d,_0x37a4f6:0x34a,_0x2d5b92:0x323,_0x4df187:0x341},_0xcce13e={_0x3014a9:0x28},_0x2f3e0d={_0x374c15:0xe4},_0x258dd4=[],{sessionId:_0x29c5b7,projectDir:_0x3545a1}=_0x322661;function _0x891078(_0x148260,_0x5adda9,_0x265f52,_0x3a4661){return _0x200a(_0x5adda9- -0x307,_0x265f52);}const _0xa920a6=_0x521487=>_0x34e846[_0x891078(-0x232,-0x223,-0x240,-0x205)]?_0x34e846[_0x2d17f3(-0x1e4,-0x1e0,-0x1dd,-0x1e5)](_0x521487):_0x34e846[_0x891078(-0x245,-0x227,-0x21a,-0x213)](_0x521487)[_0x891078(-0x24c,-0x252,-0x255,-0x235)]>0x0;_0xa920a6(_0x891078(-_0x3dc39a._0xc5b5eb,-0x23d,-0x243,-0x257))&&_0x258dd4[_0x2d17f3(-0x20b,-0x215,-_0x3dc39a._0x49989a,-0x20c)]({'id':'hook:PostToolUse','stage':_0x2d17f3(-_0x3dc39a._0x11b1e6,-0x1e6,-_0x3dc39a._0x86eee3,-_0x3dc39a._0x189ef4),'kind':'observer','order':0x0,'enabled':!![],'run':async(_0x5a089a,_0x27cb64)=>{function _0x30e216(_0x103d34,_0x56963c,_0x3f4e04,_0x4fd454){return _0x891078(_0x103d34-0x9d,_0x103d34-0x567,_0x56963c,_0x4fd454-_0x2f3e0d._0x374c15);}const _0x2fb3da=_0x34e846['getHooks'](_0x6fb4df(_0x526a7f._0x594695,0x94,0x7e,_0x526a7f._0x43ad29),_0x5a089a[_0x6fb4df(0xb2,_0x526a7f._0x257e31,0xbe,0xbf)]);function _0x6fb4df(_0x2e8582,_0x640ae9,_0x20fd99,_0x560cce){return _0x891078(_0x2e8582-0x23,_0x640ae9-0x2d1,_0x560cce,_0x560cce-_0xcce13e._0x3014a9);}for(const _0x3e4f8c of _0x2fb3da){const _0x4182d8={'tool_name':_0x5a089a[_0x30e216(0x34a,0x364,0x344,0x35f)],'tool_input':void 0x0,'tool_output':_0x5a089a[_0x30e216(0x339,_0x526a7f._0x291827,0x335,_0x526a7f._0xf533e7)],'tool_result_status':_0x5a089a[_0x30e216(0x33f,0x341,_0x526a7f._0x37a4f6,0x345)],'session_id':_0x29c5b7??_0x27cb64['state'][_0x30e216(_0x526a7f._0x2d5b92,0x319,0x330,_0x526a7f._0x4df187)]};await _0x39f4f2(_0x3e4f8c['command'],_0x4182d8,_0x3e4f8c['timeout'],_0x3545a1);}}});function _0x2d17f3(_0x13bbc1,_0x22a72b,_0x33efaa,_0x571327){return _0x200a(_0x13bbc1- -0x2c8,_0x33efaa);}return _0xa920a6(_0x2d17f3(-_0x3dc39a._0x513df7,-_0x3dc39a._0x5bfe5b,-_0x3dc39a._0x86bff9,-_0x3dc39a._0x2e8255))&&_0x258dd4[_0x891078(-0x250,-0x24a,-0x251,-_0x3dc39a._0x2e786a)]({'id':_0x2d17f3(-0x1f5,-0x1e3,-_0x3dc39a._0xc22483,-_0x3dc39a._0x2fe480),'stage':_0x2d17f3(-_0x3dc39a._0x2504c9,-0x1d5,-0x207,-0x1fd),'kind':_0x2d17f3(-0x219,-0x221,-_0x3dc39a._0x5babb5,-0x20c),'order':0x0,'enabled':!![],'run':async(_0x3b9423,_0x1462cc)=>{const _0xe4c704={_0x32e256:0xab,_0x47380a:0x62c,_0x25a737:0x15d};function _0x2cd41a(_0x50342a,_0x232644,_0x26bfc4,_0x4ccb98){return _0x891078(_0x50342a-_0xe4c704._0x32e256,_0x4ccb98-_0xe4c704._0x47380a,_0x232644,_0x4ccb98-_0xe4c704._0x25a737);}function _0x96fce9(_0x29e058,_0x4a8640,_0x11b965,_0x394a79){return _0x891078(_0x29e058-_0xcbcc4a._0x4a3b8c,_0x394a79-0x35d,_0x4a8640,_0x394a79-_0xcbcc4a._0xc2a660);}const _0x3bf17f=_0x34e846[_0x96fce9(_0xf354b3._0x2cdef9,0x14f,0x11b,_0xf354b3._0x36bdfb)](_0x96fce9(0x119,_0xf354b3._0x50dbf7,_0xf354b3._0xaeef9b,_0xf354b3._0x131e53));for(const _0x4cc009 of _0x3bf17f){const _0x339d59={'stop_reason':_0x96fce9(_0xf354b3._0x338028,0x127,0x11f,_0xf354b3._0x2ffbb0),'session_id':_0x29c5b7??_0x1462cc[_0x96fce9(_0xf354b3._0x30095a,_0xf354b3._0x5c59f7,_0xf354b3._0x514810,_0xf354b3._0x59fbae)][_0x96fce9(0xfb,_0xf354b3._0x10e5cc,0x128,_0xf354b3._0x52e1bb)]};await _0x39f4f2(_0x4cc009[_0x96fce9(_0xf354b3._0x12fb93,0x11c,0x129,0x137)],_0x339d59,_0x4cc009['timeout'],_0x3545a1);}}}),_0xa920a6(_0x891078(-_0x3dc39a._0x2067c6,-0x23b,-_0x3dc39a._0x453e22,-0x242))&&_0x258dd4[_0x2d17f3(-_0x3dc39a._0x49989a,-_0x3dc39a._0x25c512,-0x205,-_0x3dc39a._0xcd0d4b)]({'id':'hook:Notification','stage':'afterTurnComplete','kind':_0x2d17f3(-0x219,-_0x3dc39a._0x44a2f1,-0x229,-0x1f9),'order':0x0,'enabled':!![],'run':async(_0x48c348,_0x10b877)=>{const _0x28b911={_0x1384bc:0x1e2,_0x3c9671:0x1a1};function _0x75357c(_0x5c481f,_0x3af173,_0x56e4a0,_0x26d5e7){return _0x2d17f3(_0x26d5e7- -0xe7,_0x3af173-0x130,_0x3af173,_0x26d5e7-_0x347c19._0x49e88e);}function _0x2df3c2(_0x23a5aa,_0x539d4b,_0xddc1ed,_0x3f4c31){return _0x2d17f3(_0xddc1ed-0x153,_0x539d4b-_0x28b911._0x1384bc,_0x3f4c31,_0x3f4c31-_0x28b911._0x3c9671);}const _0x48e3a0=_0x34e846[_0x2df3c2(-_0x1b9abb._0x299bbf,-_0x1b9abb._0xe21b9a,-_0x1b9abb._0x57a5d3,-0x7d)](_0x2df3c2(-0x9b,-_0x1b9abb._0x56532f,-_0x1b9abb._0x18b0e6,-0x99));for(const _0x3103c7 of _0x48e3a0){const _0x84bf70={'message':'Agent\x20finished\x20responding','session_id':_0x29c5b7??_0x48c348[_0x2df3c2(-_0x1b9abb._0x30bdc0,-_0x1b9abb._0x1651d7,-0xb2,-0xa4)]};await _0x39f4f2(_0x3103c7['command'],_0x84bf70,_0x3103c7['timeout'],_0x3545a1);}}}),_0x258dd4;}function createHookOnToolCallMiddleware(_0x3d77ed,_0x4ff8e0,_0x398e5c,_0x5416f7={}){const _0x261462={_0x44af56:0x266,_0x24dc68:0x27e,_0x4e6365:0x23b,_0x5b39a3:0x226,_0x231e04:0x23f,_0x5a5584:0x261,_0x58b5c6:0x25e,_0x5c5e3a:0x201,_0x283a10:0x208,_0x1889a5:0x28b,_0x3bf215:0x267,_0x575d2d:0x27f,_0x7498b4:0x282,_0xcab05b:0x277,_0x46f24c:0x22d,_0x4a33ae:0x23d,_0x5b8091:0x27e,_0x5b2504:0x25a,_0x11ee8b:0x252,_0x5c772d:0x257,_0x4cac5b:0x249,_0x5d84c6:0x25a,_0x285db8:0x264,_0x22f01f:0x28b,_0x250167:0x297,_0x217a11:0x285,_0x11c94a:0x26c,_0x3b96f6:0x21e,_0x1b6d13:0x240,_0x396477:0x27a,_0x4e8977:0x27d,_0x1ac579:0x26f,_0x235f8f:0x274,_0x4252f4:0x278,_0x544e11:0x25b,_0x1030ad:0x21c,_0x2056d6:0x23a,_0x278a04:0x24e,_0x4e4859:0x23b,_0x1e2935:0x24d,_0x3026a5:0x275,_0x3aa939:0x25f},{sessionId:_0x3a2587,projectDir:_0x441062}=_0x5416f7;return async(_0x2ecd3f,_0x48c22e)=>{const _0x3676fe={_0x58d769:0x166},_0x130ba3=_0x3d77ed[_0x4169fa(_0x261462._0x44af56,0x282,0x276,_0x261462._0x24dc68)](_0x24933c(0x236,0x229,0x248,_0x261462._0x4e6365),_0x2ecd3f[_0x24933c(_0x261462._0x5b39a3,0x219,0x217,0x233)]);function _0x4169fa(_0x5866d8,_0x5a11d0,_0xcd4ae3,_0x1473df){return _0x200a(_0x1473df-0x19e,_0x5a11d0);}function _0x24933c(_0x52e987,_0x331aa0,_0x27f77a,_0x1a112c){return _0x200a(_0x52e987-_0x3676fe._0x58d769,_0x27f77a);}for(const _0x2cd31f of _0x130ba3){const _0x2edc7f={'tool_name':_0x2ecd3f[_0x4169fa(_0x261462._0x231e04,_0x261462._0x5a5584,0x25b,_0x261462._0x58b5c6)],'tool_input':_0x2ecd3f[_0x24933c(0x21f,_0x261462._0x5c5e3a,0x23a,_0x261462._0x283a10)],'session_id':_0x3a2587},_0x20dfdf=await _0x4ff8e0(_0x2cd31f[_0x4169fa(0x285,_0x261462._0x1889a5,_0x261462._0x3bf215,_0x261462._0x575d2d)],_0x2edc7f,_0x2cd31f['timeout'],_0x441062),_0x4b4692=_0x20dfdf[_0x4169fa(0x28a,_0x261462._0x7498b4,0x278,_0x261462._0xcab05b)]?.['hookSpecificOutput']?.[_0x24933c(_0x261462._0x46f24c,0x247,0x227,_0x261462._0x4a33ae)];if(_0x4b4692===_0x4169fa(_0x261462._0x5b8091,0x257,_0x261462._0x5b2504,0x263))return{'action':'run'};if(_0x4b4692===_0x24933c(_0x261462._0x11ee8b,_0x261462._0x5c772d,_0x261462._0x4cac5b,_0x261462._0x5d84c6))return{'action':_0x4169fa(_0x261462._0x285db8,_0x261462._0x22f01f,0x26f,0x283),'reason':_0x20dfdf[_0x4169fa(_0x261462._0x250167,_0x261462._0x217a11,_0x261462._0x11c94a,_0x261462._0xcab05b)]?.['hookSpecificOutput']?.[_0x24933c(0x21a,0x212,_0x261462._0x3b96f6,0x210)]||'Permission\x20denied\x20for\x20'+_0x2ecd3f[_0x4169fa(0x246,_0x261462._0x1b6d13,0x273,0x25e)]};if(_0x20dfdf[_0x4169fa(0x268,0x274,_0x261462._0x396477,_0x261462._0x4e8977)]===_0x4169fa(_0x261462._0x1889a5,_0x261462._0x1ac579,_0x261462._0x235f8f,0x272)||_0x20dfdf[_0x4169fa(_0x261462._0x4252f4,_0x261462._0x544e11,0x265,0x277)]?.[_0x24933c(0x21e,0x21c,0x208,_0x261462._0x1030ad)]===_0x24933c(_0x261462._0x2056d6,0x258,_0x261462._0x278a04,_0x261462._0x4e4859))return{'action':_0x24933c(0x24b,_0x261462._0x1e2935,0x23b,0x254),'reason':_0x20dfdf[_0x4169fa(0x27d,_0x261462._0xcab05b,_0x261462._0x3026a5,0x277)]?.['reason']||_0x4169fa(0x262,_0x261462._0x3aa939,0x275,0x275)+_0x2ecd3f['name']};}return _0x398e5c(_0x2ecd3f,_0x48c22e);};}var DEFAULT_TIMEOUT_S2=0x3c;function createHookRegistry(_0x1161cc){const _0x2c39ad={_0x244cce:0x1cd,_0x4038e7:0x326,_0xd2e619:0x303,_0x10cfe7:0x31b,_0x5b8478:0x1c4,_0xbcd275:0x1c1,_0x254e5d:0x1ba,_0x39e163:0x1bc,_0x1bc68f:0x31f,_0x3c7167:0x1d0,_0x40e215:0x328,_0x7b5935:0x329,_0x1031b3:0x32a,_0x1697c7:0x328,_0xb10bf9:0x340,_0x567137:0x314,_0x491c9d:0x326},_0x4e3c33={_0x3a10ee:0x2fd,_0x11c7a6:0x2ea};return{'hasHooks'(_0x2cb79e){const _0x2687ae={_0x505198:0x3ae};function _0x29f089(_0x129bb4,_0x29c259,_0x2d4887,_0x40e3cd){return _0x200a(_0x29c259- -_0x2687ae._0x505198,_0x129bb4);}return(_0x1161cc[_0x2cb79e]?.[_0x29f089(-0x2ee,-0x2f9,-_0x4e3c33._0x3a10ee,-_0x4e3c33._0x11c7a6)]??0x0)>0x0;},'getHooks'(_0x2eb2ee,_0x330dc2){function _0x4f3d60(_0x3e512c,_0x21a856,_0x4007a2,_0x28ead7){return _0x200a(_0x3e512c-0x107,_0x4007a2);}const _0x578f8f=_0x1161cc[_0x2eb2ee];function _0x28626f(_0x16e579,_0x203c3d,_0x46329f,_0xe7f42a){return _0x200a(_0xe7f42a-0x26b,_0x16e579);}if(!_0x578f8f)return[];const _0x1be332=[];for(const _0x2aac17 of _0x578f8f){if(!_0x2aac17[_0x4f3d60(0x1b7,_0x2c39ad._0x244cce,0x1b3,0x1d6)]||_0x2aac17[_0x28626f(_0x2c39ad._0x4038e7,_0x2c39ad._0xd2e619,0x2fe,_0x2c39ad._0x10cfe7)]==='*'){_0x1be332[_0x4f3d60(_0x2c39ad._0x5b8478,_0x2c39ad._0xbcd275,0x1b0,0x1c1)](..._0x2aac17['hooks'][_0x4f3d60(_0x2c39ad._0x254e5d,_0x2c39ad._0x39e163,0x1c9,0x1b2)](_0x816b6b=>({'command':_0x816b6b[_0x4f3d60(0x1e8,0x1dc,0x1fb,0x1e9)],'timeout':_0x816b6b['timeout']??DEFAULT_TIMEOUT_S2})));continue;}if(_0x330dc2===void 0x0)continue;const _0x3413f5=new RegExp(_0x28626f(0x33f,_0x2c39ad._0x1bc68f,0x332,0x325)+_0x2aac17['matcher']+')$');_0x3413f5[_0x4f3d60(_0x2c39ad._0x3c7167,0x1e5,0x1b5,0x1ec)](_0x330dc2)&&_0x1be332[_0x28626f(_0x2c39ad._0x40e215,_0x2c39ad._0x7b5935,_0x2c39ad._0x1031b3,_0x2c39ad._0x1697c7)](..._0x2aac17[_0x28626f(_0x2c39ad._0xb10bf9,_0x2c39ad._0x567137,0x339,_0x2c39ad._0x491c9d)]['map'](_0x5977a3=>({'command':_0x5977a3[_0x4f3d60(0x1e8,0x1c8,0x1fb,0x1f8)],'timeout':_0x5977a3['timeout']??DEFAULT_TIMEOUT_S2})));}return _0x1be332;}};}export{createHookExtensions,createHookOnToolCallMiddleware,createHookRegistry,executeCommandHook};