@nuvin/agent-core 0.1.0-rc.1 → 0.1.0-rc.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuvin/agent-core",
3
- "version": "0.1.0-rc.1",
3
+ "version": "0.1.0-rc.3",
4
4
  "private": false,
5
5
  "description": "Core agent, model, format, and tool primitives for Nuvin",
6
6
  "license": "Apache-2.0",
@@ -52,7 +52,7 @@
52
52
  "tsup": "^8.5.1",
53
53
  "typescript": "^6.0.2",
54
54
  "vitest": "^4.1.2",
55
- "@nuvin/config": "0.1.1-rc.1"
55
+ "@nuvin/config": "0.1.1-rc.2"
56
56
  },
57
57
  "dependencies": {
58
58
  "@anthropic-ai/sdk": "^0.82.0",
@@ -1 +0,0 @@
1
- (function(_0x20c9db,_0x5e09ae){const _0x40974d={_0x3bbe4e:0x3bf,_0x1440b0:0x25e,_0xd5e984:0x21e,_0x1da271:0x213,_0x486c7a:0x1ac,_0x5a5697:0x1bd,_0x213d77:0x20e,_0x1ec971:0x1be,_0x25140e:0x1fa,_0x1fcf87:0x3f4},_0x536120={_0x8b2d7f:0x296};function _0x398ed1(_0x4b6e89,_0x4f70c3,_0x438204,_0x2de7a4){return _0x57c2(_0x438204-0xca,_0x4b6e89);}const _0x20e058=_0x20c9db();function _0x5a4415(_0x373f9c,_0x82b987,_0x532802,_0x3b05a8){return _0x57c2(_0x373f9c-_0x536120._0x8b2d7f,_0x82b987);}while(!![]){try{const _0x5ff882=parseInt(_0x5a4415(_0x40974d._0x3bbe4e,0x413,0x3b5,0x372))/0x1*(parseInt(_0x398ed1(0x211,_0x40974d._0x1440b0,_0x40974d._0xd5e984,0x244))/0x2)+-parseInt(_0x398ed1(0x1fa,0x20f,_0x40974d._0x1da271,0x235))/0x3+parseInt(_0x398ed1(_0x40974d._0x486c7a,0x1b2,_0x40974d._0x5a5697,0x1c5))/0x4+-parseInt(_0x398ed1(0x224,_0x40974d._0x213d77,0x1d9,_0x40974d._0x1ec971))/0x5+parseInt(_0x398ed1(_0x40974d._0x25140e,0x1b4,0x1c8,0x19b))/0x6+parseInt(_0x5a4415(_0x40974d._0x1fcf87,0x3bd,0x3da,0x427))/0x7+-parseInt(_0x5a4415(0x397,0x39b,0x369,0x378))/0x8;if(_0x5ff882===_0x5e09ae)break;else _0x20e058['push'](_0x20e058['shift']());}catch(_0x597237){_0x20e058['push'](_0x20e058['shift']());}}}(_0x4906,0xb73ac));import{createAssistantTextMessage,createReasoningMessage,createToolResultUserMessage,createToolUseMessage,getToolUseBlocks,normalizeMessage,normalizeSystem,responseToAssistantMessage,synthesizeMissingToolResults}from'./chunk-QDOE7NWO.js';import{TurnFailedError}from'./chunk-FFIZ6TKW.js';import{addAbortListener,isAbortError,throwIfAborted,toAbortError}from'./chunk-X7VAACWY.js';function _0x106530(_0x35215e,_0x528789,_0x40ae28,_0x25ea53){const _0x587ba6={_0x17b358:0xf0};return _0x57c2(_0x25ea53-_0x587ba6._0x17b358,_0x35215e);}function isJsonObject(_0x7b5164){const _0x2d0587={_0x34d7c9:0x15,_0x297648:0xbd,_0x2bcb1a:0xf5},_0x59bb1c={_0x5b3268:0x78};function _0xf6544d(_0x4238a8,_0x45d2c1,_0x32c6f2,_0x91582e){return _0x57c2(_0x4238a8-0x17f,_0x45d2c1);}function _0x25997f(_0x5c9c34,_0x4383e6,_0x255fba,_0x213843){return _0x57c2(_0x255fba- -_0x59bb1c._0x5b3268,_0x213843);}return typeof _0x7b5164===_0x25997f(0x7d,0xe,0x50,_0x2d0587._0x34d7c9)&&_0x7b5164!==null&&!Array[_0x25997f(0x100,0xcd,_0x2d0587._0x297648,_0x2d0587._0x2bcb1a)](_0x7b5164);}function isToolOutputEnvelope(_0x1ad608){const _0x1e0547={_0x3c0818:0x22c,_0x9633bb:0x226,_0x2a2a95:0x4a8,_0x50906d:0x4a7,_0x28525f:0x474,_0x13950d:0x414,_0xa225d1:0x3cd},_0xb6fa8f={_0x474333:0x340},_0x2cc3b0={_0x4c3f56:0x30d};if(typeof _0x1ad608!==_0x4ffd3b(-0x1f5,-0x27f,-0x245,-_0x1e0547._0x3c0818)||_0x1ad608===null||Array[_0x4ffd3b(-_0x1e0547._0x9633bb,-0x21b,-0x1d8,-0x187)](_0x1ad608))return![];if(typeof _0x1ad608[_0x6e8660(0x4cc,_0x1e0547._0x2a2a95,_0x1e0547._0x50906d,_0x1e0547._0x28525f)]!==_0x6e8660(0x401,_0x1e0547._0x13950d,_0x1e0547._0xa225d1,0x3ca))return![];function _0x4ffd3b(_0x13b5b4,_0x30f735,_0x3e5a36,_0x3770cf){return _0x57c2(_0x3e5a36- -_0x2cc3b0._0x4c3f56,_0x3770cf);}const _0xec1675=_0x1ad608[_0x4ffd3b(-0x272,-0x208,-0x23d,-0x242)];function _0x6e8660(_0x51b26e,_0x1c5cad,_0x4ce57e,_0x143ff5){return _0x57c2(_0x1c5cad-_0xb6fa8f._0x474333,_0x51b26e);}return _0xec1675===void 0x0||isJsonObject(_0xec1675);}function validateAgainstSchema(_0x957f6c,_0x2c26f4,_0xc43ec2){const _0x13736f={_0x2f5b1b:0x2f8,_0x4f251c:0x2d5,_0x362318:0x2d9,_0x2053a7:0x303,_0x36fdbe:0x2d3,_0x52fc75:0x2a2,_0x5433d2:0x26b,_0x506aaa:0x2a7,_0x219ddd:0x269,_0x3bd40c:0x22f,_0x46d59b:0x2e9,_0x1c6d62:0x2dd,_0x4b3480:0x2b5,_0x7b28d2:0x2c8,_0x3864ff:0x2f8,_0x267150:0x2e1,_0x2c8bf1:0x33a,_0xda9d08:0x275,_0x14db8f:0x29d,_0x1e4e92:0x28a,_0x26e46a:0x265,_0x3eccf2:0x317,_0x1a8309:0x2f6,_0x3fb566:0x33d,_0x241c0d:0x342,_0x5e0c9d:0x365,_0x48fd46:0x215,_0x4746be:0x239,_0x29f60a:0x2df,_0x383ca2:0x2f3,_0x182ae7:0x291,_0x13b7ff:0x2ba,_0x364797:0x2c6,_0x15f430:0x2fb,_0x328345:0x325,_0x33b4bb:0x313,_0x196109:0x322,_0x2d7fe1:0x359},_0x355d07={_0x445512:0x197},_0x3f9253={_0x566ac0:0x20d};function _0x55643e(_0x45c5d1,_0x41e45f,_0x15d384,_0x3d0442){return _0x57c2(_0x41e45f-_0x3f9253._0x566ac0,_0x3d0442);}function _0x14c464(_0x52c75f,_0x5ece24,_0x58c5a6,_0x1e9ea1){return _0x57c2(_0x58c5a6-_0x355d07._0x445512,_0x1e9ea1);}switch(_0xc43ec2[_0x14c464(_0x13736f._0x2f5b1b,0x2e4,_0x13736f._0x4f251c,_0x13736f._0x362318)]){case _0x55643e(_0x13736f._0x2053a7,0x2e1,0x31c,_0x13736f._0x36fdbe):if(typeof _0x2c26f4!==_0x14c464(0x2b1,_0x13736f._0x52fc75,_0x13736f._0x5433d2,0x24a))throw new Error(_0x14c464(0x25a,_0x13736f._0x506aaa,_0x13736f._0x219ddd,_0x13736f._0x3bd40c)+_0x957f6c+':\x20expected\x20string');return;case'number':if(typeof _0x2c26f4!==_0x55643e(0x2f7,_0x13736f._0x46d59b,0x2dc,_0x13736f._0x1c6d62))throw new Error('Invalid\x20tool\x20input\x20at\x20'+_0x957f6c+_0x14c464(0x2c7,_0x13736f._0x4b3480,_0x13736f._0x7b28d2,_0x13736f._0x3864ff));return;case _0x55643e(0x327,0x2eb,_0x13736f._0x267150,_0x13736f._0x2c8bf1):if(typeof _0x2c26f4!==_0x14c464(0x28c,0x284,_0x13736f._0xda9d08,_0x13736f._0x14db8f))throw new Error('Invalid\x20tool\x20input\x20at\x20'+_0x957f6c+_0x14c464(0x244,_0x13736f._0x1e4e92,0x282,_0x13736f._0x26e46a));return;case _0x14c464(_0x13736f._0x3eccf2,0x2c2,_0x13736f._0x1a8309,0x314):if(!Array[_0x55643e(_0x13736f._0x3fb566,_0x13736f._0x241c0d,0x2f7,_0x13736f._0x5e0c9d)](_0x2c26f4))throw new Error(_0x14c464(0x295,_0x13736f._0x48fd46,0x269,_0x13736f._0x4746be)+_0x957f6c+':\x20expected\x20array');_0x2c26f4[_0x55643e(0x2b6,0x2f6,0x2dc,_0x13736f._0x7b28d2)]((_0x38a3be,_0x1ce945)=>{const _0xef1705={_0x134433:0x185,_0x17c6cb:0x49};function _0x3f977f(_0x403c7d,_0x1f0581,_0x5c479a,_0x4b33b3){return _0x14c464(_0x403c7d-_0xef1705._0x134433,_0x1f0581-_0xef1705._0x17c6cb,_0x1f0581- -0x46b,_0x403c7d);}validateAgainstSchema(_0x957f6c+'['+_0x1ce945+']',_0x38a3be,_0xc43ec2[_0x3f977f(-0x203,-0x1cc,-0x21b,-0x1a5)]);});return;case'object':if(!isJsonObject(_0x2c26f4))throw new Error(_0x55643e(0x32a,_0x13736f._0x29f60a,_0x13736f._0x383ca2,_0x13736f._0x182ae7)+_0x957f6c+_0x14c464(_0x13736f._0x13b7ff,_0x13736f._0x364797,0x2dc,0x290));for(const _0x2d8c06 of _0xc43ec2[_0x14c464(0x28c,0x311,0x2c5,0x286)]??[]){if(!(_0x2d8c06 in _0x2c26f4))throw new Error('Invalid\x20tool\x20input\x20at\x20'+_0x957f6c+_0x55643e(_0x13736f._0x15f430,0x2db,0x2db,_0x13736f._0x328345)+_0x2d8c06+'\x22');}for(const [_0x1a8bab,_0x562982]of Object[_0x14c464(0x2d0,0x2cb,0x2f8,_0x13736f._0x33b4bb)](_0xc43ec2[_0x55643e(_0x13736f._0x196109,0x312,_0x13736f._0x2d7fe1,0x343)])){_0x1a8bab in _0x2c26f4&&validateAgainstSchema(_0x957f6c+'.'+_0x1a8bab,_0x2c26f4[_0x1a8bab],_0x562982);}}}function normalizeToolOutputValue(_0x1f4f9d){const _0x1d019d={_0x38807b:0x4d,_0x438ca9:0x34,_0x36a00a:0x18,_0x2395da:0x50,_0x24d72e:0x25f,_0x2b4433:0x24d,_0x1860ae:0x217,_0x4f93a8:0x30e,_0x3dd9ca:0x2ff,_0x24b169:0x94,_0x3ebb0b:0xc2,_0x123d52:0xa5,_0x1c5f2c:0x32c,_0xcdc89:0x96,_0x5b44b5:0x91,_0x3133ca:0x4b,_0x303ec5:0x93,_0x2812c2:0x296,_0x4944ae:0x2d7,_0x209d8b:0x2ae};function _0x363d32(_0x312d17,_0x3e1167,_0x51af18,_0x5364d5){return _0x57c2(_0x3e1167- -0x3a3,_0x312d17);}function _0x3ba003(_0xa41f65,_0x25f07f,_0x2457a0,_0x1dd929){return _0x57c2(_0x2457a0- -0x180,_0x1dd929);}if(isToolOutputEnvelope(_0x1f4f9d))return{'output':_0x1f4f9d[_0x3ba003(-_0x1d019d._0x38807b,-_0x1d019d._0x438ca9,-_0x1d019d._0x36a00a,-_0x1d019d._0x2395da)],'structured':_0x1f4f9d['structured']??{'value':_0x1f4f9d[_0x363d32(-_0x1d019d._0x24d72e,-0x23b,-_0x1d019d._0x2b4433,-_0x1d019d._0x1860ae)]},..._0x1f4f9d[_0x363d32(-_0x1d019d._0x4f93a8,-0x2e5,-_0x1d019d._0x3dd9ca,-0x2a7)]!==void 0x0?{'content':_0x1f4f9d[_0x3ba003(-0xca,-_0x1d019d._0x24b169,-_0x1d019d._0x3ebb0b,-_0x1d019d._0x123d52)]}:{}};if(typeof _0x1f4f9d==='string')return{'output':_0x1f4f9d,'structured':{'value':_0x1f4f9d}};if(typeof _0x1f4f9d===_0x363d32(-0x2b5,-0x2db,-0x2c0,-_0x1d019d._0x1c5f2c)&&_0x1f4f9d!==null&&!Array[_0x3ba003(-_0x1d019d._0xcdc89,-_0x1d019d._0x5b44b5,-_0x1d019d._0x3133ca,-_0x1d019d._0x303ec5)](_0x1f4f9d))return{'output':JSON[_0x363d32(-_0x1d019d._0x2812c2,-_0x1d019d._0x4944ae,-0x309,-_0x1d019d._0x209d8b)](_0x1f4f9d,null,0x2),'structured':_0x1f4f9d};return{'output':JSON['stringify'](_0x1f4f9d,null,0x2),'structured':{'value':_0x1f4f9d}};}function createToolOutput(_0x5a98a8,_0x194560={'value':_0x5a98a8},_0x4c0bb1){return{'output':_0x5a98a8,'structured':_0x194560,..._0x4c0bb1!==void 0x0?{'content':_0x4c0bb1}:{}};}var ToolExecutionError=class extends Error{[_0x106530(0x190,0x181,0x1b3,0x1c0)];constructor(_0x4cffb6,_0xae552f={}){const _0xe8f618={_0x37e352:0x2d7,_0x342502:0x319,_0x1bd4c0:0x5b,_0x34242c:0x48},_0x1e6247={_0x108c7b:0xaf,_0x1dd3ca:0x10c,_0x4b53c9:0x114},_0x23128c={_0x4a0b09:0x2d,_0x33ab7f:0xbf,_0x385260:0x165};super(_0x4cffb6);function _0x638675(_0x395198,_0x499c08,_0x513c61,_0x520ab5){return _0x106530(_0x520ab5,_0x499c08-_0x23128c._0x4a0b09,_0x513c61-_0x23128c._0x33ab7f,_0x499c08- -_0x23128c._0x385260);}this['name']=_0x2126f4(0x2f8,_0xe8f618._0x37e352,0x305,_0xe8f618._0x342502);function _0x2126f4(_0x34ae59,_0x461646,_0x242703,_0x431d61){return _0x106530(_0x34ae59,_0x461646-_0x1e6247._0x108c7b,_0x242703-_0x1e6247._0x1dd3ca,_0x461646-_0x1e6247._0x4b53c9);}this[_0x638675(0x74,_0xe8f618._0x1bd4c0,_0xe8f618._0x34242c,0x98)]=_0xae552f;}};function defineTool(_0x55ae96){return _0x55ae96;}var ToolRegistry=class{[_0x2b8011(0x11b,0xf4,0xe9,0xd7)]=new Map();constructor(_0x2581bc=[]){const _0x31fc0c={_0x31f08c:0x118},_0x2c8ef9={_0x3c46a9:0x36};function _0x2776e7(_0x5c901d,_0x564397,_0x42de35,_0x5bf580){return _0x2b8011(_0x5c901d-0x6e,_0x564397,_0x42de35-_0x2c8ef9._0x3c46a9,_0x42de35-0xa0);}for(const _0xab9e7a of _0x2581bc){this[_0x2776e7(0x166,_0x31fc0c._0x31f08c,0x147,0x180)](_0xab9e7a);}}[_0x2b8011(0xfc,0x6c,0x7b,0xa7)](_0x488ae0){const _0x3ac21e={_0x3424bc:0x366,_0x58b474:0x2eb,_0x45b2e0:0x320,_0x46ed58:0x2a7},_0x16bb8c={_0x49e469:0x103};function _0x482fe1(_0x36780f,_0x51e784,_0x55240e,_0x148034){return _0x106530(_0x55240e,_0x51e784-0x189,_0x55240e-0x174,_0x36780f-_0x16bb8c._0x49e469);}function _0x469c64(_0xb0593e,_0x2c20c0,_0x44fdc0,_0x3f66a1){return _0x2b8011(_0xb0593e-0xba,_0xb0593e,_0x44fdc0-0x172,_0x2c20c0-0xf6);}this['toolsByName'][_0x482fe1(0x31d,0x2ed,_0x3ac21e._0x3424bc,_0x3ac21e._0x58b474)](_0x488ae0[_0x482fe1(0x2cb,_0x3ac21e._0x45b2e0,0x2ca,_0x3ac21e._0x46ed58)],_0x488ae0);}[_0x106530(0x1b0,0x173,0x1c5,0x1c5)](_0x56bfe4){const _0x21a325={_0x38b4f4:0x139,_0xbcf03b:0xfb},_0x51e6b4={_0x2bcddd:0x45,_0x4df06e:0x1b6};function _0xb426ab(_0x423376,_0x3bcbfd,_0x48934a,_0x5da228){return _0x2b8011(_0x423376-0xfe,_0x48934a,_0x48934a-0x1f3,_0x5da228-0x48);}function _0x2a452b(_0x1e4277,_0x1a8cce,_0x21186c,_0x3c2642){return _0x2b8011(_0x1e4277-_0x51e6b4._0x2bcddd,_0x3c2642,_0x21186c-_0x51e6b4._0x4df06e,_0x1e4277-0xcb);}return this[_0x2a452b(0x1a2,0x1ef,0x1db,0x167)][_0xb426ab(_0x21a325._0x38b4f4,0xbb,_0x21a325._0xbcf03b,0xfd)](_0x56bfe4);}[_0x106530(0x21d,0x240,0x1ff,0x242)](){const _0x316db8={_0x2797b1:0x127,_0x5c92dc:0x16c,_0x10e167:0xf6},_0xb2db62={_0x411e37:0xa5,_0x1f47c7:0xd4,_0x1bf984:0x33},_0x303c76={_0x20ad4c:0x1c6,_0x70a396:0x353};function _0x2d6d78(_0x570b2e,_0x42ebb0,_0x1e661a,_0x54f564){return _0x106530(_0x1e661a,_0x42ebb0-0x84,_0x1e661a-_0x303c76._0x20ad4c,_0x42ebb0- -_0x303c76._0x70a396);}function _0x58c8b4(_0x4c41a7,_0x54e3e3,_0x465c25,_0x42b75b){return _0x2b8011(_0x4c41a7-_0xb2db62._0x411e37,_0x4c41a7,_0x465c25-_0xb2db62._0x1f47c7,_0x42b75b-_0xb2db62._0x1bf984);}return[...this[_0x2d6d78(-_0x316db8._0x2797b1,-_0x316db8._0x5c92dc,-0x19b,-0x128)][_0x58c8b4(0x115,0x121,_0x316db8._0x10e167,0x10d)]()];}[_0x106530(0x21d,0x1da,0x1cd,0x1e4)](){const _0x599778={_0x236763:0x20d,_0x5d2c9e:0x1f4,_0x41ee44:0x1b8,_0x58045c:0x1ea,_0x164979:0x1d4,_0x39fa71:0x190,_0x5a75ec:0x18a,_0x387460:0x1a4};return this['list']()['map'](_0x39f434=>{const _0x5b87ef={_0x108c9b:0x2cc};function _0x18953c(_0x4696b3,_0x45ad29,_0x468213,_0x190e27){return _0x57c2(_0x190e27-0x5e,_0x4696b3);}function _0xfccd8f(_0x1d9f7c,_0x3d8a2c,_0x1e2da7,_0x2bb98d){return _0x57c2(_0x3d8a2c- -_0x5b87ef._0x108c9b,_0x2bb98d);}return{'name':_0x39f434[_0xfccd8f(-_0x599778._0x236763,-_0x599778._0x5d2c9e,-_0x599778._0x41ee44,-_0x599778._0x58045c)],'description':_0x39f434[_0x18953c(0x1df,_0x599778._0x164979,0x1bd,_0x599778._0x39fa71)],'input_schema':_0x39f434[_0xfccd8f(-0x139,-_0x599778._0x5a75ec,-0x1db,-_0x599778._0x387460)]};});}};function validateToolInput(_0x5722d1,_0x3889a8){return validateAgainstSchema('input',_0x5722d1,_0x3889a8),_0x5722d1;}function deriveFinalToolOutput(_0x35f949){const _0x4acced={_0x32ed82:0x3db,_0x1b534a:0x3b4,_0xa5c1c2:0x407,_0x380275:0x46d,_0x11a2f6:0x48e,_0x4751b0:0x4ca,_0x49e205:0x4c2,_0x53f123:0x513,_0x4239f3:0x4ce,_0x3182f2:0x4d6,_0x5620f2:0x57b,_0x4a859a:0x374},_0x598207={_0x35d8d2:0x12a},_0x1adfcd={_0x1f27c8:0x2e0};function _0x5432a6(_0x50713f,_0x5388e3,_0x4a39d8,_0x1eef08){return _0x106530(_0x1eef08,_0x5388e3-0x152,_0x4a39d8-0x179,_0x4a39d8-_0x1adfcd._0x1f27c8);}function _0x3fd8e8(_0x124aea,_0x2509b9,_0x48b55e,_0x500867){return _0x2b8011(_0x124aea-_0x598207._0x35d8d2,_0x124aea,_0x48b55e-0x117,_0x2509b9-0x304);}if(_0x35f949['length']===0x0)return{'output':'','structured':{}};if(_0x35f949['length']===0x1)return{'output':_0x35f949[0x0]['output'],'structured':_0x35f949[0x0][_0x3fd8e8(_0x4acced._0x32ed82,_0x4acced._0x1b534a,_0x4acced._0xa5c1c2,0x3ff)],..._0x35f949[0x0][_0x5432a6(_0x4acced._0x380275,0x4aa,_0x4acced._0x11a2f6,0x459)]!==void 0x0?{'content':_0x35f949[0x0][_0x5432a6(_0x4acced._0x4751b0,0x46f,_0x4acced._0x11a2f6,_0x4acced._0x49e205)]}:{}};const _0x2165b0=_0x35f949['filter'](_0x161290=>_0x161290[_0x5432a6(0x492,0x4ac,0x48e,0x4a1)]!==void 0x0);return{'output':_0x35f949[_0x5432a6(0x4d8,_0x4acced._0x53f123,0x4e9,_0x4acced._0x4239f3)](_0x5c6679=>_0x5c6679[_0x3fd8e8(0x40a,0x44c,0x455,0x403)])[_0x5432a6(_0x4acced._0x3182f2,0x507,0x528,_0x4acced._0x5620f2)](''),'structured':{'chunks':_0x35f949['map'](_0x4cca07=>_0x4cca07[_0x5432a6(0x498,0x4aa,0x4a0,0x4db)])},..._0x2165b0[_0x3fd8e8(0x40d,0x3bf,0x3bd,_0x4acced._0x4a859a)]===0x1?{'content':_0x2165b0[0x0]['content']}:{}};}function _0x4906(){const _0x4b8e4d=['C3rHz2u','Bwv0yq','CMvHC29UAw5NtwvZC2fNzuLK','ywz0zxjnB2rLBfjLC3bVBNnL','Aw5WDxq','mZu0mJG4ueXLwuLK','BgLZDfrVB2Xty2HLBwfZ','Dg9VBhm','Bwf4vg9Rzw5Z','Dg9VBhncEu5HBwu','zw5HyMXLza','zMLUywXnzxnZywDL','DMfSDwvZ','Bwv0CMLJCW','Dg90ywXuB2TLBNm','Aw5WDxruB2TLBNm','nJiXodq3mLbHqMf6Da','BwvZC2fNzxm','Bw9KzwW','oty5odC1mK9yEvvrwa','BwvZC2fNzq','ywz0zxjuDxjUq29TCgXLDgu','CMvHC29UAw5Nu3rHCNrLzef0','ChjVCgvYDgLLCW','C3rYzwfT','C3rHDhvZ','AxrLBxm','B25vC2vYtwvZC2fNzq','B3v0Chv0sw5KzxG','DhjPBq','C2v0vg9VBhm','x3n5C3rLBvbYB21WDa','B3v0Chv0rM9YBwf0','nZG0ntmWEwzvChbK','BMv4Da','Dg90ywXszwfZB25PBMDuB2TLBNm','yxnZAxn0yw50twvZC2fNzuLK','y29UDgv4DfDPBMrVD0XPBwL0','C2LNBMfS','C2v0vg9WAwm','ywjVCNq','CMvHC29UAw5Nvg9Rzw5Z','zg9Uzq','BwfW','zxjYB3i','C29Tzq','y2HHDe1VzgvS','Dw5RBM93BL90B29S','y29UDgvUDf9KzwX0yq','Bw9KzwXFCMvZCg9UC2u','B25uB29Sq2fSBa','ywjVCNrLza','zxH0zw5ZAw9UCW','DxnLCG','C2vZC2LVBI0','AxrLBuLK','Dg9VBf9JywXS','CMvXDwvZDa','Dg9VBf9Yzxn1BhrFBwvZC2fNzq','mtKZqvnnDwXM','C2v0','zgvSzxrL','z2v0vg9VBhm','DMfSDwu','CMvXDwLYzwq','zMLSDgvY','CMfUzg9T','oIbLEhbLy3rLzcbUDw1Izxi','zgvZy3jPChrPB24','C3LZDgvTuhjVBxb0','Dg9VBf9Yzxn1Bhq','AxnbCNjHEq','ywz0zxjnzxnZywDLqxbWzw5K','Dg90ywXpDxrWDxruB2TLBNm','yw50AhjVCgLJx3rOAw5RAw5Nx2rLBhrH','DhvYBL9JB21WBgv0zq','zgvMyxvSDe1LC3nHz2u','C3rHDgu','DxnHz2u','Dg9VBf9JB21WBgv0zwq','DhLWzq','zxHLy3v0zq','CMvZCg9UC2u','A2LUza','Aw5WDxrty2HLBwe','zNvUy3rPB24','DhvYBLn0yxj0zwrbDa','oIbLEhbLy3rLzcbVyMPLy3q','yMvMB3jLtw9KzwXszxf1zxn0','Dg9VBfj1BNrPBwu','DhjHBNnMB3jTzxi','mJi4nZq3m2frqvDPvW','C2v0u3LZDgvTuhjVBxb0','Dg9VBf91C2vFy2H1BMS','C2vZC2LVBKLK','CMvJB3jKrxzLBNq','y29TCgXLDgvK','CNvUt2jZzxj2zxjZ','Dg9VBenHBgXdB3vUDa','B3jKzxi','BgLZDa','Dg9VBf91C2u','ndy1nerpzKjLBq','ChvZAa','B3bLBMfPx3jLyxnVBMLUz19KzwX0yq','B25fDMvUDa','AM9PBG','z2v0q29UDgv4DfDPBMrVD0XPBwL0','C2v0u2vZC2LVBKLK','CMvHC29UAw5Nx21LC3nHz2u','CMvHC29UAw5Nx2nODw5R','vg9VBcbLEgvJDxrPB24GCMvQzwn0zwqGzM9Yia','ote1nZa3ohvpr2fsCW','yxjYyxK','Aw5KzxG','zw50CMLLCW','Dg9VBf9ZDgfYDgvK','Bw9KzwXdywXSq291BNq','C2vUza','ChjVDMLKzxi','Dgv4Da','CNvUvhjHBNnMB3jTzxjZ','B3v0Chv0','B2jZzxj2zxi','y29UDgvUDa','CMvHC29UAw5Nq29TCgXLDgvKqxq','DxnLCL9TzxnZywDL','CMvHC29U','Dg90ywXjBNb1DfrVA2vUCW','tw9KzwWGC3rYzwfTigvUzgvKihDPDgHVDxqGysbMAw5HBcbYzxnWB25Zzq','DhvYBI0','qwDLBNqGCMvXDwLYzxmGysbJAgf0tw9KzwW','C3vTBwfYEuLUzgv4','CMvNAxn0zxi','B2jQzwn0','B3bLBMfPx3jLyxnVBMLUz19ZDw1Tyxj5x2rLBhrH','CMvZzxrnzxnZywDLCW','yMvMB3jLrMLUywXpDxrWDxq','C3rYAw5NAwz5','zgvWCW','oIbTAxnZAw5NihjLCxvPCMvKigzPzwXKici','C3LZDgvT','C3rYDwn0DxjLza','CNvU','sw52ywXPzcb0B29SigLUChv0igf0ia','vg9VBev4zwn1DgLVBKvYCM9Y','C3rYAw5N','z2v0','Bw9KzwXFCMvXDwvZDa','Aw5WDxrezwX0yq','BMfTzq','zgvSDge','Dg9VBf9VDxrWDxrFy2H1BMS','BgvUz3rO','BNvTyMvY','zMLUywXFBwvZC2fNzq','yM9VBgvHBG','vw5RBM93BIb0B29SoIa','y29UDgvUDeLUzgv4','DhvYBKLK','ywXS','Dg9VBf91C2vFzgvSDge','CMvQzwn0','BgfZDfjLC3bVBNnL','ywn0Aw9U','C2vZC2LVBKrPCG','DhvYBKLUzgv4','zM9YrwfJAa','BM93','oIbLEhbLy3rLzcbIB29SzwfU','CMvNAxn0CNK','oMfZC2LZDgfUDdO'];_0x4906=function(){return _0x4b8e4d;};return _0x4906();}function createToolMeta(){return{'transforms':[]};}function createErrorToolResult(_0x13dd29,_0x399421,_0x3db315,_0x249ab6=[]){const _0x2707ae={_0x356376:0x3d4,_0x1f0865:0x3e7,_0x109942:0x40d,_0x197029:0x42e,_0x80ecc5:0x429,_0x1953ac:0x3d6},_0x44f703={_0x4a93d3:0x32f},_0x36804a={_0x42b78a:0x34e};function _0x20ca56(_0x358141,_0x3e9dfe,_0x1fc4c3,_0x40eaa8){return _0x2b8011(_0x358141-0x18,_0x40eaa8,_0x1fc4c3-0x2,_0x1fc4c3- -_0x36804a._0x42b78a);}function _0x57f45c(_0x2532eb,_0x179405,_0x400fd6,_0x236a7b){return _0x2b8011(_0x2532eb-0x173,_0x236a7b,_0x400fd6-0xd2,_0x179405-_0x44f703._0x4a93d3);}return{'callId':_0x13dd29['id'],'toolName':_0x13dd29[_0x57f45c(_0x2707ae._0x356376,_0x2707ae._0x1f0865,_0x2707ae._0x109942,0x3de)],'status':_0x57f45c(_0x2707ae._0x197029,_0x2707ae._0x80ecc5,_0x2707ae._0x1953ac,0x3dd),'output':_0x399421,'structured':_0x3db315,'chunks':_0x249ab6,'meta':createToolMeta()};}function createRejectedToolResult(_0xb341ae,_0x1a5147){const _0x2b63a4={_0x441d0c:0x1cb,_0xd4578c:0x179,_0x19395e:0x150,_0x18f9f2:0x19b,_0x2a91c5:0x1a6,_0x10c11e:0x233,_0xd48f0e:0x21d,_0x4cc4a2:0x18b,_0x580f74:0x198,_0x515566:0xaf,_0x29e7e9:0x1a7,_0x56cbba:0x19b},_0x3181b5={_0x1a5591:0x14b},_0x242ac0={_0x4d2700:0x100,_0x2d80d2:0x30};function _0xb76e3f(_0x12aa42,_0x9a07bd,_0x342e1c,_0x299573){return _0x106530(_0x12aa42,_0x9a07bd-0x6b,_0x342e1c-_0x242ac0._0x4d2700,_0x342e1c- -_0x242ac0._0x2d80d2);}function _0x4409d4(_0x2277d8,_0x27ea9e,_0x462bc9,_0x55b271){return _0x2b8011(_0x2277d8-0x1ee,_0x27ea9e,_0x462bc9-0x4f,_0x2277d8- -_0x3181b5._0x1a5591);}const _0xa85e74=_0x1a5147?.[_0xb76e3f(0x211,0x210,_0x2b63a4._0x441d0c,_0x2b63a4._0xd4578c)]()[_0xb76e3f(_0x2b63a4._0x19395e,0x177,_0x2b63a4._0x18f9f2,_0x2b63a4._0x2a91c5)]?_0x1a5147:_0xb76e3f(0x1d2,_0x2b63a4._0x10c11e,_0x2b63a4._0xd48f0e,0x267)+_0xb341ae[_0xb76e3f(0x14e,_0x2b63a4._0x4cc4a2,_0x2b63a4._0x580f74,0x18e)];return createErrorToolResult(_0xb341ae,_0xa85e74,{'error':'tool_rejected',..._0x1a5147?.[_0x4409d4(-0x60,-0x2d,-_0x2b63a4._0x515566,-0x70)]()[_0xb76e3f(_0x2b63a4._0x2a91c5,_0x2b63a4._0x29e7e9,_0x2b63a4._0x56cbba,0x1b4)]?{'reason':_0x1a5147}:{}});}function _0x57c2(_0x5333ce,_0x4b3452){_0x5333ce=_0x5333ce-0xbe;const _0x490663=_0x4906();let _0x57c27b=_0x490663[_0x5333ce];if(_0x57c2['UDFhFB']===undefined){var _0x440dd0=function(_0x39cba5){const _0x51d936='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x7b5164='',_0x1ad608='';for(let _0xec1675=0x0,_0x957f6c,_0x2c26f4,_0xc43ec2=0x0;_0x2c26f4=_0x39cba5['charAt'](_0xc43ec2++);~_0x2c26f4&&(_0x957f6c=_0xec1675%0x4?_0x957f6c*0x40+_0x2c26f4:_0x2c26f4,_0xec1675++%0x4)?_0x7b5164+=String['fromCharCode'](0xff&_0x957f6c>>(-0x2*_0xec1675&0x6)):0x0){_0x2c26f4=_0x51d936['indexOf'](_0x2c26f4);}for(let _0x38a3be=0x0,_0x1ce945=_0x7b5164['length'];_0x38a3be<_0x1ce945;_0x38a3be++){_0x1ad608+='%'+('00'+_0x7b5164['charCodeAt'](_0x38a3be)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1ad608);};_0x57c2['zVXLCK']=_0x440dd0,_0x57c2['yLWMyY']={},_0x57c2['UDFhFB']=!![];}const _0x36cf64=_0x490663[0x0],_0x43958f=_0x5333ce+_0x36cf64,_0xe16b07=_0x57c2['yLWMyY'][_0x43958f];return!_0xe16b07?(_0x57c27b=_0x57c2['zVXLCK'](_0x57c27b),_0x57c2['yLWMyY'][_0x43958f]=_0x57c27b):_0x57c27b=_0xe16b07,_0x57c27b;}function createAbortedToolResult(_0x5a961d,_0xe7401f,_0x2e7d2f=[]){const _0x3c9419={_0x415a0b:0x19c};function _0x1fcdfc(_0x1d00d6,_0x52c434,_0x23f623,_0x51855a){return _0x2b8011(_0x1d00d6-_0x3c9419._0x415a0b,_0x52c434,_0x23f623-0x35,_0x51855a- -0x36d);}const _0x3fa079=toAbortError(_0xe7401f);function _0x255e32(_0x33210a,_0x5a6130,_0x18c5c2,_0x259d5d){return _0x106530(_0x5a6130,_0x5a6130-0x165,_0x18c5c2-0xb3,_0x33210a- -0x4b4);}return createErrorToolResult(_0x5a961d,_0x3fa079[_0x1fcdfc(-0x29f,-0x274,-0x290,-0x28b)],{'error':_0x3fa079[_0x1fcdfc(-0x2c7,-0x27a,-0x2b0,-0x28b)],'aborted':!![]},_0x2e7d2f);}function createSuccessToolResult(_0x3ad673,_0x3d8452,_0x12aeda){const _0x3b7e2f={_0x2af557:0x323,_0x26e019:0x2fb,_0x5ab2b8:0x3b8,_0x4ca6cb:0x3e2,_0x363cc0:0x353,_0x67d0f:0x2d7,_0x34b9a8:0x302},_0x2369d9={_0x1ef6fd:0x170,_0x47bc0f:0x158},_0x1488be={_0x1d7be0:0x154};function _0x44f4ce(_0x4708b4,_0x37f798,_0x2efb20,_0x4d5356){return _0x106530(_0x37f798,_0x37f798-0x159,_0x2efb20-0x166,_0x4d5356-_0x1488be._0x1d7be0);}function _0x1b1dcc(_0x2aeacb,_0x166ae8,_0x2d7a8d,_0x30081b){return _0x106530(_0x166ae8,_0x166ae8-_0x2369d9._0x1ef6fd,_0x2d7a8d-0x16b,_0x2d7a8d-_0x2369d9._0x47bc0f);}return{'callId':_0x3ad673['id'],'toolName':_0x3ad673[_0x44f4ce(0x337,_0x3b7e2f._0x2af557,_0x3b7e2f._0x26e019,0x31c)],'status':'ok','output':_0x3d8452[_0x44f4ce(_0x3b7e2f._0x5ab2b8,0x3c1,_0x3b7e2f._0x4ca6cb,0x3ac)],'structured':_0x3d8452['structured'],..._0x3d8452[_0x44f4ce(0x316,0x31b,_0x3b7e2f._0x363cc0,0x302)]!==void 0x0?{'content':_0x3d8452[_0x44f4ce(0x335,_0x3b7e2f._0x67d0f,0x2b4,_0x3b7e2f._0x34b9a8)]}:{},'chunks':_0x12aeda,'meta':createToolMeta()};}function createUnknownToolResult(_0x51203b){const _0x6c1f7a={_0x46a6d0:0x1ce,_0x489959:0x1b2,_0x2ff1b0:0x189,_0x387284:0x1ac,_0xc8d11f:0x152,_0x10f701:0x119},_0x46f1de={_0xd73897:0xe3,_0x4b2201:0xba},_0x58a754={_0x37eb54:0x20d};function _0x302ade(_0x57e780,_0x217550,_0x121cf6,_0x44dbea){return _0x106530(_0x57e780,_0x217550-0x47,_0x121cf6-0x16c,_0x44dbea-_0x58a754._0x37eb54);}function _0xc3fe38(_0xcef510,_0x4e7069,_0x532cff,_0x516b89){return _0x106530(_0x4e7069,_0x4e7069-_0x46f1de._0xd73897,_0x532cff-_0x46f1de._0x4b2201,_0x516b89- -0x374);}return createErrorToolResult(_0x51203b,_0xc3fe38(-0x1b2,-_0x6c1f7a._0x46a6d0,-0x1f4,-0x1a5)+_0x51203b[_0xc3fe38(-_0x6c1f7a._0x489959,-0x178,-_0x6c1f7a._0x2ff1b0,-_0x6c1f7a._0x387284)],{'error':_0xc3fe38(-0x113,-_0x6c1f7a._0xc8d11f,-_0x6c1f7a._0x10f701,-0x167)});}function isDispatchDecision(_0x235f80){const _0x393f26={_0xd594c4:0x147,_0x3d0404:0x149,_0x25843b:0x106,_0x51e6e9:0x197,_0x134c9e:0x134,_0x5d5476:0x172},_0x229927={_0x5dd0c6:0x497};if(typeof _0x235f80!=='object'||_0x235f80===null)return![];function _0x4896ac(_0x5d9575,_0x269c51,_0x589572,_0x3c4303){return _0x106530(_0x269c51,_0x269c51-0xca,_0x589572-0x188,_0x3c4303- -_0x229927._0x5dd0c6);}function _0x37521b(_0x32e908,_0x2e2fd3,_0x3995ee,_0x435780){return _0x2b8011(_0x32e908-0xc2,_0x435780,_0x3995ee-0x79,_0x2e2fd3-0x83);}return _0x235f80['action']===_0x37521b(0x12e,_0x393f26._0xd594c4,0x106,0x178)||_0x235f80[_0x37521b(0x118,_0x393f26._0x3d0404,_0x393f26._0x25843b,_0x393f26._0x51e6e9)]===_0x37521b(0x186,_0x393f26._0x134c9e,_0x393f26._0x5d5476,0x163);}function normalizeExecutionError(_0x5961b6){const _0xbd51a6={_0x485dc8:0x313,_0xd91367:0x2d7,_0xecec45:0x2af,_0x2ff1b7:0x29f,_0x24b5e5:0x2a5,_0xb07da4:0x298},_0x32ca96={_0x1db2b5:0x31,_0x3b0bd1:0x1a9},_0xad7738={_0x94ff63:0xc5};function _0x1571ab(_0x38d390,_0x289fd9,_0x2288a5,_0x6abff0){return _0x2b8011(_0x38d390-0xf5,_0x2288a5,_0x2288a5-_0xad7738._0x94ff63,_0x6abff0-0x163);}if(_0x5961b6 instanceof ToolExecutionError)return{'errorMessage':_0x5961b6[_0xfbefc(_0xbd51a6._0x485dc8,0x322,_0xbd51a6._0xd91367,_0xbd51a6._0xecec45)],'structured':{'error':_0x5961b6['message'],..._0x5961b6[_0xfbefc(0x275,_0xbd51a6._0x2ff1b7,_0xbd51a6._0x24b5e5,0x2ea)]}};if(_0x5961b6 instanceof Error)return{'errorMessage':_0x5961b6[_0x1571ab(0x270,_0xbd51a6._0xb07da4,0x210,0x245)],'structured':{'error':_0x5961b6['message']}};function _0xfbefc(_0x427bd5,_0x45e30b,_0x19cc3c,_0x11b149){return _0x2b8011(_0x427bd5-_0x32ca96._0x1db2b5,_0x45e30b,_0x19cc3c-_0x32ca96._0x3b0bd1,_0x19cc3c-0x1f5);}const _0x42685e=String(_0x5961b6);return{'errorMessage':_0x42685e,'structured':{'error':_0x42685e}};}async function emitEvent(_0x420c54,_0x6007b9,_0x582d4c){await _0x420c54?.(_0x6007b9,_0x582d4c);}async function resolveDispatchDecision(_0x13876a,_0x1f9d3a,_0x3c553d){const _0x473841={_0x486a1a:0x2f3,_0xe89741:0x2d2},_0x142e04={_0x2537a0:0x5,_0x218c40:0x7e,_0x375454:0x11,_0x4c2ce7:0x25d,_0x484dd0:0x280,_0x42b2f6:0x245,_0x2e9568:0x2a,_0x2c4910:0xa,_0x4a5f6b:0x35,_0x1a0273:0x16,_0x3110ef:0x73,_0x39a76f:0x23,_0x5b1c22:0x15,_0xf6e8b0:0x1e,_0x5b5e0c:0x12,_0x1b029f:0x28d,_0x5281b9:0x2af},_0x209900={_0x397a98:0x16f},_0x343689={_0x4f3880:0x255,_0x4e701a:0x246,_0x1c6643:0x241,_0x37ee53:0x5e,_0x436ad3:0x6,_0x3229d6:0x18,_0x37b94e:0x1fb,_0x2763b7:0x23f},_0x3fed84={_0x19d835:0x8f},_0x2ad176={_0x2859ea:0x12c};function _0x52fc8f(_0x119d3c,_0x2ae300,_0x2ead01,_0x1f0d0f){return _0x106530(_0x1f0d0f,_0x2ae300-_0x2ad176._0x2859ea,_0x2ead01-0x1d0,_0x2ae300-0x230);}if(!_0x13876a)return{'action':_0x52fc8f(0x439,0x3f1,0x43f,0x3b8)};function _0x5a1a27(_0x2854c6,_0x4079ee,_0x32e7f8,_0x490252){return _0x2b8011(_0x2854c6-0x118,_0x4079ee,_0x32e7f8-_0x3fed84._0x19d835,_0x32e7f8- -0x3c8);}const _0x491478=Promise['resolve']()['then'](()=>_0x13876a(_0x1f9d3a,_0x3c553d));if(!_0x3c553d['signal']){const _0x42ddcb=await _0x491478;return isDispatchDecision(_0x42ddcb)?_0x42ddcb:{'action':_0x5a1a27(-0x2ea,-0x2f3,-0x317,-0x35e)};}const _0x48f761=new Promise((_0x48e162,_0x2ff42d)=>{const _0x48998d={_0x1cc15d:0xf4,_0x301109:0x309,_0x1b44ba:0x101},_0x743d95={_0x17a43e:0x167},_0x4b230d=()=>{function _0x158157(_0x16d7ad,_0xeb1f19,_0x1ad859,_0x58e7b4){return _0x57c2(_0xeb1f19-0x141,_0x58e7b4);}function _0x5f26af(_0x33e86f,_0x2ff820,_0x143226,_0x20a16f){return _0x57c2(_0x20a16f- -_0x743d95._0x17a43e,_0x33e86f);}_0x3c553d[_0x158157(0x24c,_0x343689._0x4f3880,_0x343689._0x4e701a,_0x343689._0x1c6643)]?.['removeEventListener']('abort',_0x4b230d),_0x2ff42d(toAbortError(_0x3c553d[_0x5f26af(-_0x343689._0x37ee53,-_0x343689._0x436ad3,-_0x343689._0x3229d6,-0x53)]?.[_0x158157(_0x343689._0x37b94e,0x202,0x24b,_0x343689._0x2763b7)]));};function _0x598631(_0x1f1902,_0x4f4f31,_0x39be0f,_0x3d5633){return _0x5a1a27(_0x1f1902-0x148,_0x1f1902,_0x4f4f31-0x50,_0x3d5633-_0x209900._0x397a98);}function _0x536277(_0x565406,_0x14519f,_0xbd7156,_0x3e236e){return _0x5a1a27(_0x565406-_0x48998d._0x1cc15d,_0x14519f,_0x3e236e-_0x48998d._0x301109,_0x3e236e-_0x48998d._0x1b44ba);}if(_0x3c553d[_0x536277(-_0x142e04._0x2537a0,_0x142e04._0x218c40,-_0x142e04._0x375454,0x35)]?.[_0x598631(-_0x142e04._0x4c2ce7,-0x277,-_0x142e04._0x484dd0,-_0x142e04._0x42b2f6)]){_0x2ff42d(toAbortError(_0x3c553d[_0x536277(_0x142e04._0x2e9568,0x81,_0x142e04._0x2c4910,_0x142e04._0x4a5f6b)][_0x536277(-_0x142e04._0x1a0273,-_0x142e04._0x3110ef,_0x142e04._0x39a76f,-0x1e)]));return;}_0x3c553d[_0x536277(_0x142e04._0x5b1c22,_0x142e04._0xf6e8b0,_0x142e04._0x5b5e0c,0x35)]?.['addEventListener'](_0x598631(-0x261,-0x282,-_0x142e04._0x1b029f,-_0x142e04._0x5281b9),_0x4b230d,{'once':!![]});}),_0x4d274c=await Promise['race']([_0x491478,_0x48f761]);return isDispatchDecision(_0x4d274c)?_0x4d274c:{'action':_0x5a1a27(-_0x473841._0x486a1a,-0x33c,-0x317,-_0x473841._0xe89741)};}async function executeToolCall(_0x20d4be,_0x1d22d4,_0x1d1405,_0x4ee986,_0x3225cc){const _0x4240bb={_0x47fff2:0x2b8,_0x44dbb8:0x25e,_0x48149c:0xd7,_0xb7b509:0xda,_0x78e212:0x104,_0x2e305e:0xdf,_0x2d645d:0x101,_0x11dc51:0x125,_0xdaa19c:0xf0,_0x2edd73:0x67,_0x2f1a2f:0x9c,_0x5bb15c:0x82,_0x14d000:0xc5,_0xef2a59:0xe3,_0x46562e:0x10a,_0x351c60:0x287,_0x46048d:0x27c,_0x2b98f9:0x2c9,_0x49439e:0x28c,_0x3fb3f5:0x27b,_0x1f5b19:0x7b,_0x3d0535:0x289,_0x5cc083:0x23a,_0xfd9367:0x2a3,_0x594157:0x277,_0x457568:0xc5,_0x302e1c:0x7a,_0x3720fe:0x5a,_0x78ac0a:0xac,_0x3986f6:0x81,_0x12f94d:0x91,_0x305941:0x7d,_0x38c62e:0x83,_0x3a19a9:0xff,_0x53e37c:0xbf,_0x13bdba:0xc5,_0xb271f2:0x8e,_0x39f471:0xaf,_0xd04b54:0x68},_0x4e19a3={_0xef6a6a:0x1ca,_0x93263f:0x74},_0x5a3541={..._0x1d1405,'toolCallId':_0x1d22d4['id']};throwIfAborted(_0x5a3541['signal']);function _0x3b2262(_0x5e8cdd,_0x27b4b0,_0x1fa281,_0x5f4539){return _0x2b8011(_0x5e8cdd-0xcd,_0x5e8cdd,_0x1fa281-0xda,_0x27b4b0- -0x1b9);}function _0x297edc(_0x58c955,_0x4453be,_0x5894dc,_0x144943){return _0x106530(_0x4453be,_0x4453be-_0x4e19a3._0xef6a6a,_0x5894dc-_0x4e19a3._0x93263f,_0x144943-0x77);}const _0x1fff55=await resolveDispatchDecision(_0x4ee986,_0x1d22d4,_0x5a3541);throwIfAborted(_0x5a3541[_0x297edc(0x22b,_0x4240bb._0x47fff2,_0x4240bb._0x44dbb8,0x27b)]);if(_0x1fff55['action']===_0x3b2262(-0xa3,-0xf5,-_0x4240bb._0x48149c,-_0x4240bb._0xb7b509)){const _0x17f764=createRejectedToolResult(_0x1d22d4,_0x1fff55[_0x3b2262(-0x13e,-0x118,-0xe1,-0x145)]);return await emitEvent(_0x3225cc,{'type':'tool_rejected','toolCall':_0x1d22d4,'result':_0x17f764},_0x5a3541),_0x17f764;}const _0x4a63d0=_0x20d4be[_0x3b2262(-0x123,-_0x4240bb._0x78e212,-0xae,-_0x4240bb._0x2e305e)](_0x1d22d4[_0x3b2262(-0xea,-_0x4240bb._0x2d645d,-_0x4240bb._0x11dc51,-_0x4240bb._0xdaa19c)]);if(!_0x4a63d0){const _0x2193c2=createUnknownToolResult(_0x1d22d4);return await emitEvent(_0x3225cc,{'type':_0x3b2262(-_0x4240bb._0x2edd73,-_0x4240bb._0x2f1a2f,-0xc5,-0xcb),'toolCall':_0x1d22d4,'result':_0x2193c2},_0x5a3541),_0x2193c2;}throwIfAborted(_0x5a3541[_0x3b2262(-_0x4240bb._0x5bb15c,-_0x4240bb._0x14d000,-_0x4240bb._0xef2a59,-_0x4240bb._0x46562e)]),await emitEvent(_0x3225cc,{'type':_0x297edc(0x2d6,_0x4240bb._0x351c60,_0x4240bb._0x46048d,_0x4240bb._0x2b98f9),'toolCall':_0x1d22d4},_0x5a3541);try{throwIfAborted(_0x5a3541[_0x297edc(0x2c9,_0x4240bb._0x49439e,0x29b,_0x4240bb._0x3fb3f5)]);const _0xf923d3=validateToolInput(_0x1d22d4[_0x3b2262(-0x115,-0xe7,-0xca,-0xd5)],_0x4a63d0['inputSchema']),_0x528284=await _0x4a63d0[_0x3b2262(-0x99,-0x9a,-0x81,-_0x4240bb._0x1f5b19)](_0xf923d3,_0x5a3541),_0x592ad3=[],_0x2da097=addAbortListener(_0x5a3541['signal'],()=>{void _0x528284['return'](void 0x0)['catch'](()=>{});});try{throwIfAborted(_0x5a3541[_0x297edc(0x25f,0x255,_0x4240bb._0x3d0535,0x27b)]);let _0x5e8af0=await _0x528284[_0x297edc(_0x4240bb._0x5cc083,0x285,_0x4240bb._0xfd9367,_0x4240bb._0x594157)]();while(!_0x5e8af0['done']){throwIfAborted(_0x5a3541[_0x3b2262(-0xba,-_0x4240bb._0x457568,-_0x4240bb._0x302e1c,-0xe6)]);const _0x345c49=normalizeToolOutputValue(_0x5e8af0[_0x3b2262(-_0x4240bb._0x3720fe,-_0x4240bb._0x78ac0a,-_0x4240bb._0x3986f6,-0x56)]);_0x592ad3[_0x3b2262(-_0x4240bb._0x12f94d,-0x84,-_0x4240bb._0x305941,-_0x4240bb._0x38c62e)](_0x345c49),await emitEvent(_0x3225cc,{'type':_0x3b2262(-0x129,-_0x4240bb._0x3a19a9,-0xfb,-0x147),'toolCall':_0x1d22d4,'chunk':_0x345c49},_0x5a3541),throwIfAborted(_0x5a3541['signal']),_0x5e8af0=await _0x528284[_0x3b2262(-0xf6,-0xc9,-0x106,-0xbe)]();}throwIfAborted(_0x5a3541[_0x3b2262(-_0x4240bb._0x53e37c,-_0x4240bb._0x13bdba,-0x106,-_0x4240bb._0xb271f2)]);const _0x6f1599=_0x5e8af0['value']===void 0x0?deriveFinalToolOutput(_0x592ad3):normalizeToolOutputValue(_0x5e8af0['value']),_0x578a8b=createSuccessToolResult(_0x1d22d4,_0x6f1599,_0x592ad3);return await emitEvent(_0x3225cc,{'type':_0x3b2262(-0xdd,-0x9c,-0x86,-0x95),'toolCall':_0x1d22d4,'result':_0x578a8b},_0x5a3541),_0x578a8b;}catch(_0x8bff5f){if(isAbortError(_0x8bff5f)){const _0x25471a=createAbortedToolResult(_0x1d22d4,_0x8bff5f,_0x592ad3);return await emitEvent(_0x3225cc,{'type':'tool_completed','toolCall':_0x1d22d4,'result':_0x25471a},_0x5a3541),_0x25471a;}const {errorMessage:_0x478a11,structured:_0x24f6ad}=normalizeExecutionError(_0x8bff5f),_0x5a8385=createErrorToolResult(_0x1d22d4,_0x478a11,_0x24f6ad,_0x592ad3);return await emitEvent(_0x3225cc,{'type':_0x3b2262(-0x77,-_0x4240bb._0x2f1a2f,-0xd2,-0x9e),'toolCall':_0x1d22d4,'result':_0x5a8385},_0x5a3541),_0x5a8385;}finally{_0x2da097();}}catch(_0x567a8b){if(isAbortError(_0x567a8b)){const _0x2c4c59=createAbortedToolResult(_0x1d22d4,_0x567a8b);return await emitEvent(_0x3225cc,{'type':_0x3b2262(-_0x4240bb._0x39f471,-0x9c,-_0x4240bb._0xd04b54,-0x9b),'toolCall':_0x1d22d4,'result':_0x2c4c59},_0x5a3541),_0x2c4c59;}const {errorMessage:_0x5236ec,structured:_0x4a8498}=normalizeExecutionError(_0x567a8b),_0x48f7c1=createErrorToolResult(_0x1d22d4,_0x5236ec,_0x4a8498);return await emitEvent(_0x3225cc,{'type':'tool_completed','toolCall':_0x1d22d4,'result':_0x48f7c1},_0x5a3541),_0x48f7c1;}}function createInternalToolRuntime(_0x2a54a6=[],_0x3d0a4c={}){const _0x197e9a={_0x481dde:0x425,_0x5ab882:0x4a4,_0x2adf3b:0x46b},_0x47c495={_0x53f86c:0x270,_0x398ca9:0x229,_0x22db5b:0x1fe},_0xef9f4a={_0x2b4ef5:0x41,_0x5ce0d8:0x66,_0x3cf143:0x67};let _0x3206b2=new ToolRegistry(_0x2a54a6);return{'listToolSchemas'(){function _0x1bdc6e(_0x125772,_0x2d66a3,_0x4140d4,_0x2ca670){return _0x57c2(_0x2ca670- -0x15b,_0x4140d4);}return _0x3206b2[_0x1bdc6e(-_0xef9f4a._0x2b4ef5,-_0xef9f4a._0x5ce0d8,-0x1c,-_0xef9f4a._0x3cf143)]();},'setTools'(_0x3aefc3){_0x3206b2=new ToolRegistry(_0x3aefc3);},async 'executeCalls'(_0x3b7f8a,_0x26621f){const _0x11a09d={_0x1cec58:0x389};function _0x1f3936(_0x14632e,_0x3e260e,_0x42c0df,_0x51f63e){return _0x57c2(_0x51f63e-_0x11a09d._0x1cec58,_0x14632e);}return await Promise[_0x1f3936(0x450,_0x197e9a._0x481dde,_0x197e9a._0x5ab882,_0x197e9a._0x2adf3b)](_0x3b7f8a['map'](async _0x59fe0b=>{const _0x495418={_0x3c2242:0x9e,_0x163d35:0x709};function _0x2bae03(_0x504a6b,_0x273f9a,_0x3fc5dc,_0x1cab29){return _0x1f3936(_0x3fc5dc,_0x273f9a-0x12,_0x3fc5dc-_0x495418._0x3c2242,_0x273f9a- -_0x495418._0x163d35);}return await executeToolCall(_0x3206b2,_0x59fe0b,_0x26621f,_0x3d0a4c['onToolCall'],_0x3d0a4c[_0x2bae03(-_0x47c495._0x53f86c,-_0x47c495._0x398ca9,-0x25c,-_0x47c495._0x22db5b)]);}));},async 'execute'(_0x329983,_0xb214fa){const [_0x3767a8]=await this['executeCalls']([_0x329983],_0xb214fa);return _0x3767a8;}};}function getOrderedObserverExtensions(_0x5d6383,_0x74cd20){const _0x4faf81={_0x945825:0xab,_0x18e8ee:0xa3},_0xa70139={_0x36d8ca:0x3eb,_0x7dc5e2:0x1ef,_0x527869:0x1ab,_0x3944f3:0x44d,_0x133128:0x432,_0x24b92f:0x497},_0x3e0041={_0x2ed384:0x259,_0x2ca566:0x4d,_0x9e60a2:0x163},_0x5e77bd={_0x929be8:0x368,_0x2bb644:0x10e},_0x456d10={_0x5cb17f:0xae,_0x416e4f:0x312};function _0x4f4b75(_0x4562c6,_0x21945a,_0x5b956a,_0xd83762){return _0x2b8011(_0x4562c6-0x12b,_0x5b956a,_0x5b956a-_0x456d10._0x5cb17f,_0x21945a-_0x456d10._0x416e4f);}function _0x364390(_0x42c689,_0x575b32,_0x51298d,_0x515102){return _0x106530(_0x515102,_0x575b32-0xfb,_0x51298d-0x134,_0x42c689- -0x174);}return _0x5d6383[_0x364390(_0x4faf81._0x945825,0xc8,_0x4faf81._0x18e8ee,0xaf)](_0x2fa390=>{function _0x54278e(_0x4f7111,_0x2d95ad,_0x78943e,_0x9eeb20){return _0x364390(_0x78943e-_0x5e77bd._0x929be8,_0x2d95ad-0x118,_0x78943e-_0x5e77bd._0x2bb644,_0x4f7111);}function _0x3ed5ed(_0x37c877,_0x5f4208,_0x5943b4,_0x30af13){return _0x364390(_0x37c877- -_0x3e0041._0x2ed384,_0x5f4208-_0x3e0041._0x2ca566,_0x5943b4-_0x3e0041._0x9e60a2,_0x5f4208);}return _0x2fa390[_0x54278e(_0xa70139._0x36d8ca,0x411,0x3dc,0x3cb)]!==![]&&_0x2fa390[_0x3ed5ed(-_0xa70139._0x7dc5e2,-0x1aa,-_0xa70139._0x527869,-0x1da)]===_0x74cd20&&_0x2fa390[_0x54278e(_0xa70139._0x3944f3,_0xa70139._0x133128,0x425,0x42b)]===_0x54278e(_0xa70139._0x24b92f,0x482,_0xa70139._0x3944f3,0x482);})['sort']((_0x15bcc5,_0x11adf3)=>_0x15bcc5[_0x364390(0xcd,0xcf,0x11d,0xd7)]-_0x11adf3[_0x4f4b75(0x3f1,0x443,0x490,0x423)]);}function getOrderedTransformerExtensions(_0x253acd,_0x3481cf){const _0x42a6bc={_0x5221a1:0x89,_0x395aae:0xb1,_0x244854:0x66},_0x326278={_0x1c1658:0x18e,_0x4c7cd4:0x12e,_0xa775bb:0x11d,_0x584f6a:0x170,_0x1e9096:0x177,_0x4e8939:0x1c2,_0x2f9d6f:0x1f5},_0x2a8d07={_0x4fa7a0:0xc7,_0x158d61:0x84},_0x24dea2={_0x2a531a:0x57};function _0x3cf3aa(_0x29ed17,_0xbafef7,_0x559bf6,_0x4eb6db){return _0x106530(_0x559bf6,_0xbafef7-_0x24dea2._0x2a531a,_0x559bf6-0x15,_0x4eb6db- -0x1b9);}function _0x55a154(_0x32f31e,_0x469770,_0x8cc9f2,_0x20c22c){return _0x106530(_0x20c22c,_0x469770-0x12a,_0x8cc9f2-_0x2a8d07._0x4fa7a0,_0x32f31e- -_0x2a8d07._0x158d61);}return _0x253acd[_0x3cf3aa(0x12,_0x42a6bc._0x5221a1,_0x42a6bc._0x395aae,_0x42a6bc._0x244854)](_0x4afafc=>{const _0x1c4927={_0x590253:0x14c};function _0x2f92f5(_0x3c521b,_0x302d6f,_0x3b32c4,_0x3fbcd1){return _0x3cf3aa(_0x3c521b-0x13c,_0x302d6f-0x7b,_0x3b32c4,_0x3fbcd1-0x122);}function _0x2730c2(_0x45f28e,_0x3c99c4,_0x3c4ed3,_0x5242fe){return _0x3cf3aa(_0x45f28e-0x16e,_0x3c99c4-_0x1c4927._0x590253,_0x5242fe,_0x3c99c4-0x11b);}return _0x4afafc[_0x2730c2(0x10e,0x14a,_0x326278._0x1c1658,0x160)]!==![]&&_0x4afafc[_0x2730c2(_0x326278._0x4c7cd4,0x140,_0x326278._0xa775bb,_0x326278._0x584f6a)]===_0x3481cf&&_0x4afafc[_0x2f92f5(_0x326278._0x1e9096,_0x326278._0x4e8939,0x1c9,0x19a)]===_0x2f92f5(0x1bb,0x16e,_0x326278._0x2f9d6f,0x1a1);})['sort']((_0x481b74,_0x1e9b9d)=>_0x481b74[_0x3cf3aa(0x3c,0x61,0x90,0x88)]-_0x1e9b9d[_0x55a154(0x1bd,0x20b,0x18f,0x1f8)]);}function createExtensionRegistry(){const _0x5899d3={_0x119759:0x3a5,_0x26a2ba:0x3bf},_0x5c8e29={_0x41ddd7:0x2d4},_0x2c348e={_0x56bcc8:0x3b1,_0x3b3ba4:0x3e2},_0x144c3a=[];return{'register'(_0x3c28c8){_0x144c3a['push'](_0x3c28c8);},async 'runTransformers'(_0x45b681,_0xb7c5a2,_0x1f5b6b){const _0x167887={_0x4143b9:0x2e0};let _0x2762d8=_0xb7c5a2;function _0x18eab2(_0x23f305,_0x5a4ef7,_0x3e31fa,_0x5c4b86){return _0x57c2(_0x5a4ef7-_0x167887._0x4143b9,_0x3e31fa);}for(const _0x3d8c67 of getOrderedTransformerExtensions(_0x144c3a,_0x45b681)){_0x2762d8=await _0x3d8c67[_0x18eab2(0x3f8,_0x2c348e._0x56bcc8,0x3f3,_0x2c348e._0x3b3ba4)](_0x2762d8,_0x1f5b6b);}return _0x2762d8;},async 'runObservers'(_0x3cb82d,_0x48b6ff,_0x35e2c0){function _0x5e17bd(_0x135f47,_0x1abf6b,_0x48f02e,_0x3d618f){return _0x57c2(_0x1abf6b-_0x5c8e29._0x41ddd7,_0x135f47);}for(const _0xff1ca3 of getOrderedObserverExtensions(_0x144c3a,_0x3cb82d)){await _0xff1ca3[_0x5e17bd(0x3f2,_0x5899d3._0x119759,_0x5899d3._0x26a2ba,0x37c)](_0x48b6ff,_0x35e2c0);}}};}function createEmptySnapshot(){return{'totalTokens':0x0,'totalInputTokens':0x0,'totalOutputTokens':0x0,'totalReasoningTokens':0x0,'requestCount':0x0,'modelCallCount':0x0,'toolCallCount':0x0,'totalModelTimeMs':0x0,'currentTokens':0x0,'currentInputTokens':0x0,'currentOutputTokens':0x0,'currentReasoningTokens':0x0,'currentModelTimeMs':0x0};}function createAgentMetrics(_0x536cef={}){const _0x3e367f={_0x1e787d:0x4f7,_0x209161:0x4a0,_0x2a75c8:0x505,_0xab2faf:0x4c0,_0x44c2db:0x257,_0x3ca67d:0x206,_0x4afb70:0x226,_0x123763:0x273,_0x21613c:0x1f2,_0x43b657:0x21e,_0x1307d6:0x264,_0xe49377:0x1ce,_0x57a617:0x256,_0x6a878b:0x23b,_0x3aea4f:0x28c,_0x1d1ca2:0x51c,_0x9ed5ad:0x523,_0x1c7a71:0x513,_0x1a8da5:0x55a,_0x591797:0x232,_0x5b2ecd:0x23f,_0x14a930:0x22f,_0x1bfd7e:0x4e3,_0x11fb79:0x1e9,_0x5b0376:0x194,_0x3c05b5:0x1fb,_0x2cddf3:0x24e,_0x584ba4:0x197,_0x34a054:0x4fc,_0x1e16b1:0x4bf,_0x5a9573:0x49a,_0x5c6fc4:0x587,_0x5f0f10:0x567,_0x45acfb:0x539,_0x59908d:0x4f8,_0x5d5f6:0x4e9,_0x102df8:0x222,_0x356281:0x212,_0x76f7f9:0x261,_0x4d2220:0x4bc,_0x22938c:0x24f,_0x346b72:0x1fd,_0x5628d7:0x253,_0x5e9fe8:0x24a},_0x18dc52={_0x562a6d:0xff};let _0xad6c3e=createEmptySnapshot();const _0x44071c=new Set();let _0x268772;const _0x466b30=()=>{const _0x5eecd0={..._0xad6c3e};for(const _0x395f28 of _0x44071c)_0x395f28(_0x5eecd0);};return{'getSnapshot'(){return{..._0xad6c3e};},'recordEvent'(_0x4088ad){const _0x4cb7af={_0xfd45ec:0x3d6};if(_0x4088ad['type']==='model_request'){_0x268772=Date[_0x2f9698(_0x3e367f._0x1e787d,_0x3e367f._0x209161,_0x3e367f._0x2a75c8,_0x3e367f._0xab2faf)]();const _0x2afec1=_0x536cef[_0x101515(_0x3e367f._0x44c2db,0x258,0x29e,_0x3e367f._0x3ca67d)]?.(_0x4088ad[_0x101515(0x266,_0x3e367f._0x4afb70,0x200,_0x3e367f._0x123763)]);_0x2afec1!==void 0x0&&(_0xad6c3e={..._0xad6c3e,'contextWindowLimit':_0x2afec1},_0x466b30());return;}if(_0x4088ad['type']===_0x101515(_0x3e367f._0x21613c,_0x3e367f._0x43b657,_0x3e367f._0x1307d6,_0x3e367f._0xe49377)){const _0x53b924=_0x4088ad[_0x101515(0x21d,0x23f,_0x3e367f._0x57a617,0x23e)][_0x101515(0x21e,_0x3e367f._0x6a878b,0x28f,_0x3e367f._0x3aea4f)][_0x2f9698(_0x3e367f._0x1d1ca2,0x4ce,0x511,0x4d3)],_0x379a17=_0x4088ad[_0x2f9698(_0x3e367f._0x9ed5ad,0x509,0x52d,0x516)]['usage']['outputTokens'],_0x8c1899=_0x4088ad[_0x2f9698(0x54e,_0x3e367f._0x1c7a71,_0x3e367f._0x1a8da5,0x516)][_0x101515(_0x3e367f._0x591797,_0x3e367f._0x6a878b,_0x3e367f._0x5b2ecd,_0x3e367f._0x14a930)][_0x2f9698(_0x3e367f._0x1bfd7e,0x538,0x51a,0x4ed)]??0x0,_0x436cd6=_0x53b924+_0x379a17,_0xae659d=_0x268772===void 0x0?0x0:Date[_0x101515(0x1ce,_0x3e367f._0x11fb79,0x1c2,_0x3e367f._0x5b0376)]()-_0x268772;_0x268772=void 0x0,_0xad6c3e={..._0xad6c3e,'totalTokens':_0xad6c3e[_0x101515(0x24f,_0x3e367f._0x3c05b5,0x22d,_0x3e367f._0x2cddf3)]+_0x436cd6,'totalInputTokens':_0xad6c3e[_0x101515(0x16c,0x1c1,0x19b,_0x3e367f._0x584ba4)]+_0x53b924,'totalOutputTokens':_0xad6c3e[_0x2f9698(0x4ed,_0x3e367f._0x34a054,0x501,0x50d)]+_0x379a17,'totalReasoningTokens':_0xad6c3e[_0x2f9698(_0x3e367f._0x1e16b1,0x4a1,_0x3e367f._0x5a9573,0x4e7)]+_0x8c1899,'modelCallCount':_0xad6c3e[_0x2f9698(_0x3e367f._0x5c6fc4,0x510,_0x3e367f._0x5f0f10,_0x3e367f._0x45acfb)]+0x1,'totalModelTimeMs':_0xad6c3e['totalModelTimeMs']+_0xae659d,'currentTokens':_0x436cd6,'currentInputTokens':_0x53b924,'currentOutputTokens':_0x379a17,'currentReasoningTokens':_0x8c1899,'currentModelTimeMs':_0xae659d,..._0xad6c3e[_0x2f9698(0x527,0x4ba,_0x3e367f._0x59908d,_0x3e367f._0x5d5f6)]&&_0x436cd6>0x0?{'contextWindowUsage':_0x436cd6/_0xad6c3e[_0x101515(_0x3e367f._0x102df8,_0x3e367f._0x356281,_0x3e367f._0x76f7f9,0x1ee)]}:{}},_0x466b30();return;}function _0x101515(_0x18cd78,_0x446dd0,_0x1d395e,_0x2b1220){return _0x57c2(_0x446dd0-_0x18dc52._0x562a6d,_0x1d395e);}function _0x2f9698(_0xf4978e,_0xc019ec,_0x5d8747,_0x36178e){return _0x57c2(_0x36178e-_0x4cb7af._0xfd45ec,_0xc019ec);}if(_0x4088ad['type']===_0x2f9698(_0x3e367f._0x4d2220,0x527,0x4d8,0x4fc)){_0xad6c3e={..._0xad6c3e,'toolCallCount':_0xad6c3e[_0x101515(0x20d,_0x3e367f._0x22938c,_0x3e367f._0x346b72,0x206)]+0x1},_0x466b30();return;}_0x4088ad['type']===_0x101515(_0x3e367f._0x5628d7,0x238,_0x3e367f._0x5e9fe8,0x222)&&(_0xad6c3e={..._0xad6c3e,'requestCount':_0xad6c3e['requestCount']+0x1},_0x466b30());},'reset'(){_0xad6c3e=createEmptySnapshot(),_0x268772=void 0x0,_0x466b30();},'subscribe'(_0x3b2901){const _0x590c9e={_0x549d40:0x44c,_0x32d8a4:0x400};return _0x44071c['add'](_0x3b2901),()=>{function _0x265aa9(_0x4b95ca,_0x691cb8,_0x16fc0c,_0x1ce5d8){return _0x57c2(_0x1ce5d8-0x319,_0x691cb8);}_0x44071c[_0x265aa9(_0x590c9e._0x549d40,0x47c,_0x590c9e._0x32d8a4,0x444)](_0x3b2901);};}};}function makeExtensionContext(_0x34e72f){return{'state':_0x34e72f};}async function runStage(_0x6ad32f,_0x4bc6da,_0x2701b1,_0x10229f){const _0x94d8a8={_0xafa621:0x4db,_0x3eefe0:0x493,_0x19c0e3:0x4e5},_0x1a58c1={_0x4fa82e:0x18b,_0x5e18d6:0x111,_0x595252:0xd0},_0x32d347=await _0x6ad32f[_0x4b4186(_0x94d8a8._0xafa621,0x4ed,_0x94d8a8._0x3eefe0,_0x94d8a8._0x19c0e3)](_0x4bc6da,_0x2701b1,_0x10229f);await _0x6ad32f[_0x4b4186(0x4c3,0x4e3,0x47d,0x48f)](_0x4bc6da,_0x32d347,_0x10229f);function _0x4b4186(_0x5a6d9d,_0xb20a5c,_0x52a1b8,_0x29b6bd){return _0x106530(_0x52a1b8,_0xb20a5c-0x167,_0x52a1b8-0x73,_0x5a6d9d-0x284);}function _0x5449b5(_0xf8d85b,_0x497cf9,_0x518422,_0x493bc9){return _0x106530(_0x493bc9,_0x497cf9-_0x1a58c1._0x4fa82e,_0x518422-_0x1a58c1._0x5e18d6,_0x497cf9- -_0x1a58c1._0x595252);}return _0x32d347;}async function emitEvent2(_0x2ab6b0,_0x5e69b5,_0x1614e4){await _0x2ab6b0?.(_0x5e69b5,_0x1614e4);}function replaceToolUseBlocks(_0x5b508e,_0x15b815){const _0x250dbd={_0x4b9371:0xde,_0x316f37:0x14c,_0x4ad1ff:0x4bb,_0x44d7f5:0x493},_0x1ccc9d={_0x5d0fb0:0x282,_0x3d5330:0x277,_0x1e9a8d:0x259,_0x5250e2:0x295},_0xb8e30f={_0x46b575:0x1cf,_0x4c9aa3:0x39},_0x1ce528={_0xc9caf4:0x757,_0x3ca9b4:0x19c},_0x53c468={_0x321689:0x1ce},_0x57dd59={_0x32351d:0x1b,_0xf00217:0x1b1};function _0x11ddf8(_0x49c3fb,_0x11489a,_0x26bac4,_0x36a5d6){return _0x2b8011(_0x49c3fb-_0x57dd59._0x32351d,_0x11489a,_0x26bac4-0xf5,_0x26bac4- -_0x57dd59._0xf00217);}let _0x20e1ae=0x0;function _0x17f178(_0x10ba15,_0x383c81,_0x2676b6,_0x55670e){return _0x2b8011(_0x10ba15-_0x53c468._0x321689,_0x55670e,_0x2676b6-0x141,_0x383c81-0x3c2);}return{..._0x5b508e,'content':_0x5b508e[_0x11ddf8(-_0x250dbd._0x4b9371,-_0x250dbd._0x316f37,-0x113,-0xec)][_0x17f178(0x49b,_0x250dbd._0x4ad1ff,0x499,_0x250dbd._0x44d7f5)](_0x371fca=>{if(_0x371fca[_0x41c451(-_0x1ccc9d._0x5d0fb0,-0x292,-_0x1ccc9d._0x3d5330,-0x23d)]!==_0x41c451(-0x246,-_0x1ccc9d._0x1e9a8d,-0x262,-_0x1ccc9d._0x5250e2))return _0x371fca;function _0x41c451(_0x466224,_0x1b1e97,_0x3b3d97,_0x108f42){return _0x17f178(_0x466224-0x5d,_0x3b3d97- -_0x1ce528._0xc9caf4,_0x3b3d97-_0x1ce528._0x3ca9b4,_0x466224);}const _0xc7b480=_0x15b815[_0x20e1ae];_0x20e1ae+=0x1;function _0x1f284d(_0x1c6872,_0x2903bb,_0x137ce4,_0x1393a5){return _0x11ddf8(_0x1c6872-_0xb8e30f._0x46b575,_0x1393a5,_0x137ce4-0x4d7,_0x1393a5-_0xb8e30f._0x4c9aa3);}return structuredClone(_0xc7b480);})};}function createAssistantMessageId(_0x516350,_0x1a35ba){const _0xd188b0={_0x134922:0x15a},_0x312155={_0x1baea4:0xc,_0x2ac402:0xc4};function _0x120bc6(_0x49040a,_0x851e90,_0x4808b3,_0x37c4ca){return _0x106530(_0x49040a,_0x851e90-0x151,_0x4808b3-_0x312155._0x1baea4,_0x4808b3- -_0x312155._0x2ac402);}return _0x516350+_0x120bc6(0xd3,_0xd188b0._0x134922,0x119,0x167)+_0x1a35ba;}function createReasoningMessageId(_0x31b53c){return _0x31b53c+':reasoning';}function _0x2b8011(_0x29f27e,_0xbe2057,_0x2ffedf,_0x91d15){return _0x57c2(_0x91d15- -0x20,_0xbe2057);}function withMessageId(_0x658d9b,_0x524ece){if(_0x658d9b['id']===_0x524ece)return _0x658d9b;return{..._0x658d9b,'id':_0x524ece};}function createAssistantChunkEvent(_0x92fa1,_0x1f3695){const _0x126329={_0x1897c4:0xe7,_0x15450b:0x10d,_0x143679:0x99,_0x1d9f14:0x9f,_0xff5414:0xdc,_0x21806d:0xbd,_0x57e05a:0xab,_0x8f291:0xb2,_0x5b54bd:0x93,_0x17260a:0x92,_0x4ca445:0xb7,_0x42993a:0xeb,_0x58fcb5:0xe0},_0x23b657={_0x568980:0x155,_0xf7df1d:0x34},_0x32a057={_0x28cf08:0x95,_0x400301:0x2f5};if(_0x92fa1['type']!==_0x3237c9(-_0x126329._0x1897c4,-0xa1,-_0x126329._0x15450b,-_0x126329._0x143679))return void 0x0;function _0x3237c9(_0x180498,_0x695b28,_0x3c7975,_0x54bf72){return _0x106530(_0x3c7975,_0x695b28-0x15,_0x3c7975-_0x32a057._0x28cf08,_0x180498- -_0x32a057._0x400301);}if(_0x92fa1[_0x3237c9(-_0x126329._0x1d9f14,-0x7a,-0xe8,-_0x126329._0xff5414)]===void 0x0)return void 0x0;function _0x5a42fd(_0x4846be,_0x3380c5,_0xcdabda,_0x4b610d){return _0x106530(_0x4b610d,_0x3380c5-_0x23b657._0x568980,_0xcdabda-_0x23b657._0xf7df1d,_0x4846be- -0x30d);}return{'type':'assistant_chunk','index':_0x92fa1[_0x5a42fd(-_0x126329._0x21806d,-_0x126329._0x57e05a,-0xad,-_0x126329._0x8f291)]??0x0,'messageId':_0x1f3695,'chunk':{'type':'content_delta','index':_0x92fa1[_0x5a42fd(-0xbd,-_0x126329._0x5b54bd,-_0x126329._0x17260a,-_0x126329._0x4ca445)]??0x0,'text':_0x92fa1[_0x5a42fd(-_0x126329._0x4ca445,-0x62,-_0x126329._0x42993a,-_0x126329._0x58fcb5)]}};}function createToolUseChunkEvent(_0xb20f9c,_0x4f839c){const _0x398028={_0x443d0d:0xeb,_0x48043b:0x86,_0x40a795:0x185,_0x4658bc:0x1b0,_0x32c3ad:0x86,_0x29f10b:0xb0,_0x373d56:0xa4,_0x265669:0x1b7,_0x7ba013:0x17d,_0x31792d:0x178,_0x12dc13:0x170,_0x4beec0:0xdc,_0x20f27f:0x160,_0x1d4905:0x1a4,_0x139a11:0x17e,_0x3b8e0a:0x13e,_0x10015e:0x12e},_0x25bd28={_0xc978fa:0x1b2,_0x150e4b:0x14,_0x383b30:0x235},_0x3e1b3f={_0x27e34d:0xe8,_0x4762b7:0x1c6};function _0x400694(_0x490a77,_0x311771,_0x58e60f,_0x115b0a){return _0x2b8011(_0x490a77-0xcc,_0x311771,_0x58e60f-_0x3e1b3f._0x27e34d,_0x490a77- -_0x3e1b3f._0x4762b7);}function _0x5e1bea(_0x27f486,_0x46563c,_0xba1165,_0x33b6b6){return _0x2b8011(_0x27f486-_0x25bd28._0xc978fa,_0x33b6b6,_0xba1165-_0x25bd28._0x150e4b,_0x46563c- -_0x25bd28._0x383b30);}if(_0xb20f9c['type']!=='tool_use_delta')return void 0x0;return{'type':_0x5e1bea(-0x115,-0x10a,-_0x398028._0x443d0d,-0x13d),'index':_0xb20f9c[_0x400694(-_0x398028._0x48043b,-0xa2,-0x8e,-0x55)]??0x0,'messageId':_0x4f839c,'chunk':{'type':_0x5e1bea(-0x1bb,-0x172,-_0x398028._0x40a795,-_0x398028._0x4658bc),'id':_0xb20f9c['id']??'','index':_0xb20f9c[_0x400694(-_0x398028._0x32c3ad,-_0x398028._0x29f10b,-0x44,-_0x398028._0x373d56)]??0x0,..._0xb20f9c[_0x5e1bea(-_0x398028._0x265669,-_0x398028._0x7ba013,-_0x398028._0x31792d,-_0x398028._0x12dc13)]!==void 0x0?{'name':_0xb20f9c[_0x400694(-0x10e,-0x14a,-0x120,-_0x398028._0x4beec0)]}:{},..._0xb20f9c[_0x5e1bea(-_0x398028._0x20f27f,-0x17e,-0x1d1,-0x153)]!==void 0x0?{'inputDelta':_0xb20f9c[_0x5e1bea(-_0x398028._0x1d4905,-_0x398028._0x139a11,-_0x398028._0x3b8e0a,-_0x398028._0x10015e)]}:{}}};}function createReasoningChunkEvent(_0x5c9ed3,_0x379ca5){const _0x4c5661={_0x58a823:0x1a8,_0xb948cc:0x13e,_0x21c25b:0x136,_0x262a0e:0x188,_0x3dbb7b:0x153,_0x13bd24:0xb0,_0x7f2fa2:0x106,_0x4f8f9b:0x208,_0x15fa18:0x249,_0x54d9e7:0xe9,_0x18a790:0xbc,_0x29c16e:0xbc,_0x2de489:0x1de,_0x56753b:0x226,_0xb242d3:0x22f,_0x280c17:0x73,_0x56290b:0xb9,_0x4d1794:0x79,_0x3b158c:0x10c,_0x1b729e:0x1d4,_0x468dda:0x62,_0x403828:0x91,_0x54e94e:0x89,_0x3c4eb3:0x1cc,_0x2ea07e:0x208,_0x2d890a:0x211,_0x464a01:0x1ec,_0x535c05:0x222,_0x377df1:0x217,_0x335c78:0x271,_0x4c7e82:0x21c},_0x389ed6={_0x4e21cd:0x180,_0x33a988:0x2c8};function _0x168421(_0x5b7d50,_0x335670,_0x1f10d5,_0x1ee386){return _0x2b8011(_0x5b7d50-_0x389ed6._0x4e21cd,_0x1ee386,_0x1f10d5-0x1d8,_0x5b7d50- -_0x389ed6._0x33a988);}function _0x5eef04(_0x4bf861,_0xa58583,_0x1408fc,_0x5dd68a){return _0x2b8011(_0x4bf861-0x10a,_0x4bf861,_0x1408fc-0x16f,_0x5dd68a- -0x30);}switch(_0x5c9ed3[_0x168421(-0x1aa,-0x19c,-0x1df,-0x159)]){case _0x168421(-0x1b0,-0x1bd,-0x1b2,-_0x4c5661._0x58a823):return{'type':_0x168421(-0x18c,-0x172,-0x148,-_0x4c5661._0xb948cc),'index':_0x5c9ed3[_0x5eef04(_0x4c5661._0x21c25b,0xd9,0xf5,0x110)],'messageId':_0x379ca5,'chunk':{'type':_0x5eef04(0xb4,0x11d,0xb0,0xe8),'index':_0x5c9ed3[_0x168421(-_0x4c5661._0x262a0e,-0x13b,-_0x4c5661._0x3dbb7b,-0x1dc)]??0x0,'thinking':_0x5c9ed3['thinking']??''},'text':_0x5c9ed3['thinking']??''};case'openai_reasoning_delta':return{'type':_0x168421(-0x18c,-0x15b,-0x1e1,-0x1ac),'index':_0x5c9ed3['contentIndex'],'messageId':_0x379ca5,'chunk':{'type':_0x5eef04(0x15b,0x14d,_0x4c5661._0x13bd24,_0x4c5661._0x7f2fa2),'contentIndex':_0x5c9ed3[_0x168421(-_0x4c5661._0x4f8f9b,-_0x4c5661._0x15fa18,-0x1e0,-0x21e)]??0x0,'delta':_0x5c9ed3['delta']??'','itemId':_0x5c9ed3[_0x5eef04(_0x4c5661._0x54d9e7,_0x4c5661._0x18a790,_0x4c5661._0x29c16e,0xd5)]??'','outputIndex':_0x5c9ed3[_0x168421(-_0x4c5661._0x2de489,-_0x4c5661._0x56753b,-0x232,-_0x4c5661._0xb242d3)]??0x0},'text':_0x5c9ed3['delta']??''};case _0x5eef04(_0x4c5661._0x280c17,_0x4c5661._0x56290b,0x74,_0x4c5661._0x4d1794):return{'type':_0x5eef04(0x152,0xb9,0x110,_0x4c5661._0x3b158c),'index':_0x5c9ed3[_0x168421(-0x222,-0x22f,-0x1fb,-_0x4c5661._0x1b729e)],'messageId':_0x379ca5,'chunk':{'type':'openai_reasoning_summary_delta','delta':_0x5c9ed3[_0x5eef04(_0x4c5661._0x468dda,_0x4c5661._0x403828,0xbb,_0x4c5661._0x54e94e)]??'','itemId':_0x5c9ed3[_0x168421(-0x1c3,-_0x4c5661._0x3c4eb3,-_0x4c5661._0x2ea07e,-_0x4c5661._0x2d890a)]??'','outputIndex':_0x5c9ed3[_0x168421(-_0x4c5661._0x2de489,-0x1e2,-0x1c5,-_0x4c5661._0x464a01)]??0x0,'summaryIndex':_0x5c9ed3[_0x168421(-_0x4c5661._0x535c05,-_0x4c5661._0x377df1,-_0x4c5661._0x335c78,-_0x4c5661._0x4c7e82)]??0x0},'text':_0x5c9ed3['delta']??''};default:return void 0x0;}}function isAbortedToolResult(_0x5610f3){const _0x521de1={_0x1f9acf:0x446,_0x38e470:0x43b,_0xa8b2ac:0x1d9,_0x1aea94:0x1a1,_0x4a3eaa:0x1ee,_0x55fe01:0x45b,_0x175f10:0x3fc},_0x12c1f8={_0x425927:0x3ab},_0x4f9801={_0xd4e066:0x1b,_0x532cca:0x192};function _0x57be79(_0x16a353,_0x3773a1,_0x4cafdc,_0x58ea6b){return _0x106530(_0x4cafdc,_0x3773a1-_0x4f9801._0xd4e066,_0x4cafdc-_0x4f9801._0x532cca,_0x16a353-0x26a);}function _0x5d5750(_0x1f3d3e,_0x1898da,_0x38caab,_0x55a5c8){return _0x106530(_0x38caab,_0x1898da-0x168,_0x38caab-0x102,_0x1898da- -_0x12c1f8._0x425927);}return _0x5610f3[_0x57be79(0x461,_0x521de1._0x1f9acf,0x45c,_0x521de1._0x38e470)]===_0x5d5750(-_0x521de1._0xa8b2ac,-_0x521de1._0x1aea94,-_0x521de1._0x4a3eaa,-0x185)&&_0x5610f3[_0x57be79(0x42a,_0x521de1._0x55fe01,_0x521de1._0x175f10,0x44b)]['aborted']===!![];}async function executeModelRequest(_0x248734,_0x433763,_0x1b7d38,_0xe6127f,_0xce2f0f){const _0x1aafb1={_0x384623:0x3bb,_0x574695:0x39a,_0x269bc6:0x3f4,_0x485882:0x3bf,_0x1cab6e:0x3a1,_0x1a5001:0x371,_0x1384f0:0x3b0,_0x27f04a:0x3e1,_0x4e9064:0x3c3,_0x4ba981:0x36d,_0x467de9:0x3ee,_0x2447bb:0x3b6,_0x405218:0x3fb,_0x4a317c:0x3d6,_0x35b76d:0x38c,_0x578399:0x3de,_0x25b4ce:0x3e3,_0x4fb609:0x37a,_0x422d94:0x3a6,_0x654214:0x38d,_0x391371:0x3d3,_0x529ae9:0x34f,_0xd0358a:0x41c,_0x2e1a60:0x37c,_0x59d373:0x420,_0x17a59b:0x424,_0x22cc8b:0x3e5,_0x4cb759:0x3b1,_0x198904:0x43e,_0x44053f:0x3fe,_0xefe5ff:0x34b,_0x5b9cae:0x3d8,_0x48a1fb:0x397,_0x48bda4:0x403,_0x1c9064:0x3c6,_0x28ac78:0x443,_0x19eb08:0x442,_0x41ae3e:0x382,_0x3545cb:0x41b,_0x4deeb3:0x3d2,_0x18791e:0x3bc,_0x2c5f5b:0x3f4,_0x42dbc9:0x38a,_0x5a15a4:0x437,_0x3941e5:0x42d,_0x1736da:0x3c9,_0x4ebe3a:0x378,_0xb611d6:0x3db,_0x4fef1a:0x3bd,_0x3eecb6:0x35b,_0xc441ad:0x3a6,_0x1d8e06:0x3e7,_0x5778d2:0x3a6,_0x1cbfe6:0x3bd,_0x2f0d20:0x391,_0x38c6d6:0x39d,_0x178148:0x3d6,_0x87fa66:0x435,_0x2a7268:0x3b9,_0x330729:0x390,_0x459d2b:0x33c,_0x2e0891:0x36a,_0x5b50fd:0x3b0},_0x520f84={_0xd4a705:0xdc,_0x12eb46:0x77,_0x48285a:0x2c7};function _0x28e4b9(_0x52517a,_0x1f1a85,_0x35b342,_0x133701){return _0x2b8011(_0x52517a-_0x520f84._0xd4a705,_0x1f1a85,_0x35b342-_0x520f84._0x12eb46,_0x35b342-_0x520f84._0x48285a);}throwIfAborted(_0x433763[_0x28e4b9(0x386,0x36e,_0x1aafb1._0x384623,0x408)]);if(!_0x433763['streaming']||!_0x1b7d38['chatModel'][_0x28e4b9(_0x1aafb1._0x574695,_0x1aafb1._0x269bc6,0x3ad,_0x1aafb1._0x485882)])return await _0x1b7d38[_0x28e4b9(_0x1aafb1._0x1cab6e,0x3e2,0x3c3,_0x1aafb1._0x1a5001)]['complete'](_0x248734,{'signal':_0x433763['signal']});let _0x5e1244;for await(const _0x112d7d of _0x1b7d38[_0x28e4b9(_0x1aafb1._0x1384f0,_0x1aafb1._0x27f04a,_0x1aafb1._0x4e9064,_0x1aafb1._0x4ba981)][_0x28e4b9(0x390,_0x1aafb1._0x467de9,0x3ad,_0x1aafb1._0x2447bb)](_0x248734,{'signal':_0x433763[_0x43641f(_0x1aafb1._0x1384f0,0x3d4,0x3f1,_0x1aafb1._0x405218)]})){throwIfAborted(_0x433763[_0x28e4b9(_0x1aafb1._0x4a317c,0x3e0,0x3bb,0x3e4)]);if(_0x112d7d['type']===_0x28e4b9(_0x1aafb1._0x35b76d,_0x1aafb1._0x578399,0x3bf,0x3a7)){_0xce2f0f[_0x28e4b9(_0x1aafb1._0x25b4ce,0x379,0x396,0x3eb)]['reasoningStartedAt']!==void 0x0&&_0xce2f0f['meta'][_0x43641f(_0x1aafb1._0x4fb609,0x3c3,0x35b,_0x1aafb1._0x422d94)]===void 0x0&&(_0xce2f0f[_0x28e4b9(_0x1aafb1._0x654214,_0x1aafb1._0x391371,0x396,0x3ec)][_0x28e4b9(0x3bb,_0x1aafb1._0x529ae9,0x366,0x399)]=Date[_0x43641f(0x3fb,_0x1aafb1._0xd0358a,_0x1aafb1._0x2e1a60,0x3d1)]());_0x5e1244=_0x112d7d['response'];continue;}if(_0x112d7d[_0x28e4b9(_0x1aafb1._0x59d373,_0x1aafb1._0x17a59b,_0x1aafb1._0x22cc8b,_0x1aafb1._0x4cb759)]==='provider_retry'){await emitEvent2(_0x1b7d38[_0x28e4b9(_0x1aafb1._0x198904,0x40e,_0x1aafb1._0x44053f,0x3cd)],_0x112d7d,_0xe6127f);continue;}const _0x3f2caa=createReasoningChunkEvent(_0x112d7d,_0xce2f0f[_0x28e4b9(_0x1aafb1._0xefe5ff,_0x1aafb1._0x5b9cae,_0x1aafb1._0x48a1fb,0x3d5)]);if(_0x3f2caa&&_0x3f2caa['type']===_0x28e4b9(0x43b,0x3af,_0x1aafb1._0x48bda4,_0x1aafb1._0x1c9064)&&_0x3f2caa[_0x28e4b9(0x3e7,_0x1aafb1._0x28ac78,0x40d,_0x1aafb1._0x19eb08)][_0x28e4b9(0x3ba,0x391,_0x1aafb1._0x41ae3e,0x34a)]>0x0){_0xce2f0f[_0x28e4b9(0x3c0,0x3c7,0x396,0x340)]['reasoningStartedAt']===void 0x0&&(_0xce2f0f[_0x43641f(_0x1aafb1._0x3545cb,0x407,_0x1aafb1._0x4deeb3,_0x1aafb1._0x4a317c)][_0x43641f(0x425,0x417,0x3e4,0x3eb)]=Date[_0x43641f(_0x1aafb1._0x18791e,_0x1aafb1._0x2c5f5b,0x39e,0x3d1)]());await emitEvent2(_0x1b7d38['onEvent'],_0x3f2caa,_0xe6127f);continue;}const _0x183f30=createAssistantChunkEvent(_0x112d7d,_0xce2f0f['assistantMessageId']);if(_0x183f30){_0xce2f0f[_0x28e4b9(0x3e5,0x3d4,0x396,_0x1aafb1._0x42dbc9)][_0x43641f(_0x1aafb1._0x5a15a4,_0x1aafb1._0x3941e5,_0x1aafb1._0x1736da,0x3eb)]!==void 0x0&&_0xce2f0f[_0x28e4b9(0x36e,_0x1aafb1._0x4ebe3a,0x396,0x361)][_0x43641f(_0x1aafb1._0xb611d6,_0x1aafb1._0x4fef1a,_0x1aafb1._0x3eecb6,_0x1aafb1._0xc441ad)]===void 0x0&&(_0xce2f0f['meta'][_0x43641f(_0x1aafb1._0x1d8e06,0x3d9,0x3f3,_0x1aafb1._0x5778d2)]=Date[_0x28e4b9(_0x1aafb1._0x1cbfe6,0x3a2,_0x1aafb1._0x2f0d20,_0x1aafb1._0x38c6d6)]());await emitEvent2(_0x1b7d38[_0x28e4b9(_0x1aafb1._0x178148,_0x1aafb1._0x87fa66,_0x1aafb1._0x44053f,0x3cc)],_0x183f30,_0xe6127f);continue;}const _0x2f049c=createToolUseChunkEvent(_0x112d7d,_0xce2f0f[_0x28e4b9(0x407,_0x1aafb1._0x44053f,_0x1aafb1._0x2a7268,_0x1aafb1._0x330729)]);_0x2f049c&&await emitEvent2(_0x1b7d38['onEvent'],_0x2f049c,_0xe6127f);}function _0x43641f(_0x5acc86,_0x34c333,_0xe1c5c0,_0x278972){return _0x2b8011(_0x5acc86-0x17a,_0x34c333,_0xe1c5c0-0x36,_0x278972-0x307);}if(!_0x5e1244)throw new Error(_0x28e4b9(_0x1aafb1._0x459d2b,0x352,_0x1aafb1._0x2e0891,_0x1aafb1._0x5b50fd));return _0x5e1244;}function makeTurnGuards(_0x427a64,_0x3aeab5,_0x213cac,_0x3cff30,_0x56f6fb){return{async 'stage'(_0x4d24f3,_0x386b8f){return throwIfAborted(_0x427a64),await runStage(_0x3aeab5,_0x4d24f3,_0x386b8f,_0x3cff30);},async 'emit'(_0x25700d){throwIfAborted(_0x427a64),await emitEvent2(_0x213cac,_0x25700d,_0x56f6fb);},async 'stageUnchecked'(_0x1c194e,_0x3fe6e4){return await runStage(_0x3aeab5,_0x1c194e,_0x3fe6e4,_0x3cff30);},async 'emitUnchecked'(_0x57e0c8){await emitEvent2(_0x213cac,_0x57e0c8,_0x56f6fb);}};}async function runTurn(_0x1cca29,_0x59b511){const _0x41e43d={_0x2fe8f2:0x2cd,_0x4808fe:0x289,_0x1e818d:0x31f,_0x411ab7:0x2d9,_0x2ca402:0x28c,_0x507008:0x2a9,_0x26cabd:0x75,_0xcdfb77:0xc2,_0x4e9164:0xdd,_0x3b10f7:0xf2,_0x51ddee:0x10c,_0x5dd1b6:0xe3,_0x8b0d8f:0xda,_0x1d4ff6:0x8d,_0x2df490:0x106,_0x30d17c:0x2fc,_0x87d76d:0x2e1,_0x508286:0xe2,_0x170ef0:0x8b,_0x5bd43a:0x111,_0x51e5fd:0x2dc,_0x380965:0x310,_0x1492db:0xd4,_0x253d0c:0xd5,_0x5eea00:0xc8,_0x12277b:0x311,_0x5b2250:0x29f,_0x51d71d:0x122,_0xad84d0:0x2a5,_0x42765b:0x2f2,_0x2ba2c9:0xfc,_0x2ce91e:0xc8,_0x466dc7:0x2bb,_0x5cb52c:0x27c,_0x15e1c3:0x305,_0x7a72eb:0x2b8,_0x5dad90:0x300,_0x391940:0x301,_0x466b7c:0x122,_0x1ff7cb:0x148,_0x19e0f0:0xb0,_0x35b46a:0xb3,_0x7a5859:0xff,_0x2ba70d:0x2d5,_0x503d36:0x31e,_0x511115:0x158,_0xc737be:0x138,_0x5f5a25:0x274,_0x271fde:0x2e7,_0x398b6c:0xe0,_0x2aecad:0xa9,_0x2de3e8:0xbe,_0x1932ea:0xad,_0xc985e6:0x2ad,_0x28bd67:0x2f5,_0x205c9c:0x2bc,_0x2c202a:0x2fb,_0x42ddfb:0x2a6,_0x18a91b:0x2b9,_0xc142e3:0x2a1,_0x41afdb:0x11e,_0x59b1ab:0x24a,_0x26ecb2:0x2fd,_0x19ea95:0x31c,_0x5fd2c4:0x2c5,_0x25ab14:0x2a6,_0x2785da:0x119,_0x5bcdbc:0x2aa,_0x2dec21:0x2af,_0x2ef80d:0x27e,_0x3cc0f8:0x2a0,_0x58bd21:0x2bb,_0x248f9c:0x29b,_0xe05a1d:0x28d,_0x107a9e:0x2d3,_0x3082e1:0x294,_0xb34842:0x26c,_0x242fb3:0x2c9,_0xace28b:0x354,_0x3060e9:0x352,_0x1f3003:0xf2,_0x3b8b6d:0xc3,_0x424254:0x244,_0x40e43b:0x289,_0x2301b9:0xf6,_0x2c608e:0x119,_0x573b5d:0xc2,_0x500c66:0x87,_0x17b680:0x247,_0x5668d1:0x2b2,_0x3c7e7a:0x2b2,_0x5ce537:0x279,_0x555f67:0xc6,_0x284f94:0x10e,_0xf869d7:0x283,_0x290f67:0x308,_0x17f98a:0x2ef,_0x29a92c:0x296,_0x433a61:0x2c4,_0x3debc4:0xdf,_0x56355d:0x16e,_0x2f549c:0x142,_0xb2c6a7:0x15b,_0x5511fa:0xbe,_0x275eb6:0x140,_0x2b07b5:0x2c2,_0x41206f:0x2aa,_0x1c46db:0x2bd,_0x3ee94b:0x307,_0x4d2fac:0x302,_0x4e1aea:0x315,_0x576932:0x286,_0x168a46:0x2b6,_0x27d976:0x11d,_0x2510dd:0x12d,_0x36c42a:0x127,_0x13bebb:0x106,_0x3147f4:0x12e,_0x5a0ff6:0x13d,_0x326e76:0x11a,_0x3172eb:0x116,_0x46e962:0x13c,_0x983403:0x2da,_0x291a46:0x284},_0x3fd700={_0x3289b3:0x13f,_0x188a88:0x17b,_0x3c5014:0x180},_0x4f439b={_0x174cf0:0x1c8},_0x16f5b2={_0x430903:0x1af,_0x16b5b2:0x1d9};function _0xbbaa39(_0xd2c812,_0x66bf19,_0x288479,_0x179911){return _0x2b8011(_0xd2c812-0x135,_0x179911,_0x288479-_0x16f5b2._0x430903,_0xd2c812-_0x16f5b2._0x16b5b2);}const _0x4b03bd=_0x1cca29[_0xbbaa39(_0x41e43d._0x2fe8f2,_0x41e43d._0x4808fe,_0x41e43d._0x1e818d,_0x41e43d._0x411ab7)]??new AbortController()['signal'],_0x570ff6={'sessionId':_0x1cca29['sessionId'],'turnId':_0x1cca29[_0xbbaa39(0x29a,_0x41e43d._0x2ca402,0x2ce,_0x41e43d._0x507008)],'system':normalizeSystem(_0x1cca29[_0x409f5d(_0x41e43d._0x26cabd,_0x41e43d._0xcdfb77,_0x41e43d._0x4e9164,0xb1)]),'messages':(_0x1cca29['messages']??[])[_0x409f5d(_0x41e43d._0x3b10f7,_0x41e43d._0x51ddee,0x141,_0x41e43d._0x5dd1b6)](normalizeMessage),'lastResponse':void 0x0,'toolResults':[],'finalMessage':void 0x0,'sessionDir':typeof _0x59b511[_0x409f5d(0xb8,_0x41e43d._0x8b0d8f,_0x41e43d._0x1d4ff6,_0x41e43d._0x2df490)]===_0xbbaa39(_0x41e43d._0x30d17c,0x315,0x2c8,_0x41e43d._0x87d76d)?_0x59b511[_0x409f5d(0xd8,0xda,_0x41e43d._0x508286,_0x41e43d._0x170ef0)]():_0x59b511[_0x409f5d(_0x41e43d._0x5bd43a,_0x41e43d._0x8b0d8f,0xc2,0xe2)]},_0x31b546=makeExtensionContext(_0x570ff6);function _0x409f5d(_0x4fd2b0,_0x5a8192,_0xbeb90f,_0x1e10cc){return _0x2b8011(_0x4fd2b0-_0x4f439b._0x174cf0,_0x1e10cc,_0xbeb90f-0x11,_0x5a8192-0x13);}const _0x176426={'sessionId':_0x570ff6[_0xbbaa39(0x305,0x2d4,_0x41e43d._0x51e5fd,_0x41e43d._0x380965)],'turnId':_0x570ff6[_0x409f5d(0x82,_0x41e43d._0x1492db,_0x41e43d._0x253d0c,_0x41e43d._0x5eea00)],'state':_0x570ff6,'signal':_0x4b03bd,..._0x59b511['askUser']?{'askUser':_0x59b511['askUser']}:{},..._0x59b511[_0xbbaa39(0x2ce,_0x41e43d._0x12277b,_0x41e43d._0x5b2250,0x2c1)]?{'setTopic':_0x59b511[_0x409f5d(0x106,0x108,0xbf,_0x41e43d._0x51d71d)]}:{}},{stage:_0x5a1617,emit:_0xb478dc,stageUnchecked:_0x45d479,emitUnchecked:_0x41c478}=makeTurnGuards(_0x4b03bd,_0x59b511[_0xbbaa39(_0x41e43d._0xad84d0,_0x41e43d._0x42765b,0x2cc,0x284)],_0x59b511['onEvent'],_0x31b546,_0x176426),_0x3c7538=async(_0x2ad20b,_0x1cbea6)=>{const _0x5c8610={_0x3f600c:0xc5};function _0x801d47(_0x56bf30,_0x3b3803,_0x4b0f3c,_0xb6ea3e){return _0xbbaa39(_0x4b0f3c- -0x482,_0x3b3803-0x3f,_0x4b0f3c-_0x5c8610._0x3f600c,_0xb6ea3e);}const _0x414756=_0x1cbea6?{..._0x31b546,'turnMeta':_0x1cbea6}:_0x31b546;await _0x59b511['registry']['runObservers'](_0x801d47(-_0x3fd700._0x3289b3,-_0x3fd700._0x188a88,-0x193,-_0x3fd700._0x3c5014),structuredClone(_0x2ad20b),_0x414756);};let _0x30dd30=0x0;try{const _0x1ee63e=await _0x5a1617(_0x409f5d(0x10c,_0x41e43d._0x2ba2c9,_0x41e43d._0x2ce91e,0x11b),normalizeMessage(_0x1cca29[_0xbbaa39(_0x41e43d._0x466dc7,_0x41e43d._0x5cb52c,_0x41e43d._0x15e1c3,0x2b9)]));_0x570ff6[_0xbbaa39(_0x41e43d._0x7a72eb,_0x41e43d._0x15e1c3,_0x41e43d._0x5dad90,_0x41e43d._0x391940)][_0x409f5d(_0x41e43d._0x466b7c,_0x41e43d._0x1ff7cb,0x10b,0x174)](_0x1ee63e),await _0x3c7538(_0x1ee63e),await _0xb478dc({'type':_0x409f5d(_0x41e43d._0x19e0f0,_0x41e43d._0x35b46a,0x94,_0x41e43d._0x7a5859),'message':_0x1ee63e});while(!![]){throwIfAborted(_0x4b03bd),_0x30dd30+=0x1;const _0x9ff0da=createAssistantMessageId(_0x570ff6['turnId'],_0x30dd30),_0x4191d=createReasoningMessageId(_0x9ff0da),_0x1abcaf={'model':_0x59b511[_0xbbaa39(_0x41e43d._0x2ba70d,0x2a3,0x2b6,0x318)]['model'],..._0x59b511[_0x409f5d(0xf3,0x10f,0x128,0x14a)][_0xbbaa39(_0x41e43d._0x503d36,0x32a,0x356,0x344)]?{'provider':_0x59b511['chatModel'][_0x409f5d(0x187,_0x41e43d._0x511115,_0x41e43d._0xc737be,0x131)]}:{}};let _0x387b7b={'model':_0x59b511[_0x409f5d(0x11e,0x10f,0x160,0x110)][_0xbbaa39(0x2b9,_0x41e43d._0x5f5a25,_0x41e43d._0x271fde,0x2d6)],'maxTokens':_0x59b511['chatModel'][_0x409f5d(0x9f,0xe9,_0x41e43d._0x398b6c,_0x41e43d._0x2aecad)]??0x4000,'system':structuredClone(_0x570ff6[_0x409f5d(0x73,0xc2,_0x41e43d._0x2de3e8,0xdb)]),'messages':structuredClone(_0x570ff6[_0x409f5d(_0x41e43d._0x1932ea,0xf2,0x131,0xc7)]),'tools':_0x59b511['toolRuntime'][_0xbbaa39(_0x41e43d._0xc985e6,_0x41e43d._0x28bd67,_0x41e43d._0x205c9c,0x2dc)](),'metadata':{'sessionId':_0x570ff6[_0xbbaa39(0x305,_0x41e43d._0x2c202a,0x2e2,0x321)],'turnId':_0x570ff6[_0xbbaa39(0x29a,_0x41e43d._0x42ddfb,_0x41e43d._0x18a91b,_0x41e43d._0xc142e3)]},..._0x59b511[_0xbbaa39(0x2c7,0x2f7,_0x41e43d._0x5dad90,0x2bf)]?{'outputFormat':_0x59b511[_0x409f5d(0xfe,0x101,_0x41e43d._0x41afdb,0x14a)]}:{}};_0x387b7b=await _0x5a1617(_0xbbaa39(0x2ff,0x30e,0x31c,0x2de),_0x387b7b),await _0xb478dc({'type':_0xbbaa39(0x28f,_0x41e43d._0x59b1ab,0x24e,0x279),'request':_0x387b7b}),_0x1abcaf[_0xbbaa39(_0x41e43d._0x26ecb2,_0x41e43d._0x19ea95,0x2e9,0x31b)]=Date[_0xbbaa39(0x2a3,_0x41e43d._0x5fd2c4,0x285,_0x41e43d._0x25ab14)]();let _0x1518d=await executeModelRequest(_0x387b7b,_0x1cca29,_0x59b511,_0x176426,{'assistantMessageId':_0x9ff0da,'reasoningMessageId':_0x4191d,'meta':_0x1abcaf});_0x1abcaf['turnCompletedAt']=Date[_0x409f5d(_0x41e43d._0x19e0f0,_0x41e43d._0x4e9164,0xc2,_0x41e43d._0x2785da)](),_0x1518d=await _0x5a1617(_0xbbaa39(_0x41e43d._0x5bcdbc,_0x41e43d._0x2dec21,_0x41e43d._0x2ef80d,0x2f1),_0x1518d),await _0xb478dc({'type':'model_response','response':_0x1518d}),_0x570ff6[_0xbbaa39(0x29e,_0x41e43d._0x3cc0f8,_0x41e43d._0x58bd21,0x2da)]=_0x1518d;let _0x4b61d1=await _0x5a1617('beforeAssistantAppend',withMessageId(responseToAssistantMessage(_0x1518d),_0x9ff0da));_0x4b61d1=withMessageId(_0x4b61d1,_0x9ff0da);const _0x4eb6e6=getToolUseBlocks(_0x4b61d1),_0x2661b7=await Promise[_0xbbaa39(_0x41e43d._0x248f9c,0x272,_0x41e43d._0xe05a1d,0x28f)](_0x4eb6e6[_0xbbaa39(0x2d2,0x28d,0x2b0,_0x41e43d._0x107a9e)](_0xcfab76=>_0x5a1617('beforeToolExecution',_0xcfab76)));_0x2661b7[_0xbbaa39(_0x41e43d._0x3082e1,_0x41e43d._0xb34842,0x2d7,_0x41e43d._0x59b1ab)]>0x0&&(_0x4b61d1=replaceToolUseBlocks(_0x4b61d1,_0x2661b7));const _0xdafead=withMessageId(_0x4b61d1,_0x9ff0da);_0x4b61d1=_0xdafead;const _0x407700=createReasoningMessage(_0x4b61d1),_0xb2cbed=createAssistantTextMessage(_0x4b61d1),_0x5ad7b5=createToolUseMessage(_0x4b61d1);_0x407700&&await _0xb478dc({'type':_0xbbaa39(0x314,_0x41e43d._0x242fb3,_0x41e43d._0xace28b,_0x41e43d._0x3060e9),'message':withMessageId(_0x407700,_0x4191d)});_0xb2cbed&&await _0xb478dc({'type':'assistant_message','message':withMessageId(_0xb2cbed,_0x9ff0da)});_0x5ad7b5&&await _0xb478dc({'type':'tool_use_message','message':withMessageId(_0x5ad7b5,_0x9ff0da)});_0x570ff6[_0x409f5d(0xff,_0x41e43d._0x1f3003,0xcf,_0x41e43d._0x3b8b6d)]['push'](_0xdafead);_0x2661b7[_0xbbaa39(0x294,0x2ad,_0x41e43d._0x424254,_0x41e43d._0x40e43b)]>0x0&&await _0x3c7538(_0xdafead,_0x1abcaf);for(const _0x3ed100 of _0x2661b7){await _0xb478dc({'type':_0x409f5d(_0x41e43d._0x2301b9,_0x41e43d._0x2c608e,0xd4,0x13e),'toolCall':_0x3ed100});}if(_0x2661b7[_0x409f5d(0x100,0xce,_0x41e43d._0x573b5d,_0x41e43d._0x500c66)]===0x0){const _0x216864=await _0x5a1617(_0xbbaa39(0x284,_0x41e43d._0x17b680,0x296,0x2b9),_0x4b61d1),_0x533b56=withMessageId(_0x216864,_0x9ff0da);return _0x570ff6[_0xbbaa39(_0x41e43d._0x5668d1,_0x41e43d._0x3c7e7a,_0x41e43d._0x5ce537,0x2bb)]=_0x533b56,_0x570ff6[_0x409f5d(_0x41e43d._0x555f67,_0x41e43d._0x1f3003,0xf4,_0x41e43d._0x284f94)][_0x570ff6[_0xbbaa39(0x2b8,_0x41e43d._0xf869d7,_0x41e43d._0x290f67,_0x41e43d._0x17f98a)][_0xbbaa39(_0x41e43d._0x3082e1,0x26f,0x254,0x2e7)]-0x1]=_0x533b56,await _0x3c7538(_0x533b56,_0x1abcaf),await _0xb478dc({'type':_0xbbaa39(_0x41e43d._0x29a92c,0x2bd,_0x41e43d._0x433a61,0x2d7),'message':_0x533b56}),throwIfAborted(_0x4b03bd),await _0x59b511[_0x409f5d(0xfb,_0x41e43d._0x3debc4,0xbd,0xa3)][_0x409f5d(_0x41e43d._0x56355d,_0x41e43d._0x2f549c,_0x41e43d._0xb2c6a7,0x107)](_0x409f5d(_0x41e43d._0x5511fa,0xf6,0x13d,_0x41e43d._0x275eb6),_0x570ff6,_0x31b546),await _0xb478dc({'type':_0xbbaa39(0x2f2,_0x41e43d._0x2b07b5,_0x41e43d._0x41206f,_0x41e43d._0x1c46db),'state':_0x570ff6}),{'status':_0xbbaa39(_0x41e43d._0x3ee94b,_0x41e43d._0x4d2fac,0x2dc,0x35a),'finalMessage':_0x533b56,'state':_0x570ff6};}let _0x30a5a2=await _0x59b511['toolRuntime']['executeCalls'](_0x2661b7,_0x176426);const _0x1e1f46=_0x30a5a2[_0xbbaa39(0x2d4,0x28c,_0x41e43d._0x290f67,_0x41e43d._0x4e1aea)](isAbortedToolResult),_0x211de8=_0x1e1f46?_0x45d479:_0x5a1617,_0x3d89bd=_0x1e1f46?_0x41c478:_0xb478dc;_0x30a5a2=await Promise[_0xbbaa39(0x29b,0x273,_0x41e43d._0x576932,_0x41e43d._0x168a46)](_0x30a5a2[_0x409f5d(_0x41e43d._0x27d976,0x10c,_0x41e43d._0x2510dd,0xef)](_0x408a68=>_0x211de8('afterToolResult',_0x408a68))),_0x570ff6['toolResults']['push'](..._0x30a5a2);for(const _0x4234e3 of _0x30a5a2){await _0x3d89bd({'type':_0x409f5d(0x159,_0x41e43d._0x36c42a,_0x41e43d._0x13bebb,_0x41e43d._0x3147f4),'result':_0x4234e3});}const _0x27dfcd=await _0x211de8('beforeToolResultAppend',createToolResultUserMessage(_0x30a5a2));await _0x3d89bd({'type':_0x409f5d(0x160,0x11b,0xca,_0x41e43d._0x5a0ff6),'message':_0x27dfcd}),_0x570ff6[_0x409f5d(_0x41e43d._0x326e76,_0x41e43d._0x1f3003,_0x41e43d._0x3172eb,0xa9)]['push'](_0x27dfcd),await _0x3c7538(_0x27dfcd);if(_0x1e1f46)return{'status':'aborted','state':_0x570ff6};}}catch(_0x598276){if(!_0x4b03bd[_0x409f5d(0x110,0x114,_0x41e43d._0x46e962,0x165)])throw new TurnFailedError(_0x598276,_0x570ff6);return{'status':_0xbbaa39(_0x41e43d._0x983403,0x2a6,_0x41e43d._0x3c7e7a,_0x41e43d._0x291a46),'state':_0x570ff6};}}function createSessionId(){const _0x684774={_0x42f36a:0x2f2,_0xebf0bf:0x2e4,_0x3761a4:0x335,_0x36d740:0x2b9,_0x1275e4:0x34a,_0x385fb4:0x308,_0x4f7c8c:0x2ea},_0x149fc1={_0x5d9cd3:0x160},_0x5ed145={_0x2eec56:0x164,_0x7158c1:0x1ee};function _0xd28d1c(_0x276589,_0x4d4ebb,_0x2dba72,_0x46c739){return _0x2b8011(_0x276589-0x64,_0x46c739,_0x2dba72-_0x5ed145._0x2eec56,_0x276589-_0x5ed145._0x7158c1);}function _0x4e8dc7(_0x11744e,_0x43623e,_0x43e817,_0x2babf5){return _0x2b8011(_0x11744e-_0x149fc1._0x5d9cd3,_0x43623e,_0x43e817-0x1a9,_0x11744e- -0x1c6);}return _0xd28d1c(_0x684774._0x42f36a,_0x684774._0xebf0bf,_0x684774._0x3761a4,0x29f)+Date[_0xd28d1c(0x2b8,_0x684774._0x36d740,0x267,0x2c8)]()+'-'+Math[_0xd28d1c(0x2fe,_0x684774._0x1275e4,_0x684774._0x385fb4,_0x684774._0x4f7c8c)]()['toString'](0x10)['slice'](0x2,0xa);}function createTurnId(_0x58ee4){const _0x1b8bfe={_0x5a5842:0x79,_0x57fe85:0x8f,_0x22ad3a:0xbc},_0x10643a={_0x3669ac:0x1c5,_0x18499c:0x166};function _0x2988fa(_0x200781,_0x30d764,_0x28104a,_0x531733){return _0x2b8011(_0x200781-_0x10643a._0x3669ac,_0x531733,_0x28104a-_0x10643a._0x18499c,_0x30d764- -0x117);}return _0x2988fa(-_0x1b8bfe._0x5a5842,-0x73,-_0x1b8bfe._0x57fe85,-_0x1b8bfe._0x22ad3a)+_0x58ee4;}function createDefaultMessage(_0x15bb43){if(_0x15bb43===void 0x0)return void 0x0;return normalizeUserInput(_0x15bb43);}function normalizeUserInput(_0x2e35b1){const _0x1e5bc6={_0xed13ef:0x13a,_0xcad59b:0x25c,_0x5193ed:0x1d7,_0x28613b:0x207},_0x278a52={_0xee638:0x46f},_0x49c062={_0x305c2d:0x3e};function _0x45673a(_0x2d2b87,_0x5bfe99,_0x30fc7b,_0x348609){return _0x106530(_0x30fc7b,_0x5bfe99-0x1e9,_0x30fc7b-0xf2,_0x2d2b87- -_0x49c062._0x305c2d);}function _0x25f044(_0x2728f4,_0x24df05,_0xe3220a,_0x4eeae0){return _0x106530(_0x2728f4,_0x24df05-0x8c,_0xe3220a-0x7a,_0x4eeae0- -_0x278a52._0xee638);}if(typeof _0x2e35b1===_0x45673a(0x186,_0x1e5bc6._0xed13ef,0x1d7,0x17c))return{'role':_0x25f044(-0x239,-0x223,-0x2a7,-_0x1e5bc6._0xcad59b),'content':[{'type':_0x45673a(0x218,0x252,_0x1e5bc6._0x5193ed,_0x1e5bc6._0x28613b),'text':_0x2e35b1}]};return normalizeMessage(_0x2e35b1);}function resolveChatModel(_0x5d86ea){const _0x4d8b65={_0x4a92df:0xf9,_0x50d4ff:0x147,_0x25826c:0xec,_0x30a03b:0x25d,_0x473f8c:0x262,_0x5a9e4a:0x12c,_0x571c7b:0xef},_0x5e556b={_0x550727:0x1d};function _0x3f492f(_0x1dd9f0,_0x10bdf0,_0x3302f2,_0x5515fe){return _0x106530(_0x5515fe,_0x10bdf0-0x143,_0x3302f2-_0x5e556b._0x550727,_0x1dd9f0- -0x412);}function _0x5587fd(_0xbadf17,_0x217239,_0x56cb40,_0x6588f8){return _0x2b8011(_0xbadf17-0xba,_0x217239,_0x56cb40-0x8e,_0xbadf17-0x30);}if(!_0x5d86ea[_0x5587fd(0x12c,_0x4d8b65._0x4a92df,_0x4d8b65._0x50d4ff,_0x4d8b65._0x25826c)])throw new Error(_0x3f492f(-_0x4d8b65._0x30a03b,-_0x4d8b65._0x473f8c,-0x285,-0x246));return _0x5d86ea[_0x5587fd(_0x4d8b65._0x5a9e4a,0x101,0xe7,_0x4d8b65._0x571c7b)];}function createRegistry(_0x2e01aa){const _0x4348fe={_0x468c52:0x237,_0x26acc9:0x2a6,_0x431dd8:0x28c,_0xc26d6b:0x2a9,_0x5a2d42:0x215,_0x37c014:0x6d,_0x2ee234:0x18,_0x43280e:0x8a,_0x571802:0xb7},_0x2cd4fb={_0xf81122:0x1c3,_0x272f2b:0x68},_0x5e5971={_0xe859cc:0x1e7,_0xde6b7:0x224};function _0x51fa3b(_0x487740,_0x27c494,_0xeb9f5f,_0x1b2140){return _0x106530(_0xeb9f5f,_0x27c494-0x1a4,_0xeb9f5f-_0x5e5971._0xe859cc,_0x487740- -_0x5e5971._0xde6b7);}function _0x2f9e00(_0x3258f4,_0x3d22d0,_0x2b8f83,_0x259f11){return _0x106530(_0x3d22d0,_0x3d22d0-_0x2cd4fb._0xf81122,_0x2b8f83-_0x2cd4fb._0x272f2b,_0x3258f4- -0x466);}if(_0x2e01aa[_0x2f9e00(-0x28a,-_0x4348fe._0x468c52,-_0x4348fe._0x26acc9,-0x23f)])return _0x2e01aa[_0x2f9e00(-0x28a,-0x27b,-_0x4348fe._0x431dd8,-_0x4348fe._0xc26d6b)];const _0x13791f=createExtensionRegistry(),_0x17a574=_0x2e01aa[_0x2f9e00(-0x254,-0x253,-0x22c,-_0x4348fe._0x5a2d42)]??[];for(const _0x2fee2b of _0x17a574){_0x13791f[_0x51fa3b(-_0x4348fe._0x37c014,-_0x4348fe._0x2ee234,-_0x4348fe._0x43280e,-_0x4348fe._0x571802)](_0x2fee2b);}return _0x13791f;}var Agent=class{['_systemPrompt'];['deps'];[_0x2b8011(0xf3,0x85,0x104,0xdb)];[_0x106530(0x210,0x250,0x27f,0x23c)];['messages'];[_0x2b8011(0xd8,0x10b,0x162,0x11a)];[_0x2b8011(0xc3,0xdf,0x7b,0xc8)];constructor(_0x90fb6f={}){const _0x268c77={_0x157816:0x13e,_0x4c95a2:0x141,_0xf61e80:0x141,_0x3b2807:0x110,_0x381973:0x21b,_0xa8e2e8:0x270,_0x2a5e12:0x1ec,_0x50ba80:0x214,_0x11276a:0xd0,_0x1e5256:0x12b,_0xd6a229:0xf4,_0x2b3f36:0x20f,_0x33dd9e:0x218,_0x5315d5:0x13b,_0x4febe2:0x148,_0x355bba:0x225,_0x248b5f:0x1cf,_0x2d1dca:0x26c,_0x72f501:0x233,_0x485c59:0x164,_0x2f4abb:0x100,_0x28c277:0xc2,_0xd7c737:0x213,_0x3f918e:0xd4},_0x348f5a={_0x549c7d:0x488,_0x59169a:0x48e},_0x30f58a={_0x4155b0:0x114,_0x1bb0f4:0x15},_0xdac617={_0x24834e:0x45,_0x3ff1d4:0x308};this[_0x5e4120(_0x268c77._0x157816,0x102,0x115,_0x268c77._0x4c95a2)]=_0x90fb6f[_0x5e4120(0x166,0x16c,0x172,_0x268c77._0xf61e80)]??createSessionId(),this[_0x5e4120(0xa7,_0x268c77._0x3b2807,0xa6,0xdd)]=0x0,this[_0x506d0a(-0x235,-0x22c,-_0x268c77._0x381973,-0x254)]=_0x90fb6f[_0x506d0a(-0x226,-0x242,-0x1f5,-0x235)]??'';function _0x506d0a(_0x435ae2,_0x18c855,_0x5dfc88,_0x55a858){return _0x2b8011(_0x435ae2-_0xdac617._0x24834e,_0x55a858,_0x5dfc88-0xc3,_0x5dfc88- -_0xdac617._0x3ff1d4);}this[_0x506d0a(-_0x268c77._0xa8e2e8,-_0x268c77._0x2a5e12,-0x229,-_0x268c77._0x50ba80)]=(_0x90fb6f[_0x5e4120(_0x268c77._0x11276a,_0x268c77._0x1e5256,0x13d,_0x268c77._0xd6a229)]??[])[_0x506d0a(-0x21d,-0x214,-_0x268c77._0x2b3f36,-_0x268c77._0x33dd9e)](normalizeMessage),this['defaultMessage']=createDefaultMessage(_0x90fb6f[_0x5e4120(0xf2,_0x268c77._0x5315d5,_0x268c77._0x4febe2,0xf7)]);function _0x5e4120(_0x4bab46,_0x377bc5,_0x327552,_0x197cc0){return _0x2b8011(_0x4bab46-_0x30f58a._0x4155b0,_0x4bab46,_0x327552-0x1e6,_0x197cc0-_0x30f58a._0x1bb0f4);}this['metrics']=createAgentMetrics({'getContextWindowLimit':_0x90fb6f[_0x506d0a(-0x1da,-_0x268c77._0x355bba,-_0x268c77._0x248b5f,-0x1b5)]});const _0x3f8df5=_0x90fb6f['onEvent'],_0x4906b4=async(_0x44a8f8,_0x3b6e5d)=>{const _0x5b135c={_0x4f74e2:0x158,_0x4a2a07:0x52};this['metrics'][_0x1d569e(_0x348f5a._0x549c7d,_0x348f5a._0x59169a,0x4ba,0x479)](_0x44a8f8);function _0x1d569e(_0x573da4,_0x6d379d,_0x12dbaa,_0x38b98b){return _0x506d0a(_0x573da4-_0x5b135c._0x4f74e2,_0x6d379d-_0x5b135c._0x4a2a07,_0x6d379d-0x669,_0x38b98b);}await _0x3f8df5?.(_0x44a8f8,_0x3b6e5d);},_0x4ade40=createInternalToolRuntime(_0x90fb6f[_0x506d0a(-0x27e,-_0x268c77._0x2d1dca,-_0x268c77._0x72f501,-_0x268c77._0x2a5e12)]??[],{'onEvent':_0x4906b4,'onToolCall':_0x90fb6f[_0x5e4120(_0x268c77._0x485c59,0xd9,0xcf,0x115)]});this[_0x5e4120(0xf1,_0x268c77._0x2f4abb,0xe3,_0x268c77._0x28c277)]={'registry':createRegistry(_0x90fb6f),'chatModel':resolveChatModel(_0x90fb6f),'toolRuntime':_0x4ade40,'askUser':_0x90fb6f['askUser'],'setTopic':_0x90fb6f[_0x506d0a(-_0x268c77._0x33dd9e,-0x211,-_0x268c77._0xd7c737,-0x24e)],'onEvent':_0x4906b4,'sessionDir':_0x90fb6f[_0x5e4120(0x107,0xe3,_0x268c77._0x3f918e,0xdc)],'outputFormat':_0x90fb6f['outputFormat']};}get[_0x2b8011(0xea,0x129,0x122,0x113)](){return this['_systemPrompt'];}[_0x106530(0x243,0x24f,0x251,0x1fc)](_0x1c727c=[]){const _0x2df620={_0x245052:0xd6,_0x2e3ac3:0xe9,_0x18f75e:0x150,_0x5d5feb:0x11a,_0x21fcbb:0x11d,_0x355246:0xaa,_0x1dbcd9:0x9c},_0x12495f={_0x1767bc:0x3b},_0x40f192={_0xe36642:0xac};function _0x3d064a(_0x4e539d,_0x245464,_0x451dbd,_0xbbee96){return _0x106530(_0x451dbd,_0x245464-_0x40f192._0xe36642,_0x451dbd-0xcb,_0x245464- -0x2a6);}function _0x3d188e(_0x58deb3,_0x15371e,_0x2565d1,_0x36d52a){return _0x106530(_0x15371e,_0x15371e-0x14,_0x2565d1-_0x12495f._0x1767bc,_0x58deb3- -0xe7);}this[_0x3d188e(_0x2df620._0x245052,0x11b,0xd1,_0x2df620._0x2e3ac3)][_0x3d188e(_0x2df620._0x18f75e,_0x2df620._0x5d5feb,_0x2df620._0x21fcbb,0x10b)][_0x3d064a(-0xa4,-_0x2df620._0x355246,-_0x2df620._0x1dbcd9,-0x8c)](_0x1c727c);}[_0x2b8011(0x11d,0x10e,0x12f,0x10c)](){const _0x1e143d={_0xda7f1c:0x15a,_0x257ce9:0x152,_0x14fb83:0x155},_0x1e0c0f={_0x3e80bf:0xbc},_0x2a91dc={_0x3f5f90:0x12a,_0x3da057:0x1bb,_0x328eb4:0x408};function _0x53b0ad(_0x5ed9a9,_0x370a42,_0x1a9e62,_0x41fbd9){return _0x106530(_0x5ed9a9,_0x370a42-_0x2a91dc._0x3f5f90,_0x1a9e62-_0x2a91dc._0x3da057,_0x370a42- -_0x2a91dc._0x328eb4);}function _0x36a154(_0x1a49e9,_0x13016f,_0x54a604,_0x3b3e32){return _0x2b8011(_0x1a49e9-0x10,_0x1a49e9,_0x54a604-_0x1e0c0f._0x3e80bf,_0x54a604-0xa5);}return this[_0x36a154(0x17d,_0x1e143d._0xda7f1c,_0x1e143d._0x257ce9,0x156)]['toolRuntime'][_0x36a154(0x16f,_0x1e143d._0x14fb83,0x179,0x135)]();}[_0x106530(0x242,0x26b,0x203,0x23a)](_0x400f10,_0x1e1b5f={}){const _0x35dfa4={_0x974d3:0x239,_0x3fbe56:0x21b,_0x9c8c42:0x23c,_0x314bbd:0x2e7,_0x2198f7:0x309,_0x1d2030:0x317,_0x3dd723:0x345,_0x326faa:0x300,_0x568161:0x2f7,_0x4ee209:0x2da},_0x351c1a={_0x4752ee:0x14f,_0x333d07:0x1d9},_0x3ea568={_0x8f3bd0:0x183,_0x299d65:0xbf,_0x18d999:0x238};this[_0x4e39d4(-_0x35dfa4._0x974d3,-0x222,-_0x35dfa4._0x3fbe56,-_0x35dfa4._0x9c8c42)]=_0x400f10;function _0x172736(_0x30d8ae,_0x2e5e39,_0x249db5,_0x502794){return _0x2b8011(_0x30d8ae-_0x3ea568._0x8f3bd0,_0x30d8ae,_0x249db5-_0x3ea568._0x299d65,_0x2e5e39-_0x3ea568._0x18d999);}function _0x4e39d4(_0x267604,_0x455772,_0x39b6bd,_0x45d02e){return _0x106530(_0x267604,_0x455772-_0x351c1a._0x4752ee,_0x39b6bd-_0x351c1a._0x333d07,_0x45d02e- -0x439);}_0x1e1b5f[_0x172736(_0x35dfa4._0x314bbd,0x2e2,0x2fe,0x2a4)]===!![]&&(this[_0x172736(_0x35dfa4._0x2198f7,_0x35dfa4._0x1d2030,_0x35dfa4._0x3dd723,0x356)]=[],this[_0x172736(0x307,_0x35dfa4._0x326faa,_0x35dfa4._0x568161,_0x35dfa4._0x4ee209)]=0x0);}[_0x2b8011(0x13b,0x12f,0x125,0x13a)](_0x21d143){const _0x299ddc={_0x206399:0x1d6,_0x35e035:0x1df},_0x2f5f08={_0xdf3a92:0x178,_0x110b66:0xa8};function _0x357863(_0x4ca705,_0x4f3311,_0x26a071,_0x452da7){return _0x2b8011(_0x4ca705-_0x2f5f08._0xdf3a92,_0x4ca705,_0x26a071-_0x2f5f08._0x110b66,_0x4f3311- -0x302);}this[_0x357863(-0x1f7,-_0x299ddc._0x206399,-_0x299ddc._0x35e035,-0x186)]=_0x21d143;}['setChatModel'](_0x195a70){const _0x12c7be={_0x3ac966:0x228,_0x1002e9:0x20a,_0x376e31:0x25b},_0xc3b1f4={_0x510210:0x179,_0x3eaee2:0x3c7};function _0x352e26(_0x3a9d4c,_0x2afcf9,_0x212b6d,_0x110604){return _0x106530(_0x3a9d4c,_0x2afcf9-_0xc3b1f4._0x510210,_0x212b6d-0x6,_0x212b6d- -_0xc3b1f4._0x3eaee2);}this[_0x352e26(-_0x12c7be._0x3ac966,-0x1da,-_0x12c7be._0x1002e9,-_0x12c7be._0x376e31)]['chatModel']=_0x195a70;}async[_0x106530(0x268,0x235,0x205,0x254)](_0x67d35=this['defaultMessage'],_0xd4914={}){const _0x28bc06={_0x196fc2:0x478,_0x3a7f72:0xf5,_0x151122:0x149,_0x2532f1:0xc3,_0x3eb1e1:0xef,_0x55cb0b:0x7a,_0x2e9eba:0x7e,_0x40608e:0x7b,_0x4746f1:0x4e4,_0x6dce84:0x4f4,_0x2d6b9b:0xa8,_0x2dd024:0xd3,_0x54bf11:0x76,_0x44efbd:0xb5,_0x1c58d8:0x83,_0x435c18:0xcb,_0x232b61:0x4ec,_0x3a2726:0x553,_0x28119f:0x549,_0x32c037:0x485,_0x17af84:0x490,_0x2d0dde:0x79,_0x389e6e:0xca},_0x195e20={_0x491a51:0x134,_0x35ef6f:0x142},_0x4c822c={_0x28568e:0x85,_0x379d51:0x37};if(!_0x67d35)throw new Error('Agent.send\x20requires\x20a\x20message\x20when\x20no\x20default\x20message\x20is\x20configured');function _0x22e42e(_0x5611aa,_0x387393,_0x4ac31b,_0x3c39c0){return _0x2b8011(_0x5611aa-0x4a,_0x387393,_0x4ac31b-_0x4c822c._0x28568e,_0x5611aa- -_0x4c822c._0x379d51);}this[_0x4268b0(0x4b8,_0x28bc06._0x196fc2,0x4e1,0x47a)]+=0x1;function _0x4268b0(_0x491069,_0x481499,_0x4d9556,_0x567c18){return _0x106530(_0x567c18,_0x481499-_0x195e20._0x491a51,_0x4d9556-_0x195e20._0x35ef6f,_0x491069-0x2e0);}try{const _0x527711=await runTurn({'sessionId':this[_0x22e42e(_0x28bc06._0x3a7f72,_0x28bc06._0x151122,_0x28bc06._0x2532f1,_0x28bc06._0x3eb1e1)],'turnId':createTurnId(this[_0x22e42e(0x91,_0x28bc06._0x55cb0b,_0x28bc06._0x2e9eba,_0x28bc06._0x40608e)]),'streaming':_0xd4914['streaming'],'signal':_0xd4914[_0x4268b0(_0x28bc06._0x4746f1,0x505,0x4b9,_0x28bc06._0x6dce84)],'system':this[_0x22e42e(0xdc,0xd1,0x125,0xbc)],'messages':this[_0x22e42e(_0x28bc06._0x2d6b9b,0xf0,0x55,_0x28bc06._0x2dd024)],'message':normalizeUserInput(_0x67d35)},this[_0x22e42e(_0x28bc06._0x54bf11,0x29,0x54,_0x28bc06._0x44efbd)]);return this['messages']=_0x527711['state']['messages'][_0x22e42e(0xc2,0x9e,_0x28bc06._0x1c58d8,_0x28bc06._0x435c18)](normalizeMessage),_0x527711;}catch(_0x26e92e){if(_0x26e92e instanceof TurnFailedError){this[_0x4268b0(0x4cf,0x4d1,_0x28bc06._0x232b61,0x496)]=synthesizeMissingToolResults(_0x26e92e[_0x4268b0(0x50b,0x4f4,_0x28bc06._0x3a2726,_0x28bc06._0x28119f)][_0x4268b0(0x4cf,_0x28bc06._0x32c037,_0x28bc06._0x17af84,0x4b5)][_0x22e42e(0xc2,_0x28bc06._0x2d0dde,0xc2,_0x28bc06._0x389e6e)](normalizeMessage));throw _0x26e92e['cause'];}throw _0x26e92e;}}};export{normalizeToolOutputValue,createToolOutput,ToolExecutionError,defineTool,ToolRegistry,validateToolInput,deriveFinalToolOutput,createInternalToolRuntime,createExtensionRegistry,createAgentMetrics,runTurn,Agent};