@tangle-network/sandbox 0.9.2 → 0.9.3-develop.20260627002527.3cd562b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/index.d.ts +2 -2
- package/dist/agent/index.js +1026 -1
- package/dist/auth/index.js +273 -1
- package/dist/{client-D3FqPlde.d.ts → client-BBb2p7y5.d.ts} +1 -1
- package/dist/client-CjqJUa22.js +2193 -0
- package/dist/collaboration/index.js +2 -1
- package/dist/collaboration-BxlfZ2Uh.js +201 -1
- package/dist/core.d.ts +2 -2
- package/dist/core.js +4 -1
- package/dist/errors-DZsfJUuc.js +262 -1
- package/dist/{index-Dy1fHLYz.d.ts → index-BY1_6xI7.d.ts} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1180 -1
- package/dist/intelligence/index.js +225 -1
- package/dist/openai/index.js +1760 -1
- package/dist/{sandbox-B55j2q9K.d.ts → sandbox-BQQ2jhV3.d.ts} +14 -26
- package/dist/sandbox-FcVsLeUJ.js +4500 -0
- package/dist/session-gateway/index.js +667 -1
- package/dist/tangle/index.d.ts +1 -1
- package/dist/tangle/index.js +2 -1
- package/dist/tangle-DvdKAK94.js +831 -0
- package/package.json +4 -4
- package/dist/client-BBZ7YLmq.js +0 -1
- package/dist/sandbox-joKtQ5y3.js +0 -1
- package/dist/tangle-DM0o66lW.js +0 -1
package/dist/agent/index.js
CHANGED
|
@@ -1 +1,1026 @@
|
|
|
1
|
-
const a0_0x51cfca=a0_0x4c06;(function(_0x4a72ba,_0x547a5d){const _0x1d64a1=a0_0x4c06,_0x50f0ca=_0x4a72ba();while(!![]){try{const _0x659938=-parseInt(_0x1d64a1(0x1a2))/0x1+-parseInt(_0x1d64a1(0x150))/0x2+parseInt(_0x1d64a1(0x192))/0x3*(-parseInt(_0x1d64a1(0x114))/0x4)+-parseInt(_0x1d64a1(0x1a1))/0x5*(-parseInt(_0x1d64a1(0x16f))/0x6)+parseInt(_0x1d64a1(0x148))/0x7*(-parseInt(_0x1d64a1(0x19c))/0x8)+parseInt(_0x1d64a1(0x18d))/0x9*(parseInt(_0x1d64a1(0x158))/0xa)+-parseInt(_0x1d64a1(0x11e))/0xb*(-parseInt(_0x1d64a1(0x13f))/0xc);if(_0x659938===_0x547a5d)break;else _0x50f0ca['push'](_0x50f0ca['shift']());}catch(_0x59f02a){_0x50f0ca['push'](_0x50f0ca['shift']());}}}(a0_0x2a29,0x7c497));import{createRequire}from'\x6e\x6f\x64\x65\x3a\x6d\x6f\x64\x75\x6c\x65';const TOOL_SPECS={'\x73\x61\x6e\x64\x62\x6f\x78\x5f\x72\x75\x6e\x5f\x63\x6f\x64\x65':{'\x6e\x61\x6d\x65':a0_0x51cfca(0x196),'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':a0_0x51cfca(0x108),'\x69\x6e\x70\x75\x74\x53\x63\x68\x65\x6d\x61':{'\x74\x79\x70\x65':'\x6f\x62\x6a\x65\x63\x74','\x70\x72\x6f\x70\x65\x72\x74\x69\x65\x73':{'\x6c\x61\x6e\x67\x75\x61\x67\x65':{'\x74\x79\x70\x65':a0_0x51cfca(0x131),'\x65\x6e\x75\x6d':[a0_0x51cfca(0x1b6),'\x6e\x6f\x64\x65','\x74\x79\x70\x65\x73\x63\x72\x69\x70\x74',a0_0x51cfca(0x187)],'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':a0_0x51cfca(0x146)},'\x73\x6f\x75\x72\x63\x65':{'\x74\x79\x70\x65':a0_0x51cfca(0x131),'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':a0_0x51cfca(0x170)},'\x74\x69\x6d\x65\x6f\x75\x74\x5f\x6d\x73':{'\x74\x79\x70\x65':'\x6e\x75\x6d\x62\x65\x72','\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':a0_0x51cfca(0x129)}},'\x72\x65\x71\x75\x69\x72\x65\x64':[a0_0x51cfca(0x173),a0_0x51cfca(0x1be)],'\x61\x64\x64\x69\x74\x69\x6f\x6e\x61\x6c\x50\x72\x6f\x70\x65\x72\x74\x69\x65\x73':![]},'\x6d\x61\x6b\x65\x48\x61\x6e\x64\x6c\x65\x72':({box:_0x215f1c,sessionId:_0x584198})=>async _0x3d2d60=>{const _0xb8a25a=a0_0x51cfca;return await _0x215f1c[_0xb8a25a(0x15d)](_0x3d2d60[_0xb8a25a(0x173)],_0x3d2d60[_0xb8a25a(0x1be)],{'\x73\x65\x73\x73\x69\x6f\x6e\x49\x64':_0x584198,'\x74\x69\x6d\x65\x6f\x75\x74\x4d\x73':_0x3d2d60['\x74\x69\x6d\x65\x6f\x75\x74\x5f\x6d\x73']});}},'\x73\x61\x6e\x64\x62\x6f\x78\x5f\x65\x78\x65\x63':{'\x6e\x61\x6d\x65':a0_0x51cfca(0x18a),'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':'\x52\x75\x6e\x20\x61\x20\x73\x68\x65\x6c\x6c\x20\x63\x6f\x6d\x6d\x61\x6e\x64\x20\x28\x6e\x6f\x20\x70\x65\x72\x73\x69\x73\x74\x65\x6e\x74\x20\x73\x74\x61\x74\x65\x29\x20\x69\x6e\x20\x74\x68\x65\x20\x73\x61\x6e\x64\x62\x6f\x78\x2e\x20\x55\x73\x65\x20\x66\x6f\x72\x20\x6f\x6e\x65\x2d\x73\x68\x6f\x74\x20\x74\x61\x73\x6b\x73\x20\x6c\x69\x6b\x65\x20\x27\x70\x6e\x70\x6d\x20\x69\x6e\x73\x74\x61\x6c\x6c\x27\x20\x6f\x72\x20\x27\x6c\x73\x27\x2e\x20\x46\x6f\x72\x20\x63\x6f\x64\x65\x20\x74\x68\x61\x74\x20\x73\x68\x6f\x75\x6c\x64\x20\x73\x68\x61\x72\x65\x20\x73\x74\x61\x74\x65\x20\x61\x63\x72\x6f\x73\x73\x20\x63\x61\x6c\x6c\x73\x2c\x20\x70\x72\x65\x66\x65\x72\x20\x73\x61\x6e\x64\x62\x6f\x78\x5f\x72\x75\x6e\x5f\x63\x6f\x64\x65\x20\x77\x69\x74\x68\x20\x61\x20\x73\x65\x73\x73\x69\x6f\x6e\x49\x64\x2e','\x69\x6e\x70\x75\x74\x53\x63\x68\x65\x6d\x61':{'\x74\x79\x70\x65':a0_0x51cfca(0x19a),'\x70\x72\x6f\x70\x65\x72\x74\x69\x65\x73':{'\x63\x6f\x6d\x6d\x61\x6e\x64':{'\x74\x79\x70\x65':a0_0x51cfca(0x131),'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':a0_0x51cfca(0x145)},'\x63\x77\x64':{'\x74\x79\x70\x65':'\x73\x74\x72\x69\x6e\x67','\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':a0_0x51cfca(0x17e)},'\x74\x69\x6d\x65\x6f\x75\x74\x5f\x6d\x73':{'\x74\x79\x70\x65':'\x6e\x75\x6d\x62\x65\x72','\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':a0_0x51cfca(0x185)}},'\x72\x65\x71\x75\x69\x72\x65\x64':[a0_0x51cfca(0x17f)],'\x61\x64\x64\x69\x74\x69\x6f\x6e\x61\x6c\x50\x72\x6f\x70\x65\x72\x74\x69\x65\x73':![]},'\x6d\x61\x6b\x65\x48\x61\x6e\x64\x6c\x65\x72':({box:_0x5f34e3,sessionId:_0x143d56})=>async _0x1adc9f=>{const _0x57d614=a0_0x51cfca;return await _0x5f34e3[_0x57d614(0x1ab)](_0x1adc9f[_0x57d614(0x17f)],{'\x63\x77\x64':_0x1adc9f[_0x57d614(0x151)],'\x74\x69\x6d\x65\x6f\x75\x74\x4d\x73':_0x1adc9f[_0x57d614(0x16c)],'\x73\x65\x73\x73\x69\x6f\x6e\x49\x64':_0x143d56});}},'\x73\x61\x6e\x64\x62\x6f\x78\x5f\x72\x65\x61\x64':{'\x6e\x61\x6d\x65':a0_0x51cfca(0x156),'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':a0_0x51cfca(0x198),'\x69\x6e\x70\x75\x74\x53\x63\x68\x65\x6d\x61':{'\x74\x79\x70\x65':a0_0x51cfca(0x19a),'\x70\x72\x6f\x70\x65\x72\x74\x69\x65\x73':{'\x70\x61\x74\x68':{'\x74\x79\x70\x65':a0_0x51cfca(0x131)}},'\x72\x65\x71\x75\x69\x72\x65\x64':['\x70\x61\x74\x68'],'\x61\x64\x64\x69\x74\x69\x6f\x6e\x61\x6c\x50\x72\x6f\x70\x65\x72\x74\x69\x65\x73':![]},'\x6d\x61\x6b\x65\x48\x61\x6e\x64\x6c\x65\x72':({box:_0x3eff57,sessionId:_0x1704c2})=>async _0x2350b5=>{const _0x2abc98=a0_0x51cfca;return{'\x63\x6f\x6e\x74\x65\x6e\x74':await _0x3eff57[_0x2abc98(0x13b)](_0x2350b5[_0x2abc98(0x11b)],{'\x73\x65\x73\x73\x69\x6f\x6e\x49\x64':_0x1704c2})};}},'\x73\x61\x6e\x64\x62\x6f\x78\x5f\x77\x72\x69\x74\x65':{'\x6e\x61\x6d\x65':a0_0x51cfca(0x197),'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':a0_0x51cfca(0x121),'\x69\x6e\x70\x75\x74\x53\x63\x68\x65\x6d\x61':{'\x74\x79\x70\x65':a0_0x51cfca(0x19a),'\x70\x72\x6f\x70\x65\x72\x74\x69\x65\x73':{'\x70\x61\x74\x68':{'\x74\x79\x70\x65':a0_0x51cfca(0x131)},'\x63\x6f\x6e\x74\x65\x6e\x74':{'\x74\x79\x70\x65':a0_0x51cfca(0x131),'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':a0_0x51cfca(0x124)}},'\x72\x65\x71\x75\x69\x72\x65\x64':['\x70\x61\x74\x68',a0_0x51cfca(0x142)],'\x61\x64\x64\x69\x74\x69\x6f\x6e\x61\x6c\x50\x72\x6f\x70\x65\x72\x74\x69\x65\x73':![]},'\x6d\x61\x6b\x65\x48\x61\x6e\x64\x6c\x65\x72':({box:_0x4e7323})=>async _0x2d4791=>{const _0x2c2a1d=a0_0x51cfca;return await _0x4e7323['\x77\x72\x69\x74\x65'](_0x2d4791[_0x2c2a1d(0x11b)],_0x2d4791[_0x2c2a1d(0x142)]),{'\x6f\x6b':!![]};}},'\x73\x61\x6e\x64\x62\x6f\x78\x5f\x6c\x69\x73\x74':{'\x6e\x61\x6d\x65':a0_0x51cfca(0x11a),'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':a0_0x51cfca(0x19f),'\x69\x6e\x70\x75\x74\x53\x63\x68\x65\x6d\x61':{'\x74\x79\x70\x65':a0_0x51cfca(0x19a),'\x70\x72\x6f\x70\x65\x72\x74\x69\x65\x73':{'\x70\x61\x74\x68':{'\x74\x79\x70\x65':a0_0x51cfca(0x131)}},'\x72\x65\x71\x75\x69\x72\x65\x64':[a0_0x51cfca(0x11b)],'\x61\x64\x64\x69\x74\x69\x6f\x6e\x61\x6c\x50\x72\x6f\x70\x65\x72\x74\x69\x65\x73':![]},'\x6d\x61\x6b\x65\x48\x61\x6e\x64\x6c\x65\x72':({box:_0x26dac2})=>async _0x1808ac=>{const _0x10baab=a0_0x51cfca;return{'\x65\x6e\x74\x72\x69\x65\x73':await _0x26dac2['\x66\x73'][_0x10baab(0x137)](_0x1808ac['\x70\x61\x74\x68'])};}},'\x73\x61\x6e\x64\x62\x6f\x78\x5f\x73\x65\x61\x72\x63\x68':{'\x6e\x61\x6d\x65':a0_0x51cfca(0x168),'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':a0_0x51cfca(0x144),'\x69\x6e\x70\x75\x74\x53\x63\x68\x65\x6d\x61':{'\x74\x79\x70\x65':a0_0x51cfca(0x19a),'\x70\x72\x6f\x70\x65\x72\x74\x69\x65\x73':{'\x70\x61\x74\x74\x65\x72\x6e':{'\x74\x79\x70\x65':a0_0x51cfca(0x131),'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':'\x52\x65\x67\x65\x78\x20\x70\x61\x74\x74\x65\x72\x6e\x2e'},'\x70\x61\x74\x68':{'\x74\x79\x70\x65':a0_0x51cfca(0x131),'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':a0_0x51cfca(0x193)},'\x6d\x61\x78\x5f\x72\x65\x73\x75\x6c\x74\x73':{'\x74\x79\x70\x65':'\x6e\x75\x6d\x62\x65\x72','\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':'\x43\x61\x70\x2e\x20\x44\x65\x66\x61\x75\x6c\x74\x20\x31\x30\x30\x2e'}},'\x72\x65\x71\x75\x69\x72\x65\x64':['\x70\x61\x74\x74\x65\x72\x6e'],'\x61\x64\x64\x69\x74\x69\x6f\x6e\x61\x6c\x50\x72\x6f\x70\x65\x72\x74\x69\x65\x73':![]},'\x6d\x61\x6b\x65\x48\x61\x6e\x64\x6c\x65\x72':({box:_0x9e82c1})=>async _0x135d0d=>{const _0x54c6e6=a0_0x51cfca,_0x24409c={'\x71\x6f\x69\x59\x72':function(_0x3fe17b,_0x5d9136){return _0x3fe17b>=_0x5d9136;}},_0x1dbe83=[],_0x409648=_0x135d0d['\x6d\x61\x78\x5f\x72\x65\x73\x75\x6c\x74\x73']??0x64;for await(const _0x322dfb of _0x9e82c1[_0x54c6e6(0x10d)](_0x135d0d[_0x54c6e6(0x1b5)],{'\x63\x77\x64':_0x135d0d['\x70\x61\x74\x68'],'\x6d\x61\x78\x52\x65\x73\x75\x6c\x74\x73':_0x409648})){_0x1dbe83[_0x54c6e6(0x107)](_0x322dfb);if(_0x24409c['\x71\x6f\x69\x59\x72'](_0x1dbe83[_0x54c6e6(0x191)],_0x409648))break;}return{'\x6d\x61\x74\x63\x68\x65\x73':_0x1dbe83};}}},ALL_TOOL_SPECS=Object[a0_0x51cfca(0x179)](TOOL_SPECS);function selectSpecs(_0x500a32){const _0x720de3=a0_0x51cfca;if(!_0x500a32||_0x500a32[_0x720de3(0x191)]===0x0)return ALL_TOOL_SPECS;const _0x26a308=new Set(_0x500a32);return Object[_0x720de3(0x154)](TOOL_SPECS)[_0x720de3(0x199)](_0x558919=>_0x26a308[_0x720de3(0x17c)](_0x558919))[_0x720de3(0x17b)](_0x375201=>TOOL_SPECS[_0x375201]);}function serializeToolResult(_0x1d7ff3){const _0x520f45=a0_0x51cfca;if(typeof _0x1d7ff3===_0x520f45(0x131))return _0x1d7ff3;try{return JSON['\x73\x74\x72\x69\x6e\x67\x69\x66\x79'](_0x1d7ff3,null,0x2);}catch{return String(_0x1d7ff3);}}const SDK_VERSION=((()=>{const _0x125ffb=a0_0x51cfca,_0x53a1ff={'\x51\x4c\x68\x73\x61':function(_0x1d8454,_0x54788){return _0x1d8454(_0x54788);},'\x74\x68\x59\x68\x51':_0x125ffb(0x1a5),'\x47\x5a\x64\x70\x58':_0x125ffb(0x116)};try{return _0x53a1ff[_0x125ffb(0x152)](createRequire,import.meta.url)(_0x53a1ff['\x74\x68\x59\x68\x51'])['\x76\x65\x72\x73\x69\x6f\x6e']??_0x125ffb(0x116);}catch{return _0x53a1ff['\x47\x5a\x64\x70\x58'];}})());async function createMcpServer(_0x1d28f5,_0x4c7a91={}){const _0x27371e=a0_0x51cfca,_0x2958e2={'\x79\x70\x58\x69\x50':_0x27371e(0x161),'\x4c\x4a\x59\x69\x42':function(_0x46ca1a,_0x164bd3){return _0x46ca1a instanceof _0x164bd3;},'\x44\x6d\x72\x79\x76':function(_0x4c79e7,_0x5c8a6f){return _0x4c79e7(_0x5c8a6f);},'\x64\x66\x74\x6b\x44':_0x27371e(0x155),'\x71\x75\x79\x64\x59':_0x27371e(0x118),'\x47\x78\x70\x47\x57':_0x27371e(0x18b)};let _0x191662,_0x14e8d7;try{[_0x191662,_0x14e8d7]=await Promise['\x61\x6c\x6c']([import(_0x27371e(0x189)),import(_0x2958e2['\x64\x66\x74\x6b\x44'])]);}catch{throw new Error(_0x2958e2[_0x27371e(0x11f)]);}const _0x148ff5=selectSpecs(_0x4c7a91[_0x27371e(0x130)]),_0x3bc898={'\x62\x6f\x78':_0x1d28f5,'\x73\x65\x73\x73\x69\x6f\x6e\x49\x64':_0x4c7a91['\x73\x65\x73\x73\x69\x6f\x6e\x49\x64']},_0x1d773a=new Map();for(const _0xf83e5 of _0x148ff5)_0x1d773a['\x73\x65\x74'](_0xf83e5[_0x27371e(0x140)],_0xf83e5['\x6d\x61\x6b\x65\x48\x61\x6e\x64\x6c\x65\x72'](_0x3bc898));const _0x8fe86f=new _0x191662[(_0x27371e(0x14c))]({'\x6e\x61\x6d\x65':_0x4c7a91['\x6e\x61\x6d\x65']??_0x2958e2[_0x27371e(0x1b9)],'\x76\x65\x72\x73\x69\x6f\x6e':_0x4c7a91[_0x27371e(0x194)]??SDK_VERSION},{'\x63\x61\x70\x61\x62\x69\x6c\x69\x74\x69\x65\x73':{'\x74\x6f\x6f\x6c\x73':{}}});return _0x8fe86f['\x73\x65\x74\x52\x65\x71\x75\x65\x73\x74\x48\x61\x6e\x64\x6c\x65\x72'](_0x14e8d7[_0x27371e(0x10a)],async()=>({'\x74\x6f\x6f\x6c\x73':_0x148ff5['\x6d\x61\x70'](_0x46de3c=>({'\x6e\x61\x6d\x65':_0x46de3c[_0x27371e(0x140)],'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':_0x46de3c[_0x27371e(0x1a0)],'\x69\x6e\x70\x75\x74\x53\x63\x68\x65\x6d\x61':_0x46de3c['\x69\x6e\x70\x75\x74\x53\x63\x68\x65\x6d\x61']}))})),_0x8fe86f[_0x27371e(0x174)](_0x14e8d7[_0x27371e(0x18c)],async _0x1799a6=>{const _0x53c32d=_0x27371e,_0x1263e5=_0x1799a6,_0x3a0390=_0x1d773a[_0x53c32d(0x112)](_0x1263e5[_0x53c32d(0x165)][_0x53c32d(0x140)]);if(!_0x3a0390)return{'\x69\x73\x45\x72\x72\x6f\x72':!![],'\x63\x6f\x6e\x74\x65\x6e\x74':[{'\x74\x79\x70\x65':'\x74\x65\x78\x74','\x74\x65\x78\x74':_0x53c32d(0x18e)+_0x1263e5[_0x53c32d(0x165)]['\x6e\x61\x6d\x65']}]};try{return{'\x63\x6f\x6e\x74\x65\x6e\x74':[{'\x74\x79\x70\x65':_0x2958e2[_0x53c32d(0x10e)],'\x74\x65\x78\x74':serializeToolResult(await _0x3a0390(_0x1263e5[_0x53c32d(0x165)][_0x53c32d(0x1b8)]??{}))}]};}catch(_0x36de13){return{'\x69\x73\x45\x72\x72\x6f\x72':!![],'\x63\x6f\x6e\x74\x65\x6e\x74':[{'\x74\x79\x70\x65':_0x53c32d(0x161),'\x74\x65\x78\x74':_0x2958e2[_0x53c32d(0x141)](_0x36de13,Error)?_0x36de13[_0x53c32d(0x14e)]:_0x2958e2[_0x53c32d(0x1ad)](String,_0x36de13)}]};}}),{'\x73\x65\x72\x76\x65\x72':_0x8fe86f,'\x63\x6f\x6e\x6e\x65\x63\x74':_0x5b4c9b=>_0x8fe86f[_0x27371e(0x160)](_0x5b4c9b),'\x63\x6c\x6f\x73\x65':()=>_0x8fe86f[_0x27371e(0x164)]()};}function runCode(_0x59db88,_0x43abc3,_0x3811b2,_0x249699){const _0x470708=a0_0x51cfca;return _0x59db88[_0x470708(0x15d)](_0x43abc3,_0x3811b2,_0x249699);}function anthropicTools(_0x3ab347,_0x16ceca={}){const _0x29051d=a0_0x51cfca,_0x18d8c4={'\x75\x45\x73\x71\x5a':'\x74\x6f\x6f\x6c\x5f\x72\x65\x73\x75\x6c\x74','\x5a\x47\x55\x45\x4f':function(_0x301f27,_0x501e44){return _0x301f27(_0x501e44);},'\x65\x4a\x68\x59\x66':function(_0xc22012,_0x4293b5){return _0xc22012 instanceof _0x4293b5;}},_0x2f94a5=selectSpecs(_0x16ceca[_0x29051d(0x130)]),_0x39bc86={'\x62\x6f\x78':_0x3ab347,'\x73\x65\x73\x73\x69\x6f\x6e\x49\x64':_0x16ceca[_0x29051d(0x139)]},_0x37c3a4=new Map();for(const _0x4e6518 of _0x2f94a5)_0x37c3a4['\x73\x65\x74'](_0x4e6518[_0x29051d(0x140)],_0x4e6518[_0x29051d(0x19e)](_0x39bc86));const _0xd601f4=_0x2f94a5[_0x29051d(0x17b)](_0x2f76e6=>({'\x6e\x61\x6d\x65':_0x2f76e6[_0x29051d(0x140)],'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':_0x2f76e6[_0x29051d(0x1a0)],'\x69\x6e\x70\x75\x74\x5f\x73\x63\x68\x65\x6d\x61':_0x2f76e6[_0x29051d(0x136)]}));async function _0x32fa76(_0x492ef0){const _0x5771db=_0x29051d,_0x3e1cc5=_0x37c3a4[_0x5771db(0x112)](_0x492ef0[_0x5771db(0x140)]);if(!_0x3e1cc5)return{'\x74\x79\x70\x65':_0x18d8c4[_0x5771db(0x183)],'\x74\x6f\x6f\x6c\x5f\x75\x73\x65\x5f\x69\x64':_0x492ef0['\x69\x64'],'\x63\x6f\x6e\x74\x65\x6e\x74':'\x55\x6e\x6b\x6e\x6f\x77\x6e\x20\x74\x6f\x6f\x6c\x3a\x20'+_0x492ef0[_0x5771db(0x140)],'\x69\x73\x5f\x65\x72\x72\x6f\x72':!![]};try{const _0x13e32a=await _0x18d8c4[_0x5771db(0x12c)](_0x3e1cc5,_0x492ef0[_0x5771db(0x153)]);return{'\x74\x79\x70\x65':_0x5771db(0x1a3),'\x74\x6f\x6f\x6c\x5f\x75\x73\x65\x5f\x69\x64':_0x492ef0['\x69\x64'],'\x63\x6f\x6e\x74\x65\x6e\x74':toAnthropicContent(_0x13e32a)};}catch(_0x1a4347){return{'\x74\x79\x70\x65':_0x5771db(0x1a3),'\x74\x6f\x6f\x6c\x5f\x75\x73\x65\x5f\x69\x64':_0x492ef0['\x69\x64'],'\x63\x6f\x6e\x74\x65\x6e\x74':_0x18d8c4[_0x5771db(0x1a4)](_0x1a4347,Error)?_0x1a4347[_0x5771db(0x14e)]:String(_0x1a4347),'\x69\x73\x5f\x65\x72\x72\x6f\x72':!![]};}}async function _0x27f7db(_0x16ec12){const _0x460641=_0x29051d,_0x22a8ca=_0x16ec12[_0x460641(0x199)](_0x576828=>typeof _0x576828==='\x6f\x62\x6a\x65\x63\x74'&&_0x576828!==null&&_0x576828['\x74\x79\x70\x65']==='\x74\x6f\x6f\x6c\x5f\x75\x73\x65');return Promise[_0x460641(0x184)](_0x22a8ca[_0x460641(0x17b)](_0x32fa76));}return{'\x74\x6f\x6f\x6c\x73':_0xd601f4,'\x68\x61\x6e\x64\x6c\x65\x54\x6f\x6f\x6c\x55\x73\x65':_0x32fa76,'\x68\x61\x6e\x64\x6c\x65\x41\x73\x73\x69\x73\x74\x61\x6e\x74\x4d\x65\x73\x73\x61\x67\x65':_0x27f7db};}function toAnthropicContent(_0x490c4e){const _0xcd3764=a0_0x51cfca,_0x365e58={'\x6e\x4c\x4c\x57\x64':_0xcd3764(0x161),'\x76\x69\x48\x4b\x75':function(_0xc6de0f,_0x118cff){return _0xc6de0f(_0x118cff);},'\x44\x74\x46\x76\x70':_0xcd3764(0x1a9),'\x55\x6f\x45\x6e\x53':function(_0x5957f2,_0x1f1b80){return _0x5957f2(_0x1f1b80);}};if(!isCodeExecutionResultWithImages(_0x490c4e))return serializeToolResult(_0x490c4e);const _0x53db29=[],_0x2a0d95={..._0x490c4e,'\x72\x65\x73\x75\x6c\x74\x73':_0x490c4e[_0xcd3764(0x138)]['\x66\x69\x6c\x74\x65\x72'](_0x35008a=>_0x35008a[_0xcd3764(0x12a)]!==_0xcd3764(0x1a9))};_0x53db29[_0xcd3764(0x107)]({'\x74\x79\x70\x65':_0x365e58['\x6e\x4c\x4c\x57\x64'],'\x74\x65\x78\x74':serializeToolResult(_0x2a0d95)});for(const _0xdbfc21 of _0x490c4e[_0xcd3764(0x138)])if(_0x365e58[_0xcd3764(0x157)](isImagePart,_0xdbfc21))_0x53db29['\x70\x75\x73\x68']({'\x74\x79\x70\x65':_0x365e58[_0xcd3764(0x167)],'\x73\x6f\x75\x72\x63\x65':{'\x74\x79\x70\x65':_0xcd3764(0x122),'\x6d\x65\x64\x69\x61\x5f\x74\x79\x70\x65':_0x365e58[_0xcd3764(0x176)](imageMediaType,_0xdbfc21['\x66\x6f\x72\x6d\x61\x74']),'\x64\x61\x74\x61':_0xdbfc21['\x64\x61\x74\x61']}});return _0x53db29;}function isImagePart(_0x4fe16b){const _0x11053a=a0_0x51cfca,_0x19e42c={'\x70\x6d\x57\x6d\x78':function(_0x1c3ef0,_0x1d1e1b){return _0x1c3ef0===_0x1d1e1b;},'\x6f\x62\x70\x70\x46':_0x11053a(0x1a9)};return _0x19e42c[_0x11053a(0x181)](_0x4fe16b['\x74\x79\x70\x65'],_0x19e42c['\x6f\x62\x70\x70\x46']);}function isCodeExecutionResultWithImages(_0x104eba){const _0x43fe54=a0_0x51cfca;if(!_0x104eba||typeof _0x104eba!==_0x43fe54(0x19a))return![];const _0x4d8e63=_0x104eba[_0x43fe54(0x138)];if(!Array['\x69\x73\x41\x72\x72\x61\x79'](_0x4d8e63))return![];return _0x4d8e63[_0x43fe54(0x123)](_0x12687a=>_0x12687a&&typeof _0x12687a==='\x6f\x62\x6a\x65\x63\x74'&&_0x12687a['\x74\x79\x70\x65']===_0x43fe54(0x1a9));}function imageMediaType(_0x96b7ac){const _0x508495=a0_0x51cfca,_0xa14f8e={'\x44\x53\x63\x78\x68':_0x508495(0x12d),'\x77\x6f\x51\x79\x78':_0x508495(0x17a),'\x73\x50\x6b\x50\x4d':_0x508495(0x117)};switch(_0x96b7ac){case'\x70\x6e\x67':return _0xa14f8e[_0x508495(0x135)];case _0x508495(0x105):return _0xa14f8e['\x77\x6f\x51\x79\x78'];case _0xa14f8e['\x73\x50\x6b\x50\x4d']:return _0xa14f8e[_0x508495(0x135)];}}const FLEET_TOOL_SPECS={'\x73\x61\x6e\x64\x62\x6f\x78\x5f\x66\x6c\x65\x65\x74\x5f\x73\x70\x61\x77\x6e':{'\x6e\x61\x6d\x65':a0_0x51cfca(0x178),'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':a0_0x51cfca(0x13a),'\x69\x6e\x70\x75\x74\x53\x63\x68\x65\x6d\x61':{'\x74\x79\x70\x65':a0_0x51cfca(0x19a),'\x70\x72\x6f\x70\x65\x72\x74\x69\x65\x73':{'\x74\x65\x6d\x70\x6c\x61\x74\x65\x5f\x69\x64':{'\x74\x79\x70\x65':a0_0x51cfca(0x131),'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':a0_0x51cfca(0x17d)},'\x77\x6f\x72\x6b\x65\x72\x73':{'\x74\x79\x70\x65':a0_0x51cfca(0x159),'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':'\x4e\x75\x6d\x62\x65\x72\x20\x6f\x66\x20\x77\x6f\x72\x6b\x65\x72\x20\x73\x61\x6e\x64\x62\x6f\x78\x65\x73\x2e\x20\x45\x61\x63\x68\x20\x69\x73\x20\x62\x69\x6c\x6c\x65\x64\x20\x69\x6e\x64\x65\x70\x65\x6e\x64\x65\x6e\x74\x6c\x79\x2e'},'\x6d\x65\x74\x61\x64\x61\x74\x61':{'\x74\x79\x70\x65':a0_0x51cfca(0x19a),'\x70\x72\x6f\x70\x65\x72\x74\x69\x65\x73':{},'\x61\x64\x64\x69\x74\x69\x6f\x6e\x61\x6c\x50\x72\x6f\x70\x65\x72\x74\x69\x65\x73':!![],'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':a0_0x51cfca(0x104)}},'\x72\x65\x71\x75\x69\x72\x65\x64':[a0_0x51cfca(0x13c),a0_0x51cfca(0x1ae)],'\x61\x64\x64\x69\x74\x69\x6f\x6e\x61\x6c\x50\x72\x6f\x70\x65\x72\x74\x69\x65\x73':![]},'\x6d\x61\x6b\x65\x48\x61\x6e\x64\x6c\x65\x72':({client:_0x1ecde7})=>async _0x4cda0a=>{const _0x173020=a0_0x51cfca,_0x2dfb69=await _0x1ecde7[_0x173020(0x149)][_0x173020(0x1ac)]({'\x64\x65\x66\x61\x75\x6c\x74\x73':{'\x70\x75\x62\x6c\x69\x63\x54\x65\x6d\x70\x6c\x61\x74\x65\x49\x64':_0x4cda0a['\x74\x65\x6d\x70\x6c\x61\x74\x65\x5f\x69\x64']},'\x77\x6f\x72\x6b\x65\x72\x73':Array['\x66\x72\x6f\x6d']({'\x6c\x65\x6e\x67\x74\x68':_0x4cda0a[_0x173020(0x1ae)]},(_0x5281a0,_0x4b1911)=>({'\x6d\x61\x63\x68\x69\x6e\x65\x49\x64':_0x173020(0x14b)+_0x4b1911})),'\x6d\x65\x74\x61\x64\x61\x74\x61':_0x4cda0a['\x6d\x65\x74\x61\x64\x61\x74\x61']});return{'\x66\x6c\x65\x65\x74\x49\x64':_0x2dfb69[_0x173020(0x132)],'\x6d\x61\x63\x68\x69\x6e\x65\x49\x64\x73':_0x2dfb69[_0x173020(0x1b3)]};}},'\x73\x61\x6e\x64\x62\x6f\x78\x5f\x66\x6c\x65\x65\x74\x5f\x64\x69\x73\x70\x61\x74\x63\x68':{'\x6e\x61\x6d\x65':'\x73\x61\x6e\x64\x62\x6f\x78\x5f\x66\x6c\x65\x65\x74\x5f\x64\x69\x73\x70\x61\x74\x63\x68','\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':a0_0x51cfca(0x1bd),'\x69\x6e\x70\x75\x74\x53\x63\x68\x65\x6d\x61':{'\x74\x79\x70\x65':a0_0x51cfca(0x19a),'\x70\x72\x6f\x70\x65\x72\x74\x69\x65\x73':{'\x66\x6c\x65\x65\x74\x5f\x69\x64':{'\x74\x79\x70\x65':a0_0x51cfca(0x131)},'\x63\x6f\x6d\x6d\x61\x6e\x64':{'\x74\x79\x70\x65':'\x73\x74\x72\x69\x6e\x67','\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':'\x53\x68\x65\x6c\x6c\x20\x63\x6f\x6d\x6d\x61\x6e\x64\x20\x6c\x69\x6e\x65\x2e'},'\x6d\x61\x63\x68\x69\x6e\x65\x73':{'\x74\x79\x70\x65':a0_0x51cfca(0x16b),'\x69\x74\x65\x6d\x73':{'\x74\x79\x70\x65':a0_0x51cfca(0x131)},'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':a0_0x51cfca(0x166)},'\x74\x69\x6d\x65\x6f\x75\x74\x5f\x6d\x73':{'\x74\x79\x70\x65':a0_0x51cfca(0x159),'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':a0_0x51cfca(0x11d)}},'\x72\x65\x71\x75\x69\x72\x65\x64':['\x66\x6c\x65\x65\x74\x5f\x69\x64','\x63\x6f\x6d\x6d\x61\x6e\x64'],'\x61\x64\x64\x69\x74\x69\x6f\x6e\x61\x6c\x50\x72\x6f\x70\x65\x72\x74\x69\x65\x73':![]},'\x6d\x61\x6b\x65\x48\x61\x6e\x64\x6c\x65\x72':({client:_0x446145})=>async _0x99a17b=>{const _0x2191f8=a0_0x51cfca;return await(await _0x446145['\x66\x6c\x65\x65\x74\x73'][_0x2191f8(0x137)]({'\x66\x6c\x65\x65\x74\x49\x64':_0x99a17b[_0x2191f8(0x1b0)]}))[_0x2191f8(0x180)](_0x99a17b[_0x2191f8(0x17f)],{'\x6d\x61\x63\x68\x69\x6e\x65\x73':_0x99a17b[_0x2191f8(0x1aa)],'\x74\x69\x6d\x65\x6f\x75\x74\x4d\x73':_0x99a17b['\x74\x69\x6d\x65\x6f\x75\x74\x5f\x6d\x73']});}},'\x73\x61\x6e\x64\x62\x6f\x78\x5f\x66\x6c\x65\x65\x74\x5f\x73\x74\x61\x74\x75\x73':{'\x6e\x61\x6d\x65':a0_0x51cfca(0x15a),'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':a0_0x51cfca(0x120),'\x69\x6e\x70\x75\x74\x53\x63\x68\x65\x6d\x61':{'\x74\x79\x70\x65':a0_0x51cfca(0x19a),'\x70\x72\x6f\x70\x65\x72\x74\x69\x65\x73':{'\x66\x6c\x65\x65\x74\x5f\x69\x64':{'\x74\x79\x70\x65':a0_0x51cfca(0x131)}},'\x72\x65\x71\x75\x69\x72\x65\x64':[a0_0x51cfca(0x1b0)],'\x61\x64\x64\x69\x74\x69\x6f\x6e\x61\x6c\x50\x72\x6f\x70\x65\x72\x74\x69\x65\x73':![]},'\x6d\x61\x6b\x65\x48\x61\x6e\x64\x6c\x65\x72':({client:_0x5916da})=>async _0x376687=>{const _0x2426ee=a0_0x51cfca,_0x2d53e8=await _0x5916da['\x66\x6c\x65\x65\x74\x73'][_0x2426ee(0x137)]({'\x66\x6c\x65\x65\x74\x49\x64':_0x376687[_0x2426ee(0x1b0)]});return{'\x66\x6c\x65\x65\x74\x49\x64':_0x2d53e8[_0x2426ee(0x132)],'\x6d\x61\x63\x68\x69\x6e\x65\x73':_0x2d53e8[_0x2426ee(0x1b3)][_0x2426ee(0x17b)](_0x28c928=>({'\x6d\x61\x63\x68\x69\x6e\x65\x49\x64':_0x28c928,'\x73\x74\x61\x74\x75\x73':_0x2d53e8[_0x2426ee(0x112)](_0x28c928)['\x73\x74\x61\x74\x75\x73']}))};}},'\x73\x61\x6e\x64\x62\x6f\x78\x5f\x66\x6c\x65\x65\x74\x5f\x64\x65\x73\x74\x72\x6f\x79':{'\x6e\x61\x6d\x65':a0_0x51cfca(0x16a),'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':a0_0x51cfca(0x177),'\x69\x6e\x70\x75\x74\x53\x63\x68\x65\x6d\x61':{'\x74\x79\x70\x65':a0_0x51cfca(0x19a),'\x70\x72\x6f\x70\x65\x72\x74\x69\x65\x73':{'\x66\x6c\x65\x65\x74\x5f\x69\x64':{'\x74\x79\x70\x65':a0_0x51cfca(0x131)},'\x63\x6f\x6e\x74\x69\x6e\x75\x65\x5f\x6f\x6e\x5f\x65\x72\x72\x6f\x72':{'\x74\x79\x70\x65':a0_0x51cfca(0x12f),'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':a0_0x51cfca(0x126)}},'\x72\x65\x71\x75\x69\x72\x65\x64':['\x66\x6c\x65\x65\x74\x5f\x69\x64'],'\x61\x64\x64\x69\x74\x69\x6f\x6e\x61\x6c\x50\x72\x6f\x70\x65\x72\x74\x69\x65\x73':![]},'\x6d\x61\x6b\x65\x48\x61\x6e\x64\x6c\x65\x72':({client:_0x429409})=>async _0x595907=>{const _0x65a348=a0_0x51cfca;return await(await _0x429409[_0x65a348(0x149)][_0x65a348(0x137)]({'\x66\x6c\x65\x65\x74\x49\x64':_0x595907[_0x65a348(0x1b0)]}))[_0x65a348(0x186)]({'\x63\x6f\x6e\x74\x69\x6e\x75\x65\x4f\x6e\x45\x72\x72\x6f\x72':_0x595907[_0x65a348(0x10c)]}),{'\x66\x6c\x65\x65\x74\x49\x64':_0x595907[_0x65a348(0x1b0)],'\x64\x65\x6c\x65\x74\x65\x64':!![]};}}},ALL_FLEET_TOOL_SPECS=Object[a0_0x51cfca(0x179)](FLEET_TOOL_SPECS);function selectFleetSpecs(_0x2a08cf){const _0x48f47c=a0_0x51cfca;if(!_0x2a08cf||_0x2a08cf['\x6c\x65\x6e\x67\x74\x68']===0x0)return ALL_FLEET_TOOL_SPECS;const _0x3576c5=new Set(_0x2a08cf);return Object[_0x48f47c(0x154)](FLEET_TOOL_SPECS)[_0x48f47c(0x199)](_0x533d9b=>_0x3576c5[_0x48f47c(0x17c)](_0x533d9b))[_0x48f47c(0x17b)](_0x59a96f=>FLEET_TOOL_SPECS[_0x59a96f]);}function anthropicFleetTools(_0x4ad2a3,_0x33cbed={}){const _0x348772=a0_0x51cfca,_0x59aa6f={'\x46\x47\x55\x67\x51':'\x74\x6f\x6f\x6c\x5f\x72\x65\x73\x75\x6c\x74','\x61\x42\x50\x57\x73':function(_0x525f22,_0x137e90){return _0x525f22 instanceof _0x137e90;},'\x63\x65\x69\x6c\x66':function(_0x26e7ee,_0x4f920f){return _0x26e7ee(_0x4f920f);},'\x76\x6b\x4b\x6a\x48':function(_0x5a0bec,_0x584c9d){return _0x5a0bec(_0x584c9d);},'\x59\x70\x73\x53\x41':function(_0x592eeb,_0x1dcc46,_0x8f70e1){return _0x592eeb(_0x1dcc46,_0x8f70e1);}},_0x5ddcf1=_0x59aa6f[_0x348772(0x128)](selectFleetSpecs,_0x33cbed['\x61\x6c\x6c\x6f\x77']),_0x3ada1e=_0x59aa6f[_0x348772(0x1b1)](buildFleetHandlers,_0x5ddcf1,{'\x63\x6c\x69\x65\x6e\x74':_0x4ad2a3});return{'\x74\x6f\x6f\x6c\x73':_0x5ddcf1[_0x348772(0x17b)](_0x584548=>({'\x6e\x61\x6d\x65':_0x584548[_0x348772(0x140)],'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':_0x584548[_0x348772(0x1a0)],'\x69\x6e\x70\x75\x74\x5f\x73\x63\x68\x65\x6d\x61':_0x584548[_0x348772(0x136)]})),async '\x68\x61\x6e\x64\x6c\x65\x54\x6f\x6f\x6c\x55\x73\x65'(_0x2177ff){const _0xe725f=_0x348772,_0x2dab9d=_0x3ada1e[_0xe725f(0x112)](_0x2177ff['\x6e\x61\x6d\x65']);if(!_0x2dab9d)return{'\x74\x79\x70\x65':_0x59aa6f['\x46\x47\x55\x67\x51'],'\x74\x6f\x6f\x6c\x5f\x75\x73\x65\x5f\x69\x64':_0x2177ff['\x69\x64'],'\x63\x6f\x6e\x74\x65\x6e\x74':_0xe725f(0x172)+_0x2177ff['\x6e\x61\x6d\x65'],'\x69\x73\x5f\x65\x72\x72\x6f\x72':!![]};try{const _0xc3c37f=await _0x2dab9d(_0x2177ff['\x69\x6e\x70\x75\x74']);return{'\x74\x79\x70\x65':_0xe725f(0x1a3),'\x74\x6f\x6f\x6c\x5f\x75\x73\x65\x5f\x69\x64':_0x2177ff['\x69\x64'],'\x63\x6f\x6e\x74\x65\x6e\x74':serializeToolResult(_0xc3c37f)};}catch(_0x4808fb){return{'\x74\x79\x70\x65':_0xe725f(0x1a3),'\x74\x6f\x6f\x6c\x5f\x75\x73\x65\x5f\x69\x64':_0x2177ff['\x69\x64'],'\x63\x6f\x6e\x74\x65\x6e\x74':_0x59aa6f['\x61\x42\x50\x57\x73'](_0x4808fb,Error)?_0x4808fb[_0xe725f(0x14e)]:_0x59aa6f['\x63\x65\x69\x6c\x66'](String,_0x4808fb),'\x69\x73\x5f\x65\x72\x72\x6f\x72':!![]};}}};}function openaiFleetTools(_0x533ec9,_0x447956={}){const _0x4c36b0=a0_0x51cfca,_0x3b84a1={'\x45\x79\x5a\x79\x75':function(_0x31916d,_0x1865c0){return _0x31916d(_0x1865c0);},'\x41\x68\x47\x57\x54':_0x4c36b0(0x15b),'\x5a\x4a\x47\x70\x54':function(_0x5aa3c0,_0x1160d7,_0x3bdd22){return _0x5aa3c0(_0x1160d7,_0x3bdd22);}},_0x28e7e6=selectFleetSpecs(_0x447956[_0x4c36b0(0x130)]),_0x27323d=_0x3b84a1[_0x4c36b0(0x14f)](buildFleetHandlers,_0x28e7e6,{'\x63\x6c\x69\x65\x6e\x74':_0x533ec9});return{'\x74\x6f\x6f\x6c\x73':_0x28e7e6[_0x4c36b0(0x17b)](_0x223bed=>({'\x74\x79\x70\x65':_0x4c36b0(0x10f),'\x66\x75\x6e\x63\x74\x69\x6f\x6e':{'\x6e\x61\x6d\x65':_0x223bed['\x6e\x61\x6d\x65'],'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':_0x223bed[_0x4c36b0(0x1a0)],'\x70\x61\x72\x61\x6d\x65\x74\x65\x72\x73':_0x223bed['\x69\x6e\x70\x75\x74\x53\x63\x68\x65\x6d\x61']}})),async '\x68\x61\x6e\x64\x6c\x65\x54\x6f\x6f\x6c\x43\x61\x6c\x6c'(_0x4aeb9d){const _0xeb466f=_0x4c36b0,_0x4a85d7=_0x27323d[_0xeb466f(0x112)](_0x4aeb9d[_0xeb466f(0x10f)][_0xeb466f(0x140)]);if(!_0x4a85d7)return{'\x72\x6f\x6c\x65':_0xeb466f(0x15b),'\x74\x6f\x6f\x6c\x5f\x63\x61\x6c\x6c\x5f\x69\x64':_0x4aeb9d['\x69\x64'],'\x63\x6f\x6e\x74\x65\x6e\x74':JSON['\x73\x74\x72\x69\x6e\x67\x69\x66\x79']({'\x65\x72\x72\x6f\x72':'\x55\x6e\x6b\x6e\x6f\x77\x6e\x20\x66\x6c\x65\x65\x74\x20\x74\x6f\x6f\x6c\x3a\x20'+_0x4aeb9d[_0xeb466f(0x10f)][_0xeb466f(0x140)]})};let _0x4d3088={};try{const _0xbb9b19=JSON[_0xeb466f(0x109)](_0x4aeb9d[_0xeb466f(0x10f)][_0xeb466f(0x1b8)]||'\x7b\x7d');if(_0xbb9b19&&typeof _0xbb9b19===_0xeb466f(0x19a))_0x4d3088=_0xbb9b19;}catch{}try{const _0x3f8a27=await _0x3b84a1['\x45\x79\x5a\x79\x75'](_0x4a85d7,_0x4d3088);return{'\x72\x6f\x6c\x65':_0x3b84a1[_0xeb466f(0x16d)],'\x74\x6f\x6f\x6c\x5f\x63\x61\x6c\x6c\x5f\x69\x64':_0x4aeb9d['\x69\x64'],'\x63\x6f\x6e\x74\x65\x6e\x74':serializeToolResult(_0x3f8a27)};}catch(_0x4a0a3e){return{'\x72\x6f\x6c\x65':_0x3b84a1[_0xeb466f(0x16d)],'\x74\x6f\x6f\x6c\x5f\x63\x61\x6c\x6c\x5f\x69\x64':_0x4aeb9d['\x69\x64'],'\x63\x6f\x6e\x74\x65\x6e\x74':JSON[_0xeb466f(0x1bb)]({'\x65\x72\x72\x6f\x72':_0x4a0a3e instanceof Error?_0x4a0a3e[_0xeb466f(0x14e)]:_0x3b84a1[_0xeb466f(0x10b)](String,_0x4a0a3e)})};}}};}async function vercelAiFleetTools(_0x409946,_0x287f9b={}){const _0x1615e4=a0_0x51cfca,_0x47278d={'\x75\x46\x59\x58\x61':function(_0x2c7570,_0x5ec298,_0x3776c9){return _0x2c7570(_0x5ec298,_0x3776c9);}};let _0x1e2061;try{_0x1e2061=await import('\x61\x69');}catch{throw new Error(_0x1615e4(0x1a6));}const _0x53ae8c=selectFleetSpecs(_0x287f9b[_0x1615e4(0x130)]),_0x43703a=_0x47278d[_0x1615e4(0x190)](buildFleetHandlers,_0x53ae8c,{'\x63\x6c\x69\x65\x6e\x74':_0x409946}),_0x27e259={};for(const _0x3bffc5 of _0x53ae8c)_0x27e259[_0x3bffc5[_0x1615e4(0x140)]]=_0x1e2061[_0x1615e4(0x15b)]({'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':_0x3bffc5[_0x1615e4(0x1a0)],'\x69\x6e\x70\x75\x74\x53\x63\x68\x65\x6d\x61':_0x1e2061[_0x1615e4(0x15c)](_0x3bffc5[_0x1615e4(0x136)]),'\x65\x78\x65\x63\x75\x74\x65':async _0x250bbe=>{const _0xb054b4=_0x1615e4,_0xa2bbdb=_0x43703a[_0xb054b4(0x112)](_0x3bffc5[_0xb054b4(0x140)]);if(!_0xa2bbdb)throw new Error(_0xb054b4(0x172)+_0x3bffc5[_0xb054b4(0x140)]);return serializeToolResult(await _0xa2bbdb(_0x250bbe));}});return _0x27e259;}async function mastraFleetTools(_0x431cd2,_0x58f733={}){const _0x4f37ba=a0_0x51cfca,_0x4e110b={'\x47\x6e\x43\x43\x6d':function(_0x42351a,_0x3bf9db,_0x2fbf62){return _0x42351a(_0x3bf9db,_0x2fbf62);}};let _0x58ae06;try{_0x58ae06=await import(_0x4f37ba(0x133));}catch{throw new Error(_0x4f37ba(0x1b7));}const _0x470bf7=selectFleetSpecs(_0x58f733[_0x4f37ba(0x130)]),_0x20f03a=_0x4e110b[_0x4f37ba(0x171)](buildFleetHandlers,_0x470bf7,{'\x63\x6c\x69\x65\x6e\x74':_0x431cd2}),_0x192b17={};for(const _0x2ce592 of _0x470bf7)_0x192b17[_0x2ce592[_0x4f37ba(0x140)]]=_0x58ae06[_0x4f37ba(0x188)]({'\x69\x64':_0x2ce592[_0x4f37ba(0x140)],'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':_0x2ce592[_0x4f37ba(0x1a0)],'\x69\x6e\x70\x75\x74\x53\x63\x68\x65\x6d\x61':_0x58ae06[_0x4f37ba(0x15c)]?_0x58ae06[_0x4f37ba(0x15c)](_0x2ce592[_0x4f37ba(0x136)]):_0x2ce592[_0x4f37ba(0x136)],'\x65\x78\x65\x63\x75\x74\x65':async _0x187399=>{const _0x2db081=_0x4f37ba,_0x31b8e9=_0x20f03a[_0x2db081(0x112)](_0x2ce592['\x6e\x61\x6d\x65']);if(!_0x31b8e9)throw new Error('\x55\x6e\x6b\x6e\x6f\x77\x6e\x20\x66\x6c\x65\x65\x74\x20\x74\x6f\x6f\x6c\x3a\x20'+_0x2ce592[_0x2db081(0x140)]);return{'\x72\x65\x73\x75\x6c\x74':serializeToolResult(await _0x31b8e9(_0x187399?.[_0x2db081(0x1ba)]??{}))};}});return _0x192b17;}function a0_0x4c06(_0x595f42,_0x35690e){_0x595f42=_0x595f42-0x104;const _0x2a29b8=a0_0x2a29();let _0x4c066c=_0x2a29b8[_0x595f42];if(a0_0x4c06['\x59\x70\x41\x44\x4d\x6d']===undefined){var _0x1737d4=function(_0x36a78a){const _0x497d7f='\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x2b\x2f\x3d';let _0x5152ba='',_0x323673='';for(let _0x16671b=0x0,_0x1904ab,_0x4a8650,_0x557a65=0x0;_0x4a8650=_0x36a78a['\x63\x68\x61\x72\x41\x74'](_0x557a65++);~_0x4a8650&&(_0x1904ab=_0x16671b%0x4?_0x1904ab*0x40+_0x4a8650:_0x4a8650,_0x16671b++%0x4)?_0x5152ba+=String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](0xff&_0x1904ab>>(-0x2*_0x16671b&0x6)):0x0){_0x4a8650=_0x497d7f['\x69\x6e\x64\x65\x78\x4f\x66'](_0x4a8650);}for(let _0x5b8253=0x0,_0x2eac4e=_0x5152ba['\x6c\x65\x6e\x67\x74\x68'];_0x5b8253<_0x2eac4e;_0x5b8253++){_0x323673+='\x25'+('\x30\x30'+_0x5152ba['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x5b8253)['\x74\x6f\x53\x74\x72\x69\x6e\x67'](0x10))['\x73\x6c\x69\x63\x65'](-0x2);}return decodeURIComponent(_0x323673);};a0_0x4c06['\x47\x76\x68\x6d\x65\x77']=_0x1737d4,a0_0x4c06['\x44\x52\x75\x58\x66\x66']={},a0_0x4c06['\x59\x70\x41\x44\x4d\x6d']=!![];}const _0x299030=_0x2a29b8[0x0],_0x901b9b=_0x595f42+_0x299030,_0x58aad0=a0_0x4c06['\x44\x52\x75\x58\x66\x66'][_0x901b9b];return!_0x58aad0?(_0x4c066c=a0_0x4c06['\x47\x76\x68\x6d\x65\x77'](_0x4c066c),a0_0x4c06['\x44\x52\x75\x58\x66\x66'][_0x901b9b]=_0x4c066c):_0x4c066c=_0x58aad0,_0x4c066c;}function buildFleetHandlers(_0x8347ef,_0x5b5e01){const _0xe2d30=a0_0x51cfca,_0x1d9b73=new Map();for(const _0x296f15 of _0x8347ef)_0x1d9b73[_0xe2d30(0x115)](_0x296f15[_0xe2d30(0x140)],_0x296f15[_0xe2d30(0x19e)](_0x5b5e01));return _0x1d9b73;}const LIFECYCLE_TOOL_SPECS={'\x73\x61\x6e\x64\x62\x6f\x78\x5f\x63\x72\x65\x61\x74\x65':{'\x6e\x61\x6d\x65':a0_0x51cfca(0x195),'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':a0_0x51cfca(0x125),'\x69\x6e\x70\x75\x74\x53\x63\x68\x65\x6d\x61':{'\x74\x79\x70\x65':a0_0x51cfca(0x19a),'\x70\x72\x6f\x70\x65\x72\x74\x69\x65\x73':{'\x65\x6e\x76\x69\x72\x6f\x6e\x6d\x65\x6e\x74':{'\x74\x79\x70\x65':a0_0x51cfca(0x131),'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':a0_0x51cfca(0x19d)},'\x6e\x61\x6d\x65':{'\x74\x79\x70\x65':a0_0x51cfca(0x131),'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':a0_0x51cfca(0x110)}},'\x72\x65\x71\x75\x69\x72\x65\x64':[],'\x61\x64\x64\x69\x74\x69\x6f\x6e\x61\x6c\x50\x72\x6f\x70\x65\x72\x74\x69\x65\x73':![]},'\x6d\x61\x6b\x65\x48\x61\x6e\x64\x6c\x65\x72':({client:_0x47d4cc})=>async _0x5b8e15=>{const _0x1de046=a0_0x51cfca,_0x1aa1f4={'\x51\x51\x47\x48\x49':_0x1de046(0x163)},_0x53d3bc=await _0x47d4cc[_0x1de046(0x12e)]({'\x65\x6e\x76\x69\x72\x6f\x6e\x6d\x65\x6e\x74':_0x5b8e15[_0x1de046(0x1b2)]??_0x1aa1f4['\x51\x51\x47\x48\x49'],'\x6e\x61\x6d\x65':_0x5b8e15['\x6e\x61\x6d\x65']});return{'\x73\x61\x6e\x64\x62\x6f\x78\x49\x64':_0x53d3bc['\x69\x64'],'\x73\x74\x61\x74\x75\x73':_0x53d3bc[_0x1de046(0x162)]};}},'\x73\x61\x6e\x64\x62\x6f\x78\x5f\x72\x75\x6e\x5f\x63\x6f\x6d\x6d\x61\x6e\x64':{'\x6e\x61\x6d\x65':a0_0x51cfca(0x11c),'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':a0_0x51cfca(0x15e),'\x69\x6e\x70\x75\x74\x53\x63\x68\x65\x6d\x61':{'\x74\x79\x70\x65':a0_0x51cfca(0x19a),'\x70\x72\x6f\x70\x65\x72\x74\x69\x65\x73':{'\x73\x61\x6e\x64\x62\x6f\x78\x5f\x69\x64':{'\x74\x79\x70\x65':a0_0x51cfca(0x131),'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':a0_0x51cfca(0x113)},'\x63\x6f\x6d\x6d\x61\x6e\x64':{'\x74\x79\x70\x65':a0_0x51cfca(0x131),'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':a0_0x51cfca(0x145)},'\x63\x77\x64':{'\x74\x79\x70\x65':a0_0x51cfca(0x131),'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':a0_0x51cfca(0x1a7)},'\x74\x69\x6d\x65\x6f\x75\x74\x5f\x6d\x73':{'\x74\x79\x70\x65':a0_0x51cfca(0x159),'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':a0_0x51cfca(0x13d)}},'\x72\x65\x71\x75\x69\x72\x65\x64':[a0_0x51cfca(0x111),a0_0x51cfca(0x17f)],'\x61\x64\x64\x69\x74\x69\x6f\x6e\x61\x6c\x50\x72\x6f\x70\x65\x72\x74\x69\x65\x73':![]},'\x6d\x61\x6b\x65\x48\x61\x6e\x64\x6c\x65\x72':({client:_0x202e6f})=>async _0x3208c1=>{const _0xb72d6d=a0_0x51cfca,_0xee4318=await _0x202e6f[_0xb72d6d(0x112)](_0x3208c1[_0xb72d6d(0x111)]);if(!_0xee4318)throw new Error(_0xb72d6d(0x175)+_0x3208c1[_0xb72d6d(0x111)]+'\x20\x6e\x6f\x74\x20\x66\x6f\x75\x6e\x64\x2e\x20\x43\x72\x65\x61\x74\x65\x20\x69\x74\x20\x66\x69\x72\x73\x74\x20\x77\x69\x74\x68\x20\x73\x61\x6e\x64\x62\x6f\x78\x5f\x63\x72\x65\x61\x74\x65\x2e');const _0x2bf4fb=await _0xee4318['\x65\x78\x65\x63'](_0x3208c1[_0xb72d6d(0x17f)],{'\x63\x77\x64':_0x3208c1[_0xb72d6d(0x151)],'\x74\x69\x6d\x65\x6f\x75\x74\x4d\x73':_0x3208c1['\x74\x69\x6d\x65\x6f\x75\x74\x5f\x6d\x73']??0xea60});return{'\x73\x74\x64\x6f\x75\x74':_0x2bf4fb[_0xb72d6d(0x169)],'\x73\x74\x64\x65\x72\x72':_0x2bf4fb[_0xb72d6d(0x12b)],'\x65\x78\x69\x74\x43\x6f\x64\x65':_0x2bf4fb[_0xb72d6d(0x1b4)]};}},'\x73\x61\x6e\x64\x62\x6f\x78\x5f\x64\x65\x73\x74\x72\x6f\x79':{'\x6e\x61\x6d\x65':'\x73\x61\x6e\x64\x62\x6f\x78\x5f\x64\x65\x73\x74\x72\x6f\x79','\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':a0_0x51cfca(0x134),'\x69\x6e\x70\x75\x74\x53\x63\x68\x65\x6d\x61':{'\x74\x79\x70\x65':a0_0x51cfca(0x19a),'\x70\x72\x6f\x70\x65\x72\x74\x69\x65\x73':{'\x73\x61\x6e\x64\x62\x6f\x78\x5f\x69\x64':{'\x74\x79\x70\x65':'\x73\x74\x72\x69\x6e\x67','\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':'\x49\x64\x20\x72\x65\x74\x75\x72\x6e\x65\x64\x20\x62\x79\x20\x73\x61\x6e\x64\x62\x6f\x78\x5f\x63\x72\x65\x61\x74\x65\x2e'}},'\x72\x65\x71\x75\x69\x72\x65\x64':[a0_0x51cfca(0x111)],'\x61\x64\x64\x69\x74\x69\x6f\x6e\x61\x6c\x50\x72\x6f\x70\x65\x72\x74\x69\x65\x73':![]},'\x6d\x61\x6b\x65\x48\x61\x6e\x64\x6c\x65\x72':({client:_0x3f3399})=>async _0x5f498d=>{const _0x17257e=a0_0x51cfca,_0x3949aa=await _0x3f3399[_0x17257e(0x112)](_0x5f498d[_0x17257e(0x111)]);if(!_0x3949aa)return{'\x73\x61\x6e\x64\x62\x6f\x78\x49\x64':_0x5f498d[_0x17257e(0x111)],'\x64\x65\x6c\x65\x74\x65\x64':!![]};return await _0x3949aa[_0x17257e(0x186)](),{'\x73\x61\x6e\x64\x62\x6f\x78\x49\x64':_0x5f498d['\x73\x61\x6e\x64\x62\x6f\x78\x5f\x69\x64'],'\x64\x65\x6c\x65\x74\x65\x64':!![]};}}},ALL_LIFECYCLE_TOOL_SPECS=Object[a0_0x51cfca(0x179)](LIFECYCLE_TOOL_SPECS);function selectLifecycleSpecs(_0x2fd61a){const _0x1e7236=a0_0x51cfca,_0x5eac96={'\x4f\x5a\x4b\x72\x72':function(_0x1b7ad3,_0x91c535){return _0x1b7ad3===_0x91c535;}};if(!_0x2fd61a||_0x5eac96[_0x1e7236(0x127)](_0x2fd61a[_0x1e7236(0x191)],0x0))return ALL_LIFECYCLE_TOOL_SPECS;const _0x19cf46=new Set(_0x2fd61a);return Object[_0x1e7236(0x154)](LIFECYCLE_TOOL_SPECS)[_0x1e7236(0x199)](_0x4ff409=>_0x19cf46[_0x1e7236(0x17c)](_0x4ff409))[_0x1e7236(0x17b)](_0x1dffd9=>LIFECYCLE_TOOL_SPECS[_0x1dffd9]);}function anthropicLifecycleTools(_0x158c68,_0xd87392={}){const _0x55dc24=a0_0x51cfca,_0x7ceeb5={'\x41\x63\x75\x70\x61':_0x55dc24(0x1a3),'\x5a\x6f\x4b\x71\x70':function(_0x55b12c,_0x445f45){return _0x55b12c(_0x445f45);},'\x4c\x64\x65\x62\x49':function(_0x18debf,_0x1d9e72){return _0x18debf(_0x1d9e72);},'\x44\x53\x6f\x57\x4f':function(_0x18f835,_0x173f47){return _0x18f835 instanceof _0x173f47;},'\x71\x5a\x48\x53\x44':function(_0x3d8326,_0x1301cf,_0x1db971){return _0x3d8326(_0x1301cf,_0x1db971);}},_0x143fed=selectLifecycleSpecs(_0xd87392[_0x55dc24(0x130)]),_0x150dc4=_0x7ceeb5[_0x55dc24(0x1af)](buildLifecycleHandlers,_0x143fed,{'\x63\x6c\x69\x65\x6e\x74':_0x158c68});return{'\x74\x6f\x6f\x6c\x73':_0x143fed[_0x55dc24(0x17b)](_0x5ce548=>({'\x6e\x61\x6d\x65':_0x5ce548[_0x55dc24(0x140)],'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':_0x5ce548[_0x55dc24(0x1a0)],'\x69\x6e\x70\x75\x74\x5f\x73\x63\x68\x65\x6d\x61':_0x5ce548[_0x55dc24(0x136)]})),async '\x68\x61\x6e\x64\x6c\x65\x54\x6f\x6f\x6c\x55\x73\x65'(_0x1b3fc1){const _0x37d4c3=_0x55dc24,_0x576bad=_0x150dc4['\x67\x65\x74'](_0x1b3fc1[_0x37d4c3(0x140)]);if(!_0x576bad)return{'\x74\x79\x70\x65':_0x7ceeb5['\x41\x63\x75\x70\x61'],'\x74\x6f\x6f\x6c\x5f\x75\x73\x65\x5f\x69\x64':_0x1b3fc1['\x69\x64'],'\x63\x6f\x6e\x74\x65\x6e\x74':'\x55\x6e\x6b\x6e\x6f\x77\x6e\x20\x6c\x69\x66\x65\x63\x79\x63\x6c\x65\x20\x74\x6f\x6f\x6c\x3a\x20'+_0x1b3fc1[_0x37d4c3(0x140)],'\x69\x73\x5f\x65\x72\x72\x6f\x72':!![]};try{const _0xd39e74=await _0x7ceeb5[_0x37d4c3(0x147)](_0x576bad,_0x1b3fc1[_0x37d4c3(0x153)]);return{'\x74\x79\x70\x65':_0x7ceeb5[_0x37d4c3(0x182)],'\x74\x6f\x6f\x6c\x5f\x75\x73\x65\x5f\x69\x64':_0x1b3fc1['\x69\x64'],'\x63\x6f\x6e\x74\x65\x6e\x74':_0x7ceeb5['\x4c\x64\x65\x62\x49'](serializeToolResult,_0xd39e74)};}catch(_0x3df8aa){return{'\x74\x79\x70\x65':_0x7ceeb5['\x41\x63\x75\x70\x61'],'\x74\x6f\x6f\x6c\x5f\x75\x73\x65\x5f\x69\x64':_0x1b3fc1['\x69\x64'],'\x63\x6f\x6e\x74\x65\x6e\x74':_0x7ceeb5[_0x37d4c3(0x119)](_0x3df8aa,Error)?_0x3df8aa[_0x37d4c3(0x14e)]:String(_0x3df8aa),'\x69\x73\x5f\x65\x72\x72\x6f\x72':!![]};}}};}function openaiLifecycleTools(_0x56dfdd,_0xb3f2ca={}){const _0x373fce=a0_0x51cfca,_0x574bed={'\x76\x53\x6f\x5a\x44':'\x74\x6f\x6f\x6c','\x76\x46\x73\x53\x41':_0x373fce(0x19a),'\x55\x62\x77\x41\x72':function(_0x56955b,_0x43348f){return _0x56955b(_0x43348f);},'\x70\x57\x61\x63\x41':function(_0x1cd05a,_0x507290){return _0x1cd05a instanceof _0x507290;},'\x6b\x54\x54\x71\x55':function(_0x1eac99,_0xd80e52){return _0x1eac99(_0xd80e52);}},_0x1110fc=selectLifecycleSpecs(_0xb3f2ca[_0x373fce(0x130)]),_0x3b7bac=buildLifecycleHandlers(_0x1110fc,{'\x63\x6c\x69\x65\x6e\x74':_0x56dfdd});return{'\x74\x6f\x6f\x6c\x73':_0x1110fc[_0x373fce(0x17b)](_0x2cb6df=>({'\x74\x79\x70\x65':'\x66\x75\x6e\x63\x74\x69\x6f\x6e','\x66\x75\x6e\x63\x74\x69\x6f\x6e':{'\x6e\x61\x6d\x65':_0x2cb6df[_0x373fce(0x140)],'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':_0x2cb6df['\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e'],'\x70\x61\x72\x61\x6d\x65\x74\x65\x72\x73':_0x2cb6df[_0x373fce(0x136)]}})),async '\x68\x61\x6e\x64\x6c\x65\x54\x6f\x6f\x6c\x43\x61\x6c\x6c'(_0x2ec8b3){const _0xa3a651=_0x373fce,_0x34b886=_0x3b7bac[_0xa3a651(0x112)](_0x2ec8b3[_0xa3a651(0x10f)][_0xa3a651(0x140)]);if(!_0x34b886)return{'\x72\x6f\x6c\x65':_0x574bed[_0xa3a651(0x15f)],'\x74\x6f\x6f\x6c\x5f\x63\x61\x6c\x6c\x5f\x69\x64':_0x2ec8b3['\x69\x64'],'\x63\x6f\x6e\x74\x65\x6e\x74':JSON[_0xa3a651(0x1bb)]({'\x65\x72\x72\x6f\x72':'\x55\x6e\x6b\x6e\x6f\x77\x6e\x20\x6c\x69\x66\x65\x63\x79\x63\x6c\x65\x20\x74\x6f\x6f\x6c\x3a\x20'+_0x2ec8b3['\x66\x75\x6e\x63\x74\x69\x6f\x6e']['\x6e\x61\x6d\x65']})};let _0x363e55={};try{const _0x2564c5=JSON[_0xa3a651(0x109)](_0x2ec8b3[_0xa3a651(0x10f)][_0xa3a651(0x1b8)]||'\x7b\x7d');if(_0x2564c5&&typeof _0x2564c5===_0x574bed[_0xa3a651(0x106)])_0x363e55=_0x2564c5;}catch{}try{const _0xd4977c=await _0x574bed[_0xa3a651(0x19b)](_0x34b886,_0x363e55);return{'\x72\x6f\x6c\x65':_0x574bed['\x76\x53\x6f\x5a\x44'],'\x74\x6f\x6f\x6c\x5f\x63\x61\x6c\x6c\x5f\x69\x64':_0x2ec8b3['\x69\x64'],'\x63\x6f\x6e\x74\x65\x6e\x74':_0x574bed[_0xa3a651(0x19b)](serializeToolResult,_0xd4977c)};}catch(_0xaf4506){return{'\x72\x6f\x6c\x65':'\x74\x6f\x6f\x6c','\x74\x6f\x6f\x6c\x5f\x63\x61\x6c\x6c\x5f\x69\x64':_0x2ec8b3['\x69\x64'],'\x63\x6f\x6e\x74\x65\x6e\x74':JSON[_0xa3a651(0x1bb)]({'\x65\x72\x72\x6f\x72':_0x574bed[_0xa3a651(0x143)](_0xaf4506,Error)?_0xaf4506[_0xa3a651(0x14e)]:_0x574bed[_0xa3a651(0x14d)](String,_0xaf4506)})};}}};}function buildLifecycleHandlers(_0xa0bf60,_0x3c81b3){const _0x694939=a0_0x51cfca,_0xcc0efd=new Map();for(const _0x3422f4 of _0xa0bf60)_0xcc0efd[_0x694939(0x115)](_0x3422f4[_0x694939(0x140)],_0x3422f4['\x6d\x61\x6b\x65\x48\x61\x6e\x64\x6c\x65\x72'](_0x3c81b3));return _0xcc0efd;}async function mastraTools(_0xecf2d5,_0x14627e={}){const _0x2b12cf=a0_0x51cfca;let _0x20e548;try{_0x20e548=await import(_0x2b12cf(0x133));}catch{throw new Error(_0x2b12cf(0x1a8));}const _0x3b8cbe=selectSpecs(_0x14627e[_0x2b12cf(0x130)]),_0x340ef7={'\x62\x6f\x78':_0xecf2d5,'\x73\x65\x73\x73\x69\x6f\x6e\x49\x64':_0x14627e[_0x2b12cf(0x139)]},_0xab4b7f={};for(const _0x59194e of _0x3b8cbe){const _0x4dcc9b=_0x59194e[_0x2b12cf(0x19e)](_0x340ef7);_0xab4b7f[_0x59194e[_0x2b12cf(0x140)]]=_0x20e548[_0x2b12cf(0x188)]({'\x69\x64':_0x59194e[_0x2b12cf(0x140)],'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':_0x59194e[_0x2b12cf(0x1a0)],'\x69\x6e\x70\x75\x74\x53\x63\x68\x65\x6d\x61':_0x20e548[_0x2b12cf(0x15c)]?_0x20e548[_0x2b12cf(0x15c)](_0x59194e[_0x2b12cf(0x136)]):_0x59194e['\x69\x6e\x70\x75\x74\x53\x63\x68\x65\x6d\x61'],'\x65\x78\x65\x63\x75\x74\x65':async _0x57dcd2=>{const _0x2daa8f=_0x2b12cf;return{'\x72\x65\x73\x75\x6c\x74':serializeToolResult(await _0x4dcc9b(_0x57dcd2?.[_0x2daa8f(0x1ba)]??{}))};}});}return _0xab4b7f;}function a0_0x2a29(){const _0x26b11f=['\x7a\x77\x35\x32\x41\x78\x6a\x56\x42\x4d\x31\x4c\x42\x4e\x71','\x41\x77\x72\x5a','\x7a\x78\x48\x50\x44\x65\x6e\x56\x7a\x67\x75','\x43\x67\x66\x30\x44\x67\x76\x59\x42\x47','\x43\x68\x4c\x30\x41\x67\x39\x55','\x42\x77\x66\x5a\x44\x68\x6a\x48\x72\x4d\x58\x4c\x7a\x78\x72\x75\x42\x32\x39\x53\x43\x59\x47\x50\x6f\x49\x62\x30\x41\x67\x75\x47\x79\x65\x62\x54\x79\x78\x6e\x30\x43\x4d\x65\x56\x79\x32\x39\x59\x7a\x77\x61\x47\x43\x67\x66\x4a\x41\x32\x66\x4e\x7a\x73\x62\x50\x43\x59\x62\x55\x42\x33\x71\x47\x41\x77\x35\x5a\x44\x67\x66\x53\x42\x67\x76\x4b\x6c\x49\x62\x6a\x42\x4e\x6e\x30\x79\x77\x58\x53\x69\x68\x7a\x50\x79\x73\x62\x47\x43\x67\x35\x57\x42\x73\x62\x48\x7a\x67\x71\x47\x71\x67\x31\x48\x43\x33\x72\x59\x79\x73\x39\x4a\x42\x33\x6a\x4c\x79\x63\x34','\x79\x78\x6a\x4e\x44\x77\x31\x4c\x42\x4e\x72\x5a','\x72\x33\x48\x57\x72\x31\x43','\x79\x32\x39\x55\x44\x67\x76\x34\x44\x61','\x43\x33\x72\x59\x41\x77\x35\x4e\x41\x77\x7a\x35','\x72\x67\x31\x55\x77\x65\x71','\x75\x4e\x76\x55\x69\x67\x65\x47\x43\x32\x48\x4c\x42\x67\x57\x47\x79\x32\x39\x54\x42\x77\x66\x55\x7a\x63\x62\x56\x42\x49\x62\x48\x69\x67\x7a\x53\x7a\x77\x76\x30\x6a\x33\x6d\x47\x44\x32\x39\x59\x41\x32\x76\x59\x43\x59\x62\x50\x42\x49\x62\x57\x79\x78\x6a\x48\x42\x67\x58\x4c\x42\x63\x34\x47\x72\x67\x76\x4d\x79\x78\x76\x53\x44\x68\x6d\x47\x44\x67\x38\x47\x79\x77\x58\x53\x69\x68\x44\x56\x43\x4d\x54\x4c\x43\x4e\x6d\x37\x69\x68\x62\x48\x43\x33\x6d\x47\x79\x67\x31\x48\x79\x32\x48\x50\x42\x4d\x76\x5a\x79\x63\x62\x30\x42\x59\x62\x30\x79\x78\x6a\x4e\x7a\x78\x71\x47\x43\x33\x62\x4c\x79\x32\x4c\x4d\x41\x77\x6d\x47\x42\x32\x35\x4c\x43\x59\x34\x47\x75\x4d\x76\x30\x44\x78\x6a\x55\x43\x59\x62\x57\x7a\x78\x69\x54\x42\x77\x66\x4a\x41\x67\x4c\x55\x7a\x73\x62\x37\x42\x32\x53\x53\x69\x68\x6a\x4c\x43\x33\x76\x53\x44\x64\x38\x53\x69\x67\x76\x59\x43\x4d\x39\x59\x70\x33\x30\x47\x7a\x77\x35\x30\x43\x4d\x4c\x4c\x43\x59\x34','\x43\x32\x39\x31\x43\x4d\x6e\x4c','\x74\x33\x62\x30\x41\x77\x39\x55\x79\x77\x57\x47\x42\x77\x76\x30\x79\x77\x72\x48\x44\x67\x65\x47\x43\x33\x72\x48\x42\x78\x62\x4c\x7a\x63\x62\x56\x42\x49\x62\x4c\x44\x4d\x76\x59\x45\x73\x62\x4d\x42\x67\x76\x4c\x44\x63\x62\x54\x7a\x77\x31\x49\x7a\x78\x69\x55','\x41\x4e\x62\x4c\x7a\x57','\x44\x4b\x7a\x5a\x75\x30\x65','\x43\x68\x76\x5a\x41\x61','\x72\x78\x48\x4c\x79\x33\x76\x30\x7a\x73\x62\x4a\x42\x32\x72\x4c\x69\x67\x4c\x55\x69\x67\x65\x47\x43\x67\x76\x59\x43\x32\x4c\x5a\x44\x67\x76\x55\x44\x63\x62\x53\x79\x77\x35\x4e\x44\x77\x66\x4e\x7a\x73\x62\x52\x7a\x78\x6a\x55\x7a\x77\x57\x47\x41\x77\x35\x5a\x41\x77\x72\x4c\x69\x68\x72\x4f\x7a\x73\x62\x5a\x79\x77\x35\x4b\x79\x4d\x39\x34\x6c\x49\x62\x77\x79\x78\x6a\x50\x79\x77\x6a\x53\x7a\x78\x6d\x47\x43\x67\x76\x59\x43\x32\x4c\x5a\x44\x63\x62\x48\x79\x33\x6a\x56\x43\x33\x6d\x47\x79\x32\x66\x53\x42\x68\x6d\x47\x44\x32\x4c\x30\x41\x63\x62\x30\x41\x67\x75\x47\x43\x32\x66\x54\x7a\x73\x62\x5a\x7a\x78\x6e\x5a\x41\x77\x39\x55\x6c\x49\x62\x73\x7a\x78\x72\x31\x43\x4d\x35\x5a\x69\x68\x6e\x30\x7a\x67\x39\x31\x44\x63\x57\x47\x43\x33\x72\x4b\x7a\x78\x6a\x59\x6c\x63\x62\x4c\x45\x67\x4c\x30\x69\x67\x6e\x56\x7a\x67\x75\x53\x69\x67\x66\x55\x7a\x63\x62\x48\x69\x68\x72\x35\x43\x67\x76\x4b\x69\x67\x62\x59\x7a\x78\x6e\x31\x42\x68\x72\x5a\x79\x63\x62\x48\x43\x4e\x6a\x48\x45\x73\x62\x4a\x42\x32\x35\x30\x79\x77\x4c\x55\x41\x77\x35\x4e\x69\x67\x31\x48\x44\x68\x62\x53\x42\x33\x72\x53\x41\x77\x69\x47\x7a\x4d\x4c\x4e\x44\x78\x6a\x4c\x43\x59\x61\x4f\x79\x4d\x66\x5a\x7a\x74\x79\x30\x69\x66\x62\x6f\x72\x59\x4b\x53\x69\x68\x62\x48\x42\x4d\x72\x48\x43\x59\x62\x65\x79\x78\x72\x48\x72\x4e\x6a\x48\x42\x77\x76\x5a\x6c\x63\x62\x6b\x75\x30\x39\x6f\x69\x68\x7a\x50\x79\x73\x62\x4b\x41\x78\x6e\x57\x42\x67\x66\x35\x6b\x63\x4b\x53\x69\x67\x39\x59\x69\x67\x76\x59\x43\x4d\x39\x59\x43\x59\x34\x47\x75\x68\x6a\x4c\x7a\x4d\x76\x59\x69\x68\x72\x4f\x41\x78\x6d\x47\x42\x33\x7a\x4c\x43\x49\x62\x5a\x79\x77\x35\x4b\x79\x4d\x39\x34\x78\x32\x76\x34\x7a\x77\x6d\x47\x7a\x4d\x39\x59\x69\x67\x66\x55\x45\x73\x62\x4a\x42\x32\x72\x4c\x69\x68\x72\x4f\x79\x78\x71\x47\x42\x4d\x76\x4c\x7a\x68\x6d\x47\x43\x33\x72\x59\x44\x77\x6e\x30\x44\x78\x6a\x4c\x7a\x63\x62\x56\x44\x78\x72\x57\x44\x78\x71\x55','\x43\x67\x66\x59\x43\x32\x75','\x74\x67\x4c\x5a\x44\x66\x72\x56\x42\x32\x58\x5a\x75\x4d\x76\x58\x44\x77\x76\x5a\x44\x66\x6e\x4a\x41\x67\x76\x54\x79\x71','\x72\x78\x4c\x41\x45\x78\x75','\x79\x32\x39\x55\x44\x67\x4c\x55\x44\x77\x76\x46\x42\x32\x35\x46\x7a\x78\x6a\x59\x42\x33\x69','\x43\x32\x76\x48\x43\x4d\x6e\x4f','\x45\x78\x62\x79\x41\x76\x61','\x7a\x4e\x76\x55\x79\x33\x72\x50\x42\x32\x34','\x74\x33\x62\x30\x41\x77\x39\x55\x79\x77\x57\x47\x7a\x67\x4c\x5a\x43\x67\x58\x48\x45\x73\x62\x55\x79\x77\x31\x4c\x69\x67\x7a\x56\x43\x49\x62\x30\x41\x67\x75\x47\x43\x32\x66\x55\x7a\x67\x6a\x56\x45\x63\x34','\x43\x32\x66\x55\x7a\x67\x6a\x56\x45\x66\x39\x50\x7a\x61','\x7a\x32\x76\x30','\x73\x77\x71\x47\x43\x4d\x76\x30\x44\x78\x6a\x55\x7a\x77\x71\x47\x79\x4e\x4b\x47\x43\x32\x66\x55\x7a\x67\x6a\x56\x45\x66\x39\x4a\x43\x4d\x76\x48\x44\x67\x75\x55','\x6d\x74\x61\x58\x6e\x64\x75\x34\x6e\x67\x6a\x56\x79\x78\x6a\x35\x42\x57','\x43\x32\x76\x30','\x6d\x63\x34\x57\x6c\x4a\x61','\x43\x33\x7a\x4e','\x79\x33\x6a\x4c\x79\x78\x72\x4c\x74\x77\x6e\x57\x75\x32\x76\x59\x44\x4d\x76\x59\x6b\x63\x4b\x36\x69\x68\x72\x4f\x7a\x73\x62\x47\x71\x67\x31\x56\x7a\x67\x76\x53\x79\x32\x39\x55\x44\x67\x76\x34\x44\x68\x62\x59\x42\x33\x72\x56\x79\x32\x39\x53\x6c\x33\x6e\x4b\x41\x32\x61\x47\x43\x67\x66\x4a\x41\x32\x66\x4e\x7a\x73\x62\x50\x43\x59\x62\x55\x42\x33\x71\x47\x41\x77\x35\x5a\x44\x67\x66\x53\x42\x67\x76\x4b\x6c\x49\x62\x6a\x42\x4e\x6e\x30\x79\x77\x58\x53\x69\x67\x4c\x30\x69\x68\x7a\x50\x79\x73\x62\x47\x43\x67\x35\x57\x42\x73\x62\x48\x7a\x67\x71\x47\x71\x67\x31\x56\x7a\x67\x76\x53\x79\x32\x39\x55\x44\x67\x76\x34\x44\x68\x62\x59\x42\x33\x72\x56\x79\x32\x39\x53\x6c\x33\x6e\x4b\x41\x32\x61\x55','\x72\x66\x6e\x56\x76\x30\x38','\x43\x32\x66\x55\x7a\x67\x6a\x56\x45\x66\x39\x53\x41\x78\x6e\x30','\x43\x67\x66\x30\x41\x61','\x43\x32\x66\x55\x7a\x67\x6a\x56\x45\x66\x39\x59\x44\x77\x35\x46\x79\x32\x39\x54\x42\x77\x66\x55\x7a\x61','\x75\x67\x76\x59\x6c\x77\x31\x48\x79\x32\x48\x50\x42\x4d\x75\x47\x44\x67\x4c\x54\x7a\x77\x39\x31\x44\x63\x34\x47\x72\x67\x76\x4d\x79\x78\x76\x53\x44\x63\x61\x32\x6d\x64\x61\x57\x6d\x63\x34','\x6e\x74\x65\x34\x6e\x64\x69\x34\x6f\x75\x54\x6b\x42\x68\x4c\x7a\x74\x47','\x43\x78\x76\x35\x7a\x66\x4b','\x74\x67\x4c\x5a\x44\x63\x62\x30\x41\x67\x75\x47\x7a\x4d\x58\x4c\x7a\x78\x71\x4e\x43\x59\x62\x54\x79\x77\x6e\x4f\x41\x77\x35\x4c\x43\x59\x62\x48\x42\x4d\x71\x47\x44\x67\x48\x4c\x41\x78\x69\x47\x43\x67\x76\x59\x6c\x77\x31\x48\x79\x32\x48\x50\x42\x4d\x75\x47\x43\x33\x72\x48\x44\x67\x75\x47\x6b\x68\x6a\x31\x42\x4d\x35\x50\x42\x4d\x43\x47\x6c\x59\x62\x5a\x44\x67\x39\x57\x43\x67\x76\x4b\x69\x63\x38\x47\x7a\x4d\x66\x50\x42\x67\x76\x4b\x6b\x73\x62\x57\x42\x68\x76\x5a\x69\x67\x58\x48\x43\x33\x71\x54\x44\x78\x6e\x4c\x7a\x63\x62\x30\x41\x77\x31\x4c\x43\x33\x72\x48\x42\x78\x62\x5a\x6c\x47','\x76\x33\x6a\x50\x44\x67\x75\x47\x79\x73\x62\x4d\x41\x77\x58\x4c\x69\x67\x4c\x55\x69\x68\x72\x4f\x7a\x73\x62\x5a\x79\x77\x35\x4b\x79\x4d\x39\x34\x6c\x49\x62\x64\x43\x4d\x76\x48\x44\x67\x76\x5a\x69\x68\x62\x48\x43\x4d\x76\x55\x44\x63\x62\x4b\x41\x78\x6a\x4c\x79\x33\x72\x56\x43\x4d\x4c\x4c\x43\x59\x62\x48\x43\x59\x62\x55\x7a\x77\x76\x4b\x7a\x77\x71\x55\x69\x65\x39\x32\x7a\x78\x6a\x33\x43\x4d\x4c\x30\x7a\x78\x6d\x47\x7a\x78\x48\x50\x43\x33\x72\x50\x42\x4d\x43\x47\x7a\x4d\x4c\x53\x7a\x78\x6d\x55','\x79\x4d\x66\x5a\x7a\x74\x79\x30','\x43\x32\x39\x54\x7a\x71','\x72\x4e\x76\x53\x42\x63\x62\x4d\x41\x77\x58\x4c\x69\x67\x6e\x56\x42\x4e\x72\x4c\x42\x4e\x72\x5a\x6c\x47','\x71\x33\x6a\x4c\x79\x78\x72\x4c\x69\x67\x66\x55\x69\x67\x4c\x5a\x42\x32\x58\x48\x44\x67\x76\x4b\x69\x68\x6e\x48\x42\x4d\x72\x49\x42\x33\x47\x47\x7a\x77\x35\x32\x41\x78\x6a\x56\x42\x4d\x31\x4c\x42\x4e\x71\x47\x79\x77\x35\x4b\x69\x68\x6a\x4c\x44\x68\x76\x59\x42\x49\x62\x50\x44\x68\x6d\x47\x41\x77\x71\x47\x7a\x4d\x39\x59\x69\x68\x76\x5a\x7a\x73\x62\x33\x41\x78\x72\x4f\x69\x68\x6e\x48\x42\x4d\x72\x49\x42\x33\x48\x46\x43\x4e\x76\x55\x78\x32\x6e\x56\x42\x77\x31\x48\x42\x4d\x71\x55\x69\x66\x76\x5a\x7a\x73\x62\x30\x41\x67\x4c\x5a\x69\x68\x44\x4f\x7a\x77\x34\x47\x44\x67\x48\x4c\x69\x68\x76\x5a\x7a\x78\x69\x47\x42\x4d\x76\x4c\x7a\x68\x6d\x47\x79\x32\x39\x4b\x7a\x73\x62\x4c\x45\x67\x76\x4a\x44\x78\x72\x4c\x7a\x63\x57\x47\x7a\x4d\x4c\x53\x7a\x78\x6d\x47\x79\x77\x35\x48\x42\x68\x4c\x36\x7a\x77\x71\x53\x69\x67\x39\x59\x69\x67\x6e\x56\x42\x77\x31\x48\x42\x4d\x72\x5a\x69\x68\x6a\x31\x42\x49\x62\x50\x42\x49\x62\x48\x69\x68\x6e\x4c\x79\x33\x76\x59\x7a\x73\x62\x4c\x42\x4e\x7a\x50\x43\x4d\x39\x55\x42\x77\x76\x55\x44\x63\x34\x47\x76\x67\x48\x4c\x69\x68\x6e\x48\x42\x4d\x72\x49\x42\x33\x47\x47\x71\x4b\x4c\x6d\x74\x66\x6d\x47\x44\x77\x35\x30\x41\x77\x57\x47\x7a\x67\x76\x5a\x44\x68\x6a\x56\x45\x77\x76\x4b\x69\x6f\x6b\x61\x4c\x63\x62\x4a\x79\x77\x58\x53\x69\x68\x6e\x48\x42\x4d\x72\x49\x42\x33\x48\x46\x7a\x67\x76\x5a\x44\x68\x6a\x56\x45\x73\x62\x33\x41\x67\x76\x55\x69\x68\x72\x4f\x7a\x73\x62\x33\x42\x33\x6a\x52\x69\x67\x4c\x5a\x69\x67\x72\x56\x42\x4d\x75\x55','\x71\x32\x39\x55\x44\x67\x4c\x55\x44\x77\x75\x47\x7a\x67\x76\x53\x7a\x78\x72\x50\x42\x4d\x43\x47\x43\x4d\x76\x54\x79\x77\x4c\x55\x41\x77\x35\x4e\x69\x67\x31\x48\x79\x32\x48\x50\x42\x4d\x76\x5a\x69\x67\x4c\x4d\x69\x67\x39\x55\x7a\x73\x62\x4d\x79\x77\x4c\x53\x43\x59\x34','\x74\x31\x50\x6c\x43\x4e\x69','\x44\x4d\x54\x6c\x41\x4b\x47','\x75\x67\x76\x59\x6c\x77\x6e\x48\x42\x67\x57\x47\x44\x67\x4c\x54\x7a\x77\x39\x31\x44\x63\x34\x47\x6d\x63\x62\x4b\x41\x78\x6e\x48\x79\x4d\x58\x4c\x43\x59\x34\x47\x72\x67\x76\x4d\x79\x78\x76\x53\x44\x63\x61\x32\x6d\x64\x61\x57\x6d\x63\x34','\x44\x68\x4c\x57\x7a\x71','\x43\x33\x72\x4b\x7a\x78\x6a\x59','\x77\x4b\x44\x76\x72\x75\x38','\x41\x77\x31\x48\x7a\x32\x75\x56\x43\x67\x35\x4e','\x79\x33\x6a\x4c\x79\x78\x72\x4c','\x79\x4d\x39\x56\x42\x67\x76\x48\x42\x47','\x79\x77\x58\x53\x42\x33\x43','\x43\x33\x72\x59\x41\x77\x35\x4e','\x7a\x4d\x58\x4c\x7a\x78\x72\x6a\x7a\x61','\x71\x67\x31\x48\x43\x33\x72\x59\x79\x73\x39\x4a\x42\x33\x6a\x4c','\x72\x67\x76\x53\x7a\x78\x72\x4c\x69\x67\x65\x47\x43\x32\x66\x55\x7a\x67\x6a\x56\x45\x63\x62\x4a\x43\x4d\x76\x48\x44\x67\x76\x4b\x69\x68\x44\x50\x44\x67\x47\x47\x43\x32\x66\x55\x7a\x67\x6a\x56\x45\x66\x39\x4a\x43\x4d\x76\x48\x44\x67\x75\x55\x69\x66\x6e\x30\x42\x33\x62\x5a\x69\x67\x6a\x50\x42\x67\x58\x50\x42\x4d\x43\x47\x41\x77\x31\x54\x7a\x77\x72\x50\x79\x78\x72\x4c\x42\x68\x4b\x55\x69\x65\x6e\x48\x42\x67\x57\x47\x44\x67\x48\x50\x43\x59\x62\x56\x42\x4d\x6e\x4c\x69\x68\x72\x4f\x7a\x73\x62\x5a\x79\x77\x35\x4b\x79\x4d\x39\x34\x7a\x77\x71\x47\x44\x32\x39\x59\x41\x59\x62\x50\x43\x59\x62\x4d\x41\x77\x35\x50\x43\x32\x48\x4c\x7a\x64\x53\x47\x42\x33\x6a\x57\x41\x67\x66\x55\x7a\x77\x71\x47\x43\x32\x66\x55\x7a\x67\x6a\x56\x45\x67\x76\x5a\x69\x67\x54\x4c\x7a\x78\x61\x47\x79\x77\x6e\x4a\x43\x4e\x76\x50\x42\x4d\x43\x47\x79\x32\x39\x5a\x44\x63\x34','\x72\x66\x6e\x4a\x45\x67\x47','\x41\x77\x35\x57\x44\x78\x72\x74\x79\x32\x48\x4c\x42\x77\x65','\x42\x67\x4c\x5a\x44\x61','\x43\x4d\x76\x5a\x44\x77\x58\x30\x43\x57','\x43\x32\x76\x5a\x43\x32\x4c\x56\x42\x4b\x4c\x4b','\x75\x33\x62\x48\x44\x32\x34\x47\x79\x73\x62\x4d\x42\x67\x76\x4c\x44\x63\x62\x56\x7a\x49\x62\x6f\x69\x68\x6e\x48\x42\x4d\x72\x49\x42\x33\x48\x4c\x43\x59\x62\x4d\x43\x4d\x39\x54\x69\x67\x65\x47\x44\x67\x76\x54\x43\x67\x58\x48\x44\x67\x75\x53\x69\x68\x44\x50\x44\x67\x47\x47\x79\x73\x62\x4a\x42\x32\x39\x59\x7a\x67\x4c\x55\x79\x78\x72\x56\x43\x49\x62\x57\x42\x68\x76\x5a\x69\x65\x34\x47\x44\x32\x39\x59\x41\x32\x76\x59\x43\x59\x62\x5a\x41\x67\x66\x59\x41\x77\x35\x4e\x69\x67\x65\x47\x44\x32\x39\x59\x41\x33\x6e\x57\x79\x77\x6e\x4c\x6c\x49\x62\x73\x7a\x78\x72\x31\x43\x4d\x35\x5a\x69\x68\x72\x4f\x7a\x73\x62\x4d\x42\x67\x76\x4c\x44\x63\x62\x50\x7a\x63\x62\x48\x42\x4d\x71\x47\x44\x67\x48\x4c\x69\x67\x31\x48\x79\x32\x48\x50\x42\x4d\x75\x47\x41\x77\x72\x5a\x6c\x49\x62\x66\x79\x77\x6e\x4f\x69\x68\x44\x56\x43\x4d\x54\x4c\x43\x49\x62\x4f\x79\x78\x6d\x47\x41\x78\x72\x5a\x69\x67\x39\x33\x42\x49\x62\x57\x7a\x78\x6a\x5a\x41\x78\x6e\x30\x7a\x77\x35\x30\x69\x67\x6e\x56\x7a\x67\x75\x54\x7a\x78\x48\x4c\x79\x33\x76\x30\x41\x77\x39\x55\x69\x67\x54\x4c\x43\x4d\x35\x4c\x42\x64\x53\x47\x44\x67\x48\x4c\x69\x68\x6e\x48\x42\x77\x75\x47\x44\x32\x39\x59\x41\x33\x6e\x57\x79\x77\x6e\x4c\x69\x67\x4c\x5a\x69\x67\x31\x56\x44\x77\x35\x30\x7a\x77\x71\x47\x79\x77\x6e\x59\x42\x33\x6e\x5a\x69\x68\x72\x4f\x7a\x77\x30\x55\x69\x65\x6e\x70\x75\x31\x72\x74\x69\x66\x6e\x64\x71\x75\x58\x66\x69\x65\x58\x6a\x74\x4b\x76\x62\x75\x4b\x58\x7a\x69\x68\x44\x50\x44\x67\x47\x47\x79\x68\x44\x56\x43\x4d\x54\x4c\x43\x4e\x6e\x47\x6c\x49\x62\x76\x43\x32\x75\x47\x43\x32\x66\x55\x7a\x67\x6a\x56\x45\x66\x39\x4d\x42\x67\x76\x4c\x44\x66\x39\x4b\x7a\x78\x6e\x30\x43\x4d\x39\x35\x69\x68\x44\x4f\x7a\x77\x34\x47\x7a\x67\x39\x55\x7a\x73\x34','\x43\x4d\x76\x48\x7a\x61','\x44\x67\x76\x54\x43\x67\x58\x48\x44\x67\x76\x46\x41\x77\x71','\x76\x67\x4c\x54\x7a\x77\x39\x31\x44\x63\x62\x50\x42\x49\x62\x54\x41\x77\x58\x53\x41\x78\x6e\x4c\x79\x32\x39\x55\x7a\x68\x6d\x55\x69\x65\x72\x4c\x7a\x4d\x66\x31\x42\x68\x71\x47\x6e\x4a\x61\x57\x6d\x64\x61\x55','\x44\x67\x39\x56\x42\x66\x39\x4a\x79\x77\x58\x53\x43\x57','\x6d\x5a\x7a\x75\x44\x4b\x72\x64\x77\x66\x47','\x42\x4d\x66\x54\x7a\x71','\x74\x65\x50\x7a\x41\x75\x69','\x79\x32\x39\x55\x44\x67\x76\x55\x44\x61','\x43\x66\x44\x48\x79\x30\x65','\x75\x4d\x4c\x57\x7a\x33\x6a\x4c\x43\x63\x31\x5a\x44\x68\x4c\x53\x7a\x73\x62\x4a\x42\x32\x72\x4c\x69\x68\x6e\x4c\x79\x78\x6a\x4a\x41\x63\x34\x47\x75\x4d\x76\x30\x44\x78\x6a\x55\x43\x59\x62\x54\x79\x78\x72\x4a\x41\x67\x4c\x55\x7a\x59\x62\x53\x41\x77\x35\x4c\x43\x59\x62\x33\x41\x78\x72\x4f\x69\x68\x6e\x31\x43\x4e\x6a\x56\x44\x77\x35\x4b\x41\x77\x35\x4e\x69\x67\x6e\x56\x42\x4e\x72\x4c\x45\x68\x71\x55','\x75\x32\x48\x4c\x42\x67\x57\x47\x79\x32\x39\x54\x42\x77\x66\x55\x7a\x63\x62\x53\x41\x77\x35\x4c\x6c\x47','\x73\x32\x76\x59\x42\x4d\x76\x53\x69\x67\x58\x48\x42\x4d\x44\x31\x79\x77\x44\x4c\x6c\x47','\x77\x4d\x39\x6c\x43\x78\x61','\x6f\x74\x4b\x35\x6d\x74\x66\x7a\x42\x4c\x50\x41\x73\x4d\x79','\x7a\x4d\x58\x4c\x7a\x78\x72\x5a','\x45\x4d\x76\x63\x74\x68\x69','\x44\x32\x39\x59\x41\x32\x76\x59\x6c\x71','\x75\x32\x76\x59\x44\x4d\x76\x59','\x41\x31\x72\x75\x43\x76\x75','\x42\x77\x76\x5a\x43\x32\x66\x4e\x7a\x71','\x77\x4b\x50\x68\x43\x66\x71','\x6e\x64\x6d\x58\x6d\x5a\x61\x59\x7a\x76\x72\x71\x79\x4d\x6e\x6c','\x79\x33\x44\x4b','\x75\x75\x58\x4f\x43\x32\x65','\x41\x77\x35\x57\x44\x78\x71','\x41\x32\x76\x35\x43\x57','\x71\x67\x31\x56\x7a\x67\x76\x53\x79\x32\x39\x55\x44\x67\x76\x34\x44\x68\x62\x59\x42\x33\x72\x56\x79\x32\x39\x53\x6c\x33\x6e\x4b\x41\x59\x39\x30\x45\x78\x62\x4c\x43\x59\x35\x51\x43\x57','\x43\x32\x66\x55\x7a\x67\x6a\x56\x45\x66\x39\x59\x7a\x77\x66\x4b','\x44\x4d\x4c\x69\x73\x33\x75','\x6d\x74\x65\x57\x77\x66\x48\x66\x7a\x32\x39\x51','\x42\x4e\x76\x54\x79\x4d\x76\x59','\x43\x32\x66\x55\x7a\x67\x6a\x56\x45\x66\x39\x4d\x42\x67\x76\x4c\x44\x66\x39\x5a\x44\x67\x66\x30\x44\x78\x6d','\x44\x67\x39\x56\x42\x61','\x41\x4e\x6e\x56\x42\x4c\x6e\x4a\x41\x67\x76\x54\x79\x71','\x43\x4e\x76\x55\x71\x32\x39\x4b\x7a\x71','\x72\x78\x48\x4c\x79\x33\x76\x30\x7a\x73\x62\x48\x69\x68\x6e\x4f\x7a\x77\x58\x53\x69\x67\x6e\x56\x42\x77\x31\x48\x42\x4d\x71\x47\x41\x77\x34\x47\x79\x73\x62\x57\x43\x4d\x76\x32\x41\x77\x39\x31\x43\x32\x58\x35\x69\x67\x6e\x59\x7a\x77\x66\x30\x7a\x77\x71\x47\x43\x32\x66\x55\x7a\x67\x6a\x56\x45\x63\x62\x48\x42\x4d\x71\x47\x43\x4d\x76\x30\x44\x78\x6a\x55\x69\x68\x54\x5a\x44\x67\x72\x56\x44\x78\x71\x53\x69\x68\x6e\x30\x7a\x67\x76\x59\x43\x49\x57\x47\x7a\x78\x48\x50\x44\x65\x6e\x56\x7a\x67\x76\x39\x6c\x49\x62\x75\x41\x67\x75\x47\x43\x32\x66\x55\x7a\x67\x6a\x56\x45\x63\x62\x54\x44\x78\x6e\x30\x69\x67\x76\x34\x41\x78\x6e\x30\x69\x6f\x6b\x61\x4c\x63\x62\x4a\x43\x4d\x76\x48\x44\x67\x75\x47\x41\x78\x71\x47\x7a\x4d\x4c\x59\x43\x33\x71\x47\x44\x32\x4c\x30\x41\x63\x62\x5a\x79\x77\x35\x4b\x79\x4d\x39\x34\x78\x32\x6e\x59\x7a\x77\x66\x30\x7a\x73\x34','\x44\x4c\x6e\x56\x77\x4b\x71','\x79\x32\x39\x55\x42\x4d\x76\x4a\x44\x61','\x44\x67\x76\x34\x44\x61','\x43\x33\x72\x48\x44\x68\x76\x5a','\x44\x77\x35\x50\x44\x4d\x76\x59\x43\x32\x66\x53','\x79\x32\x58\x56\x43\x32\x75','\x43\x67\x66\x59\x79\x77\x31\x5a','\x74\x33\x62\x30\x41\x77\x39\x55\x79\x77\x57\x47\x43\x33\x76\x49\x43\x32\x76\x30\x69\x67\x39\x4d\x69\x67\x31\x48\x79\x32\x48\x50\x42\x4d\x75\x47\x41\x77\x72\x5a\x6c\x49\x62\x65\x7a\x77\x7a\x48\x44\x77\x58\x30\x43\x59\x62\x30\x42\x59\x62\x48\x42\x67\x57\x47\x44\x32\x39\x59\x41\x32\x76\x59\x43\x59\x34','\x72\x68\x72\x67\x44\x4e\x61','\x43\x32\x66\x55\x7a\x67\x6a\x56\x45\x66\x39\x5a\x7a\x77\x66\x59\x79\x32\x47','\x43\x33\x72\x4b\x42\x33\x76\x30','\x43\x32\x66\x55\x7a\x67\x6a\x56\x45\x66\x39\x4d\x42\x67\x76\x4c\x44\x66\x39\x4b\x7a\x78\x6e\x30\x43\x4d\x39\x35','\x79\x78\x6a\x59\x79\x78\x4b','\x44\x67\x4c\x54\x7a\x77\x39\x31\x44\x66\x39\x54\x43\x57','\x71\x77\x48\x68\x76\x31\x71','\x76\x4d\x39\x48\x41\x4d\x38','\x6e\x4b\x4c\x6d\x76\x78\x76\x4d\x7a\x57','\x75\x32\x39\x31\x43\x4d\x6e\x4c\x69\x67\x6e\x56\x7a\x67\x75\x47\x44\x67\x38\x47\x43\x4e\x76\x55\x6c\x49\x62\x6e\x44\x77\x58\x30\x41\x73\x31\x53\x41\x77\x35\x4c\x69\x68\x6e\x31\x43\x68\x62\x56\x43\x4e\x72\x4c\x7a\x63\x34','\x72\x32\x35\x64\x71\x32\x30','\x76\x77\x35\x52\x42\x4d\x39\x33\x42\x49\x62\x4d\x42\x67\x76\x4c\x44\x63\x62\x30\x42\x32\x39\x53\x6f\x49\x61','\x42\x67\x66\x55\x7a\x33\x76\x48\x7a\x32\x75','\x43\x32\x76\x30\x75\x4d\x76\x58\x44\x77\x76\x5a\x44\x65\x48\x48\x42\x4d\x72\x53\x7a\x78\x69','\x75\x32\x66\x55\x7a\x67\x6a\x56\x45\x63\x61','\x76\x77\x39\x66\x42\x4c\x6d','\x72\x67\x76\x53\x7a\x78\x72\x4c\x69\x68\x72\x4f\x7a\x73\x62\x4d\x42\x67\x76\x4c\x44\x63\x62\x48\x42\x4d\x71\x47\x7a\x78\x7a\x4c\x43\x4e\x4b\x47\x42\x77\x66\x4a\x41\x67\x4c\x55\x7a\x73\x62\x50\x42\x49\x62\x50\x44\x63\x34\x47\x75\x33\x72\x56\x43\x68\x6d\x47\x79\x4d\x4c\x53\x42\x67\x4c\x55\x7a\x59\x62\x50\x42\x77\x31\x4c\x7a\x67\x4c\x48\x44\x67\x76\x53\x45\x73\x34\x47\x71\x32\x66\x53\x42\x63\x62\x30\x41\x67\x4c\x5a\x69\x68\x44\x4f\x7a\x77\x34\x47\x44\x67\x48\x4c\x69\x67\x6e\x48\x42\x78\x62\x48\x41\x77\x44\x55\x69\x67\x4c\x5a\x69\x67\x72\x56\x42\x4d\x75\x37\x69\x67\x39\x59\x43\x67\x48\x48\x42\x4d\x76\x4b\x69\x67\x7a\x53\x7a\x77\x76\x30\x43\x59\x62\x52\x7a\x77\x76\x57\x69\x67\x6a\x31\x43\x4d\x35\x50\x42\x4d\x43\x47\x79\x33\x6a\x4c\x7a\x67\x4c\x30\x43\x59\x34','\x43\x32\x66\x55\x7a\x67\x6a\x56\x45\x66\x39\x4d\x42\x67\x76\x4c\x44\x66\x39\x5a\x43\x67\x66\x33\x42\x47','\x44\x4d\x66\x53\x44\x77\x76\x5a','\x41\x77\x31\x48\x7a\x32\x75\x56\x41\x4e\x62\x4c\x7a\x57','\x42\x77\x66\x57','\x41\x67\x66\x5a','\x75\x68\x76\x49\x42\x67\x4c\x4a\x69\x68\x72\x4c\x42\x78\x62\x53\x79\x78\x72\x4c\x69\x68\x6e\x53\x44\x77\x43\x47\x42\x33\x69\x47\x41\x77\x71\x47\x6b\x67\x75\x55\x7a\x59\x34\x47\x6a\x33\x62\x35\x44\x67\x48\x56\x42\x49\x31\x4b\x79\x78\x72\x48\x6c\x78\x6e\x4a\x41\x77\x76\x55\x79\x32\x75\x4e\x6b\x73\x34','\x76\x32\x39\x59\x41\x32\x4c\x55\x7a\x59\x62\x4b\x41\x78\x6a\x4c\x79\x33\x72\x56\x43\x4e\x4b\x55\x69\x65\x39\x57\x44\x67\x4c\x56\x42\x4d\x66\x53\x6c\x47','\x79\x32\x39\x54\x42\x77\x66\x55\x7a\x61','\x7a\x67\x4c\x5a\x43\x67\x66\x30\x79\x32\x48\x66\x45\x67\x76\x4a','\x43\x67\x31\x78\x42\x78\x47','\x71\x77\x6e\x31\x43\x67\x65','\x44\x75\x76\x5a\x43\x76\x4f','\x79\x77\x58\x53','\x72\x67\x76\x4d\x79\x78\x76\x53\x44\x63\x61\x32\x6d\x64\x61\x57\x6d\x63\x34','\x7a\x67\x76\x53\x7a\x78\x72\x4c','\x79\x4d\x66\x5a\x41\x61','\x79\x33\x6a\x4c\x79\x78\x72\x4c\x76\x67\x39\x56\x42\x61','\x71\x67\x31\x56\x7a\x67\x76\x53\x79\x32\x39\x55\x44\x67\x76\x34\x44\x68\x62\x59\x42\x33\x72\x56\x79\x32\x39\x53\x6c\x33\x6e\x4b\x41\x59\x39\x5a\x7a\x78\x6a\x32\x7a\x78\x69\x56\x41\x77\x35\x4b\x7a\x78\x47\x55\x41\x4e\x6d','\x43\x32\x66\x55\x7a\x67\x6a\x56\x45\x66\x39\x4c\x45\x67\x76\x4a','\x44\x67\x66\x55\x7a\x32\x58\x4c\x6c\x78\x6e\x48\x42\x4d\x72\x49\x42\x33\x47','\x71\x32\x66\x53\x42\x66\x72\x56\x42\x32\x58\x73\x7a\x78\x66\x31\x7a\x78\x6e\x30\x75\x32\x6e\x4f\x7a\x77\x31\x48','\x6d\x5a\x61\x34\x6d\x4a\x43\x33\x44\x66\x76\x71\x74\x4b\x48\x71','\x76\x77\x35\x52\x42\x4d\x39\x33\x42\x49\x62\x30\x42\x32\x39\x53\x6f\x49\x61','\x44\x4d\x76\x59\x79\x32\x76\x53\x71\x77\x4c\x75\x42\x32\x39\x53\x43\x59\x47\x50\x6f\x49\x62\x30\x41\x67\x75\x47\x79\x67\x66\x50\x79\x63\x62\x57\x79\x77\x6e\x52\x79\x77\x44\x4c\x69\x67\x4c\x5a\x69\x67\x35\x56\x44\x63\x62\x50\x42\x4e\x6e\x30\x79\x77\x58\x53\x7a\x77\x71\x55\x69\x65\x4c\x55\x43\x33\x72\x48\x42\x67\x57\x47\x41\x78\x71\x47\x44\x4d\x4c\x48\x69\x67\x62\x57\x42\x4e\x62\x54\x69\x67\x66\x4b\x7a\x63\x62\x48\x41\x77\x61\x47\x6b\x67\x66\x55\x7a\x63\x62\x57\x41\x77\x6e\x52\x69\x67\x66\x55\x69\x67\x62\x61\x79\x77\x4b\x54\x43\x32\x72\x52\x6c\x59\x50\x47\x69\x67\x31\x56\x7a\x67\x76\x53\x69\x67\x66\x4b\x79\x78\x62\x30\x7a\x78\x69\x50\x6c\x47','\x44\x75\x7a\x7a\x77\x67\x65','\x42\x67\x76\x55\x7a\x33\x72\x4f','\x6e\x4e\x50\x57\x71\x4d\x44\x73\x79\x71','\x75\x33\x76\x49\x7a\x67\x4c\x59\x7a\x77\x6e\x30\x42\x33\x6a\x35\x69\x68\x72\x56\x69\x68\x6e\x4c\x79\x78\x6a\x4a\x41\x63\x34\x47\x74\x33\x62\x30\x41\x77\x39\x55\x79\x77\x57\x55','\x44\x4d\x76\x59\x43\x32\x4c\x56\x42\x47','\x43\x32\x66\x55\x7a\x67\x6a\x56\x45\x66\x39\x4a\x43\x4d\x76\x48\x44\x67\x75','\x43\x32\x66\x55\x7a\x67\x6a\x56\x45\x66\x39\x59\x44\x77\x35\x46\x79\x32\x39\x4b\x7a\x71','\x43\x32\x66\x55\x7a\x67\x6a\x56\x45\x66\x39\x33\x43\x4d\x4c\x30\x7a\x71','\x75\x4d\x76\x48\x7a\x63\x62\x48\x69\x67\x7a\x50\x42\x67\x75\x47\x7a\x4e\x6a\x56\x42\x73\x62\x30\x41\x67\x75\x47\x43\x32\x66\x55\x7a\x67\x6a\x56\x45\x63\x62\x4d\x41\x77\x58\x4c\x43\x33\x4c\x5a\x44\x67\x76\x54\x6c\x49\x62\x73\x7a\x77\x58\x48\x44\x67\x4c\x32\x7a\x73\x62\x57\x79\x78\x72\x4f\x43\x59\x62\x59\x7a\x78\x6e\x56\x42\x68\x7a\x4c\x69\x67\x7a\x59\x42\x32\x30\x47\x44\x67\x48\x4c\x69\x68\x44\x56\x43\x4d\x54\x5a\x43\x67\x66\x4a\x7a\x73\x62\x59\x42\x32\x39\x30\x6f\x59\x62\x48\x79\x4e\x6e\x56\x42\x68\x76\x30\x7a\x73\x62\x57\x79\x78\x72\x4f\x43\x59\x62\x59\x7a\x77\x66\x4b\x69\x68\x72\x4f\x7a\x73\x62\x4a\x42\x32\x35\x30\x79\x77\x4c\x55\x7a\x78\x69\x47\x7a\x4d\x4c\x53\x7a\x78\x6e\x35\x43\x33\x72\x4c\x42\x73\x62\x4b\x41\x78\x6a\x4c\x79\x33\x72\x53\x45\x73\x34','\x7a\x4d\x4c\x53\x44\x67\x76\x59','\x42\x32\x6a\x51\x7a\x77\x6e\x30','\x76\x77\x6a\x33\x71\x78\x69','\x6d\x4a\x47\x34\x74\x76\x4c\x6b\x43\x33\x76\x52','\x72\x77\x35\x32\x41\x78\x6a\x56\x42\x4d\x31\x4c\x42\x4e\x71\x47\x42\x4d\x66\x54\x7a\x73\x61\x4f\x7a\x73\x35\x4e\x6c\x49\x61\x4e\x44\x77\x35\x50\x44\x4d\x76\x59\x43\x32\x66\x53\x6a\x59\x62\x4d\x42\x33\x69\x47\x42\x78\x76\x53\x44\x67\x4b\x54\x42\x67\x66\x55\x7a\x33\x76\x48\x7a\x32\x75\x47\x74\x4d\x39\x4b\x7a\x73\x39\x71\x45\x78\x72\x4f\x42\x32\x34\x50\x6c\x49\x62\x65\x7a\x77\x7a\x48\x44\x77\x58\x30\x69\x63\x44\x31\x42\x4d\x4c\x32\x7a\x78\x6a\x5a\x79\x77\x57\x4e\x6c\x47','\x42\x77\x66\x52\x7a\x75\x48\x48\x42\x4d\x72\x53\x7a\x78\x69','\x74\x67\x4c\x5a\x44\x63\x62\x4c\x42\x4e\x72\x59\x41\x77\x76\x5a\x69\x67\x4c\x55\x69\x67\x65\x47\x7a\x67\x4c\x59\x7a\x77\x6e\x30\x42\x33\x6a\x35\x69\x68\x44\x50\x44\x67\x47\x47\x43\x32\x4c\x36\x7a\x73\x57\x47\x44\x68\x4c\x57\x7a\x73\x57\x47\x79\x77\x35\x4b\x69\x67\x31\x56\x7a\x67\x75\x55','\x7a\x67\x76\x5a\x79\x33\x6a\x50\x43\x68\x72\x50\x42\x32\x34','\x6d\x4a\x6d\x5a\x6d\x64\x6d\x32\x6e\x77\x48\x66\x77\x78\x62\x72\x42\x71','\x6e\x74\x65\x57\x6f\x74\x61\x5a\x74\x4b\x76\x31\x75\x4b\x44\x70','\x44\x67\x39\x56\x42\x66\x39\x59\x7a\x78\x6e\x31\x42\x68\x71','\x7a\x75\x50\x4f\x77\x77\x79','\x6c\x49\x34\x56\x6c\x49\x34\x56\x43\x67\x66\x4a\x41\x32\x66\x4e\x7a\x73\x35\x51\x43\x32\x39\x55','\x44\x4d\x76\x59\x79\x32\x76\x53\x71\x77\x4c\x67\x42\x67\x76\x4c\x44\x66\x72\x56\x42\x32\x58\x5a\x6b\x63\x4b\x36\x69\x68\x72\x4f\x7a\x73\x62\x47\x79\x77\x4c\x47\x69\x68\x62\x48\x79\x32\x54\x48\x7a\x32\x75\x47\x41\x78\x6d\x47\x42\x4d\x39\x30\x69\x67\x4c\x55\x43\x33\x72\x48\x42\x67\x58\x4c\x7a\x63\x34\x47\x73\x77\x35\x5a\x44\x67\x66\x53\x42\x63\x62\x32\x41\x77\x65\x47\x79\x68\x62\x55\x43\x67\x30\x47\x79\x77\x72\x4b\x69\x67\x66\x50\x79\x63\x34','\x74\x33\x62\x30\x41\x77\x39\x55\x79\x77\x57\x47\x44\x32\x39\x59\x41\x32\x4c\x55\x7a\x59\x62\x4b\x41\x78\x6a\x4c\x79\x33\x72\x56\x43\x4e\x4b\x47\x7a\x4d\x39\x59\x69\x68\x72\x4f\x7a\x73\x62\x4a\x42\x32\x31\x54\x79\x77\x35\x4b\x6c\x47','\x42\x77\x66\x5a\x44\x68\x6a\x48\x76\x67\x39\x56\x42\x68\x6d\x4f\x6b\x74\x4f\x47\x44\x67\x48\x4c\x69\x67\x62\x61\x42\x77\x66\x5a\x44\x68\x6a\x48\x6c\x32\x6e\x56\x43\x4d\x76\x47\x69\x68\x62\x48\x79\x32\x54\x48\x7a\x32\x75\x47\x41\x78\x6d\x47\x42\x4d\x39\x30\x69\x67\x4c\x55\x43\x33\x72\x48\x42\x67\x58\x4c\x7a\x63\x34\x47\x73\x77\x35\x5a\x44\x67\x66\x53\x42\x63\x62\x50\x44\x63\x62\x32\x41\x77\x65\x47\x79\x68\x62\x55\x43\x67\x30\x47\x79\x77\x72\x4b\x69\x65\x62\x54\x79\x78\x6e\x30\x43\x4d\x65\x56\x79\x32\x39\x59\x7a\x77\x61\x55','\x41\x77\x31\x48\x7a\x32\x75','\x42\x77\x66\x4a\x41\x67\x4c\x55\x7a\x78\x6d','\x7a\x78\x48\x4c\x79\x57','\x79\x33\x6a\x4c\x79\x78\x72\x4c\x76\x32\x4c\x30\x41\x65\x6e\x56\x42\x33\x6a\x4b\x41\x77\x35\x48\x44\x67\x39\x59','\x72\x67\x31\x59\x45\x78\x79','\x44\x32\x39\x59\x41\x32\x76\x59\x43\x57','\x43\x76\x50\x69\x75\x30\x71','\x7a\x4d\x58\x4c\x7a\x78\x72\x46\x41\x77\x71','\x77\x78\x62\x5a\x75\x30\x65'];a0_0x2a29=function(){return _0x26b11f;};return a0_0x2a29();}function openaiTools(_0xc5966d,_0x2b97c6={}){const _0x325224=a0_0x51cfca,_0x520bdd={'\x44\x6d\x6e\x58\x44':function(_0x297f01,_0x3cb14e){return _0x297f01(_0x3cb14e);},'\x7a\x65\x42\x4c\x72':_0x325224(0x15b)},_0x169dee=selectSpecs(_0x2b97c6[_0x325224(0x130)]),_0x42494c={'\x62\x6f\x78':_0xc5966d,'\x73\x65\x73\x73\x69\x6f\x6e\x49\x64':_0x2b97c6[_0x325224(0x139)]},_0x4df4b1=new Map();for(const _0x2b40c8 of _0x169dee)_0x4df4b1['\x73\x65\x74'](_0x2b40c8[_0x325224(0x140)],_0x2b40c8[_0x325224(0x19e)](_0x42494c));const _0x5e9a00=_0x169dee[_0x325224(0x17b)](_0xbaa4e=>({'\x74\x79\x70\x65':_0x325224(0x10f),'\x66\x75\x6e\x63\x74\x69\x6f\x6e':{'\x6e\x61\x6d\x65':_0xbaa4e[_0x325224(0x140)],'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':_0xbaa4e['\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e'],'\x70\x61\x72\x61\x6d\x65\x74\x65\x72\x73':_0xbaa4e[_0x325224(0x136)]}}));function _0x12536f(_0x22ff54){if(!_0x22ff54)return{};try{const _0x1f3d73=JSON['\x70\x61\x72\x73\x65'](_0x22ff54);return typeof _0x1f3d73==='\x6f\x62\x6a\x65\x63\x74'&&_0x1f3d73!==null?_0x1f3d73:{};}catch{return{};}}async function _0x4d414d(_0x583e74){const _0x22ee8d=_0x325224,_0x27576a=_0x4df4b1[_0x22ee8d(0x112)](_0x583e74[_0x22ee8d(0x10f)][_0x22ee8d(0x140)]);if(!_0x27576a)return{'\x72\x6f\x6c\x65':_0x22ee8d(0x15b),'\x74\x6f\x6f\x6c\x5f\x63\x61\x6c\x6c\x5f\x69\x64':_0x583e74['\x69\x64'],'\x63\x6f\x6e\x74\x65\x6e\x74':JSON[_0x22ee8d(0x1bb)]({'\x65\x72\x72\x6f\x72':_0x22ee8d(0x18e)+_0x583e74[_0x22ee8d(0x10f)][_0x22ee8d(0x140)]})};try{const _0x22d941=await _0x27576a(_0x520bdd[_0x22ee8d(0x1bc)](_0x12536f,_0x583e74['\x66\x75\x6e\x63\x74\x69\x6f\x6e'][_0x22ee8d(0x1b8)]));return{'\x72\x6f\x6c\x65':_0x22ee8d(0x15b),'\x74\x6f\x6f\x6c\x5f\x63\x61\x6c\x6c\x5f\x69\x64':_0x583e74['\x69\x64'],'\x63\x6f\x6e\x74\x65\x6e\x74':_0x520bdd[_0x22ee8d(0x1bc)](serializeToolResult,_0x22d941)};}catch(_0x4e121b){return{'\x72\x6f\x6c\x65':_0x520bdd[_0x22ee8d(0x14a)],'\x74\x6f\x6f\x6c\x5f\x63\x61\x6c\x6c\x5f\x69\x64':_0x583e74['\x69\x64'],'\x63\x6f\x6e\x74\x65\x6e\x74':JSON[_0x22ee8d(0x1bb)]({'\x65\x72\x72\x6f\x72':_0x4e121b instanceof Error?_0x4e121b[_0x22ee8d(0x14e)]:_0x520bdd[_0x22ee8d(0x1bc)](String,_0x4e121b)})};}}async function _0x226a0b(_0x977c38){const _0x2c0ba5=_0x325224,_0xd09ff9=_0x977c38[_0x2c0ba5(0x13e)]??[];return Promise[_0x2c0ba5(0x184)](_0xd09ff9[_0x2c0ba5(0x17b)](_0x4d414d));}return{'\x74\x6f\x6f\x6c\x73':_0x5e9a00,'\x68\x61\x6e\x64\x6c\x65\x54\x6f\x6f\x6c\x43\x61\x6c\x6c':_0x4d414d,'\x68\x61\x6e\x64\x6c\x65\x41\x73\x73\x69\x73\x74\x61\x6e\x74\x4d\x65\x73\x73\x61\x67\x65':_0x226a0b};}async function vercelAiTools(_0x458e13,_0x39f3ed={}){const _0x4b37ed=a0_0x51cfca,_0x434574={'\x56\x6f\x61\x6a\x6f':function(_0x2cab04,_0x3dc439){return _0x2cab04(_0x3dc439);}};let _0x6596e5;try{_0x6596e5=await import('\x61\x69');}catch{throw new Error(_0x4b37ed(0x18f));}const _0x167413=selectSpecs(_0x39f3ed[_0x4b37ed(0x130)]),_0x533e0a={'\x62\x6f\x78':_0x458e13,'\x73\x65\x73\x73\x69\x6f\x6e\x49\x64':_0x39f3ed[_0x4b37ed(0x139)]},_0x472e53={};for(const _0x53bcfd of _0x167413){const _0x500662=_0x53bcfd[_0x4b37ed(0x19e)](_0x533e0a);_0x472e53[_0x53bcfd[_0x4b37ed(0x140)]]=_0x6596e5['\x74\x6f\x6f\x6c']({'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':_0x53bcfd[_0x4b37ed(0x1a0)],'\x69\x6e\x70\x75\x74\x53\x63\x68\x65\x6d\x61':_0x6596e5[_0x4b37ed(0x15c)](_0x53bcfd['\x69\x6e\x70\x75\x74\x53\x63\x68\x65\x6d\x61']),'\x65\x78\x65\x63\x75\x74\x65':async _0x5f3872=>{const _0x5b137b=_0x4b37ed;return serializeToolResult(await _0x434574[_0x5b137b(0x16e)](_0x500662,_0x5f3872));}});}return _0x472e53;}export{ALL_FLEET_TOOL_SPECS,ALL_LIFECYCLE_TOOL_SPECS,ALL_TOOL_SPECS,FLEET_TOOL_SPECS,LIFECYCLE_TOOL_SPECS,TOOL_SPECS,anthropicFleetTools,anthropicLifecycleTools,anthropicTools,createMcpServer,mastraFleetTools,mastraTools,openaiFleetTools,openaiLifecycleTools,openaiTools,runCode,vercelAiFleetTools,vercelAiTools};
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
/**
|
|
3
|
+
* Keyed registry. `as const` preserves per-tool TArgs/TResult through the
|
|
4
|
+
* type system — `TOOL_SPECS.sandbox_run_code.makeHandler` returns a handler
|
|
5
|
+
* whose args parameter is the runCodeSpec's typed `{language, source, ...}`,
|
|
6
|
+
* not the erased `Record<string, unknown>` that an array-of-ToolSpec loses.
|
|
7
|
+
*
|
|
8
|
+
* Iteration order matches the order entries are declared here (V8 preserves
|
|
9
|
+
* string-key insertion order), so the public surface is stable.
|
|
10
|
+
*/
|
|
11
|
+
const TOOL_SPECS = {
|
|
12
|
+
sandbox_run_code: {
|
|
13
|
+
name: "sandbox_run_code",
|
|
14
|
+
description: "Execute code in a persistent language kernel inside the sandbox. Variables persist across calls with the same session. Returns stdout, stderr, exit code, and a typed `results` array containing matplotlib figures (base64 PNG), pandas DataFrames, JSON via display(), or errors. Prefer this over sandbox_exec for any code that needs structured output.",
|
|
15
|
+
inputSchema: {
|
|
16
|
+
type: "object",
|
|
17
|
+
properties: {
|
|
18
|
+
language: {
|
|
19
|
+
type: "string",
|
|
20
|
+
enum: [
|
|
21
|
+
"python",
|
|
22
|
+
"node",
|
|
23
|
+
"typescript",
|
|
24
|
+
"bash"
|
|
25
|
+
],
|
|
26
|
+
description: "Kernel language."
|
|
27
|
+
},
|
|
28
|
+
source: {
|
|
29
|
+
type: "string",
|
|
30
|
+
description: "Source code to run. Multi-line supported."
|
|
31
|
+
},
|
|
32
|
+
timeout_ms: {
|
|
33
|
+
type: "number",
|
|
34
|
+
description: "Per-call timeout. 0 disables. Default 60000."
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
required: ["language", "source"],
|
|
38
|
+
additionalProperties: false
|
|
39
|
+
},
|
|
40
|
+
makeHandler: ({ box, sessionId }) => async (args) => {
|
|
41
|
+
return await box.runCode(args.language, args.source, {
|
|
42
|
+
sessionId,
|
|
43
|
+
timeoutMs: args.timeout_ms
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
sandbox_exec: {
|
|
48
|
+
name: "sandbox_exec",
|
|
49
|
+
description: "Run a shell command (no persistent state) in the sandbox. Use for one-shot tasks like 'pnpm install' or 'ls'. For code that should share state across calls, prefer sandbox_run_code with a sessionId.",
|
|
50
|
+
inputSchema: {
|
|
51
|
+
type: "object",
|
|
52
|
+
properties: {
|
|
53
|
+
command: {
|
|
54
|
+
type: "string",
|
|
55
|
+
description: "Shell command line."
|
|
56
|
+
},
|
|
57
|
+
cwd: {
|
|
58
|
+
type: "string",
|
|
59
|
+
description: "Working directory. Optional."
|
|
60
|
+
},
|
|
61
|
+
timeout_ms: {
|
|
62
|
+
type: "number",
|
|
63
|
+
description: "Default 60000."
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
required: ["command"],
|
|
67
|
+
additionalProperties: false
|
|
68
|
+
},
|
|
69
|
+
makeHandler: ({ box, sessionId }) => async (args) => {
|
|
70
|
+
return await box.exec(args.command, {
|
|
71
|
+
cwd: args.cwd,
|
|
72
|
+
timeoutMs: args.timeout_ms,
|
|
73
|
+
sessionId
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
sandbox_read: {
|
|
78
|
+
name: "sandbox_read",
|
|
79
|
+
description: "Read a file from the sandbox filesystem. Relative paths resolve from the workspace root; absolute paths read the container filesystem directly.",
|
|
80
|
+
inputSchema: {
|
|
81
|
+
type: "object",
|
|
82
|
+
properties: { path: { type: "string" } },
|
|
83
|
+
required: ["path"],
|
|
84
|
+
additionalProperties: false
|
|
85
|
+
},
|
|
86
|
+
makeHandler: ({ box, sessionId }) => async (args) => {
|
|
87
|
+
return { content: await box.read(args.path, { sessionId }) };
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
sandbox_write: {
|
|
91
|
+
name: "sandbox_write",
|
|
92
|
+
description: "Write a file in the sandbox. Creates parent directories as needed. Overwrites existing files.",
|
|
93
|
+
inputSchema: {
|
|
94
|
+
type: "object",
|
|
95
|
+
properties: {
|
|
96
|
+
path: { type: "string" },
|
|
97
|
+
content: {
|
|
98
|
+
type: "string",
|
|
99
|
+
description: "Full file contents."
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
required: ["path", "content"],
|
|
103
|
+
additionalProperties: false
|
|
104
|
+
},
|
|
105
|
+
makeHandler: ({ box }) => async (args) => {
|
|
106
|
+
await box.write(args.path, args.content);
|
|
107
|
+
return { ok: true };
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
sandbox_list: {
|
|
111
|
+
name: "sandbox_list",
|
|
112
|
+
description: "List entries in a directory with size, type, and mode.",
|
|
113
|
+
inputSchema: {
|
|
114
|
+
type: "object",
|
|
115
|
+
properties: { path: { type: "string" } },
|
|
116
|
+
required: ["path"],
|
|
117
|
+
additionalProperties: false
|
|
118
|
+
},
|
|
119
|
+
makeHandler: ({ box }) => async (args) => {
|
|
120
|
+
return { entries: await box.fs.list(args.path) };
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
sandbox_search: {
|
|
124
|
+
name: "sandbox_search",
|
|
125
|
+
description: "Ripgrep-style code search. Returns matching lines with surrounding context.",
|
|
126
|
+
inputSchema: {
|
|
127
|
+
type: "object",
|
|
128
|
+
properties: {
|
|
129
|
+
pattern: {
|
|
130
|
+
type: "string",
|
|
131
|
+
description: "Regex pattern."
|
|
132
|
+
},
|
|
133
|
+
path: {
|
|
134
|
+
type: "string",
|
|
135
|
+
description: "Subdirectory to search. Optional."
|
|
136
|
+
},
|
|
137
|
+
max_results: {
|
|
138
|
+
type: "number",
|
|
139
|
+
description: "Cap. Default 100."
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
required: ["pattern"],
|
|
143
|
+
additionalProperties: false
|
|
144
|
+
},
|
|
145
|
+
makeHandler: ({ box }) => async (args) => {
|
|
146
|
+
const matches = [];
|
|
147
|
+
const cap = args.max_results ?? 100;
|
|
148
|
+
for await (const m of box.search(args.pattern, {
|
|
149
|
+
cwd: args.path,
|
|
150
|
+
maxResults: cap
|
|
151
|
+
})) {
|
|
152
|
+
matches.push(m);
|
|
153
|
+
if (matches.length >= cap) break;
|
|
154
|
+
}
|
|
155
|
+
return { matches };
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
/** Canonical ordered list. Packs use this to emit tools in a stable order. */
|
|
160
|
+
const ALL_TOOL_SPECS = Object.values(TOOL_SPECS);
|
|
161
|
+
/** Pack-side helper: filter the registry by an optional allow-list. */
|
|
162
|
+
function selectSpecs(allow) {
|
|
163
|
+
if (!allow || allow.length === 0) return ALL_TOOL_SPECS;
|
|
164
|
+
const set = new Set(allow);
|
|
165
|
+
return Object.keys(TOOL_SPECS).filter((name) => set.has(name)).map((name) => TOOL_SPECS[name]);
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Best-effort serialization of a tool handler's return value into a string
|
|
169
|
+
* tool-result payload. Each pack uses this when its target API expects a
|
|
170
|
+
* string `content` field; packs that support structured content (Anthropic
|
|
171
|
+
* multi-block) can opt out and serialize differently.
|
|
172
|
+
*
|
|
173
|
+
* `CodeExecutionResult` is serialized as JSON because the LLM benefits from
|
|
174
|
+
* seeing the structured results array; images come through as base64 strings
|
|
175
|
+
* which the model can read or hand back to the user.
|
|
176
|
+
*/
|
|
177
|
+
function serializeToolResult(value) {
|
|
178
|
+
if (typeof value === "string") return value;
|
|
179
|
+
try {
|
|
180
|
+
return JSON.stringify(value, null, 2);
|
|
181
|
+
} catch {
|
|
182
|
+
return String(value);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region src/agent/mcp-local.ts
|
|
187
|
+
/**
|
|
188
|
+
* Local MCP (Model Context Protocol) server bridge.
|
|
189
|
+
*
|
|
190
|
+
* `createMcpServer(box, { allow })` returns an MCP `Server` instance wired
|
|
191
|
+
* with the same tool registry the framework packs use. Pair it with a
|
|
192
|
+
* transport (most commonly stdio) and your sandbox becomes a paste-able
|
|
193
|
+
* MCP source for Claude Desktop, Cursor, Zed, or any other MCP client.
|
|
194
|
+
*
|
|
195
|
+
* Complements `box.getMcpEndpoint()` — that returns a hosted HTTPS+JWT MCP
|
|
196
|
+
* URL for users who can expose one; this gives users a fully local server
|
|
197
|
+
* that runs inside their own process.
|
|
198
|
+
*
|
|
199
|
+
* `@modelcontextprotocol/sdk` is dynamically imported (optional peer dep).
|
|
200
|
+
* Install in your app:
|
|
201
|
+
* pnpm add @modelcontextprotocol/sdk
|
|
202
|
+
*/
|
|
203
|
+
const SDK_VERSION = (() => {
|
|
204
|
+
try {
|
|
205
|
+
return createRequire(import.meta.url)("../../package.json").version ?? "0.0.0";
|
|
206
|
+
} catch {
|
|
207
|
+
return "0.0.0";
|
|
208
|
+
}
|
|
209
|
+
})();
|
|
210
|
+
/**
|
|
211
|
+
* Build an MCP server backed by one sandbox. The server registers
|
|
212
|
+
* `tools/list` and `tools/call` handlers populated from the same registry
|
|
213
|
+
* the framework packs use.
|
|
214
|
+
*
|
|
215
|
+
* @example
|
|
216
|
+
* ```ts
|
|
217
|
+
* // tangle-mcp-server.ts — used as the command in your MCP client config.
|
|
218
|
+
* import { Sandbox } from "@tangle-network/sandbox";
|
|
219
|
+
* import { createMcpServer } from "@tangle-network/sandbox/agent";
|
|
220
|
+
* import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
221
|
+
*
|
|
222
|
+
* const client = new Sandbox({ apiKey: process.env.TANGLE_API_KEY });
|
|
223
|
+
* const box = await client.get(process.env.SANDBOX_ID!);
|
|
224
|
+
* const { connect } = await createMcpServer(box, { sessionId: "claude-desktop" });
|
|
225
|
+
* await connect(new StdioServerTransport());
|
|
226
|
+
* ```
|
|
227
|
+
*
|
|
228
|
+
* Claude Desktop config snippet:
|
|
229
|
+
* ```json
|
|
230
|
+
* {
|
|
231
|
+
* "mcpServers": {
|
|
232
|
+
* "tangle-sandbox": {
|
|
233
|
+
* "command": "node",
|
|
234
|
+
* "args": ["./tangle-mcp-server.js"],
|
|
235
|
+
* "env": { "TANGLE_API_KEY": "...", "SANDBOX_ID": "..." }
|
|
236
|
+
* }
|
|
237
|
+
* }
|
|
238
|
+
* }
|
|
239
|
+
* ```
|
|
240
|
+
*/
|
|
241
|
+
async function createMcpServer(box, options = {}) {
|
|
242
|
+
let serverModule;
|
|
243
|
+
let typesModule;
|
|
244
|
+
try {
|
|
245
|
+
[serverModule, typesModule] = await Promise.all([import("@modelcontextprotocol/sdk/server/index.js"), import("@modelcontextprotocol/sdk/types.js")]);
|
|
246
|
+
} catch {
|
|
247
|
+
throw new Error("createMcpServer(): the `@modelcontextprotocol/sdk` package is not installed. Install it via `pnpm add @modelcontextprotocol/sdk`.");
|
|
248
|
+
}
|
|
249
|
+
const specs = selectSpecs(options.allow);
|
|
250
|
+
const ctx = {
|
|
251
|
+
box,
|
|
252
|
+
sessionId: options.sessionId
|
|
253
|
+
};
|
|
254
|
+
const handlers = /* @__PURE__ */ new Map();
|
|
255
|
+
for (const spec of specs) handlers.set(spec.name, spec.makeHandler(ctx));
|
|
256
|
+
const server = new serverModule.Server({
|
|
257
|
+
name: options.name ?? "tangle-sandbox",
|
|
258
|
+
version: options.version ?? SDK_VERSION
|
|
259
|
+
}, { capabilities: { tools: {} } });
|
|
260
|
+
server.setRequestHandler(typesModule.ListToolsRequestSchema, async () => ({ tools: specs.map((s) => ({
|
|
261
|
+
name: s.name,
|
|
262
|
+
description: s.description,
|
|
263
|
+
inputSchema: s.inputSchema
|
|
264
|
+
})) }));
|
|
265
|
+
server.setRequestHandler(typesModule.CallToolRequestSchema, async (req) => {
|
|
266
|
+
const r = req;
|
|
267
|
+
const handler = handlers.get(r.params.name);
|
|
268
|
+
if (!handler) return {
|
|
269
|
+
isError: true,
|
|
270
|
+
content: [{
|
|
271
|
+
type: "text",
|
|
272
|
+
text: `Unknown tool: ${r.params.name}`
|
|
273
|
+
}]
|
|
274
|
+
};
|
|
275
|
+
try {
|
|
276
|
+
return { content: [{
|
|
277
|
+
type: "text",
|
|
278
|
+
text: serializeToolResult(await handler(r.params.arguments ?? {}))
|
|
279
|
+
}] };
|
|
280
|
+
} catch (err) {
|
|
281
|
+
return {
|
|
282
|
+
isError: true,
|
|
283
|
+
content: [{
|
|
284
|
+
type: "text",
|
|
285
|
+
text: err instanceof Error ? err.message : String(err)
|
|
286
|
+
}]
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
return {
|
|
291
|
+
server,
|
|
292
|
+
connect: (transport) => server.connect(transport),
|
|
293
|
+
close: () => server.close()
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
//#endregion
|
|
297
|
+
//#region src/agent/run-code.ts
|
|
298
|
+
/**
|
|
299
|
+
* Functional form of `box.runCode(...)`. Useful when only the function is in
|
|
300
|
+
* scope (e.g., when wiring into a framework tool definition that captures
|
|
301
|
+
* the callable but not the surrounding instance).
|
|
302
|
+
*
|
|
303
|
+
* Identical semantics to {@link SandboxInstance.runCode}.
|
|
304
|
+
*/
|
|
305
|
+
function runCode(box, language, source, options) {
|
|
306
|
+
return box.runCode(language, source, options);
|
|
307
|
+
}
|
|
308
|
+
//#endregion
|
|
309
|
+
//#region src/agent/tools/anthropic.ts
|
|
310
|
+
/**
|
|
311
|
+
* Build an Anthropic tool pack bound to one sandbox.
|
|
312
|
+
*
|
|
313
|
+
* @example
|
|
314
|
+
* ```ts
|
|
315
|
+
* import Anthropic from "@anthropic-ai/sdk";
|
|
316
|
+
* import { anthropicTools } from "@tangle-network/sandbox/agent";
|
|
317
|
+
*
|
|
318
|
+
* const claude = new Anthropic();
|
|
319
|
+
* const { tools, handleAssistantMessage } = anthropicTools(box, { sessionId: "s1" });
|
|
320
|
+
*
|
|
321
|
+
* const messages = [{ role: "user", content: "Plot sin(x) for x in [0, 2π]." }];
|
|
322
|
+
* for (let i = 0; i < 6; i++) {
|
|
323
|
+
* const r = await claude.messages.create({
|
|
324
|
+
* model: "claude-opus-4-7",
|
|
325
|
+
* max_tokens: 4096,
|
|
326
|
+
* tools,
|
|
327
|
+
* messages,
|
|
328
|
+
* });
|
|
329
|
+
* messages.push({ role: "assistant", content: r.content });
|
|
330
|
+
* if (r.stop_reason !== "tool_use") break;
|
|
331
|
+
* const results = await handleAssistantMessage(r.content);
|
|
332
|
+
* messages.push({ role: "user", content: results });
|
|
333
|
+
* }
|
|
334
|
+
* ```
|
|
335
|
+
*/
|
|
336
|
+
function anthropicTools(box, options = {}) {
|
|
337
|
+
const specs = selectSpecs(options.allow);
|
|
338
|
+
const ctx = {
|
|
339
|
+
box,
|
|
340
|
+
sessionId: options.sessionId
|
|
341
|
+
};
|
|
342
|
+
const handlers = /* @__PURE__ */ new Map();
|
|
343
|
+
for (const spec of specs) handlers.set(spec.name, spec.makeHandler(ctx));
|
|
344
|
+
const tools = specs.map((s) => ({
|
|
345
|
+
name: s.name,
|
|
346
|
+
description: s.description,
|
|
347
|
+
input_schema: s.inputSchema
|
|
348
|
+
}));
|
|
349
|
+
async function handleToolUse(block) {
|
|
350
|
+
const handler = handlers.get(block.name);
|
|
351
|
+
if (!handler) return {
|
|
352
|
+
type: "tool_result",
|
|
353
|
+
tool_use_id: block.id,
|
|
354
|
+
content: `Unknown tool: ${block.name}`,
|
|
355
|
+
is_error: true
|
|
356
|
+
};
|
|
357
|
+
try {
|
|
358
|
+
const result = await handler(block.input);
|
|
359
|
+
return {
|
|
360
|
+
type: "tool_result",
|
|
361
|
+
tool_use_id: block.id,
|
|
362
|
+
content: toAnthropicContent(result)
|
|
363
|
+
};
|
|
364
|
+
} catch (err) {
|
|
365
|
+
return {
|
|
366
|
+
type: "tool_result",
|
|
367
|
+
tool_use_id: block.id,
|
|
368
|
+
content: err instanceof Error ? err.message : String(err),
|
|
369
|
+
is_error: true
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
async function handleAssistantMessage(content) {
|
|
374
|
+
const calls = content.filter((b) => typeof b === "object" && b !== null && b.type === "tool_use");
|
|
375
|
+
return Promise.all(calls.map(handleToolUse));
|
|
376
|
+
}
|
|
377
|
+
return {
|
|
378
|
+
tools,
|
|
379
|
+
handleToolUse,
|
|
380
|
+
handleAssistantMessage
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Serialize a tool handler's return value into Anthropic content blocks.
|
|
385
|
+
* If the result is a `CodeExecutionResult` carrying image parts, those land
|
|
386
|
+
* as native `image` blocks (base64, no JSON-stringify overhead). Everything
|
|
387
|
+
* else (and the non-image fields of the result) collapses to a single text
|
|
388
|
+
* block via `serializeToolResult` so the model sees a stable shape.
|
|
389
|
+
*/
|
|
390
|
+
function toAnthropicContent(value) {
|
|
391
|
+
if (!isCodeExecutionResultWithImages(value)) return serializeToolResult(value);
|
|
392
|
+
const blocks = [];
|
|
393
|
+
const trimmed = {
|
|
394
|
+
...value,
|
|
395
|
+
results: value.results.filter((p) => p.type !== "image")
|
|
396
|
+
};
|
|
397
|
+
blocks.push({
|
|
398
|
+
type: "text",
|
|
399
|
+
text: serializeToolResult(trimmed)
|
|
400
|
+
});
|
|
401
|
+
for (const p of value.results) if (isImagePart(p)) blocks.push({
|
|
402
|
+
type: "image",
|
|
403
|
+
source: {
|
|
404
|
+
type: "base64",
|
|
405
|
+
media_type: imageMediaType(p.format),
|
|
406
|
+
data: p.data
|
|
407
|
+
}
|
|
408
|
+
});
|
|
409
|
+
return blocks;
|
|
410
|
+
}
|
|
411
|
+
function isImagePart(p) {
|
|
412
|
+
return p.type === "image";
|
|
413
|
+
}
|
|
414
|
+
function isCodeExecutionResultWithImages(v) {
|
|
415
|
+
if (!v || typeof v !== "object") return false;
|
|
416
|
+
const r = v.results;
|
|
417
|
+
if (!Array.isArray(r)) return false;
|
|
418
|
+
return r.some((p) => p && typeof p === "object" && p.type === "image");
|
|
419
|
+
}
|
|
420
|
+
function imageMediaType(format) {
|
|
421
|
+
switch (format) {
|
|
422
|
+
case "png": return "image/png";
|
|
423
|
+
case "jpeg": return "image/jpeg";
|
|
424
|
+
case "svg": return "image/png";
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
const FLEET_TOOL_SPECS = {
|
|
428
|
+
sandbox_fleet_spawn: {
|
|
429
|
+
name: "sandbox_fleet_spawn",
|
|
430
|
+
description: "Spawn a fleet of N sandboxes from a template, with a coordinator plus N workers sharing a workspace. Returns the fleet id and the machine ids. Each worker has its own persistent code-execution kernel; the same workspace is mounted across them. COSTS SCALE LINEARLY with `workers`. Use sandbox_fleet_destroy when done.",
|
|
431
|
+
inputSchema: {
|
|
432
|
+
type: "object",
|
|
433
|
+
properties: {
|
|
434
|
+
template_id: {
|
|
435
|
+
type: "string",
|
|
436
|
+
description: "Public template slug or id (e.g. 'python-data-science')."
|
|
437
|
+
},
|
|
438
|
+
workers: {
|
|
439
|
+
type: "number",
|
|
440
|
+
description: "Number of worker sandboxes. Each is billed independently."
|
|
441
|
+
},
|
|
442
|
+
metadata: {
|
|
443
|
+
type: "object",
|
|
444
|
+
properties: {},
|
|
445
|
+
additionalProperties: true,
|
|
446
|
+
description: "Optional metadata stamped on every fleet member."
|
|
447
|
+
}
|
|
448
|
+
},
|
|
449
|
+
required: ["template_id", "workers"],
|
|
450
|
+
additionalProperties: false
|
|
451
|
+
},
|
|
452
|
+
makeHandler: ({ client }) => async (args) => {
|
|
453
|
+
const fleet = await client.fleets.createWithCoordinator({
|
|
454
|
+
defaults: { publicTemplateId: args.template_id },
|
|
455
|
+
workers: Array.from({ length: args.workers }, (_, i) => ({ machineId: `worker-${i}` })),
|
|
456
|
+
metadata: args.metadata
|
|
457
|
+
});
|
|
458
|
+
return {
|
|
459
|
+
fleetId: fleet.fleetId,
|
|
460
|
+
machineIds: fleet.ids
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
},
|
|
464
|
+
sandbox_fleet_dispatch: {
|
|
465
|
+
name: "sandbox_fleet_dispatch",
|
|
466
|
+
description: "Run a shell command on a fleet's workers in parallel. Defaults to all workers; pass `machines` to target specific ones. Returns per-machine {ok, result?, error?} entries.",
|
|
467
|
+
inputSchema: {
|
|
468
|
+
type: "object",
|
|
469
|
+
properties: {
|
|
470
|
+
fleet_id: { type: "string" },
|
|
471
|
+
command: {
|
|
472
|
+
type: "string",
|
|
473
|
+
description: "Shell command line."
|
|
474
|
+
},
|
|
475
|
+
machines: {
|
|
476
|
+
type: "array",
|
|
477
|
+
items: { type: "string" },
|
|
478
|
+
description: "Optional subset of machine ids. Defaults to all workers."
|
|
479
|
+
},
|
|
480
|
+
timeout_ms: {
|
|
481
|
+
type: "number",
|
|
482
|
+
description: "Per-machine timeout. Default 60000."
|
|
483
|
+
}
|
|
484
|
+
},
|
|
485
|
+
required: ["fleet_id", "command"],
|
|
486
|
+
additionalProperties: false
|
|
487
|
+
},
|
|
488
|
+
makeHandler: ({ client }) => async (args) => {
|
|
489
|
+
return await (await client.fleets.list({ fleetId: args.fleet_id })).dispatchExec(args.command, {
|
|
490
|
+
machines: args.machines,
|
|
491
|
+
timeoutMs: args.timeout_ms
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
},
|
|
495
|
+
sandbox_fleet_status: {
|
|
496
|
+
name: "sandbox_fleet_status",
|
|
497
|
+
description: "List the fleet's machines and their per-machine state (running / stopped / failed) plus last-used timestamps.",
|
|
498
|
+
inputSchema: {
|
|
499
|
+
type: "object",
|
|
500
|
+
properties: { fleet_id: { type: "string" } },
|
|
501
|
+
required: ["fleet_id"],
|
|
502
|
+
additionalProperties: false
|
|
503
|
+
},
|
|
504
|
+
makeHandler: ({ client }) => async (args) => {
|
|
505
|
+
const fleet = await client.fleets.list({ fleetId: args.fleet_id });
|
|
506
|
+
return {
|
|
507
|
+
fleetId: fleet.fleetId,
|
|
508
|
+
machines: fleet.ids.map((machineId) => ({
|
|
509
|
+
machineId,
|
|
510
|
+
status: fleet.get(machineId).status
|
|
511
|
+
}))
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
},
|
|
515
|
+
sandbox_fleet_destroy: {
|
|
516
|
+
name: "sandbox_fleet_destroy",
|
|
517
|
+
description: "Delete the fleet and every machine in it. Stops billing immediately. Call this when the campaign is done; orphaned fleets keep burning credits.",
|
|
518
|
+
inputSchema: {
|
|
519
|
+
type: "object",
|
|
520
|
+
properties: {
|
|
521
|
+
fleet_id: { type: "string" },
|
|
522
|
+
continue_on_error: {
|
|
523
|
+
type: "boolean",
|
|
524
|
+
description: "Continue deleting remaining machines if one fails."
|
|
525
|
+
}
|
|
526
|
+
},
|
|
527
|
+
required: ["fleet_id"],
|
|
528
|
+
additionalProperties: false
|
|
529
|
+
},
|
|
530
|
+
makeHandler: ({ client }) => async (args) => {
|
|
531
|
+
await (await client.fleets.list({ fleetId: args.fleet_id })).delete({ continueOnError: args.continue_on_error });
|
|
532
|
+
return {
|
|
533
|
+
fleetId: args.fleet_id,
|
|
534
|
+
deleted: true
|
|
535
|
+
};
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
};
|
|
539
|
+
const ALL_FLEET_TOOL_SPECS = Object.values(FLEET_TOOL_SPECS);
|
|
540
|
+
function selectFleetSpecs(allow) {
|
|
541
|
+
if (!allow || allow.length === 0) return ALL_FLEET_TOOL_SPECS;
|
|
542
|
+
const set = new Set(allow);
|
|
543
|
+
return Object.keys(FLEET_TOOL_SPECS).filter((name) => set.has(name)).map((name) => FLEET_TOOL_SPECS[name]);
|
|
544
|
+
}
|
|
545
|
+
//#endregion
|
|
546
|
+
//#region src/agent/tools/fleet/index.ts
|
|
547
|
+
function anthropicFleetTools(client, options = {}) {
|
|
548
|
+
const specs = selectFleetSpecs(options.allow);
|
|
549
|
+
const handlers = buildFleetHandlers(specs, { client });
|
|
550
|
+
return {
|
|
551
|
+
tools: specs.map((s) => ({
|
|
552
|
+
name: s.name,
|
|
553
|
+
description: s.description,
|
|
554
|
+
input_schema: s.inputSchema
|
|
555
|
+
})),
|
|
556
|
+
async handleToolUse(block) {
|
|
557
|
+
const h = handlers.get(block.name);
|
|
558
|
+
if (!h) return {
|
|
559
|
+
type: "tool_result",
|
|
560
|
+
tool_use_id: block.id,
|
|
561
|
+
content: `Unknown fleet tool: ${block.name}`,
|
|
562
|
+
is_error: true
|
|
563
|
+
};
|
|
564
|
+
try {
|
|
565
|
+
const result = await h(block.input);
|
|
566
|
+
return {
|
|
567
|
+
type: "tool_result",
|
|
568
|
+
tool_use_id: block.id,
|
|
569
|
+
content: serializeToolResult(result)
|
|
570
|
+
};
|
|
571
|
+
} catch (err) {
|
|
572
|
+
return {
|
|
573
|
+
type: "tool_result",
|
|
574
|
+
tool_use_id: block.id,
|
|
575
|
+
content: err instanceof Error ? err.message : String(err),
|
|
576
|
+
is_error: true
|
|
577
|
+
};
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
};
|
|
581
|
+
}
|
|
582
|
+
function openaiFleetTools(client, options = {}) {
|
|
583
|
+
const specs = selectFleetSpecs(options.allow);
|
|
584
|
+
const handlers = buildFleetHandlers(specs, { client });
|
|
585
|
+
return {
|
|
586
|
+
tools: specs.map((s) => ({
|
|
587
|
+
type: "function",
|
|
588
|
+
function: {
|
|
589
|
+
name: s.name,
|
|
590
|
+
description: s.description,
|
|
591
|
+
parameters: s.inputSchema
|
|
592
|
+
}
|
|
593
|
+
})),
|
|
594
|
+
async handleToolCall(call) {
|
|
595
|
+
const h = handlers.get(call.function.name);
|
|
596
|
+
if (!h) return {
|
|
597
|
+
role: "tool",
|
|
598
|
+
tool_call_id: call.id,
|
|
599
|
+
content: JSON.stringify({ error: `Unknown fleet tool: ${call.function.name}` })
|
|
600
|
+
};
|
|
601
|
+
let args = {};
|
|
602
|
+
try {
|
|
603
|
+
const v = JSON.parse(call.function.arguments || "{}");
|
|
604
|
+
if (v && typeof v === "object") args = v;
|
|
605
|
+
} catch {}
|
|
606
|
+
try {
|
|
607
|
+
const result = await h(args);
|
|
608
|
+
return {
|
|
609
|
+
role: "tool",
|
|
610
|
+
tool_call_id: call.id,
|
|
611
|
+
content: serializeToolResult(result)
|
|
612
|
+
};
|
|
613
|
+
} catch (err) {
|
|
614
|
+
return {
|
|
615
|
+
role: "tool",
|
|
616
|
+
tool_call_id: call.id,
|
|
617
|
+
content: JSON.stringify({ error: err instanceof Error ? err.message : String(err) })
|
|
618
|
+
};
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
};
|
|
622
|
+
}
|
|
623
|
+
async function vercelAiFleetTools(client, options = {}) {
|
|
624
|
+
let ai;
|
|
625
|
+
try {
|
|
626
|
+
ai = await import("ai");
|
|
627
|
+
} catch {
|
|
628
|
+
throw new Error("vercelAiFleetTools(): the `ai` package is not installed. Install via `pnpm add ai`.");
|
|
629
|
+
}
|
|
630
|
+
const specs = selectFleetSpecs(options.allow);
|
|
631
|
+
const handlers = buildFleetHandlers(specs, { client });
|
|
632
|
+
const result = {};
|
|
633
|
+
for (const spec of specs) result[spec.name] = ai.tool({
|
|
634
|
+
description: spec.description,
|
|
635
|
+
inputSchema: ai.jsonSchema(spec.inputSchema),
|
|
636
|
+
execute: async (args) => {
|
|
637
|
+
const h = handlers.get(spec.name);
|
|
638
|
+
if (!h) throw new Error(`Unknown fleet tool: ${spec.name}`);
|
|
639
|
+
return serializeToolResult(await h(args));
|
|
640
|
+
}
|
|
641
|
+
});
|
|
642
|
+
return result;
|
|
643
|
+
}
|
|
644
|
+
async function mastraFleetTools(client, options = {}) {
|
|
645
|
+
let mastra;
|
|
646
|
+
try {
|
|
647
|
+
mastra = await import("@mastra/core");
|
|
648
|
+
} catch {
|
|
649
|
+
throw new Error("mastraFleetTools(): the `@mastra/core` package is not installed. Install via `pnpm add @mastra/core`.");
|
|
650
|
+
}
|
|
651
|
+
const specs = selectFleetSpecs(options.allow);
|
|
652
|
+
const handlers = buildFleetHandlers(specs, { client });
|
|
653
|
+
const result = {};
|
|
654
|
+
for (const spec of specs) result[spec.name] = mastra.createTool({
|
|
655
|
+
id: spec.name,
|
|
656
|
+
description: spec.description,
|
|
657
|
+
inputSchema: mastra.jsonSchema ? mastra.jsonSchema(spec.inputSchema) : spec.inputSchema,
|
|
658
|
+
execute: async (input) => {
|
|
659
|
+
const h = handlers.get(spec.name);
|
|
660
|
+
if (!h) throw new Error(`Unknown fleet tool: ${spec.name}`);
|
|
661
|
+
return { result: serializeToolResult(await h(input?.context ?? {})) };
|
|
662
|
+
}
|
|
663
|
+
});
|
|
664
|
+
return result;
|
|
665
|
+
}
|
|
666
|
+
function buildFleetHandlers(specs, ctx) {
|
|
667
|
+
const m = /* @__PURE__ */ new Map();
|
|
668
|
+
for (const spec of specs) m.set(spec.name, spec.makeHandler(ctx));
|
|
669
|
+
return m;
|
|
670
|
+
}
|
|
671
|
+
const LIFECYCLE_TOOL_SPECS = {
|
|
672
|
+
sandbox_create: {
|
|
673
|
+
name: "sandbox_create",
|
|
674
|
+
description: "Create an isolated sandbox environment and return its id for use with sandbox_run_command. Use this when the user needs code executed, files analyzed, or commands run in a secure environment. The sandbox BILLS until destroyed — call sandbox_destroy when the work is done.",
|
|
675
|
+
inputSchema: {
|
|
676
|
+
type: "object",
|
|
677
|
+
properties: {
|
|
678
|
+
environment: {
|
|
679
|
+
type: "string",
|
|
680
|
+
description: "Environment name (e.g. 'universal' for multi-language Node/Python). Default 'universal'."
|
|
681
|
+
},
|
|
682
|
+
name: {
|
|
683
|
+
type: "string",
|
|
684
|
+
description: "Optional display name for the sandbox."
|
|
685
|
+
}
|
|
686
|
+
},
|
|
687
|
+
required: [],
|
|
688
|
+
additionalProperties: false
|
|
689
|
+
},
|
|
690
|
+
makeHandler: ({ client }) => async (args) => {
|
|
691
|
+
const box = await client.create({
|
|
692
|
+
environment: args.environment ?? "universal",
|
|
693
|
+
name: args.name
|
|
694
|
+
});
|
|
695
|
+
return {
|
|
696
|
+
sandboxId: box.id,
|
|
697
|
+
status: box.status
|
|
698
|
+
};
|
|
699
|
+
}
|
|
700
|
+
},
|
|
701
|
+
sandbox_run_command: {
|
|
702
|
+
name: "sandbox_run_command",
|
|
703
|
+
description: "Execute a shell command in a previously created sandbox and return {stdout, stderr, exitCode}. The sandbox must exist — create it first with sandbox_create.",
|
|
704
|
+
inputSchema: {
|
|
705
|
+
type: "object",
|
|
706
|
+
properties: {
|
|
707
|
+
sandbox_id: {
|
|
708
|
+
type: "string",
|
|
709
|
+
description: "Id returned by sandbox_create."
|
|
710
|
+
},
|
|
711
|
+
command: {
|
|
712
|
+
type: "string",
|
|
713
|
+
description: "Shell command line."
|
|
714
|
+
},
|
|
715
|
+
cwd: {
|
|
716
|
+
type: "string",
|
|
717
|
+
description: "Optional working directory for the command."
|
|
718
|
+
},
|
|
719
|
+
timeout_ms: {
|
|
720
|
+
type: "number",
|
|
721
|
+
description: "Timeout in milliseconds. Default 60000."
|
|
722
|
+
}
|
|
723
|
+
},
|
|
724
|
+
required: ["sandbox_id", "command"],
|
|
725
|
+
additionalProperties: false
|
|
726
|
+
},
|
|
727
|
+
makeHandler: ({ client }) => async (args) => {
|
|
728
|
+
const box = await client.get(args.sandbox_id);
|
|
729
|
+
if (!box) throw new Error(`Sandbox ${args.sandbox_id} not found. Create it first with sandbox_create.`);
|
|
730
|
+
const result = await box.exec(args.command, {
|
|
731
|
+
cwd: args.cwd,
|
|
732
|
+
timeoutMs: args.timeout_ms ?? 6e4
|
|
733
|
+
});
|
|
734
|
+
return {
|
|
735
|
+
stdout: result.stdout,
|
|
736
|
+
stderr: result.stderr,
|
|
737
|
+
exitCode: result.exitCode
|
|
738
|
+
};
|
|
739
|
+
}
|
|
740
|
+
},
|
|
741
|
+
sandbox_destroy: {
|
|
742
|
+
name: "sandbox_destroy",
|
|
743
|
+
description: "Delete a sandbox created with sandbox_create. Stops billing immediately. Call this once the sandboxed work is finished; orphaned sandboxes keep accruing cost.",
|
|
744
|
+
inputSchema: {
|
|
745
|
+
type: "object",
|
|
746
|
+
properties: { sandbox_id: {
|
|
747
|
+
type: "string",
|
|
748
|
+
description: "Id returned by sandbox_create."
|
|
749
|
+
} },
|
|
750
|
+
required: ["sandbox_id"],
|
|
751
|
+
additionalProperties: false
|
|
752
|
+
},
|
|
753
|
+
makeHandler: ({ client }) => async (args) => {
|
|
754
|
+
const box = await client.get(args.sandbox_id);
|
|
755
|
+
if (!box) return {
|
|
756
|
+
sandboxId: args.sandbox_id,
|
|
757
|
+
deleted: true
|
|
758
|
+
};
|
|
759
|
+
await box.delete();
|
|
760
|
+
return {
|
|
761
|
+
sandboxId: args.sandbox_id,
|
|
762
|
+
deleted: true
|
|
763
|
+
};
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
};
|
|
767
|
+
const ALL_LIFECYCLE_TOOL_SPECS = Object.values(LIFECYCLE_TOOL_SPECS);
|
|
768
|
+
function selectLifecycleSpecs(allow) {
|
|
769
|
+
if (!allow || allow.length === 0) return ALL_LIFECYCLE_TOOL_SPECS;
|
|
770
|
+
const set = new Set(allow);
|
|
771
|
+
return Object.keys(LIFECYCLE_TOOL_SPECS).filter((name) => set.has(name)).map((name) => LIFECYCLE_TOOL_SPECS[name]);
|
|
772
|
+
}
|
|
773
|
+
//#endregion
|
|
774
|
+
//#region src/agent/tools/lifecycle/index.ts
|
|
775
|
+
function anthropicLifecycleTools(client, options = {}) {
|
|
776
|
+
const specs = selectLifecycleSpecs(options.allow);
|
|
777
|
+
const handlers = buildLifecycleHandlers(specs, { client });
|
|
778
|
+
return {
|
|
779
|
+
tools: specs.map((s) => ({
|
|
780
|
+
name: s.name,
|
|
781
|
+
description: s.description,
|
|
782
|
+
input_schema: s.inputSchema
|
|
783
|
+
})),
|
|
784
|
+
async handleToolUse(block) {
|
|
785
|
+
const h = handlers.get(block.name);
|
|
786
|
+
if (!h) return {
|
|
787
|
+
type: "tool_result",
|
|
788
|
+
tool_use_id: block.id,
|
|
789
|
+
content: `Unknown lifecycle tool: ${block.name}`,
|
|
790
|
+
is_error: true
|
|
791
|
+
};
|
|
792
|
+
try {
|
|
793
|
+
const result = await h(block.input);
|
|
794
|
+
return {
|
|
795
|
+
type: "tool_result",
|
|
796
|
+
tool_use_id: block.id,
|
|
797
|
+
content: serializeToolResult(result)
|
|
798
|
+
};
|
|
799
|
+
} catch (err) {
|
|
800
|
+
return {
|
|
801
|
+
type: "tool_result",
|
|
802
|
+
tool_use_id: block.id,
|
|
803
|
+
content: err instanceof Error ? err.message : String(err),
|
|
804
|
+
is_error: true
|
|
805
|
+
};
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
};
|
|
809
|
+
}
|
|
810
|
+
function openaiLifecycleTools(client, options = {}) {
|
|
811
|
+
const specs = selectLifecycleSpecs(options.allow);
|
|
812
|
+
const handlers = buildLifecycleHandlers(specs, { client });
|
|
813
|
+
return {
|
|
814
|
+
tools: specs.map((s) => ({
|
|
815
|
+
type: "function",
|
|
816
|
+
function: {
|
|
817
|
+
name: s.name,
|
|
818
|
+
description: s.description,
|
|
819
|
+
parameters: s.inputSchema
|
|
820
|
+
}
|
|
821
|
+
})),
|
|
822
|
+
async handleToolCall(call) {
|
|
823
|
+
const h = handlers.get(call.function.name);
|
|
824
|
+
if (!h) return {
|
|
825
|
+
role: "tool",
|
|
826
|
+
tool_call_id: call.id,
|
|
827
|
+
content: JSON.stringify({ error: `Unknown lifecycle tool: ${call.function.name}` })
|
|
828
|
+
};
|
|
829
|
+
let args = {};
|
|
830
|
+
try {
|
|
831
|
+
const v = JSON.parse(call.function.arguments || "{}");
|
|
832
|
+
if (v && typeof v === "object") args = v;
|
|
833
|
+
} catch {}
|
|
834
|
+
try {
|
|
835
|
+
const result = await h(args);
|
|
836
|
+
return {
|
|
837
|
+
role: "tool",
|
|
838
|
+
tool_call_id: call.id,
|
|
839
|
+
content: serializeToolResult(result)
|
|
840
|
+
};
|
|
841
|
+
} catch (err) {
|
|
842
|
+
return {
|
|
843
|
+
role: "tool",
|
|
844
|
+
tool_call_id: call.id,
|
|
845
|
+
content: JSON.stringify({ error: err instanceof Error ? err.message : String(err) })
|
|
846
|
+
};
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
};
|
|
850
|
+
}
|
|
851
|
+
function buildLifecycleHandlers(specs, ctx) {
|
|
852
|
+
const m = /* @__PURE__ */ new Map();
|
|
853
|
+
for (const spec of specs) m.set(spec.name, spec.makeHandler(ctx));
|
|
854
|
+
return m;
|
|
855
|
+
}
|
|
856
|
+
//#endregion
|
|
857
|
+
//#region src/agent/tools/mastra.ts
|
|
858
|
+
/**
|
|
859
|
+
* Build a Mastra tool pack bound to one sandbox.
|
|
860
|
+
*
|
|
861
|
+
* @example
|
|
862
|
+
* ```ts
|
|
863
|
+
* import { Agent } from "@mastra/core/agent";
|
|
864
|
+
* import { mastraTools } from "@tangle-network/sandbox/agent";
|
|
865
|
+
*
|
|
866
|
+
* const tools = await mastraTools(box, { sessionId: "s1" });
|
|
867
|
+
* const agent = new Agent({ name: "coder", instructions: "...", tools });
|
|
868
|
+
* await agent.generate("Plot sin(x).");
|
|
869
|
+
* ```
|
|
870
|
+
*/
|
|
871
|
+
async function mastraTools(box, options = {}) {
|
|
872
|
+
let mastra;
|
|
873
|
+
try {
|
|
874
|
+
mastra = await import("@mastra/core");
|
|
875
|
+
} catch {
|
|
876
|
+
throw new Error("mastraTools(): the `@mastra/core` package is not installed. Install it via `pnpm add @mastra/core`.");
|
|
877
|
+
}
|
|
878
|
+
const specs = selectSpecs(options.allow);
|
|
879
|
+
const ctx = {
|
|
880
|
+
box,
|
|
881
|
+
sessionId: options.sessionId
|
|
882
|
+
};
|
|
883
|
+
const result = {};
|
|
884
|
+
for (const spec of specs) {
|
|
885
|
+
const handler = spec.makeHandler(ctx);
|
|
886
|
+
result[spec.name] = mastra.createTool({
|
|
887
|
+
id: spec.name,
|
|
888
|
+
description: spec.description,
|
|
889
|
+
inputSchema: mastra.jsonSchema ? mastra.jsonSchema(spec.inputSchema) : spec.inputSchema,
|
|
890
|
+
execute: async (input) => {
|
|
891
|
+
return { result: serializeToolResult(await handler(input?.context ?? {})) };
|
|
892
|
+
}
|
|
893
|
+
});
|
|
894
|
+
}
|
|
895
|
+
return result;
|
|
896
|
+
}
|
|
897
|
+
//#endregion
|
|
898
|
+
//#region src/agent/tools/openai.ts
|
|
899
|
+
/**
|
|
900
|
+
* Build an OpenAI tool pack bound to one sandbox.
|
|
901
|
+
*
|
|
902
|
+
* @example
|
|
903
|
+
* ```ts
|
|
904
|
+
* import OpenAI from "openai";
|
|
905
|
+
* import { openaiTools } from "@tangle-network/sandbox/agent";
|
|
906
|
+
*
|
|
907
|
+
* const openai = new OpenAI();
|
|
908
|
+
* const { tools, handleAssistantMessage } = openaiTools(box, { sessionId: "s1" });
|
|
909
|
+
*
|
|
910
|
+
* const messages: any[] = [{ role: "user", content: "Plot sin(x) for x in [0, 2π]." }];
|
|
911
|
+
* for (let i = 0; i < 6; i++) {
|
|
912
|
+
* const r = await openai.chat.completions.create({
|
|
913
|
+
* model: "gpt-5.4", tools, messages,
|
|
914
|
+
* });
|
|
915
|
+
* const m = r.choices[0].message;
|
|
916
|
+
* messages.push(m);
|
|
917
|
+
* if (!m.tool_calls?.length) break;
|
|
918
|
+
* messages.push(...(await handleAssistantMessage(m)));
|
|
919
|
+
* }
|
|
920
|
+
* ```
|
|
921
|
+
*/
|
|
922
|
+
function openaiTools(box, options = {}) {
|
|
923
|
+
const specs = selectSpecs(options.allow);
|
|
924
|
+
const ctx = {
|
|
925
|
+
box,
|
|
926
|
+
sessionId: options.sessionId
|
|
927
|
+
};
|
|
928
|
+
const handlers = /* @__PURE__ */ new Map();
|
|
929
|
+
for (const spec of specs) handlers.set(spec.name, spec.makeHandler(ctx));
|
|
930
|
+
const tools = specs.map((s) => ({
|
|
931
|
+
type: "function",
|
|
932
|
+
function: {
|
|
933
|
+
name: s.name,
|
|
934
|
+
description: s.description,
|
|
935
|
+
parameters: s.inputSchema
|
|
936
|
+
}
|
|
937
|
+
}));
|
|
938
|
+
function parseArgs(raw) {
|
|
939
|
+
if (!raw) return {};
|
|
940
|
+
try {
|
|
941
|
+
const v = JSON.parse(raw);
|
|
942
|
+
return typeof v === "object" && v !== null ? v : {};
|
|
943
|
+
} catch {
|
|
944
|
+
return {};
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
async function handleToolCall(call) {
|
|
948
|
+
const handler = handlers.get(call.function.name);
|
|
949
|
+
if (!handler) return {
|
|
950
|
+
role: "tool",
|
|
951
|
+
tool_call_id: call.id,
|
|
952
|
+
content: JSON.stringify({ error: `Unknown tool: ${call.function.name}` })
|
|
953
|
+
};
|
|
954
|
+
try {
|
|
955
|
+
const result = await handler(parseArgs(call.function.arguments));
|
|
956
|
+
return {
|
|
957
|
+
role: "tool",
|
|
958
|
+
tool_call_id: call.id,
|
|
959
|
+
content: serializeToolResult(result)
|
|
960
|
+
};
|
|
961
|
+
} catch (err) {
|
|
962
|
+
return {
|
|
963
|
+
role: "tool",
|
|
964
|
+
tool_call_id: call.id,
|
|
965
|
+
content: JSON.stringify({ error: err instanceof Error ? err.message : String(err) })
|
|
966
|
+
};
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
async function handleAssistantMessage(message) {
|
|
970
|
+
const calls = message.tool_calls ?? [];
|
|
971
|
+
return Promise.all(calls.map(handleToolCall));
|
|
972
|
+
}
|
|
973
|
+
return {
|
|
974
|
+
tools,
|
|
975
|
+
handleToolCall,
|
|
976
|
+
handleAssistantMessage
|
|
977
|
+
};
|
|
978
|
+
}
|
|
979
|
+
//#endregion
|
|
980
|
+
//#region src/agent/tools/vercel-ai.ts
|
|
981
|
+
/**
|
|
982
|
+
* Build a Vercel AI SDK tool pack bound to one sandbox. The returned object
|
|
983
|
+
* is a `Record<toolName, ai.Tool>` ready for `generateText({ tools })`.
|
|
984
|
+
*
|
|
985
|
+
* @example
|
|
986
|
+
* ```ts
|
|
987
|
+
* import { generateText } from "ai";
|
|
988
|
+
* import { anthropic } from "@ai-sdk/anthropic";
|
|
989
|
+
* import { vercelAiTools } from "@tangle-network/sandbox/agent";
|
|
990
|
+
*
|
|
991
|
+
* const tools = await vercelAiTools(box, { sessionId: "s1" });
|
|
992
|
+
* const { text } = await generateText({
|
|
993
|
+
* model: anthropic("claude-opus-4-7"),
|
|
994
|
+
* tools,
|
|
995
|
+
* prompt: "Plot sin(x) for x in [0, 2π].",
|
|
996
|
+
* maxSteps: 6,
|
|
997
|
+
* });
|
|
998
|
+
* ```
|
|
999
|
+
*/
|
|
1000
|
+
async function vercelAiTools(box, options = {}) {
|
|
1001
|
+
let ai;
|
|
1002
|
+
try {
|
|
1003
|
+
ai = await import("ai");
|
|
1004
|
+
} catch {
|
|
1005
|
+
throw new Error("vercelAiTools(): the `ai` package is not installed. Install it via `pnpm add ai` (and pick an `@ai-sdk/*` model adapter).");
|
|
1006
|
+
}
|
|
1007
|
+
const specs = selectSpecs(options.allow);
|
|
1008
|
+
const ctx = {
|
|
1009
|
+
box,
|
|
1010
|
+
sessionId: options.sessionId
|
|
1011
|
+
};
|
|
1012
|
+
const result = {};
|
|
1013
|
+
for (const spec of specs) {
|
|
1014
|
+
const handler = spec.makeHandler(ctx);
|
|
1015
|
+
result[spec.name] = ai.tool({
|
|
1016
|
+
description: spec.description,
|
|
1017
|
+
inputSchema: ai.jsonSchema(spec.inputSchema),
|
|
1018
|
+
execute: async (args) => {
|
|
1019
|
+
return serializeToolResult(await handler(args));
|
|
1020
|
+
}
|
|
1021
|
+
});
|
|
1022
|
+
}
|
|
1023
|
+
return result;
|
|
1024
|
+
}
|
|
1025
|
+
//#endregion
|
|
1026
|
+
export { ALL_FLEET_TOOL_SPECS, ALL_LIFECYCLE_TOOL_SPECS, ALL_TOOL_SPECS, FLEET_TOOL_SPECS, LIFECYCLE_TOOL_SPECS, TOOL_SPECS, anthropicFleetTools, anthropicLifecycleTools, anthropicTools, createMcpServer, mastraFleetTools, mastraTools, openaiFleetTools, openaiLifecycleTools, openaiTools, runCode, vercelAiFleetTools, vercelAiTools };
|