@nuvin/agent-core 0.0.0-rc.0 → 0.0.0-rc.1

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.
@@ -452,6 +452,7 @@ type ToolRuntimeEventHandler = (event: ToolRuntimeEvent, ctx: ToolExecutionConte
452
452
  type AgentEventHandler = (event: AgentEvent, ctx: AgentEventContext) => Promise<void> | void;
453
453
  interface ToolRuntime {
454
454
  listToolSchemas(): ToolSchema[];
455
+ setTools(tools: AnyToolDefinition[]): void;
455
456
  executeCalls(toolCalls: ToolUseBlock[], ctx: ToolExecutionContext): Promise<ToolResult[]>;
456
457
  execute(toolCall: ToolUseBlock, ctx: ToolExecutionContext): Promise<ToolResult>;
457
458
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuvin/agent-core",
3
- "version": "0.0.0-rc.0",
3
+ "version": "0.0.0-rc.1",
4
4
  "private": false,
5
5
  "description": "Core agent, model, format, and tool primitives for Nuvin",
6
6
  "license": "Apache-2.0",
@@ -39,14 +39,6 @@
39
39
  "import": "./dist/tools/index.js"
40
40
  }
41
41
  },
42
- "scripts": {
43
- "build": "node scripts/build.js",
44
- "dev": "tsup --watch",
45
- "test": "vitest run",
46
- "test:watch": "vitest",
47
- "clean": "rm -rf dist",
48
- "prepack": "rm -rf dist && pnpm run build"
49
- },
50
42
  "devDependencies": {
51
43
  "@types/node": "^22.0.0",
52
44
  "javascript-obfuscator": "^4.2.0",
@@ -56,8 +48,17 @@
56
48
  },
57
49
  "dependencies": {
58
50
  "@anthropic-ai/sdk": "^0.82.0",
51
+ "@modelcontextprotocol/sdk": "^1.29.0",
59
52
  "openai": "^6.33.0",
60
53
  "yaml": "^2.8.3",
61
- "zod": "^4.3.6"
54
+ "zod": "^4.3.6",
55
+ "@nuvin/config": "0.1.0-rc.0"
56
+ },
57
+ "scripts": {
58
+ "build": "node scripts/build.js",
59
+ "dev": "tsup --watch",
60
+ "test": "vitest run",
61
+ "test:watch": "vitest",
62
+ "clean": "rm -rf dist"
62
63
  }
63
- }
64
+ }
@@ -1 +0,0 @@
1
- (function(_0x1a512c,_0x48d07c){const _0x4c4ea6={_0x1253f4:0x138,_0x2ef307:0x1aa,_0x4234e7:0x161,_0x44e96f:0x140,_0x3add93:0x11f,_0x2f3871:0x15b,_0x2af9bf:0x119,_0x3b810d:0x186,_0x207f21:0x184,_0x5068c6:0x1c3,_0x2f5769:0x18d,_0x5938d8:0x19a,_0x18e0f8:0x1a9,_0x4c2fe3:0x17f,_0x5c22aa:0x145,_0x2c3ff1:0x156,_0x1ff808:0x175,_0x30365d:0x160,_0x2ad4b5:0xfc,_0x4fdb86:0xea,_0x550ae3:0xf3,_0x7f3bdf:0x13b,_0x3f7c54:0x102},_0x177eb9=_0x1a512c();function _0x38f216(_0x382bfe,_0x5dda48,_0x17595b,_0x4e0741){return _0x57bb(_0x17595b- -0x385,_0x5dda48);}function _0x2dd3e0(_0x52cfb2,_0x5834fe,_0x264276,_0x115305){return _0x57bb(_0x5834fe- -0x37b,_0x115305);}while(!![]){try{const _0x20f788=parseInt(_0x38f216(-0x1d9,-0x17a,-0x19b,-0x1e3))/0x1*(-parseInt(_0x2dd3e0(-_0x4c4ea6._0x1253f4,-0x16a,-_0x4c4ea6._0x2ef307,-_0x4c4ea6._0x4234e7))/0x2)+parseInt(_0x2dd3e0(-0x14e,-0x157,-_0x4c4ea6._0x44e96f,-0x163))/0x3*(parseInt(_0x2dd3e0(-_0x4c4ea6._0x3add93,-_0x4c4ea6._0x2f3871,-0x16b,-_0x4c4ea6._0x2af9bf))/0x4)+-parseInt(_0x2dd3e0(-_0x4c4ea6._0x3b810d,-0x199,-_0x4c4ea6._0x207f21,-0x17c))/0x5+-parseInt(_0x38f216(-_0x4c4ea6._0x5068c6,-_0x4c4ea6._0x2f5769,-_0x4c4ea6._0x5938d8,-_0x4c4ea6._0x18e0f8))/0x6*(-parseInt(_0x38f216(-0x13c,-0x188,-_0x4c4ea6._0x4c2fe3,-_0x4c4ea6._0x5938d8))/0x7)+-parseInt(_0x2dd3e0(-_0x4c4ea6._0x5c22aa,-0x124,-_0x4c4ea6._0x2c3ff1,-0xd6))/0x8*(-parseInt(_0x2dd3e0(-0x163,-0x133,-0x166,-_0x4c4ea6._0x1ff808))/0x9)+-parseInt(_0x2dd3e0(-0x13c,-0x11a,-_0x4c4ea6._0x30365d,-_0x4c4ea6._0x2ad4b5))/0xa*(-parseInt(_0x2dd3e0(-_0x4c4ea6._0x4fdb86,-0x138,-_0x4c4ea6._0x550ae3,-_0x4c4ea6._0x7f3bdf))/0xb)+-parseInt(_0x2dd3e0(-0xea,-0x10c,-0x10d,-_0x4c4ea6._0x3f7c54))/0xc;if(_0x20f788===_0x48d07c)break;else _0x177eb9['push'](_0x177eb9['shift']());}catch(_0x25f36f){_0x177eb9['push'](_0x177eb9['shift']());}}}(_0x3cff,0x1f659));import{createAssistantTextMessage,createReasoningMessage,createToolResultUserMessage,createToolUseMessage,getToolUseBlocks,normalizeMessage,normalizeSystem,responseToAssistantMessage}from'./chunk-C6OLKGP6.js';function _0x20f596(_0xfa1bde,_0x1545ed,_0x82e391,_0x57b5c6){return _0x57bb(_0x82e391-0xf0,_0x57b5c6);}import{addAbortListener,isAbortError,throwIfAborted,toAbortError}from'./chunk-X7VAACWY.js';function isJsonObject(_0x16dc03){const _0x5d0843={_0x89c339:0x3bf,_0x1625df:0x3ec,_0x2888ec:0x291,_0x3719c4:0x2d8},_0x281eb3={_0x20564a:0x83},_0x162389={_0x50d061:0x1ac};function _0x56da98(_0x59ac93,_0x2bf6b5,_0x38c13a,_0xe5977f){return _0x57bb(_0x2bf6b5-_0x162389._0x50d061,_0xe5977f);}function _0x44faaa(_0x545bf3,_0x49f286,_0x1f3a66,_0x3fdabf){return _0x57bb(_0x3fdabf-_0x281eb3._0x20564a,_0x545bf3);}return typeof _0x16dc03===_0x56da98(0x3e4,_0x5d0843._0x89c339,0x3b9,_0x5d0843._0x1625df)&&_0x16dc03!==null&&!Array[_0x44faaa(_0x5d0843._0x2888ec,0x26d,_0x5d0843._0x3719c4,0x28c)](_0x16dc03);}function isToolOutputEnvelope(_0x362dcc){const _0x158303={_0x34be4c:0xbd,_0x198c43:0xbc,_0x4219b2:0xf7,_0xc1587b:0x91,_0x5dce82:0xc5,_0x72e3a0:0xdf,_0x965537:0x23a,_0x2adffc:0x20e,_0x265131:0x234},_0x8c4ad9={_0x56156a:0x22};if(typeof _0x362dcc!==_0x334bff(_0x158303._0x34be4c,0x10a,_0x158303._0x198c43,_0x158303._0x4219b2)||_0x362dcc===null||Array[_0x334bff(0xb3,_0x158303._0xc1587b,_0x158303._0x5dce82,_0x158303._0x72e3a0)](_0x362dcc))return![];if(typeof _0x362dcc[_0x927044(0x254,_0x158303._0x965537,_0x158303._0x2adffc,_0x158303._0x265131)]!=='string')return![];const _0x2d685=_0x362dcc['structured'];function _0x334bff(_0x2a1e3f,_0x503180,_0x4620bf,_0x16000f){return _0x57bb(_0x2a1e3f- -0x156,_0x4620bf);}function _0x927044(_0x103f65,_0x2eab6c,_0x56a61f,_0xe4215e){return _0x57bb(_0x2eab6c-_0x8c4ad9._0x56156a,_0xe4215e);}return _0x2d685===void 0x0||isJsonObject(_0x2d685);}function validateAgainstSchema(_0x431b2c,_0x2279b6,_0x3e0ac7){const _0x223ddd={_0x3bb25f:0x5a5,_0x3a4414:0x59d,_0x103d43:0x592,_0x44909b:0x5c5,_0x582aca:0x62b,_0x4e8d21:0x1,_0x369ba0:0x68,_0x6948ac:0x3e,_0x5dcc62:0x5ae,_0x4520ef:0x5d6,_0x7ae700:0x5da,_0x286479:0x5c8,_0x122175:0x4,_0x466897:0x28,_0x297871:0x51,_0x1630ca:0x41,_0x7fdcc3:0xc,_0x4b42b5:0x1e,_0x306f58:0x31,_0x45196b:0x5b2,_0x24dbbe:0x5eb,_0x733947:0x5c2,_0x3edab6:0x5e,_0x192717:0x3c,_0x1b2158:0x11,_0x43cf03:0x2c,_0x30b609:0x32,_0x1c9511:0x4,_0x4a6a27:0x5c3,_0x390a74:0x17,_0xee66e2:0x24,_0x5920f1:0x5f4,_0x2e65dd:0x5ac,_0x6b7b4d:0xc,_0x47d727:0xa,_0x4aa6d6:0x20,_0xd8089e:0x5c0,_0x5e4264:0x595,_0x16f320:0x5b0,_0x237ed4:0x5f1,_0x40b7db:0x5c9,_0x40c3e6:0x12,_0x2264cb:0x35,_0x31c21f:0x2b,_0x2c142b:0x609,_0x2d08c8:0x5df,_0x37263e:0x5d2,_0x2e79cd:0x5b5},_0x404bca={_0x575aa7:0x57,_0x5cf0b9:0x48},_0x1b9086={_0x2b4c96:0x21f},_0x420a3f={_0x26e9d6:0x3af};function _0x118ef5(_0x4deb8e,_0x2c3489,_0x1df75f,_0x1fa081){return _0x57bb(_0x2c3489-_0x420a3f._0x26e9d6,_0x1fa081);}function _0x211ae7(_0x2d991d,_0x225cfe,_0x42c4b0,_0x2bcf42){return _0x57bb(_0x42c4b0- -_0x1b9086._0x2b4c96,_0x225cfe);}switch(_0x3e0ac7[_0x118ef5(_0x223ddd._0x3bb25f,_0x223ddd._0x3a4414,_0x223ddd._0x103d43,_0x223ddd._0x44909b)]){case'string':if(typeof _0x2279b6!==_0x118ef5(0x606,0x620,_0x223ddd._0x582aca,0x61c))throw new Error(_0x211ae7(_0x223ddd._0x4e8d21,_0x223ddd._0x369ba0,0x1e,_0x223ddd._0x6948ac)+_0x431b2c+_0x118ef5(_0x223ddd._0x5dcc62,_0x223ddd._0x4520ef,_0x223ddd._0x7ae700,_0x223ddd._0x286479));return;case _0x211ae7(_0x223ddd._0x122175,0x16,-_0x223ddd._0x466897,-_0x223ddd._0x297871):if(typeof _0x2279b6!==_0x211ae7(-_0x223ddd._0x1630ca,0x23,-_0x223ddd._0x466897,-0x48))throw new Error(_0x211ae7(_0x223ddd._0x1630ca,-_0x223ddd._0x7fdcc3,_0x223ddd._0x4b42b5,_0x223ddd._0x306f58)+_0x431b2c+_0x118ef5(_0x223ddd._0x45196b,_0x223ddd._0x24dbbe,0x5dd,0x5be));return;case _0x118ef5(0x5ec,0x5ee,0x602,_0x223ddd._0x733947):if(typeof _0x2279b6!==_0x211ae7(_0x223ddd._0x3edab6,_0x223ddd._0x192717,0x20,_0x223ddd._0x1b2158))throw new Error(_0x211ae7(-0x2d,0x5d,0x1e,_0x223ddd._0x43cf03)+_0x431b2c+_0x211ae7(_0x223ddd._0x30b609,-0x43,_0x223ddd._0x1c9511,0x49));return;case _0x118ef5(0x632,0x60e,_0x223ddd._0x4a6a27,0x625):if(!Array['isArray'](_0x2279b6))throw new Error(_0x211ae7(-_0x223ddd._0x390a74,_0x223ddd._0xee66e2,_0x223ddd._0x4b42b5,-0x27)+_0x431b2c+_0x118ef5(_0x223ddd._0x5920f1,_0x223ddd._0x5dcc62,0x5bc,_0x223ddd._0x2e65dd));_0x2279b6[_0x211ae7(-_0x223ddd._0x6b7b4d,_0x223ddd._0x30b609,_0x223ddd._0x47d727,-_0x223ddd._0x4aa6d6)]((_0x3aeed4,_0xe4db3a)=>{const _0x5437f5={_0x57d364:0x1d0,_0x1cb681:0xba};function _0x35d665(_0x35ad8e,_0x5db9d,_0x490623,_0x2bd746){return _0x211ae7(_0x35ad8e-_0x5437f5._0x57d364,_0x490623,_0x5db9d-0x1,_0x2bd746-_0x5437f5._0x1cb681);}validateAgainstSchema(_0x431b2c+'['+_0xe4db3a+']',_0x3aeed4,_0x3e0ac7[_0x35d665(-0x2f,-0x37,-_0x404bca._0x575aa7,-_0x404bca._0x5cf0b9)]);});return;case'object':if(!isJsonObject(_0x2279b6))throw new Error('Invalid\x20tool\x20input\x20at\x20'+_0x431b2c+_0x118ef5(_0x223ddd._0xd8089e,0x588,_0x223ddd._0x5e4264,_0x223ddd._0x16f320));for(const _0x5547a7 of _0x3e0ac7[_0x211ae7(-0x45,-0x1d,0x9,0x10)]??[]){if(!(_0x5547a7 in _0x2279b6))throw new Error('Invalid\x20tool\x20input\x20at\x20'+_0x431b2c+_0x118ef5(_0x223ddd._0x237ed4,_0x223ddd._0x40b7db,0x5b7,0x5ab)+_0x5547a7+'\x22');}for(const [_0x3096aa,_0x16ecf8]of Object[_0x211ae7(-_0x223ddd._0x40c3e6,0x1e,_0x223ddd._0x2264cb,_0x223ddd._0x31c21f)](_0x3e0ac7[_0x118ef5(_0x223ddd._0x2c142b,_0x223ddd._0x2d08c8,_0x223ddd._0x37263e,_0x223ddd._0x2e79cd)])){_0x3096aa in _0x2279b6&&validateAgainstSchema(_0x431b2c+'.'+_0x3096aa,_0x2279b6[_0x3096aa],_0x16ecf8);}}}function normalizeToolOutputValue(_0x504606){const _0x5b7d15={_0x724001:0x589,_0x16f50b:0x5b4,_0x30eeea:0x5f9,_0x2fb053:0x552,_0x587b9c:0x573,_0xbaa5a6:0x56a,_0x45a579:0x577,_0x271314:0x13c,_0xec0445:0x16d,_0x48df89:0x1cb,_0x388ab8:0x53a,_0x57d160:0x52f,_0x3c66e6:0x1ae,_0x19d90f:0x142,_0x3f811f:0x14d,_0x21a9b8:0x1a8,_0x34d917:0x171,_0x487c1a:0x16a},_0x27d9cc={_0x271e15:0x3de};if(isToolOutputEnvelope(_0x504606))return{'output':_0x504606['output'],'structured':_0x504606[_0x319912(0x57f,_0x5b7d15._0x724001,_0x5b7d15._0x16f50b,_0x5b7d15._0x30eeea)]??{'value':_0x504606[_0x319912(_0x5b7d15._0x2fb053,_0x5b7d15._0x587b9c,_0x5b7d15._0xbaa5a6,_0x5b7d15._0x45a579)]}};function _0x319912(_0x3c3376,_0x3ae4c4,_0x19e101,_0x563790){return _0x57bb(_0x19e101-0x352,_0x3ae4c4);}function _0x3a5d26(_0x8b6119,_0x2f84f1,_0x3d7608,_0x425d79){return _0x57bb(_0x3d7608- -_0x27d9cc._0x271e15,_0x425d79);}if(typeof _0x504606===_0x3a5d26(-0x13c,-_0x5b7d15._0x271314,-_0x5b7d15._0xec0445,-0x16a))return{'output':_0x504606,'structured':{'value':_0x504606}};if(typeof _0x504606===_0x3a5d26(-0x18c,-0x1df,-_0x5b7d15._0x48df89,-0x1a0)&&_0x504606!==null&&!Array[_0x319912(_0x5b7d15._0x388ab8,_0x5b7d15._0x57d160,0x55b,0x5a2)](_0x504606))return{'output':JSON[_0x3a5d26(-0x141,-_0x5b7d15._0x3c66e6,-0x171,-_0x5b7d15._0x19d90f)](_0x504606,null,0x2),'structured':_0x504606};return{'output':JSON[_0x3a5d26(-_0x5b7d15._0x3f811f,-_0x5b7d15._0x21a9b8,-_0x5b7d15._0x34d917,-_0x5b7d15._0x487c1a)](_0x504606,null,0x2),'structured':{'value':_0x504606}};}function createToolOutput(_0x1ad38a,_0x52a661={'value':_0x1ad38a}){return{'output':_0x1ad38a,'structured':_0x52a661};}function _0x329fcd(_0x298d71,_0x4b271e,_0x3a5afa,_0x69486b){const _0x4106c6={_0x1d7451:0x10f};return _0x57bb(_0x298d71-_0x4106c6._0x1d7451,_0x69486b);}var ToolExecutionError=class extends Error{[_0x20f596(0x356,0x349,0x352,0x329)];constructor(_0x297da3,_0x26d006={}){const _0x4c7444={_0x4798ac:0x297,_0x302f80:0x26e,_0x5ee64b:0x2a2,_0x204c59:0x50c,_0x498a00:0x520,_0x1d08d8:0x33f,_0x269a0c:0x2f6},_0x547d29={_0x69a769:0x18f,_0x46de58:0x83},_0x519223={_0xbcea1b:0x70};super(_0x297da3);function _0x4cfb13(_0x990480,_0x43cea6,_0x4eb677,_0x322820){return _0x20f596(_0x990480-0x1b1,_0x43cea6-_0x519223._0xbcea1b,_0x322820-0x260,_0x4eb677);}function _0x2a9dbf(_0x1809f8,_0x30c9e7,_0x433300,_0xe9f2c5){return _0x20f596(_0x1809f8-_0x547d29._0x69a769,_0x30c9e7-_0x547d29._0x46de58,_0xe9f2c5- -0x5c,_0x433300);}this[_0x2a9dbf(_0x4c7444._0x4798ac,0x25c,_0x4c7444._0x302f80,_0x4c7444._0x5ee64b)]=_0x4cfb13(0x4e9,_0x4c7444._0x204c59,_0x4c7444._0x498a00,0x530),this[_0x2a9dbf(_0x4c7444._0x1d08d8,0x2c5,0x33c,_0x4c7444._0x269a0c)]=_0x26d006;}};function defineTool(_0x5da01a){return _0x5da01a;}var ToolRegistry=class{['toolsByName']=new Map();constructor(_0x2a664f=[]){for(const _0x18ef71 of _0x2a664f){this['register'](_0x18ef71);}}[_0x329fcd(0x325,0x346,0x303,0x339)](_0x64557c){const _0x5c8ae3={_0xd75411:0x278,_0x4c4312:0x25b,_0x3f40ad:0x259,_0x559daf:0x232,_0x2e7d2a:0x213,_0x2901c0:0x212},_0x551774={_0x47798f:0xae};function _0x18ab5b(_0x938e6b,_0x4aa110,_0x572b24,_0x13c9f4){return _0x20f596(_0x938e6b-_0x551774._0x47798f,_0x4aa110-0x147,_0x13c9f4- -0xc5,_0x572b24);}function _0x358986(_0x86544a,_0x52440d,_0x140b09,_0x48d7e0){return _0x20f596(_0x86544a-0x5c,_0x52440d-0x11e,_0x140b09- -0x110,_0x48d7e0);}this['toolsByName'][_0x18ab5b(_0x5c8ae3._0xd75411,_0x5c8ae3._0x4c4312,_0x5c8ae3._0x3f40ad,_0x5c8ae3._0x559daf)](_0x64557c[_0x18ab5b(_0x5c8ae3._0x2e7d2a,_0x5c8ae3._0x2901c0,0x269,0x239)],_0x64557c);}[_0x20f596(0x30a,0x31f,0x31d,0x365)](_0x349cfc){const _0x279e02={_0x90421c:0xaa,_0xc80e6a:0xc7,_0x43fe97:0xce,_0x3dd5fe:0xbc},_0x1aba4a={_0x3bcfa0:0x235};function _0x2c0d30(_0x232da2,_0x445abf,_0x482c04,_0x42f751){return _0x20f596(_0x232da2-0x10c,_0x445abf-0x1e7,_0x445abf-0xaa,_0x232da2);}function _0xc3ecd(_0x36ef64,_0x6e2619,_0x5ab7cc,_0x4fe9f1){return _0x20f596(_0x36ef64-0x48,_0x6e2619-0x32,_0x36ef64- -_0x1aba4a._0x3bcfa0,_0x6e2619);}return this[_0xc3ecd(_0x279e02._0x90421c,0xb4,_0x279e02._0xc80e6a,_0x279e02._0x43fe97)][_0xc3ecd(0xe8,_0x279e02._0x3dd5fe,0xb8,0x133)](_0x349cfc);}[_0x329fcd(0x2ee,0x331,0x2de,0x304)](){const _0x171f36={_0x127cbd:0x1d0,_0x3a5fd3:0x1f1,_0x34e3eb:0x20e,_0x5392a4:0x226},_0x59f1b2={_0x5784c0:0x12a,_0x168579:0xe1,_0xcb3145:0x18f},_0x17ce00={_0x206e02:0x105};function _0x684f00(_0x1cd37a,_0x213654,_0x1f604d,_0x3a254f){return _0x329fcd(_0x3a254f- -0x4ef,_0x213654-0x1ca,_0x1f604d-_0x17ce00._0x206e02,_0x1f604d);}function _0x54738f(_0x40a052,_0x3308b6,_0x61f4ea,_0x25a1e6){return _0x329fcd(_0x40a052-_0x59f1b2._0x5784c0,_0x3308b6-_0x59f1b2._0x168579,_0x61f4ea-_0x59f1b2._0xcb3145,_0x3308b6);}return[...this[_0x684f00(-_0x171f36._0x127cbd,-0x1e4,-0x1e6,-_0x171f36._0x3a5fd3)][_0x684f00(-_0x171f36._0x34e3eb,-_0x171f36._0x5392a4,-0x235,-0x1f8)]()];}[_0x20f596(0x31e,0x301,0x34e,0x335)](){const _0x3cedb9={_0x49ba25:0x3be,_0x172fb6:0x3c9,_0x3ab343:0x3ee},_0x468c92={_0x5843e9:0x4bd,_0x34dada:0x2eb,_0x3aa397:0x307,_0xf791a8:0x2d9},_0x33aee3={_0xeb7bc9:0x1d4},_0x371e2c={_0x41b3a5:0x16d},_0x46c648={_0x5f478c:0xc1,_0x46a256:0x9c};function _0x55cce9(_0x1de641,_0x393b3d,_0x4e5f31,_0x1bb1ed){return _0x329fcd(_0x393b3d-_0x46c648._0x5f478c,_0x393b3d-_0x46c648._0x46a256,_0x4e5f31-0x1ab,_0x1bb1ed);}function _0x3deb01(_0x297723,_0x49c754,_0x5b34c0,_0x1f4134){return _0x329fcd(_0x5b34c0- -0x1bb,_0x49c754-_0x371e2c._0x41b3a5,_0x5b34c0-0x13f,_0x297723);}return this[_0x55cce9(_0x3cedb9._0x49ba25,0x3af,_0x3cedb9._0x172fb6,0x3f4)]()[_0x55cce9(0x3d4,_0x3cedb9._0x3ab343,0x3e2,0x3be)](_0x58dfc6=>{const _0x11c069={_0x2bb6f4:0x340};function _0x1fd1d7(_0x11056b,_0x5b53bd,_0x4207ad,_0x2acbab){return _0x3deb01(_0x5b53bd,_0x5b53bd-_0x33aee3._0xeb7bc9,_0x4207ad-0x172,_0x2acbab-0xd1);}function _0x62c0ff(_0x522ac0,_0x1acdc1,_0x4c3b51,_0x481837){return _0x3deb01(_0x1acdc1,_0x1acdc1-0xd9,_0x4c3b51-_0x11c069._0x2bb6f4,_0x481837-0x19d);}return{'name':_0x58dfc6[_0x62c0ff(0x4b5,_0x468c92._0x5843e9,0x4a2,0x461)],'description':_0x58dfc6[_0x62c0ff(0x4f3,0x4a2,0x4d8,0x494)],'input_schema':_0x58dfc6[_0x1fd1d7(_0x468c92._0x34dada,0x2c4,_0x468c92._0x3aa397,_0x468c92._0xf791a8)]};});}};function validateToolInput(_0x48aadb,_0x5ca014){return validateAgainstSchema('input',_0x48aadb,_0x5ca014),_0x48aadb;}function deriveFinalToolOutput(_0x5bfff3){const _0x2acfb8={_0x3c0040:0x3ed,_0x3be848:0x3e2,_0x2f4e9e:0x2ad,_0x43fdc0:0x29f,_0x42fa8d:0x2e4,_0x123f37:0x2a9,_0x44ad12:0x47e,_0x525176:0x325,_0x12d635:0x354,_0x202a1a:0x307},_0x1e6ffd={_0x4c14dc:0x140},_0x1d7984={_0x5ed336:0x177};if(_0x5bfff3[_0x5661a2(0x3b4,0x3f1,0x415,_0x2acfb8._0x3c0040)]===0x0)return{'output':'','structured':{}};if(_0x5bfff3[_0x5661a2(_0x2acfb8._0x3be848,0x3f1,0x432,0x3fa)]===0x1)return{'output':_0x5bfff3[0x0][_0x3db7cb(_0x2acfb8._0x2f4e9e,_0x2acfb8._0x43fdc0,_0x2acfb8._0x42fa8d,_0x2acfb8._0x123f37)],'structured':_0x5bfff3[0x0][_0x5661a2(0x403,0x450,_0x2acfb8._0x44ad12,0x451)]};function _0x3db7cb(_0x1fe38c,_0x16fe4c,_0x2c376e,_0x551316){return _0x329fcd(_0x2c376e- -0x43,_0x16fe4c-_0x1d7984._0x5ed336,_0x2c376e-0x60,_0x16fe4c);}function _0x5661a2(_0x438072,_0xfd591b,_0x3784e3,_0x377c47){return _0x329fcd(_0xfd591b-0xdf,_0xfd591b-_0x1e6ffd._0x4c14dc,_0x3784e3-0xcd,_0x438072);}return{'output':_0x5bfff3['map'](_0x41a936=>_0x41a936['output'])[_0x3db7cb(_0x2acfb8._0x525176,_0x2acfb8._0x12d635,_0x2acfb8._0x202a1a,0x2f4)](''),'structured':{'chunks':_0x5bfff3['map'](_0x3ba7f9=>_0x3ba7f9['structured'])}};}function createToolMeta(){return{'transforms':[]};}function createErrorToolResult(_0x2785aa,_0x138ae5,_0x9b47ee,_0x26d334=[]){const _0x52195e={_0xf4d886:0x1e0,_0x33e5c7:0x21f},_0x171397={_0x241ec8:0x192,_0x24a996:0xff},_0xf57fdf={_0x525bd6:0xb0,_0x23c835:0x1e9};function _0xc3362b(_0x5150d8,_0x4cdb3f,_0x431eb0,_0x5c4001){return _0x329fcd(_0x4cdb3f- -0x4d8,_0x4cdb3f-_0xf57fdf._0x525bd6,_0x431eb0-_0xf57fdf._0x23c835,_0x5150d8);}function _0x56d93e(_0x133adf,_0x2773fe,_0x131a83,_0x39197b){return _0x329fcd(_0x131a83- -0x390,_0x2773fe-_0x171397._0x241ec8,_0x131a83-_0x171397._0x24a996,_0x2773fe);}return{'callId':_0x2785aa['id'],'toolName':_0x2785aa[_0x56d93e(-0x39,-0x8c,-0x73,-0x2c)],'status':_0xc3362b(-0x203,-_0x52195e._0xf4d886,-0x1da,-_0x52195e._0x33e5c7),'output':_0x138ae5,'structured':_0x9b47ee,'chunks':_0x26d334,'meta':createToolMeta()};}function _0x57bb(_0x25febb,_0x519225){_0x25febb=_0x25febb-0x1d9;const _0x3cffbc=_0x3cff();let _0x57bba4=_0x3cffbc[_0x25febb];if(_0x57bb['xNcnYC']===undefined){var _0x362e33=function(_0x1e4e74){const _0x4dc738='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x16dc03='',_0x362dcc='';for(let _0x2d685=0x0,_0x431b2c,_0x2279b6,_0x3e0ac7=0x0;_0x2279b6=_0x1e4e74['charAt'](_0x3e0ac7++);~_0x2279b6&&(_0x431b2c=_0x2d685%0x4?_0x431b2c*0x40+_0x2279b6:_0x2279b6,_0x2d685++%0x4)?_0x16dc03+=String['fromCharCode'](0xff&_0x431b2c>>(-0x2*_0x2d685&0x6)):0x0){_0x2279b6=_0x4dc738['indexOf'](_0x2279b6);}for(let _0x3aeed4=0x0,_0xe4db3a=_0x16dc03['length'];_0x3aeed4<_0xe4db3a;_0x3aeed4++){_0x362dcc+='%'+('00'+_0x16dc03['charCodeAt'](_0x3aeed4)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x362dcc);};_0x57bb['AsYzJq']=_0x362e33,_0x57bb['UqgHRX']={},_0x57bb['xNcnYC']=!![];}const _0x319797=_0x3cffbc[0x0],_0x2b46a7=_0x25febb+_0x319797,_0x369468=_0x57bb['UqgHRX'][_0x2b46a7];return!_0x369468?(_0x57bba4=_0x57bb['AsYzJq'](_0x57bba4),_0x57bb['UqgHRX'][_0x2b46a7]=_0x57bba4):_0x57bba4=_0x369468,_0x57bba4;}function createRejectedToolResult(_0x201d35,_0x23118f){const _0x2bce71={_0x5ae795:0x73,_0x5709e1:0x2a,_0x48325b:0xb4,_0x110f59:0xf2,_0x106dc9:0xc6,_0x5e09cc:0x7b,_0xaffbed:0xaa,_0x189274:0x76,_0x92a699:0x94,_0x5402ad:0x24,_0x14e850:0x5f,_0xe82f91:0x7d,_0x3bf5f7:0x125},_0x1eb09b={_0x2cca87:0x94},_0x28d7b7={_0x1968cf:0xd1};function _0x29fa22(_0x4a7b18,_0x11a55a,_0x36ab86,_0x5935ee){return _0x329fcd(_0x5935ee- -0x407,_0x11a55a-0x18e,_0x36ab86-_0x28d7b7._0x1968cf,_0x4a7b18);}function _0x693769(_0x4504e9,_0xbf4ac5,_0x405cb3,_0x190bef){return _0x20f596(_0x4504e9-0x120,_0xbf4ac5-_0x1eb09b._0x2cca87,_0x4504e9- -0x28a,_0x405cb3);}const _0x989915=_0x23118f?.[_0x693769(0x53,0x8b,0x3a,0x9e)]()[_0x693769(0x69,_0x2bce71._0x5ae795,_0x2bce71._0x5709e1,0xac)]?_0x23118f:_0x29fa22(-_0x2bce71._0x48325b,-0x107,-_0x2bce71._0x110f59,-_0x2bce71._0x106dc9)+_0x201d35['name'];return createErrorToolResult(_0x201d35,_0x989915,{'error':_0x29fa22(-_0x2bce71._0x5e09cc,-_0x2bce71._0xaffbed,-_0x2bce71._0x189274,-_0x2bce71._0x92a699),..._0x23118f?.[_0x693769(0x53,_0x2bce71._0x5402ad,_0x2bce71._0x14e850,_0x2bce71._0xe82f91)]()[_0x29fa22(-_0x2bce71._0x3bf5f7,-0x117,-0x10d,-0xf5)]?{'reason':_0x23118f}:{}});}function createAbortedToolResult(_0x3e349c,_0x4aa9f1,_0x514674=[]){const _0x2b3509={_0x245560:0x1b2,_0x447343:0x13b},_0x271154={_0x22d088:0x482,_0x1a07fd:0x137,_0x2b6745:0x44},_0x22b45b={_0x1fb700:0x3b1,_0x5dfdc7:0x196,_0x145f57:0x199};function _0x2c05f7(_0xb36dbb,_0x409bf7,_0x175ffc,_0x54bf81){return _0x329fcd(_0xb36dbb- -_0x22b45b._0x1fb700,_0x409bf7-_0x22b45b._0x5dfdc7,_0x175ffc-_0x22b45b._0x145f57,_0x175ffc);}function _0x211e00(_0x507a2a,_0x9998a8,_0x5b9925,_0x27c840){return _0x329fcd(_0x27c840- -_0x271154._0x22d088,_0x9998a8-_0x271154._0x1a07fd,_0x5b9925-_0x271154._0x2b6745,_0x9998a8);}const _0x2d14f3=toAbortError(_0x4aa9f1);return createErrorToolResult(_0x3e349c,_0x2d14f3[_0x211e00(-0x178,-0x13c,-0x154,-0x16e)],{'error':_0x2d14f3[_0x211e00(-_0x2b3509._0x245560,-_0x2b3509._0x447343,-0x16e,-0x16e)],'aborted':!![]},_0x514674);}function createSuccessToolResult(_0x141cc7,_0x3c5933,_0xe137b2){const _0x5a6804={_0x2d0039:0x374,_0x36d7c9:0x3b5,_0x3977b4:0x37e,_0x2f52d8:0x331},_0x5596ec={_0xd62a0f:0x11d};function _0xe4379b(_0x5ddb7f,_0x1a68a4,_0x19200f,_0x46722f){return _0x329fcd(_0x5ddb7f-0x57,_0x1a68a4-_0x5596ec._0xd62a0f,_0x19200f-0x156,_0x19200f);}function _0x5c63f1(_0x2935d3,_0x535385,_0x29a51d,_0x5695c7){return _0x329fcd(_0x2935d3- -0x2fa,_0x535385-0x96,_0x29a51d-0x14b,_0x29a51d);}return{'callId':_0x141cc7['id'],'toolName':_0x141cc7[_0xe4379b(_0x5a6804._0x2d0039,0x349,_0x5a6804._0x36d7c9,0x373)],'status':'ok','output':_0x3c5933[_0xe4379b(_0x5a6804._0x3977b4,_0x5a6804._0x2f52d8,0x33e,0x344)],'structured':_0x3c5933['structured'],'chunks':_0xe137b2,'meta':createToolMeta()};}function createUnknownToolResult(_0x52b252){const _0x431599={_0x5ba484:0x1c3,_0x1a5e05:0x1b3,_0x5f2282:0x1e9,_0x16f8a2:0x204,_0x45d966:0x1e7},_0x140c98={_0x4b913c:0xe5,_0x36d016:0x44};function _0x13da5d(_0x44bab9,_0x3d7d41,_0x13cc5d,_0x7a5f14){return _0x20f596(_0x44bab9-_0x140c98._0x4b913c,_0x3d7d41-_0x140c98._0x36d016,_0x44bab9- -0x108,_0x13cc5d);}function _0x183c12(_0xcf4590,_0x77903c,_0x52fe45,_0x31c47e){return _0x20f596(_0xcf4590-0xc2,_0x77903c-0x18c,_0x52fe45- -0xfe,_0x31c47e);}return createErrorToolResult(_0x52b252,_0x13da5d(_0x431599._0x5ba484,0x1d9,_0x431599._0x1a5e05,0x1bc)+_0x52b252[_0x183c12(0x202,0x1cf,0x200,0x23c)],{'error':_0x13da5d(_0x431599._0x5f2282,_0x431599._0x16f8a2,0x212,_0x431599._0x45d966)});}function isDispatchDecision(_0x26f582){const _0x39ee03={_0x14d176:0x4c3,_0x41bbb4:0x491,_0x21fe73:0x4d5,_0x57d684:0x4a8,_0x590567:0x4cf},_0x325d73={_0x5b5152:0x2c,_0x170df2:0x6,_0x22d18a:0x274};function _0x2d6071(_0x28f076,_0x335e84,_0x5d2167,_0x17dfd4){return _0x20f596(_0x28f076-_0x325d73._0x5b5152,_0x335e84-_0x325d73._0x170df2,_0x28f076-_0x325d73._0x22d18a,_0x17dfd4);}function _0x4363c7(_0x106586,_0x4633e8,_0x221058,_0x1ff7f6){return _0x329fcd(_0x4633e8-0x180,_0x4633e8-0x103,_0x221058-0x1ed,_0x221058);}if(typeof _0x26f582!==_0x4363c7(0x4ea,0x4a2,0x477,_0x39ee03._0x14d176)||_0x26f582===null)return![];return _0x26f582[_0x4363c7(_0x39ee03._0x41bbb4,0x4a8,_0x39ee03._0x21fe73,0x4b6)]==='reject'||_0x26f582[_0x4363c7(0x47f,_0x39ee03._0x57d684,_0x39ee03._0x590567,0x4e3)]==='run';}function normalizeExecutionError(_0x577c84){const _0x16b1fa={_0x305a82:0x163,_0x414726:0x177,_0x18ffc7:0x1de,_0x227026:0x176,_0x403c05:0x18f,_0x58373b:0x183},_0x16496c={_0x5ac49d:0xf4},_0x1a4dd6={_0x21d9c4:0x192};function _0x2bda84(_0x59fd11,_0x30b46c,_0x32bc50,_0x548636){return _0x20f596(_0x59fd11-0x118,_0x30b46c-0x1c6,_0x30b46c- -_0x1a4dd6._0x21d9c4,_0x32bc50);}if(_0x577c84 instanceof ToolExecutionError)return{'errorMessage':_0x577c84[_0x2bda84(0x116,_0x16b1fa._0x305a82,_0x16b1fa._0x414726,0x1a9)],'structured':{'error':_0x577c84[_0x44e487(-0x14e,-0x158,-0x183,-0x15d)],..._0x577c84[_0x2bda84(_0x16b1fa._0x18ffc7,0x1c0,_0x16b1fa._0x227026,0x205)]}};if(_0x577c84 instanceof Error)return{'errorMessage':_0x577c84['message'],'structured':{'error':_0x577c84[_0x44e487(-0x1c6,-_0x16b1fa._0x403c05,-_0x16b1fa._0x58373b,-0x168)]}};function _0x44e487(_0x4eafce,_0x435ca4,_0x23b9ad,_0x51806e){return _0x329fcd(_0x23b9ad- -0x497,_0x435ca4-0x195,_0x23b9ad-_0x16496c._0x5ac49d,_0x435ca4);}const _0x4a84b8=String(_0x577c84);return{'errorMessage':_0x4a84b8,'structured':{'error':_0x4a84b8}};}async function emitEvent(_0x225840,_0x29ddc5,_0x23e454){await _0x225840?.(_0x29ddc5,_0x23e454);}async function resolveDispatchDecision(_0x5511db,_0x1fd54f,_0x5f43b5){const _0x360e22={_0x2faf9c:0x84,_0x41528d:0x117,_0x154d65:0xb3,_0x222cf1:0x99,_0x138874:0x93,_0x5c3684:0xa4,_0x3c4a6b:0xac,_0x4aac1f:0xe4,_0x3b0aaf:0x105,_0xcb8a0:0xb9,_0x71f150:0x90},_0x333e06={_0x441874:0x154,_0x369fb9:0x36,_0x1b890c:0x3df},_0x2d9c16={_0x4c40b0:0x7d,_0x4b513f:0x56,_0x53c172:0x94,_0x8f4d09:0x27,_0x372999:0x1,_0xc574d2:0x6a},_0x5e619c={_0x43a02a:0xf3,_0x40ad90:0x53},_0x570baa={_0x3e689f:0x170},_0x1280b5={_0x559159:0x28d,_0x5ccc1a:0x1c8,_0x2b4624:0xfb};if(!_0x5511db)return{'action':'run'};function _0x2c1706(_0x208b09,_0x579280,_0x2c85d1,_0xea0391){return _0x329fcd(_0xea0391- -_0x1280b5._0x559159,_0x579280-_0x1280b5._0x5ccc1a,_0x2c85d1-_0x1280b5._0x2b4624,_0x579280);}const _0x2c0932=Promise[_0x2c1706(0x5f,_0x360e22._0x2faf9c,0x78,_0x360e22._0x2faf9c)]()[_0x2c1706(_0x360e22._0x41528d,0x143,0x11c,0xf5)](()=>_0x5511db(_0x1fd54f,_0x5f43b5));if(!_0x5f43b5[_0x3dc2a6(-0xa1,-_0x360e22._0x154d65,-_0x360e22._0x222cf1,-_0x360e22._0x138874)]){const _0x215a95=await _0x2c0932;return isDispatchDecision(_0x215a95)?_0x215a95:{'action':_0x2c1706(0xfa,0xf3,_0x360e22._0x5c3684,_0x360e22._0x3c4a6b)};}const _0x3f91b0=new Promise((_0x17b73c,_0x3612dd)=>{const _0x369ba1={_0x3c73fd:0x392,_0x5ebef3:0x336,_0x538b05:0x352,_0xef2ad4:0x3aa},_0x22b329={_0x5ee358:0x155},_0x11ea1a=()=>{const _0x10bf9d={_0x4d2d72:0x3a9};function _0x6f4def(_0x520326,_0x11a129,_0x5ec2b5,_0x1c6d88){return _0x57bb(_0x520326-_0x22b329._0x5ee358,_0x11a129);}function _0x22f464(_0x2ff6a5,_0x3d5dcf,_0x3d0f4e,_0x783418){return _0x57bb(_0x3d5dcf-_0x10bf9d._0x4d2d72,_0x2ff6a5);}_0x5f43b5['signal']?.['removeEventListener'](_0x6f4def(0x369,_0x369ba1._0x3c73fd,_0x369ba1._0x5ebef3,_0x369ba1._0x538b05),_0x11ea1a),_0x3612dd(toAbortError(_0x5f43b5['signal']?.[_0x6f4def(_0x369ba1._0xef2ad4,0x372,0x3b8,0x3db)]));};function _0x5ba737(_0x2b901e,_0x37812c,_0x2fdd08,_0x32408c){return _0x3dc2a6(_0x32408c-0x592,_0x37812c,_0x2fdd08-0x8b,_0x32408c-_0x570baa._0x3e689f);}function _0x35025b(_0x22d37a,_0x9f73e1,_0xf52a3d,_0x30d077){return _0x2c1706(_0x22d37a-0x3e,_0x9f73e1,_0xf52a3d-_0x5e619c._0x43a02a,_0x22d37a- -_0x5e619c._0x40ad90);}if(_0x5f43b5[_0x35025b(_0x2d9c16._0x4c40b0,_0x2d9c16._0x4b513f,0xa8,0x4e)]?.['aborted']){_0x3612dd(toAbortError(_0x5f43b5[_0x5ba737(0x4f4,0x4bd,0x4e7,0x4f1)][_0x35025b(0x84,0x36,_0x2d9c16._0x53c172,0x5b)]));return;}_0x5f43b5[_0x35025b(0x7d,0x8d,0x46,0xcb)]?.[_0x35025b(_0x2d9c16._0x8f4d09,-_0x2d9c16._0x372999,_0x2d9c16._0xc574d2,-0x1a)]('abort',_0x11ea1a,{'once':!![]});});function _0x3dc2a6(_0x55c54c,_0x445390,_0x5289a8,_0xcdf4ed){return _0x20f596(_0x55c54c-_0x333e06._0x441874,_0x445390-_0x333e06._0x369fb9,_0x55c54c- -_0x333e06._0x1b890c,_0x445390);}const _0x11e15e=await Promise[_0x3dc2a6(-0x10b,-0x13a,-_0x360e22._0x4aac1f,-_0x360e22._0x3b0aaf)]([_0x2c0932,_0x3f91b0]);return isDispatchDecision(_0x11e15e)?_0x11e15e:{'action':_0x3dc2a6(-0xc5,-_0x360e22._0xcb8a0,-_0x360e22._0x71f150,-0xeb)};}async function executeToolCall(_0x55b476,_0xa4d144,_0x5291a9,_0x2b9399,_0x1c21a1){const _0x37fb57={_0x5ed07b:0x382,_0x5ac903:0x369,_0x11e570:0x3fe,_0x1b89ad:0x443,_0x154e51:0x3c6,_0x5ca290:0x43a,_0x258a33:0x41e,_0x1cc22b:0x398,_0x297a11:0x38e,_0x1e199e:0x34c,_0x1325ff:0x412,_0x5ca298:0x42c,_0x3350b4:0x3d4,_0x2e27b0:0x413,_0x285d35:0x39f,_0x28e54f:0x397,_0x2d615e:0x44e,_0x4630b2:0x433,_0x1719f2:0x463,_0x831629:0x416,_0x355769:0x40d,_0x5935a4:0x434,_0x260866:0x403,_0x3c3499:0x382,_0x3878e0:0x3bd,_0x12cac2:0x3bc,_0x2b494b:0x376,_0x451d7c:0x3ba,_0x4f5113:0x3b2,_0x402a77:0x494,_0x31fbb2:0x414,_0x18723d:0x375,_0x5deb67:0x337,_0x1e41b1:0x47e,_0x5978df:0x441,_0x3515b5:0x469,_0x2b53dd:0x457,_0x4444af:0x40e,_0x4427bd:0x37f,_0xdab0e1:0x430,_0x239379:0x46d,_0x1f37e6:0x3eb},_0xf9a159={_0x1d3ca5:0x100,_0x540d7d:0xf3,_0x9ec810:0xd9,_0x2dc16c:0x150,_0x5d33ab:0xfc,_0x257a75:0x108},_0x1b03a5={_0x28b844:0x12d,_0x809bdb:0x1e5},_0x187fc4={_0x2a7b30:0x4b},_0xd29d3b={_0x384445:0x1e4,_0x1c512f:0xf5},_0x527724={..._0x5291a9,'toolCallId':_0xa4d144['id']};throwIfAborted(_0x527724[_0x18ad42(0x394,_0x37fb57._0x5ed07b,_0x37fb57._0x5ac903,0x3bd)]);const _0x368ab9=await resolveDispatchDecision(_0x2b9399,_0xa4d144,_0x527724);throwIfAborted(_0x527724['signal']);if(_0x368ab9[_0x15e6e4(_0x37fb57._0x11e570,0x427,0x3b2,_0x37fb57._0x1b89ad)]===_0x18ad42(0x394,0x39b,0x3a8,_0x37fb57._0x154e51)){const _0x157f1f=createRejectedToolResult(_0xa4d144,_0x368ab9[_0x15e6e4(_0x37fb57._0x5ca290,0x453,_0x37fb57._0x258a33,0x43c)]);return await emitEvent(_0x1c21a1,{'type':_0x18ad42(0x3cd,_0x37fb57._0x1cc22b,_0x37fb57._0x297a11,_0x37fb57._0x1e199e),'toolCall':_0xa4d144,'result':_0x157f1f},_0x527724),_0x157f1f;}const _0x2107f2=_0x55b476[_0x15e6e4(_0x37fb57._0x1325ff,0x40b,_0x37fb57._0x1325ff,0x439)](_0xa4d144[_0x15e6e4(0x3f3,_0x37fb57._0x5ca298,_0x37fb57._0x3350b4,_0x37fb57._0x2e27b0)]);function _0x15e6e4(_0x3734d6,_0x3138f0,_0x3c38bb,_0x2cf2fc){return _0x20f596(_0x3734d6-_0xd29d3b._0x384445,_0x3138f0-0xf5,_0x3734d6-_0xd29d3b._0x1c512f,_0x2cf2fc);}if(!_0x2107f2){const _0xc303c1=createUnknownToolResult(_0xa4d144);return await emitEvent(_0x1c21a1,{'type':'tool_completed','toolCall':_0xa4d144,'result':_0xc303c1},_0x527724),_0xc303c1;}throwIfAborted(_0x527724[_0x18ad42(_0x37fb57._0x285d35,_0x37fb57._0x5ed07b,0x3ca,_0x37fb57._0x28e54f)]);function _0x18ad42(_0x328b6a,_0xdca9d6,_0x2c36c9,_0x18af3d){return _0x329fcd(_0xdca9d6-0x25,_0xdca9d6-0x19f,_0x2c36c9-_0x187fc4._0x2a7b30,_0x18af3d);}await emitEvent(_0x1c21a1,{'type':_0x15e6e4(0x41c,0x465,_0x37fb57._0x2d615e,0x3fb),'toolCall':_0xa4d144},_0x527724);try{throwIfAborted(_0x527724[_0x15e6e4(_0x37fb57._0x4630b2,_0x37fb57._0x1719f2,_0x37fb57._0x2e27b0,_0x37fb57._0x831629)]);const _0x44d6cd=validateToolInput(_0xa4d144[_0x18ad42(0x361,0x31a,0x2cc,0x305)],_0x2107f2[_0x15e6e4(0x426,0x42f,_0x37fb57._0x355769,0x3ed)]),_0x57dcd3=await _0x2107f2[_0x15e6e4(_0x37fb57._0x5935a4,0x40f,0x40e,_0x37fb57._0x260866)](_0x44d6cd,_0x527724),_0x3e26a2=[],_0x235f44=addAbortListener(_0x527724['signal'],()=>{const _0x384c31={_0x591dc4:0x123,_0x366a9b:0x199};function _0x4a9110(_0x40e2da,_0x473bc6,_0x2a2c3e,_0x20a944){return _0x15e6e4(_0x2a2c3e- -0x567,_0x473bc6-_0x1b03a5._0x28b844,_0x2a2c3e-_0x1b03a5._0x809bdb,_0x473bc6);}function _0x24ce45(_0x209b16,_0x406c08,_0x3eefe8,_0x434896){return _0x18ad42(_0x209b16-_0x384c31._0x591dc4,_0x434896- -0x419,_0x3eefe8-_0x384c31._0x366a9b,_0x3eefe8);}void _0x57dcd3[_0x4a9110(-0x11e,-_0xf9a159._0x1d3ca5,-0x10e,-_0xf9a159._0x540d7d)](void 0x0)[_0x24ce45(-_0xf9a159._0x9ec810,-_0xf9a159._0x2dc16c,-_0xf9a159._0x5d33ab,-_0xf9a159._0x257a75)](()=>{});});try{throwIfAborted(_0x527724[_0x18ad42(0x3d0,_0x37fb57._0x3c3499,0x3c7,_0x37fb57._0x3878e0)]);let _0x1bb671=await _0x57dcd3[_0x18ad42(_0x37fb57._0x12cac2,_0x37fb57._0x2b494b,_0x37fb57._0x451d7c,0x3b8)]();while(!_0x1bb671[_0x15e6e4(0x3e3,0x3c0,_0x37fb57._0x4f5113,0x3f3)]){throwIfAborted(_0x527724['signal']);const _0x6f87dd=normalizeToolOutputValue(_0x1bb671[_0x15e6e4(0x457,0x452,_0x37fb57._0x402a77,_0x37fb57._0x31fbb2)]);_0x3e26a2['push'](_0x6f87dd),await emitEvent(_0x1c21a1,{'type':_0x18ad42(_0x37fb57._0x18723d,0x360,0x34d,_0x37fb57._0x5deb67),'toolCall':_0xa4d144,'chunk':_0x6f87dd},_0x527724),throwIfAborted(_0x527724['signal']),_0x1bb671=await _0x57dcd3['next']();}throwIfAborted(_0x527724[_0x15e6e4(0x433,_0x37fb57._0x1e41b1,0x425,_0x37fb57._0x5978df)]);const _0x3789e6=_0x1bb671[_0x15e6e4(0x457,_0x37fb57._0x3515b5,0x415,0x49b)]===void 0x0?deriveFinalToolOutput(_0x3e26a2):normalizeToolOutputValue(_0x1bb671[_0x15e6e4(_0x37fb57._0x2b53dd,0x462,_0x37fb57._0x4444af,0x4a4)]),_0x1f4dd1=createSuccessToolResult(_0xa4d144,_0x3789e6,_0x3e26a2);return await emitEvent(_0x1c21a1,{'type':_0x18ad42(0x339,_0x37fb57._0x4427bd,0x3a2,0x332),'toolCall':_0xa4d144,'result':_0x1f4dd1},_0x527724),_0x1f4dd1;}catch(_0x23be90){if(isAbortError(_0x23be90)){const _0x284c9b=createAbortedToolResult(_0xa4d144,_0x23be90,_0x3e26a2);return await emitEvent(_0x1c21a1,{'type':'tool_completed','toolCall':_0xa4d144,'result':_0x284c9b},_0x527724),_0x284c9b;}const {errorMessage:_0x4b7678,structured:_0xafa04b}=normalizeExecutionError(_0x23be90),_0x5e356e=createErrorToolResult(_0xa4d144,_0x4b7678,_0xafa04b,_0x3e26a2);return await emitEvent(_0x1c21a1,{'type':_0x15e6e4(_0x37fb57._0xdab0e1,_0x37fb57._0x239379,0x457,_0x37fb57._0x1f37e6),'toolCall':_0xa4d144,'result':_0x5e356e},_0x527724),_0x5e356e;}finally{_0x235f44();}}catch(_0x459bc8){if(isAbortError(_0x459bc8)){const _0x4ca6e7=createAbortedToolResult(_0xa4d144,_0x459bc8);return await emitEvent(_0x1c21a1,{'type':'tool_completed','toolCall':_0xa4d144,'result':_0x4ca6e7},_0x527724),_0x4ca6e7;}const {errorMessage:_0x6656e8,structured:_0x1fa23d}=normalizeExecutionError(_0x459bc8),_0x229ab0=createErrorToolResult(_0xa4d144,_0x6656e8,_0x1fa23d);return await emitEvent(_0x1c21a1,{'type':_0x18ad42(0x353,0x37f,0x39c,0x3b1),'toolCall':_0xa4d144,'result':_0x229ab0},_0x527724),_0x229ab0;}}function createInternalToolRuntime(_0x3ba3ce=[],_0x4b4a3e={}){const _0x3eb077={_0x40361c:0x33e},_0x1c5b45={_0x2e906e:0x289,_0x409d1c:0x25d},_0x24e32a={_0x595cb5:0x5e},_0x4b7089={_0x986f29:0x605,_0x5e092d:0x5ca},_0xe47fe=new ToolRegistry(_0x3ba3ce);return{'listToolSchemas'(){function _0x225283(_0x166dc1,_0x1c3c9d,_0x57c258,_0x2a27b9){return _0x57bb(_0x2a27b9-0x36c,_0x57c258);}return _0xe47fe[_0x225283(_0x4b7089._0x986f29,0x591,0x5f8,_0x4b7089._0x5e092d)]();},async 'executeCalls'(_0x478758,_0x200721){const _0x2e5431={_0x6ed0a9:0x538,_0x4f960d:0x1b9,_0x226659:0x162,_0x416903:0x183,_0x345b40:0x1a4};function _0x200a78(_0x1f6ad1,_0x80bfd7,_0xc34b3,_0x4b75a1){return _0x57bb(_0xc34b3- -0x221,_0x4b75a1);}function _0x2d3dde(_0x25809a,_0x182192,_0x3fb388,_0x108ec5){return _0x57bb(_0x25809a-_0x24e32a._0x595cb5,_0x108ec5);}return await Promise[_0x2d3dde(_0x1c5b45._0x2e906e,0x26d,0x25b,0x24a)](_0x478758[_0x2d3dde(0x27c,0x25b,_0x1c5b45._0x409d1c,0x29b)](async _0x9ab6ad=>{const _0x4e2c9b={_0x89e02e:0xa1};function _0x3dd492(_0x94acef,_0xa10f9f,_0x3a7581,_0x1a68cd){return _0x200a78(_0x94acef-0x10d,_0xa10f9f-_0x4e2c9b._0x89e02e,_0x94acef-0x4ee,_0xa10f9f);}function _0x137b87(_0x18c895,_0x383b4e,_0xbfb728,_0x34399a){return _0x200a78(_0x18c895-0x12f,_0x383b4e-0xd5,_0xbfb728-0x1b0,_0x34399a);}return await executeToolCall(_0xe47fe,_0x9ab6ad,_0x200721,_0x4b4a3e[_0x3dd492(_0x2e5431._0x6ed0a9,0x4ea,0x531,0x4ee)],_0x4b4a3e[_0x137b87(_0x2e5431._0x4f960d,_0x2e5431._0x226659,_0x2e5431._0x416903,_0x2e5431._0x345b40)]);}));},async 'execute'(_0x29bc33,_0x4f874e){function _0x124d20(_0x54286a,_0x5510a3,_0x1a5778,_0x4217d0){return _0x57bb(_0x54286a-_0x3eb077._0x40361c,_0x1a5778);}const [_0x1801cf]=await this[_0x124d20(0x5a1,0x578,0x5da,0x5d9)]([_0x29bc33],_0x4f874e);return _0x1801cf;}};}function getOrderedObserverExtensions(_0x1eedc7,_0x518fb9){const _0x5a583a={_0x2b2693:0x2d3,_0x373777:0x2d,_0x383b84:0x69,_0x5de84b:0x83},_0x333f02={_0x19dbeb:0x167,_0x21f1a4:0x1b1,_0x6ef251:0x143,_0x5ecb84:0x160,_0x301fcd:0xe2},_0x428f78={_0x2e47c4:0x75},_0x4f7dc7={_0x21197:0x2a1,_0x278690:0x104,_0x3e4084:0x1a0},_0x1c24cf={_0x2595a4:0x20,_0x4776e7:0x115};function _0x36526f(_0x3f629a,_0x34cb8e,_0x3cf96f,_0x4ff900){return _0x329fcd(_0x4ff900- -_0x1c24cf._0x2595a4,_0x34cb8e-_0x1c24cf._0x4776e7,_0x3cf96f-0x1b5,_0x34cb8e);}function _0x5ecbc3(_0x5845ff,_0xb7bef0,_0x1e92d,_0x44eee0){return _0x329fcd(_0x1e92d- -_0x4f7dc7._0x21197,_0xb7bef0-_0x4f7dc7._0x278690,_0x1e92d-_0x4f7dc7._0x3e4084,_0x44eee0);}return _0x1eedc7[_0x36526f(0x30f,0x2c3,_0x5a583a._0x2b2693,0x2e2)](_0x254f4c=>{function _0x31c6b1(_0x3ada13,_0xdb66d8,_0xd8023b,_0x228864){return _0x36526f(_0x3ada13-0x165,_0xd8023b,_0xd8023b-0x101,_0x228864- -0x43b);}function _0xd7ffee(_0x1308e7,_0x5d205a,_0x5090c6,_0x1cae68){return _0x36526f(_0x1308e7-0xfb,_0x1cae68,_0x5090c6-_0x428f78._0x2e47c4,_0x5d205a- -0x1b6);}return _0x254f4c['enabled']!==![]&&_0x254f4c[_0xd7ffee(_0x333f02._0x19dbeb,0x177,_0x333f02._0x21f1a4,0x187)]===_0x518fb9&&_0x254f4c[_0xd7ffee(0x11e,_0x333f02._0x6ef251,_0x333f02._0x5ecb84,0x16e)]===_0x31c6b1(-0x16b,-_0x333f02._0x301fcd,-0x150,-0x11e);})[_0x5ecbc3(_0x5a583a._0x373777,0x33,_0x5a583a._0x383b84,_0x5a583a._0x5de84b)]((_0x1a37d1,_0x24f90f)=>_0x1a37d1[_0x5ecbc3(0xd9,0x91,0xc6,0xf9)]-_0x24f90f[_0x5ecbc3(0x88,0x86,0xc6,0xc3)]);}function getOrderedTransformerExtensions(_0x2585e1,_0x18836d){const _0x23b170={_0x2dd197:0x3d6,_0x559779:0x406,_0x700937:0x3e9,_0xc8d38b:0x5ed,_0x3f1468:0x5b3,_0x422137:0x5a5},_0x555265={_0x1da514:0x367},_0x303b9c={_0x46ee1d:0x26,_0x29c0b3:0x2ed};function _0x5ef94f(_0x4f3db0,_0xcf4b3e,_0x1c5fab,_0x1aef79){return _0x329fcd(_0x4f3db0- -0x3fe,_0xcf4b3e-0x10,_0x1c5fab-0x126,_0xcf4b3e);}function _0x3c5473(_0x12e7eb,_0x21ccaa,_0x3311b2,_0x43a85a){return _0x20f596(_0x12e7eb-_0x303b9c._0x46ee1d,_0x21ccaa-0x17,_0x12e7eb-_0x303b9c._0x29c0b3,_0x21ccaa);}return _0x2585e1['filter'](_0x3465c2=>{const _0x2a14b1={_0x572402:0x1fa};function _0x5136bb(_0x5b3448,_0x5bb665,_0x2108f6,_0x229ab4){return _0x57bb(_0x229ab4-_0x555265._0x1da514,_0x5b3448);}function _0x469279(_0x3225cc,_0x35379b,_0x4a2098,_0x56745c){return _0x57bb(_0x3225cc-_0x2a14b1._0x572402,_0x35379b);}return _0x3465c2[_0x469279(_0x23b170._0x2dd197,_0x23b170._0x559779,0x3bc,_0x23b170._0x700937)]!==![]&&_0x3465c2[_0x5136bb(_0x23b170._0xc8d38b,0x58a,_0x23b170._0x3f1468,_0x23b170._0x422137)]===_0x18836d&&_0x3465c2['kind']==='transformer';})['sort']((_0x192bac,_0x5b11d4)=>_0x192bac[_0x3c5473(0x635,0x651,0x625,0x650)]-_0x5b11d4[_0x5ef94f(-0x97,-0x95,-0xe4,-0xda)]);}function createExtensionRegistry(){const _0x54814b={_0x26d442:0x9d,_0x176117:0x128,_0x5ba9b6:0x11c},_0x3d23a5={_0x2a465e:0x51e,_0x5c3f1d:0x55b},_0x44238d={_0x33f724:0xf8,_0x376532:0x159,_0x135f1:0x142,_0x17c121:0x18e},_0x254a20=[];return{'register'(_0x5b9226){function _0x337e4b(_0x53dfab,_0x5c5999,_0x516c91,_0x24ddd1){return _0x57bb(_0x516c91- -0x361,_0x24ddd1);}_0x254a20[_0x337e4b(-_0x44238d._0x33f724,-_0x44238d._0x376532,-_0x44238d._0x135f1,-_0x44238d._0x17c121)](_0x5b9226);},async 'runTransformers'(_0x128dfd,_0x28d86f,_0x5687f6){let _0xafa7e2=_0x28d86f;for(const _0x458b75 of getOrderedTransformerExtensions(_0x254a20,_0x128dfd)){_0xafa7e2=await _0x458b75[_0x10a7b2(0x57a,0x592,_0x3d23a5._0x2a465e,_0x3d23a5._0x5c3f1d)](_0xafa7e2,_0x5687f6);}function _0x10a7b2(_0x393c9d,_0x290d2c,_0x54e005,_0x457111){return _0x57bb(_0x457111-0x331,_0x54e005);}return _0xafa7e2;},async 'runObservers'(_0x33d59e,_0x643fcb,_0x437953){function _0x2f3da7(_0x4c3adf,_0x49e4b6,_0x30d0ad,_0x2ba13a){return _0x57bb(_0x4c3adf- -0x14d,_0x30d0ad);}for(const _0xc5dbd1 of getOrderedObserverExtensions(_0x254a20,_0x33d59e)){await _0xc5dbd1[_0x2f3da7(0xdd,_0x54814b._0x26d442,_0x54814b._0x176117,_0x54814b._0x5ba9b6)](_0x643fcb,_0x437953);}}};}function makeExtensionContext(_0x550444){return{'state':_0x550444};}async function runStage(_0x170ea8,_0x19479c,_0x5c6f99,_0x4937fe){const _0x3af8b7={_0x1ea268:0x37},_0x2868c0={_0x57432e:0x185};function _0x1c212c(_0x5010ee,_0xfc836b,_0x31d03d,_0x1fdbe2){return _0x329fcd(_0xfc836b- -0x30f,_0xfc836b-0x17d,_0x31d03d-_0x2868c0._0x57432e,_0x1fdbe2);}const _0x3d0abf=await _0x170ea8[_0x1c212c(-0x9,0xb,_0x3af8b7._0x1ea268,-0x14)](_0x19479c,_0x5c6f99,_0x4937fe);return await _0x170ea8['runObservers'](_0x19479c,_0x3d0abf,_0x4937fe),_0x3d0abf;}async function emitEvent2(_0x2c1a03,_0x16f11f,_0x416f98){await _0x2c1a03?.(_0x16f11f,_0x416f98);}function replaceToolUseBlocks(_0x5fb286,_0x392d3e){const _0x1fc8df={_0x275914:0x5f7,_0x12f78e:0x62d,_0x59da92:0x640},_0x4cfc1a={_0x194679:0x15,_0x2fc633:0x4,_0x3e171c:0x4b5,_0x2fc032:0x503,_0x9683e8:0x524},_0x608fad={_0x6ad84d:0x111,_0x36b881:0xe5,_0x23004b:0xca},_0x373a76={_0x4c1c71:0x2c2,_0x2a939c:0xd5};let _0x13b1eb=0x0;function _0x462cb8(_0x2ccf56,_0x12b87d,_0xe2a427,_0x2ca62f){return _0x329fcd(_0x12b87d-_0x373a76._0x4c1c71,_0x12b87d-0x43,_0xe2a427-_0x373a76._0x2a939c,_0xe2a427);}return{..._0x5fb286,'content':_0x5fb286[_0x462cb8(_0x1fc8df._0x275914,_0x1fc8df._0x12f78e,0x607,_0x1fc8df._0x59da92)]['map'](_0x50a8c1=>{const _0x4e956c={_0x153978:0x597,_0x22965a:0x8f};if(_0x50a8c1[_0x5026f0(-_0x4cfc1a._0x194679,-_0x4cfc1a._0x2fc633,0x28,0xc)]!==_0x48d9d3(_0x4cfc1a._0x3e171c,_0x4cfc1a._0x2fc032,_0x4cfc1a._0x9683e8,0x531))return _0x50a8c1;const _0x5bb6ff=_0x392d3e[_0x13b1eb];function _0x48d9d3(_0x545554,_0x3196fa,_0x18dff2,_0x486d8f){return _0x462cb8(_0x545554-_0x608fad._0x6ad84d,_0x3196fa- -_0x608fad._0x36b881,_0x486d8f,_0x486d8f-_0x608fad._0x23004b);}function _0x5026f0(_0x44d417,_0x297f0f,_0x2e5bf7,_0xbfd3cf){return _0x462cb8(_0x44d417-0x1,_0x2e5bf7- -_0x4e956c._0x153978,_0x297f0f,_0xbfd3cf-_0x4e956c._0x22965a);}return _0x13b1eb+=0x1,structuredClone(_0x5bb6ff);})};}function createAssistantMessageId(_0x52966d,_0x43807e){const _0x5749b8={_0x50259f:0xd2,_0x4e4c97:0xb1,_0x39b54a:0xa4},_0xba8f60={_0x201d34:0x3b3};function _0x4d6fe1(_0x269501,_0x387b43,_0x4fe30e,_0x4c98da){return _0x20f596(_0x269501-0x19c,_0x387b43-0x153,_0x4fe30e- -_0xba8f60._0x201d34,_0x269501);}return _0x52966d+_0x4d6fe1(-0xa2,-_0x5749b8._0x50259f,-_0x5749b8._0x4e4c97,-_0x5749b8._0x39b54a)+_0x43807e;}function createReasoningMessageId(_0x13eefb){return _0x13eefb+':reasoning';}function withMessageId(_0x53609c,_0x5bb0c1){if(_0x53609c['id']===_0x5bb0c1)return _0x53609c;return{..._0x53609c,'id':_0x5bb0c1};}function createAssistantChunkEvent(_0x2568d8,_0x94db47){const _0x36cb14={_0x3be7c2:0x577,_0x59b106:0x535,_0x1e34ca:0x5d9,_0x58ea51:0x5f3,_0x1f8b6f:0x591,_0x1987f6:0x572,_0x54da39:0x5a0,_0x484592:0x3c2,_0x393341:0x3b7,_0x1e0d47:0x376,_0x2cbe61:0x38e,_0xeb40d0:0x3bb,_0x1971d9:0x3a7,_0x267bde:0x381,_0x255e3e:0x368,_0x4e42c6:0x3a0},_0x24dc2b={_0x42e44e:0xb4,_0x73b30f:0x299};if(_0x2568d8[_0x47bea7(0x58d,_0x36cb14._0x3be7c2,0x5a0,_0x36cb14._0x59b106)]!==_0x47bea7(0x5d5,_0x36cb14._0x1e34ca,_0x36cb14._0x58ea51,0x5e6))return void 0x0;function _0x47bea7(_0x3b73aa,_0x2f0ec3,_0x32110,_0x3073b7){return _0x20f596(_0x3b73aa-0x99,_0x2f0ec3-_0x24dc2b._0x42e44e,_0x2f0ec3-_0x24dc2b._0x73b30f,_0x3b73aa);}function _0x10d766(_0x138390,_0x56e7af,_0x26624f,_0x2f41ee){return _0x20f596(_0x138390-0x17d,_0x56e7af-0xce,_0x26624f-0x93,_0x56e7af);}if(_0x2568d8['text']===void 0x0)return void 0x0;return{'type':_0x47bea7(_0x36cb14._0x1f8b6f,0x585,_0x36cb14._0x1987f6,_0x36cb14._0x54da39),'index':_0x2568d8[_0x10d766(_0x36cb14._0x484592,_0x36cb14._0x393341,0x3bd,_0x36cb14._0x1e0d47)]??0x0,'messageId':_0x94db47,'chunk':{'type':_0x10d766(_0x36cb14._0x2cbe61,0x3ad,0x3d3,0x38e),'index':_0x2568d8[_0x10d766(_0x36cb14._0xeb40d0,_0x36cb14._0x1971d9,0x3bd,0x3ff)]??0x0,'text':_0x2568d8[_0x10d766(0x359,_0x36cb14._0x267bde,_0x36cb14._0x255e3e,_0x36cb14._0x4e42c6)]}};}function createToolUseChunkEvent(_0x332e16,_0x4874e5){const _0x8bd0a={_0x40036d:0x1f7,_0x7cb68d:0x1af,_0x85de27:0x1ff,_0x258041:0x97,_0xa336d0:0x7e,_0x4d103c:0x5b,_0x18e9e4:0x79,_0x48ba59:0x8,_0x163fbf:0x77,_0x4c4c2c:0x61,_0x580e01:0x2c,_0xef9954:0x21,_0xf8a2f0:0x1,_0x102998:0x40,_0xa78556:0x206,_0x32a60f:0x233,_0x2bfd7b:0x252},_0x23d7df={_0x4a27e3:0x124},_0x2d7db5={_0x5479d3:0x37e,_0x566003:0x6b,_0x381188:0x12a};function _0x5386bd(_0x2c0702,_0x2b26d6,_0x3049bb,_0x19ddf5){return _0x329fcd(_0x2b26d6- -_0x2d7db5._0x5479d3,_0x2b26d6-_0x2d7db5._0x566003,_0x3049bb-_0x2d7db5._0x381188,_0x2c0702);}if(_0x332e16[_0x4b82dd(_0x8bd0a._0x40036d,0x1c5,_0x8bd0a._0x7cb68d,_0x8bd0a._0x85de27)]!==_0x5386bd(-0xb7,-0x79,-_0x8bd0a._0x258041,-_0x8bd0a._0xa336d0))return void 0x0;function _0x4b82dd(_0x28daef,_0x52c454,_0x43cd10,_0x41a26c){return _0x329fcd(_0x52c454- -0x138,_0x52c454-0x113,_0x43cd10-_0x23d7df._0x4a27e3,_0x41a26c);}return{'type':'tool_use_chunk','index':_0x332e16[_0x5386bd(-_0x8bd0a._0x4d103c,-0x35,-0x16,-0x5f)]??0x0,'messageId':_0x4874e5,'chunk':{'type':_0x5386bd(-0x95,-_0x8bd0a._0x18e9e4,-0x81,-0x7a),'id':_0x332e16['id']??'','index':_0x332e16[_0x5386bd(-0x6,-0x35,_0x8bd0a._0x48ba59,-0x45)]??0x0,..._0x332e16[_0x5386bd(-_0x8bd0a._0x163fbf,-_0x8bd0a._0x4c4c2c,-_0x8bd0a._0x580e01,-_0x8bd0a._0xef9954)]!==void 0x0?{'name':_0x332e16['name']}:{},..._0x332e16[_0x5386bd(_0x8bd0a._0xf8a2f0,-_0x8bd0a._0x102998,-0x78,-0x2f)]!==void 0x0?{'inputDelta':_0x332e16[_0x4b82dd(0x210,_0x8bd0a._0xa78556,_0x8bd0a._0x32a60f,_0x8bd0a._0x2bfd7b)]}:{}}};}function resolveReasoningEventIndex(_0x523dd2){const _0x358e75={_0xf4d13b:0x449,_0xdb66a3:0x428,_0x224f85:0x47a,_0x481725:0x3fb,_0x18e0c9:0x420,_0x2844bf:0x2fb,_0x20590e:0x2bd,_0x3c4124:0x32c,_0x58aa18:0x317},_0x24e1a3={_0x1d05cd:0xc9,_0xe56ee2:0x123,_0x1c5f45:0x11f},_0x4ac5a2={_0x4d89e9:0xce};function _0x5cee4a(_0x2af63d,_0x5d7b05,_0x5503d2,_0xd2fe38){return _0x20f596(_0x2af63d-0x110,_0x5d7b05-_0x4ac5a2._0x4d89e9,_0x5503d2- -0x6c,_0x2af63d);}function _0x45d43f(_0x4de899,_0xf1ed3e,_0x3f545f,_0x26eb26){return _0x20f596(_0x4de899-_0x24e1a3._0x1d05cd,_0xf1ed3e-_0x24e1a3._0xe56ee2,_0x4de899-_0x24e1a3._0x1c5f45,_0xf1ed3e);}return _0x523dd2[_0x45d43f(_0x358e75._0xf4d13b,_0x358e75._0xdb66a3,0x474,_0x358e75._0x224f85)]??_0x523dd2[_0x45d43f(0x447,0x44c,_0x358e75._0x481725,_0x358e75._0x18e0c9)]??_0x523dd2[_0x5cee4a(0x29c,_0x358e75._0x2844bf,_0x358e75._0x20590e,0x2d0)]??_0x523dd2[_0x5cee4a(_0x358e75._0x3c4124,_0x358e75._0x58aa18,0x2f0,0x30c)]??0x0;}function createReasoningChunkEvent(_0x4dcb0a,_0x46d6ab){const _0x98d735={_0x3037f8:0x4d,_0x4c0462:0xb8,_0x431c0:0xf0,_0x1aaf0f:0xeb,_0x30c325:0x5b,_0x133b6d:0x87,_0xbb935d:0x5c4,_0x50d568:0x58b,_0x4aec88:0x592,_0x5e7e64:0x593,_0x954eb3:0x5a6,_0x312fce:0x562,_0x1f7d00:0x9d,_0x384962:0x98,_0x13dd82:0x69,_0x5f44cb:0x24,_0x18696d:0xa6,_0x3044ec:0x567,_0x246182:0x5a3,_0x4c5f53:0x560,_0x810a03:0x4c,_0x3eedbd:0xba,_0x49e020:0xbb,_0x48d24b:0xb3,_0x369135:0x9e,_0x384495:0x95,_0x4313f5:0x505,_0x1ca31a:0x500,_0x535a5e:0x535,_0x18fce1:0x53f,_0x39ffa5:0x537,_0x38c911:0x556,_0x56f132:0x5d8,_0x3fc81e:0x53,_0x56137b:0x5bb,_0x44ab9c:0x598},_0x4d1554={_0x360721:0x185,_0x1d23d1:0x11a,_0x8725d4:0x2a2},_0x45e750={_0x1bca4a:0x81};function _0x3214a8(_0xca1e5a,_0x5311e3,_0x14ef3c,_0x3e89e3){return _0x20f596(_0xca1e5a-0x1e5,_0x5311e3-_0x45e750._0x1bca4a,_0x14ef3c-0x238,_0x3e89e3);}function _0x5b9225(_0x3daa44,_0x576b13,_0x121adb,_0x1127bf){return _0x20f596(_0x3daa44-_0x4d1554._0x360721,_0x576b13-_0x4d1554._0x1d23d1,_0x3daa44- -_0x4d1554._0x8725d4,_0x121adb);}switch(_0x4dcb0a[_0x5b9225(0x3c,0x30,_0x98d735._0x3037f8,0x43)]){case _0x5b9225(_0x98d735._0x4c0462,_0x98d735._0x431c0,_0x98d735._0x1aaf0f,0x8e):return{'type':_0x5b9225(_0x98d735._0x30c325,0x15,_0x98d735._0x133b6d,0x75),'index':resolveReasoningEventIndex(_0x4dcb0a),'messageId':_0x46d6ab,'chunk':{'type':_0x3214a8(_0x98d735._0xbb935d,_0x98d735._0x50d568,_0x98d735._0x4aec88,_0x98d735._0x5e7e64),'index':_0x4dcb0a[_0x3214a8(_0x98d735._0x954eb3,0x556,_0x98d735._0x312fce,0x52b)]??0x0,'thinking':_0x4dcb0a[_0x5b9225(0x69,_0x98d735._0x1f7d00,0xb6,_0x98d735._0x384962)]??''},'text':_0x4dcb0a[_0x5b9225(_0x98d735._0x13dd82,_0x98d735._0x5f44cb,0x32,_0x98d735._0x18696d)]??''};case'openai_reasoning_delta':return{'type':'reasoning_chunk','index':resolveReasoningEventIndex(_0x4dcb0a),'messageId':_0x46d6ab,'chunk':{'type':'openai_reasoning_delta','contentIndex':_0x4dcb0a[_0x3214a8(_0x98d735._0x3044ec,_0x98d735._0x246182,_0x98d735._0x4c5f53,0x568)]??0x0,'delta':_0x4dcb0a['delta']??'','itemId':_0x4dcb0a[_0x5b9225(0x74,0xae,0x71,_0x98d735._0x810a03)]??'','outputIndex':_0x4dcb0a[_0x5b9225(_0x98d735._0x3eedbd,0xf5,_0x98d735._0x49e020,0x84)]??0x0},'text':_0x4dcb0a[_0x5b9225(_0x98d735._0x48d24b,_0x98d735._0x369135,0xf0,0x95)]??''};case _0x5b9225(_0x98d735._0x384495,0xc6,0x47,0x81):return{'type':_0x3214a8(_0x98d735._0x4313f5,_0x98d735._0x1ca31a,_0x98d735._0x535a5e,0x514),'index':resolveReasoningEventIndex(_0x4dcb0a),'messageId':_0x46d6ab,'chunk':{'type':_0x3214a8(_0x98d735._0x18fce1,0x530,0x56f,_0x98d735._0x39ffa5),'delta':_0x4dcb0a[_0x5b9225(0xb3,0xb1,0xf9,0x76)]??'','itemId':_0x4dcb0a['itemId']??'','outputIndex':_0x4dcb0a[_0x3214a8(_0x98d735._0x38c911,0x5bd,0x594,_0x98d735._0x56f132)]??0x0,'summaryIndex':_0x4dcb0a[_0x5b9225(0x87,0x86,_0x98d735._0x3fc81e,_0x98d735._0x13dd82)]??0x0},'text':_0x4dcb0a[_0x3214a8(_0x98d735._0x56137b,0x5aa,0x58d,_0x98d735._0x44ab9c)]??''};default:return void 0x0;}}function isAbortedToolResult(_0x38acae){const _0x351113={_0xe24e8b:0x44a,_0x275a22:0x429,_0x5a08e7:0x191,_0x876391:0x448},_0x47c188={_0x5468c3:0x175},_0x5f2d7f={_0x5308a5:0x6,_0x5e5d70:0x1cb};function _0x15e157(_0x1e4c77,_0x26592a,_0xe43461,_0x94fc17){return _0x20f596(_0x1e4c77-_0x5f2d7f._0x5308a5,_0x26592a-_0x5f2d7f._0x5e5d70,_0x26592a-0x150,_0x1e4c77);}function _0x5edb40(_0x17481c,_0x15cd91,_0x503ba5,_0x49a5d8){return _0x329fcd(_0x49a5d8- -0x4eb,_0x15cd91-_0x47c188._0x5468c3,_0x503ba5-0x52,_0x17481c);}return _0x38acae['status']===_0x15e157(_0x351113._0xe24e8b,_0x351113._0x275a22,0x45f,0x412)&&_0x38acae[_0x5edb40(-_0x351113._0x5a08e7,-0x155,-0x152,-0x17a)][_0x15e157(0x422,_0x351113._0x876391,0x414,0x467)]===!![];}async function executeModelRequest(_0x2a1e56,_0x3b8f9f,_0x3c833e,_0x353def,_0x361c0f){const _0xcd5386={_0x5cf587:0xdb,_0x47177a:0xea,_0x4271e9:0xde,_0x36e4f5:0x106,_0x4d6f12:0xb2,_0x35adcb:0xf7,_0x45b8fd:0x4eb,_0x419a9c:0x52c,_0x46dd63:0x89,_0x318b3e:0x84,_0x42f93d:0xcc,_0x3dbf4b:0xa2,_0x12ec2f:0xff,_0x49acfb:0x539,_0x53cc69:0x57c,_0x3acb2b:0x4fe,_0x292026:0x523,_0x4c6061:0xbb,_0x5ed844:0xd1,_0x516ad6:0x558,_0x235ab2:0x16b,_0x46bb24:0x197,_0xfe381b:0x176,_0x3627ba:0x506,_0x5010bc:0x51a,_0x29c888:0x117,_0x2ecbb0:0x175,_0x3ddea6:0x129,_0x172cd6:0x4c4,_0x3105c8:0x4df,_0x4b33c5:0x526,_0x78c97:0x13f,_0x51ee92:0xf6,_0x310646:0x4e5,_0x1e5d91:0x4be,_0x34be70:0x4a8,_0x55499f:0x541,_0x56961c:0x527},_0x42ba85={_0x6a98d7:0x111},_0x18bcea={_0x16c70:0xc1,_0x41b7a4:0x41c};throwIfAborted(_0x3b8f9f[_0x41f621(-0xed,-_0xcd5386._0x5cf587,-_0xcd5386._0x47177a,-_0xcd5386._0x4271e9)]);if(!_0x3b8f9f[_0x41f621(-0x11a,-_0xcd5386._0x36e4f5,-_0xcd5386._0x4d6f12,-_0xcd5386._0x35adcb)]||!_0x3c833e[_0x2bd384(0x4ab,_0xcd5386._0x45b8fd,0x4bf,_0xcd5386._0x419a9c)][_0x41f621(-_0xcd5386._0x46dd63,-_0xcd5386._0x318b3e,-0x82,-_0xcd5386._0x42f93d)])return await _0x3c833e['chatModel'][_0x41f621(-_0xcd5386._0x3dbf4b,-0x95,-_0xcd5386._0x12ec2f,-0xdb)](_0x2a1e56,{'signal':_0x3b8f9f[_0x2bd384(0x4ee,_0xcd5386._0x49acfb,_0xcd5386._0x53cc69,_0xcd5386._0x3acb2b)]});let _0x277391;for await(const _0x5d7b16 of _0x3c833e[_0x2bd384(0x4a8,0x4eb,_0xcd5386._0x292026,0x4cb)][_0x41f621(-_0xcd5386._0x4c6061,-_0xcd5386._0x5ed844,-0x99,-_0xcd5386._0x42f93d)](_0x2a1e56,{'signal':_0x3b8f9f['signal']})){throwIfAborted(_0x3b8f9f[_0x41f621(-0x113,-0xe4,-0x103,-0xde)]);if(_0x5d7b16['type']==='done'){_0x277391=_0x5d7b16[_0x2bd384(_0xcd5386._0x516ad6,0x53d,0x534,0x557)];continue;}const _0x5d7149=createReasoningChunkEvent(_0x5d7b16,_0x361c0f[_0x41f621(-_0xcd5386._0x235ab2,-_0xcd5386._0x46bb24,-0x14b,-0x149)]);if(_0x5d7149&&_0x5d7149[_0x41f621(-_0xcd5386._0xfe381b,-0x142,-0xf0,-0x13e)]==='reasoning_chunk'&&_0x5d7149[_0x2bd384(_0xcd5386._0x3627ba,0x4d0,0x519,_0xcd5386._0x5010bc)][_0x41f621(-0x102,-_0xcd5386._0x29c888,-_0xcd5386._0x2ecbb0,-_0xcd5386._0x3ddea6)]>0x0){await emitEvent2(_0x3c833e[_0x2bd384(_0xcd5386._0x172cd6,_0xcd5386._0x3105c8,_0xcd5386._0x4b33c5,0x50f)],_0x5d7149,_0x353def);continue;}const _0x13847c=createAssistantChunkEvent(_0x5d7b16,_0x361c0f[_0x41f621(-_0xcd5386._0x78c97,-0xcc,-0xe2,-_0xcd5386._0x51ee92)]);if(_0x13847c){await emitEvent2(_0x3c833e[_0x2bd384(0x4b1,0x4df,0x4f8,_0xcd5386._0x310646)],_0x13847c,_0x353def);continue;}const _0x19b644=createToolUseChunkEvent(_0x5d7b16,_0x361c0f['assistantMessageId']);_0x19b644&&await emitEvent2(_0x3c833e[_0x2bd384(_0xcd5386._0x1e5d91,0x4df,0x4c9,_0xcd5386._0x34be70)],_0x19b644,_0x353def);}if(!_0x277391)throw new Error(_0x2bd384(_0xcd5386._0x55499f,0x541,_0xcd5386._0x56961c,0x51c));function _0x41f621(_0xfcd568,_0xf9cdcd,_0x204d1d,_0x2a2314){return _0x20f596(_0xfcd568-0x94,_0xf9cdcd-_0x18bcea._0x16c70,_0x2a2314- -_0x18bcea._0x41b7a4,_0xfcd568);}function _0x2bd384(_0x493275,_0x337bc9,_0x11312e,_0x34e046){return _0x20f596(_0x493275-0x41,_0x337bc9-_0x42ba85._0x6a98d7,_0x337bc9-0x1fb,_0x11312e);}return _0x277391;}function makeTurnGuards(_0x35e3a1,_0x42634d,_0x5ab1e5,_0x5b6bf6,_0x2dbf9f){return{async 'stage'(_0x1eacc2,_0x496be0){return throwIfAborted(_0x35e3a1),await runStage(_0x42634d,_0x1eacc2,_0x496be0,_0x5b6bf6);},async 'emit'(_0x1156b1){throwIfAborted(_0x35e3a1),await emitEvent2(_0x5ab1e5,_0x1156b1,_0x2dbf9f);},async 'stageUnchecked'(_0x475e77,_0x4ea500){return await runStage(_0x42634d,_0x475e77,_0x4ea500,_0x5b6bf6);},async 'emitUnchecked'(_0x474d6d){await emitEvent2(_0x5ab1e5,_0x474d6d,_0x2dbf9f);}};}async function runTurn(_0x207eb2,_0x3ba99c){const _0x1c3da0={_0x537845:0x52a,_0x153be1:0x56b,_0x2c90be:0x520,_0x35989c:0x563,_0x2f7bb0:0x587,_0x51cf39:0x54a,_0x352c41:0x521,_0xa9e80a:0x536,_0x48f853:0x566,_0x8925ab:0x55e,_0x5cd017:0x508,_0x45be5d:0x59a,_0x544e26:0x3a,_0x535b8c:0x69,_0x28d678:0x93,_0x207403:0x565,_0x54cad8:0x548,_0x3b6c0d:0x488,_0x72693d:0x48a,_0x4258b6:0x496,_0x46eec1:0x77,_0xbd9490:0x13,_0x594e29:0x3f,_0x3dd9f9:0x23,_0x31cf1c:0x50,_0x888d8e:0x6a,_0x21886a:0x544,_0xedb86f:0x56f,_0x3f8c50:0x592,_0x222f0f:0x4bd,_0x23e04b:0x4fd,_0x2e3f77:0x4cb,_0x22a8c6:0x552,_0x2c20a7:0x54c,_0x45fd86:0x535,_0x3e0eb8:0x9,_0x1cade4:0x3d,_0x5eef26:0x48,_0x3a8edc:0xd6,_0xac873e:0xb9,_0x758c9:0x88,_0x429fbe:0x4f4,_0x1877de:0x51a,_0xc4b7e5:0x4ff,_0x55eaa1:0x98,_0x287d4d:0xac,_0x56ee3d:0x7c,_0x431a3a:0x529,_0x2b4f47:0x4ec,_0x117289:0x515,_0x12990e:0x4d3,_0x3e38ad:0x507,_0x2d0bb0:0x551,_0x4f3add:0x53f,_0x27311c:0x3e,_0xb795e6:0x69,_0xaab171:0x7b,_0x3a4add:0x4e2,_0x277dd3:0x4df,_0x1eaeff:0x4b6,_0x541b76:0x4cd,_0x214b7f:0x48d,_0x1a6570:0x4f2,_0x4a9bf7:0x49c,_0x3a67ef:0x61,_0x247d57:0x6e,_0x5dd95f:0x80,_0xc39fc:0x6a,_0x1a7a0f:0x99,_0x465a07:0x523,_0x1ac29f:0x4d0,_0x455fa1:0x4df,_0x553e80:0x49d,_0x1a3be1:0x4ce,_0xb34bb1:0x4cf,_0x2c9720:0x4f1,_0x2bc4a3:0x52b,_0x4cee1d:0x58,_0x16f68d:0x22,_0x5d22f9:0x4ff,_0x50abe5:0x4ab,_0x439a53:0x6,_0xace27c:0x4fe,_0x2a39bf:0x488,_0x297a06:0x4ee,_0x14560a:0x510,_0x4f2c77:0x81,_0x514743:0xa8,_0x2ccdb1:0x5c,_0x6c8c28:0x29,_0x1c4ee1:0x55,_0x2603b1:0x14,_0x2820e5:0x3d,_0x5f0bad:0x4f,_0x4525cd:0xa0,_0x3d5b8d:0xb1,_0x5e4860:0xba,_0x33997f:0xb8,_0x41d147:0x76,_0x50f41c:0x5a,_0xe52b18:0xa4,_0x1d3656:0x502,_0x5a6604:0x4e1,_0x598531:0x4ca,_0x4a49a2:0x9d,_0x183fe1:0x5a,_0x516cd1:0x60,_0x1fe2e9:0x5b,_0x5a0afc:0x70,_0x4cc5f1:0x4a,_0x15f587:0x4c2,_0x3fa089:0x4f9,_0x954ad9:0x50b,_0x20ca93:0x4f1,_0x5eeab5:0x4e4,_0x3b1bc9:0x4be,_0x293ffe:0x3d,_0x3f229f:0x9e,_0x45885d:0x509},_0x1dddc7={_0x36225f:0x73},_0x548d8a={_0xcf5d0f:0x189},_0x5cd485=_0x207eb2[_0x233111(0x559,_0x1c3da0._0x537845,_0x1c3da0._0x153be1,_0x1c3da0._0x2c90be)]??new AbortController()[_0x233111(_0x1c3da0._0x35989c,0x52a,0x514,0x4e8)],_0x55af8e={'sessionId':_0x207eb2[_0x233111(_0x1c3da0._0x2f7bb0,_0x1c3da0._0x51cf39,0x584,0x56c)],'turnId':_0x207eb2[_0x233111(0x53d,_0x1c3da0._0x352c41,_0x1c3da0._0xa9e80a,_0x1c3da0._0x48f853)],'system':normalizeSystem(_0x207eb2[_0x233111(_0x1c3da0._0x8925ab,0x54c,_0x1c3da0._0x5cd017,_0x1c3da0._0x45be5d)]),'messages':(_0x207eb2['messages']??[])[_0x2eed5a(0x31,_0x1c3da0._0x544e26,_0x1c3da0._0x535b8c,_0x1c3da0._0x28d678)](normalizeMessage),'lastResponse':void 0x0,'toolResults':[],'finalMessage':void 0x0};function _0x2eed5a(_0x354fbf,_0x5a791f,_0x133b79,_0x1c894a){return _0x20f596(_0x354fbf-_0x548d8a._0xcf5d0f,_0x5a791f-0xe4,_0x133b79- -0x2a5,_0x5a791f);}const _0x2a5f4c=makeExtensionContext(_0x55af8e),_0x2080f2={'sessionId':_0x55af8e[_0x233111(0x56f,_0x1c3da0._0x51cf39,0x57e,0x53f)],'turnId':_0x55af8e[_0x233111(_0x1c3da0._0x207403,_0x1c3da0._0x352c41,_0x1c3da0._0x54cad8,0x4ff)],'state':_0x55af8e,'signal':_0x5cd485},{stage:_0x4de819,emit:_0x6524b5,stageUnchecked:_0xcc72c3,emitUnchecked:_0x3a0d5f}=makeTurnGuards(_0x5cd485,_0x3ba99c['registry'],_0x3ba99c[_0x233111(_0x1c3da0._0x3b6c0d,0x4d0,_0x1c3da0._0x72693d,_0x1c3da0._0x4258b6)],_0x2a5f4c,_0x2080f2);let _0x3ca6aa=0x0;function _0x233111(_0x3326c4,_0x322d15,_0xe5df2c,_0x1f5cac){return _0x20f596(_0x3326c4-_0x1dddc7._0x36225f,_0x322d15-0x115,_0x322d15-0x1ec,_0x1f5cac);}try{const _0x34f399=await _0x4de819(_0x2eed5a(_0x1c3da0._0x46eec1,_0x1c3da0._0xbd9490,0x44,0x5e),normalizeMessage(_0x207eb2['message']));_0x55af8e[_0x2eed5a(_0x1c3da0._0x594e29,_0x1c3da0._0x3dd9f9,0x68,_0x1c3da0._0x31cf1c)][_0x2eed5a(0x59,0x27,_0x1c3da0._0x888d8e,0x23)](_0x34f399),await _0x6524b5({'type':_0x233111(0x54b,_0x1c3da0._0x21886a,_0x1c3da0._0xedb86f,_0x1c3da0._0x3f8c50),'message':_0x34f399});while(!![]){throwIfAborted(_0x5cd485),_0x3ca6aa+=0x1;const _0x5d863e=createAssistantMessageId(_0x55af8e['turnId'],_0x3ca6aa),_0x4579ee=createReasoningMessageId(_0x5d863e);let _0x5a3b83={'model':_0x3ba99c['chatModel'][_0x233111(0x49f,_0x1c3da0._0x222f0f,_0x1c3da0._0x23e04b,0x4f6)],'maxTokens':_0x3ba99c[_0x233111(0x4be,0x4dc,0x495,_0x1c3da0._0x2e3f77)]['maxTokens']??0x4000,'system':structuredClone(_0x55af8e[_0x233111(_0x1c3da0._0x22a8c6,_0x1c3da0._0x2c20a7,_0x1c3da0._0x45fd86,0x52c)]),'messages':structuredClone(_0x55af8e['messages']),'tools':_0x3ba99c[_0x2eed5a(-_0x1c3da0._0x3e0eb8,0x6b,_0x1c3da0._0x1cade4,_0x1c3da0._0x5eef26)]['listToolSchemas'](),'metadata':{'sessionId':_0x55af8e[_0x2eed5a(_0x1c3da0._0x3a8edc,0xe2,_0x1c3da0._0xac873e,_0x1c3da0._0x758c9)],'turnId':_0x55af8e[_0x233111(0x508,_0x1c3da0._0x352c41,0x526,_0x1c3da0._0x429fbe)]}};_0x5a3b83=await _0x4de819(_0x233111(_0x1c3da0._0x1877de,0x522,_0x1c3da0._0xc4b7e5,0x562),_0x5a3b83),await _0x6524b5({'type':_0x2eed5a(_0x1c3da0._0x55eaa1,_0x1c3da0._0x287d4d,0xb1,_0x1c3da0._0x56ee3d),'request':_0x5a3b83});let _0x3a7330=await executeModelRequest(_0x5a3b83,_0x207eb2,_0x3ba99c,_0x2080f2,{'assistantMessageId':_0x5d863e,'reasoningMessageId':_0x4579ee});_0x3a7330=await _0x4de819('afterModelResponse',_0x3a7330),await _0x6524b5({'type':_0x233111(0x567,_0x1c3da0._0x431a3a,_0x1c3da0._0x2b4f47,_0x1c3da0._0x117289),'response':_0x3a7330}),_0x55af8e['lastResponse']=_0x3a7330;let _0x45285c=await _0x4de819(_0x233111(0x558,_0x1c3da0._0x45fd86,0x505,_0x1c3da0._0xedb86f),withMessageId(responseToAssistantMessage(_0x3a7330),_0x5d863e));_0x45285c=withMessageId(_0x45285c,_0x5d863e);const _0x1a5df0=getToolUseBlocks(_0x45285c),_0x515ced=await Promise[_0x233111(_0x1c3da0._0x12990e,_0x1c3da0._0x3e38ad,_0x1c3da0._0x2d0bb0,_0x1c3da0._0x4f3add)](_0x1a5df0[_0x2eed5a(_0x1c3da0._0x27311c,0x32,_0x1c3da0._0xb795e6,_0x1c3da0._0xaab171)](_0x13fd1e=>_0x4de819(_0x2eed5a(0xe3,0xb1,0x95,0x58),_0x13fd1e)));_0x515ced[_0x233111(_0x1c3da0._0x3a4add,_0x1c3da0._0x277dd3,0x516,0x4d4)]>0x0&&(_0x45285c=replaceToolUseBlocks(_0x45285c,_0x515ced));const _0x2c949b=withMessageId(_0x45285c,_0x5d863e);_0x45285c=_0x2c949b;const _0x1aa34a=createReasoningMessage(_0x45285c),_0x3c16e9=createAssistantTextMessage(_0x45285c),_0x14f017=createToolUseMessage(_0x45285c);_0x1aa34a&&await _0x6524b5({'type':_0x233111(_0x1c3da0._0x1eaeff,_0x1c3da0._0x541b76,_0x1c3da0._0x214b7f,0x4d1),'message':withMessageId(_0x1aa34a,_0x4579ee)});_0x3c16e9&&await _0x6524b5({'type':_0x233111(0x49d,0x4e0,_0x1c3da0._0x1a6570,_0x1c3da0._0x4a9bf7),'message':withMessageId(_0x3c16e9,_0x5d863e)});_0x14f017&&await _0x6524b5({'type':_0x2eed5a(_0x1c3da0._0x3a67ef,_0x1c3da0._0x247d57,0x48,_0x1c3da0._0x3e0eb8),'message':withMessageId(_0x14f017,_0x5d863e)});_0x55af8e['messages'][_0x2eed5a(0x3c,_0x1c3da0._0x5dd95f,_0x1c3da0._0xc39fc,_0x1c3da0._0x1a7a0f)](_0x2c949b);for(const _0x50c578 of _0x515ced){await _0x6524b5({'type':_0x233111(0x4d1,0x4fd,_0x1c3da0._0x465a07,0x51a),'toolCall':_0x50c578});}if(_0x515ced[_0x233111(_0x1c3da0._0x1ac29f,_0x1c3da0._0x455fa1,_0x1c3da0._0x553e80,_0x1c3da0._0x1a3be1)]===0x0){const _0x3bd21e=await _0x4de819(_0x233111(_0x1c3da0._0xb34bb1,_0x1c3da0._0x2c9720,0x4e7,_0x1c3da0._0x2bc4a3),_0x45285c),_0x211389=withMessageId(_0x3bd21e,_0x5d863e);return _0x55af8e[_0x2eed5a(_0x1c3da0._0x4cee1d,_0x1c3da0._0x16f68d,0x57,0x53)]=_0x211389,_0x55af8e['messages'][_0x55af8e[_0x233111(_0x1c3da0._0x5d22f9,0x4f9,_0x1c3da0._0x50abe5,0x538)][_0x2eed5a(_0x1c3da0._0xaab171,0x55,0x4e,_0x1c3da0._0x439a53)]-0x1]=_0x211389,await _0x6524b5({'type':_0x233111(0x4e2,_0x1c3da0._0xace27c,0x4e2,0x4f0),'message':_0x211389}),throwIfAborted(_0x5cd485),await _0x3ba99c[_0x233111(0x49d,_0x1c3da0._0x1eaeff,_0x1c3da0._0x2a39bf,_0x1c3da0._0x297a06)][_0x233111(0x4e9,_0x1c3da0._0x14560a,0x53c,0x502)]('afterTurnComplete',_0x55af8e,_0x2a5f4c),await _0x6524b5({'type':_0x2eed5a(0x9d,_0x1c3da0._0x4f2c77,0x67,_0x1c3da0._0x514743),'state':_0x55af8e}),{'status':_0x2eed5a(_0x1c3da0._0x2ccdb1,_0x1c3da0._0x6c8c28,0x29,0xf),'finalMessage':_0x211389,'state':_0x55af8e};}let _0x22b55c=await _0x3ba99c[_0x2eed5a(_0x1c3da0._0x1c4ee1,_0x1c3da0._0x2603b1,_0x1c3da0._0x2820e5,_0x1c3da0._0x5f0bad)]['executeCalls'](_0x515ced,_0x2080f2);const _0x53382e=_0x22b55c[_0x2eed5a(0xaf,_0x1c3da0._0x4525cd,0xa8,_0x1c3da0._0x3d5b8d)](isAbortedToolResult),_0x344387=_0x53382e?_0xcc72c3:_0x4de819,_0x5f3c22=_0x53382e?_0x3a0d5f:_0x6524b5;_0x22b55c=await Promise[_0x2eed5a(_0x1c3da0._0x5e4860,_0x1c3da0._0x33997f,_0x1c3da0._0x41d147,0x86)](_0x22b55c[_0x2eed5a(_0x1c3da0._0x50f41c,_0x1c3da0._0xe52b18,0x69,0x6a)](_0x4dfc94=>_0x344387(_0x233111(0x501,0x545,0x567,0x56f),_0x4dfc94))),_0x55af8e['toolResults'][_0x233111(_0x1c3da0._0x1d3656,0x4fb,_0x1c3da0._0x5a6604,_0x1c3da0._0x598531)](..._0x22b55c);for(const _0x2fc226 of _0x22b55c){await _0x5f3c22({'type':'tool_result','result':_0x2fc226});}const _0x1f8d25=await _0x344387(_0x2eed5a(0x34,_0x1c3da0._0x4a49a2,_0x1c3da0._0x183fe1,0x40),createToolResultUserMessage(_0x22b55c));await _0x5f3c22({'type':_0x2eed5a(_0x1c3da0._0x516cd1,_0x1c3da0._0x1fe2e9,_0x1c3da0._0x5a0afc,_0x1c3da0._0x4cc5f1),'message':_0x1f8d25}),_0x55af8e[_0x233111(_0x1c3da0._0x15f587,_0x1c3da0._0x3fa089,_0x1c3da0._0x954ad9,_0x1c3da0._0x20ca93)]['push'](_0x1f8d25);if(_0x53382e)return{'status':_0x233111(0x4ce,_0x1c3da0._0x5eeab5,0x49b,_0x1c3da0._0x3b1bc9),'state':_0x55af8e};}}catch(_0x174517){if(!_0x5cd485[_0x2eed5a(_0x1c3da0._0x293ffe,_0x1c3da0._0x3f229f,0x53,0xe)])throw _0x174517;return{'status':_0x233111(0x4cc,0x4e4,0x52d,_0x1c3da0._0x45885d),'state':_0x55af8e};}}function createSessionId(){const _0x32ba39={_0x7a050e:0x462,_0x7b8e06:0x466,_0xc4fcd2:0x496,_0x4dafa4:0x47d,_0x5da341:0x4db,_0xc20ea1:0x124},_0x3ee619={_0x3d0203:0x161,_0xdccaab:0x3c0},_0x339471={_0x3e1594:0x159,_0x3b78e7:0x80};function _0x270eaa(_0x501904,_0x4ceea1,_0x37340a,_0x2efdf4){return _0x329fcd(_0x501904-_0x339471._0x3e1594,_0x4ceea1-_0x339471._0x3b78e7,_0x37340a-0x86,_0x37340a);}function _0x31a05a(_0x2dd1a6,_0x43db3e,_0x4af0bc,_0x456505){return _0x20f596(_0x2dd1a6-_0x3ee619._0x3d0203,_0x43db3e-0x183,_0x456505- -_0x3ee619._0xdccaab,_0x4af0bc);}return'session-'+Date['now']()+'-'+Math[_0x270eaa(_0x32ba39._0x7a050e,0x41e,_0x32ba39._0x7b8e06,0x458)]()[_0x270eaa(0x4b4,_0x32ba39._0xc4fcd2,_0x32ba39._0x4dafa4,_0x32ba39._0x5da341)](0x10)[_0x31a05a(-_0x32ba39._0xc20ea1,-0xcf,-0xab,-0xdb)](0x2,0xa);}function createTurnId(_0x9d3698){const _0x594c74={_0x5df4cb:0x39b,_0x3251ce:0x39e},_0x5c52f3={_0x4395b5:0x10e,_0x32975c:0x19a,_0x5f4059:0x65};function _0x502d04(_0x387fe8,_0x16710d,_0x3d9877,_0x2b26e6){return _0x20f596(_0x387fe8-_0x5c52f3._0x4395b5,_0x16710d-_0x5c52f3._0x32975c,_0x3d9877-_0x5c52f3._0x5f4059,_0x16710d);}return _0x502d04(0x38b,_0x594c74._0x5df4cb,_0x594c74._0x3251ce,0x37a)+_0x9d3698;}function createDefaultMessage(_0x2a8240){if(_0x2a8240===void 0x0)return void 0x0;return normalizeUserInput(_0x2a8240);}function normalizeUserInput(_0x216ef7){const _0x4361ff={_0x1cd8b9:0x501,_0x928332:0x515,_0x3d523:0x499,_0x5f50ed:0x4e3,_0xe7b2ce:0x4cd},_0x1df43c={_0x4aea1e:0x1dd},_0xfc5ef8={_0x2bc3b1:0x12};if(typeof _0x216ef7===_0x38cbee(0x4e7,_0x4361ff._0x1cd8b9,0x510,_0x4361ff._0x928332))return{'role':_0x38cbee(0x4f0,_0x4361ff._0x3d523,0x4d0,_0x4361ff._0x5f50ed),'content':[{'type':_0x38cbee(_0x4361ff._0xe7b2ce,0x4ce,0x484,0x44d),'text':_0x216ef7}]};function _0x17381a(_0x5bb170,_0x3176d5,_0x1fc061,_0x274557){return _0x20f596(_0x5bb170-0x4c,_0x3176d5-_0xfc5ef8._0x2bc3b1,_0x5bb170- -0x252,_0x3176d5);}function _0x38cbee(_0x58fcb1,_0x3517e9,_0x48240f,_0xcf8b48){return _0x329fcd(_0x48240f-0x190,_0x3517e9-_0x1df43c._0x4aea1e,_0x48240f-0x1d8,_0x3517e9);}return normalizeMessage(_0x216ef7);}function resolveChatModel(_0x15e1c7){const _0xa32d43={_0x1c4f26:0x424,_0x533525:0x433,_0x578a61:0x42f,_0x42a34c:0x3e8},_0x2be0a6={_0x7b664:0x124,_0x5e148d:0x9b,_0x34a040:0x199};if(!_0x15e1c7[_0x26273c(_0xa32d43._0x1c4f26,_0xa32d43._0x533525,_0xa32d43._0x578a61,_0xa32d43._0x42a34c)])throw new Error('Agent\x20requires\x20a\x20chatModel');function _0x26273c(_0x2cd4bb,_0x51924b,_0x2e1606,_0x54b20a){return _0x329fcd(_0x51924b-_0x2be0a6._0x7b664,_0x51924b-_0x2be0a6._0x5e148d,_0x2e1606-_0x2be0a6._0x34a040,_0x2e1606);}return _0x15e1c7['chatModel'];}function createRegistry(_0x55a5ac){const _0x136a85={_0x349ca1:0x4a8,_0x1ce111:0x4a6,_0x25e665:0x4b7,_0x552f25:0x380,_0x3d5ac6:0x34f},_0x3e33f5={_0x1680cf:0x1de};if(_0x55a5ac[_0x3fb44e(_0x136a85._0x349ca1,_0x136a85._0x1ce111,0x4b9,_0x136a85._0x25e665)])return _0x55a5ac['registry'];function _0x3fb44e(_0x15b8fe,_0x4126ce,_0x32ec03,_0x216eb4){return _0x20f596(_0x15b8fe-0xbb,_0x4126ce-0xc7,_0x15b8fe-_0x3e33f5._0x1680cf,_0x216eb4);}const _0x54f17f=createExtensionRegistry(),_0x39d737=_0x55a5ac[_0x2acbe3(0x38e,0x36a,_0x136a85._0x552f25,_0x136a85._0x3d5ac6)]??[];for(const _0x154ee8 of _0x39d737){_0x54f17f['register'](_0x154ee8);}function _0x2acbe3(_0x555556,_0x5ea00e,_0x10518d,_0x112e7a){return _0x20f596(_0x555556-0x59,_0x5ea00e-0x1d4,_0x555556-0xb2,_0x10518d);}return _0x54f17f;}var Agent=class{['deps'];[_0x329fcd(0x37d,0x34f,0x33a,0x384)];[_0x20f596(0x2c5,0x2f3,0x300,0x303)];[_0x329fcd(0x32c,0x36c,0x377,0x33e)];[_0x329fcd(0x2ff,0x340,0x2fb,0x32d)];['turnIndex'];constructor(_0xe04829={}){const _0x8ec37d={_0x13b66d:0x597,_0x102f96:0x552,_0x4e4b77:0x5a0,_0x475aa8:0x360,_0x52daac:0x2e5,_0xc4ded9:0x2f5,_0x31eb90:0x569,_0x5cc288:0x58a,_0x2ae435:0x54f,_0x20e3b7:0x290,_0x4ee3b1:0x2f4,_0x41157c:0x2b1,_0x1b23a1:0x263,_0x1af3d9:0x31b,_0x3338e2:0x2e9,_0x116368:0x552,_0xc1ef80:0x51f,_0x5941c1:0x526,_0x55c407:0x557,_0x1627b5:0x59d,_0x1bbec3:0x339,_0xb9d650:0x301,_0x59520d:0x2b5},_0x10090b={_0x9977fe:0x223},_0x441088={_0xa38989:0x4e,_0x1d274a:0x55};function _0x415cee(_0x582015,_0x2cb7a2,_0x2de224,_0x178dd1){return _0x329fcd(_0x2cb7a2- -_0x441088._0xa38989,_0x2cb7a2-_0x441088._0x1d274a,_0x2de224-0xc5,_0x178dd1);}this[_0x1926a7(_0x8ec37d._0x13b66d,0x5d4,_0x8ec37d._0x102f96,_0x8ec37d._0x4e4b77)]=_0xe04829[_0x415cee(0x325,0x32f,0x32f,_0x8ec37d._0x475aa8)]??createSessionId(),this['turnIndex']=0x0,this[_0x415cee(0x284,0x2d1,_0x8ec37d._0x52daac,_0x8ec37d._0xc4ded9)]=_0xe04829['systemPrompt']??'',this[_0x1926a7(_0x8ec37d._0x31eb90,0x513,_0x8ec37d._0x5cc288,_0x8ec37d._0x2ae435)]=(_0xe04829[_0x415cee(0x2ca,0x2de,_0x8ec37d._0x20e3b7,0x2df)]??[])['map'](normalizeMessage),this[_0x415cee(_0x8ec37d._0x4ee3b1,_0x8ec37d._0x41157c,0x2d9,_0x8ec37d._0x1b23a1)]=createDefaultMessage(_0xe04829['message']);const _0x36152d=createInternalToolRuntime(_0xe04829[_0x415cee(0x2e1,_0x8ec37d._0x1af3d9,_0x8ec37d._0x3338e2,0x361)]??[],{'onEvent':_0xe04829[_0x1926a7(0x52b,_0x8ec37d._0x116368,_0x8ec37d._0xc1ef80,_0x8ec37d._0x5941c1)],'onToolCall':_0xe04829[_0x1926a7(_0x8ec37d._0x55c407,0x593,0x5a7,_0x8ec37d._0x1627b5)]});function _0x1926a7(_0x29a9ee,_0x2dc13a,_0x4fabc1,_0x2dc9ad){return _0x329fcd(_0x2dc9ad-_0x10090b._0x9977fe,_0x2dc13a-0x1e7,_0x4fabc1-0xaa,_0x29a9ee);}this[_0x415cee(_0x8ec37d._0x1bbec3,_0x8ec37d._0xb9d650,0x326,0x2f8)]={'registry':createRegistry(_0xe04829),'chatModel':resolveChatModel(_0xe04829),'toolRuntime':_0x36152d,'onEvent':_0xe04829[_0x415cee(0x267,_0x8ec37d._0x59520d,0x2c7,0x2d7)]};}async['send'](_0x596a20=this[_0x20f596(0x2af,0x2a0,0x2e0,0x320)],_0x6d09a4={}){const _0x2c6614={_0x1a2692:0x2e9,_0xc77436:0x2f1,_0x42c7de:0x31a,_0xd2e136:0x308,_0x93bfe9:0x313,_0x52adb8:0x2d2,_0x2bb44c:0x441,_0x417dd4:0x454,_0x26caa1:0x4a0,_0x4fc248:0x499,_0x4226ba:0x461,_0x481ccd:0x2ed,_0x13aa99:0x2dd,_0x189460:0x2c0,_0x215b1:0x2ca,_0x266465:0x456,_0x5047cb:0x497,_0x20841e:0x457,_0x37e58c:0x462},_0xe662e4={_0x30dd74:0x178,_0x5c5a2d:0x84};if(!_0x596a20)throw new Error(_0x38e735(0x2d8,0x2e0,0x2a1,0x319));this['turnIndex']+=0x1;function _0x1a50cb(_0xdcd328,_0x435a4d,_0x30486a,_0x1700ab){return _0x329fcd(_0x1700ab-0x135,_0x435a4d-0x79,_0x30486a-0x194,_0x30486a);}const _0x2f9f57=await runTurn({'sessionId':this[_0x38e735(_0x2c6614._0x1a2692,0x31b,_0x2c6614._0xc77436,0x319)],'turnId':createTurnId(this[_0x38e735(_0x2c6614._0x42c7de,_0x2c6614._0xd2e136,0x312,0x2d9)]),'streaming':_0x6d09a4['streaming'],'signal':_0x6d09a4[_0x38e735(0x2e9,0x2fb,_0x2c6614._0x93bfe9,_0x2c6614._0x52adb8)],'system':this[_0x1a50cb(0x433,0x43e,_0x2c6614._0x2bb44c,_0x2c6614._0x417dd4)],'messages':this[_0x1a50cb(0x46e,_0x2c6614._0x26caa1,_0x2c6614._0x4fc248,_0x2c6614._0x4226ba)],'message':normalizeUserInput(_0x596a20)},this[_0x38e735(0x32c,_0x2c6614._0x481ccd,0x2ff,_0x2c6614._0x13aa99)]);function _0x38e735(_0x57edac,_0x15cd05,_0x3655be,_0x2be562){return _0x329fcd(_0x15cd05- -0x62,_0x15cd05-_0xe662e4._0x30dd74,_0x3655be-_0xe662e4._0x5c5a2d,_0x57edac);}return this[_0x38e735(_0x2c6614._0x189460,_0x2c6614._0x215b1,0x2e8,0x2bc)]=_0x2f9f57[_0x1a50cb(_0x2c6614._0x266465,0x4c8,0x4e4,_0x2c6614._0x5047cb)][_0x38e735(0x27c,0x2ca,_0x2c6614._0x13aa99,0x305)][_0x1a50cb(0x439,0x431,_0x2c6614._0x20841e,_0x2c6614._0x37e58c)](normalizeMessage),_0x2f9f57;}};export{normalizeToolOutputValue,createToolOutput,ToolExecutionError,defineTool,ToolRegistry,validateToolInput,deriveFinalToolOutput,createInternalToolRuntime,createExtensionRegistry,runTurn,Agent};function _0x3cff(){const _0x42e647=['DxnLCL9TzxnZywDL','ywz0zxjuB29SuMvZDwX0','yw50AhjVCgLJx3rOAw5RAw5Nx2rLBhrH','B25uB29Sq2fSBa','B3v0Chv0sw5KzxG','C3rYAw5NAwz5','C2vZC2LVBKLK','mZm5ntK3nMrpCLrMyW','C3LZDgvT','C3rYAw5N','DMfSDwu','DgHLBG','CMv0DxjU','oIbLEhbLy3rLzcbVyMPLy3q','CMvNAxn0CNK','vw5RBM93BIb0B29SoIa','zw5HyMXLza','y2f0y2G','y29TCgXLDgvK','BgLZDa','vg9VBev4zwn1DgLVBKvYCM9Y','Bw9KzwW','ndy3nte1rgzmqKjN','CMvHC29UAw5NtwvZC2fNzuLK','CMfJzq','Dgv4Da','Aw5WDxq','AxrLBxm','DMfSDwvZ','zxjYB3i','nZy2nM5hyMjXEa','nNjTze1euq','zxH0zw5ZAw9UCW','DhjPBq','DhLWzq','Dg9VBhncEu5HBwu','zgvMyxvSDe1LC3nHz2u','CMvHC29UAw5Nx21LC3nHz2u','Dg9VBfj1BNrPBwu','zMLSDgvY','B25fDMvUDa','C2XPy2u','Dg9VBf91C2vFzgvSDge','BNvTyMvY','ywrKrxzLBNrmAxn0zw5LCG','B25vC2vYtwvZC2fNzq','CMfUzg9T','C29YDa','yxnZAxn0yw50x2nODw5R','Dg9VBf91C2vFBwvZC2fNzq','zg9Uzq','oIbLEhbLy3rLzcbHCNjHEq','y2HHDe1VzgvS','Dw5RBM93BL90B29S','CMvZB2X2zq','BgvUz3rO','yxnZAxn0yw50x21LC3nHz2u','BwvZC2fNzq','mte1mJq0nxfTBxLOrq','C2v0','ywjVCNrLza','AxnbCNjHEq','A2LUza','CNvUvhjHBNnMB3jTzxjZ','zMLUywXnzxnZywDL','CMvHC29UAw5Nx2nODw5R','BMfTzq','yMvMB3jLvg9VBfjLC3vSDefWCgvUza','C3LZDgvTuhjVBxb0','mJzQvgLWsKS','oMfZC2LZDgfUDdO','B2jQzwn0','ywjVCNq','yMvMB3jLrMLUywXpDxrWDxq','CMvNAxn0zxi','Dg9VBf91C2u','B3v0Chv0','ywn0Aw9U','oIbTAxnZAw5NihjLCxvPCMvKigzPzwXKici','DgHPBMTPBMC','DhvYBL9JB21WBgv0zq','BwvZC2fNzxm','BwfW','ChvZAa','nhPNCw5cAq','Dg9VBf9JywXS','zMLUywXFBwvZC2fNzq','oIbLEhbLy3rLzcbIB29SzwfU','nZiZnZa1B1bcwNfK','Dg9VBf9Yzxn1BhrFBwvZC2fNzq','AxrLBuLK','oIbLEhbLy3rLzcbZDhjPBMC','CMvXDwLYzwq','zM9YrwfJAa','CNvU','ywXS','Dg9VBf9VDxrWDxrFy2H1BMS','z2v0','B2jZzxj2zxi','Aw5WDxrezwX0yq','ChjVCgvYDgLLCW','DxnLCG','vg9VBcbLEgvJDxrPB24GCMvQzwn0zwqGzM9Yia','qwDLBNqUC2vUzcbYzxf1AxjLCYbHig1LC3nHz2uGD2HLBIbUBYbKzwzHDwX0ig1LC3nHz2uGAxmGy29UzMLNDxjLza','CNvUt2jZzxj2zxjZ','C3rYzwfTAw5N','yxnZAxn0yw50twvZC2fNzuLK','Dg9VBf9ZDgfYDgvK','y29UDgvUDeLUzgv4','C3vTBwfYEuLUzgv4','Aw5KzxG','AM9PBG','oIbLEhbLy3rLzcbUDw1Izxi','sw52ywXPzcb0B29SigLUChv0igf0ia','C3rHz2u','yM9VBgvHBG','zgvWCW','Aw5WDxrty2HLBwe','BMv4Da','mtiZmNHwuwrIuq','zgvZy3jPChrPB24','DhvYBKLK','yMvMB3jLtw9KzwXszxf1zxn0','B3bLBMfPx3jLyxnVBMLUz19ZDw1Tyxj5x2rLBhrH','mti0mKfgBLfmuW','DhvYBI0','yMvMB3jLvg9VBev4zwn1DgLVBG','Dg9VBf9JB21WBgv0zwq','Dg9tDhjPBMC','Bw9KzwXFCMvZCg9UC2u','C2LNBMfS','zxHLy3v0zq','y29UDgvUDf9KzwX0yq','y29TCgXLDgu','CMvZCg9UC2u','C3rHDgu','zw50CMLLCW','CMvHC29U','tw9KzwWGC3rYzwfTigvUzgvKihDPDgHVDxqGysbMAw5HBcbYzxnWB25Zzq','odi2ngjcsgX3Ca','B3jKzxi','yMvMB3jLqxnZAxn0yw50qxbWzw5K','Dg9VBhm','DhvYBKLUzgv4','y29UDgvUDa','C29Tzq','BgLZDfrVB2Xty2HLBwfZ','yxjYyxK','C3rYzwfT','ntaZme1qzwHlBW','C3rYDwn0DxjLza','zxHLy3v0zunHBgXZ','Dg9VBf9YzwPLy3rLza','zgvSDge','Bw9KzwXFCMvXDwvZDa','CMvQzwn0'];_0x3cff=function(){return _0x42e647;};return _0x3cff();}