@ejazullah/browser-mcp 0.0.56 → 0.0.57

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.
Files changed (62) hide show
  1. package/cli.js +1 -18
  2. package/index.js +1 -1060
  3. package/lib/auth.js +1 -82
  4. package/lib/browserContextFactory.js +1 -205
  5. package/lib/browserServerBackend.js +1 -125
  6. package/lib/config.js +1 -266
  7. package/lib/context.js +1 -232
  8. package/lib/databaseLogger.js +1 -264
  9. package/lib/extension/cdpRelay.js +1 -346
  10. package/lib/extension/extensionContextFactory.js +1 -56
  11. package/lib/extension/main.js +1 -26
  12. package/lib/fileUtils.js +1 -32
  13. package/lib/httpServer.js +1 -39
  14. package/lib/index.js +1 -39
  15. package/lib/javascript.js +1 -49
  16. package/lib/log.js +1 -21
  17. package/lib/loop/loop.js +1 -69
  18. package/lib/loop/loopClaude.js +1 -152
  19. package/lib/loop/loopOpenAI.js +1 -143
  20. package/lib/loop/main.js +1 -60
  21. package/lib/loopTools/context.js +1 -66
  22. package/lib/loopTools/main.js +1 -49
  23. package/lib/loopTools/perform.js +1 -32
  24. package/lib/loopTools/snapshot.js +1 -29
  25. package/lib/loopTools/tool.js +1 -18
  26. package/lib/manualPromise.js +1 -111
  27. package/lib/mcp/inProcessTransport.js +1 -72
  28. package/lib/mcp/server.js +1 -93
  29. package/lib/mcp/transport.js +1 -217
  30. package/lib/mongoDBLogger.js +1 -252
  31. package/lib/package.js +1 -20
  32. package/lib/program.js +1 -113
  33. package/lib/response.js +1 -172
  34. package/lib/sessionLog.js +1 -156
  35. package/lib/tab.js +1 -266
  36. package/lib/tools/cdp.js +1 -169
  37. package/lib/tools/common.js +1 -55
  38. package/lib/tools/console.js +1 -33
  39. package/lib/tools/dialogs.js +1 -47
  40. package/lib/tools/evaluate.js +1 -53
  41. package/lib/tools/extraction.js +1 -217
  42. package/lib/tools/files.js +1 -44
  43. package/lib/tools/forms.js +1 -180
  44. package/lib/tools/getext.js +1 -99
  45. package/lib/tools/install.js +1 -53
  46. package/lib/tools/interactions.js +1 -191
  47. package/lib/tools/keyboard.js +1 -86
  48. package/lib/tools/mouse.js +1 -99
  49. package/lib/tools/navigate.js +1 -70
  50. package/lib/tools/network.js +1 -41
  51. package/lib/tools/pdf.js +1 -40
  52. package/lib/tools/screenshot.js +1 -75
  53. package/lib/tools/selectors.js +1 -233
  54. package/lib/tools/snapshot.js +1 -169
  55. package/lib/tools/states.js +1 -147
  56. package/lib/tools/tabs.js +1 -87
  57. package/lib/tools/tool.js +1 -33
  58. package/lib/tools/utils.js +1 -74
  59. package/lib/tools/wait.js +1 -56
  60. package/lib/tools.js +1 -64
  61. package/lib/utils.js +1 -26
  62. package/package.json +5 -2
package/lib/tools/tabs.js CHANGED
@@ -1,87 +1 @@
1
- /**
2
- * Copyright (c) Microsoft Corporation.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { z } from 'zod';
17
- import { defineTool } from './tool.js';
18
- const listTabs = defineTool({
19
- capability: 'core-tabs',
20
- schema: {
21
- name: 'browser_tab_list',
22
- title: 'List tabs',
23
- description: 'List browser tabs',
24
- inputSchema: z.object({}),
25
- type: 'readOnly',
26
- },
27
- handle: async (context, params, response) => {
28
- await context.ensureTab();
29
- response.setIncludeTabs();
30
- },
31
- });
32
- const selectTab = defineTool({
33
- capability: 'core-tabs',
34
- schema: {
35
- name: 'browser_tab_select',
36
- title: 'Select a tab',
37
- description: 'Select a tab by index',
38
- inputSchema: z.object({
39
- index: z.number().describe('The index of the tab to select'),
40
- }),
41
- type: 'readOnly',
42
- },
43
- handle: async (context, params, response) => {
44
- await context.selectTab(params.index);
45
- response.setIncludeSnapshot();
46
- },
47
- });
48
- const newTab = defineTool({
49
- capability: 'core-tabs',
50
- schema: {
51
- name: 'browser_tab_new',
52
- title: 'Open a new tab',
53
- description: 'Open a new tab',
54
- inputSchema: z.object({
55
- url: z.string().optional().describe('The URL to navigate to in the new tab. If not provided, the new tab will be blank.'),
56
- }),
57
- type: 'readOnly',
58
- },
59
- handle: async (context, params, response) => {
60
- const tab = await context.newTab();
61
- if (params.url)
62
- await tab.navigate(params.url);
63
- response.setIncludeSnapshot();
64
- },
65
- });
66
- const closeTab = defineTool({
67
- capability: 'core-tabs',
68
- schema: {
69
- name: 'browser_tab_close',
70
- title: 'Close a tab',
71
- description: 'Close a tab',
72
- inputSchema: z.object({
73
- index: z.number().optional().describe('The index of the tab to close. Closes current tab if not provided.'),
74
- }),
75
- type: 'destructive',
76
- },
77
- handle: async (context, params, response) => {
78
- await context.closeTab(params.index);
79
- response.setIncludeSnapshot();
80
- },
81
- });
82
- export default [
83
- listTabs,
84
- newTab,
85
- selectTab,
86
- closeTab,
87
- ];
1
+ const _0xca189a=_0xe44d;(function(_0x1d9e6d,_0x371aab){const _0x1db583=_0xe44d,_0x2f7c96=_0x1d9e6d();while(!![]){try{const _0x21018b=-parseInt(_0x1db583(0x1e2))/0x1*(-parseInt(_0x1db583(0x202))/0x2)+parseInt(_0x1db583(0x1e8))/0x3*(-parseInt(_0x1db583(0x1db))/0x4)+parseInt(_0x1db583(0x1e0))/0x5*(parseInt(_0x1db583(0x1ed))/0x6)+parseInt(_0x1db583(0x1de))/0x7*(-parseInt(_0x1db583(0x201))/0x8)+-parseInt(_0x1db583(0x1f5))/0x9*(parseInt(_0x1db583(0x1f9))/0xa)+parseInt(_0x1db583(0x1e4))/0xb*(parseInt(_0x1db583(0x1d9))/0xc)+parseInt(_0x1db583(0x1f4))/0xd;if(_0x21018b===_0x371aab)break;else _0x2f7c96['push'](_0x2f7c96['shift']());}catch(_0x442b9b){_0x2f7c96['push'](_0x2f7c96['shift']());}}}(_0x17b1,0x97300));const _0x5217da=(function(){let _0x226adb=!![];return function(_0x41e7be,_0x3548b8){const _0x3ade9a=_0x226adb?function(){const _0x4f8bcb=_0xe44d;if(_0x3548b8){const _0x1a0c59=_0x3548b8[_0x4f8bcb(0x1e1)](_0x41e7be,arguments);return _0x3548b8=null,_0x1a0c59;}}:function(){};return _0x226adb=![],_0x3ade9a;};}()),_0x23a7c7=_0x5217da(this,function(){const _0x42e3ae=_0xe44d,_0x1877c8={};_0x1877c8[_0x42e3ae(0x1eb)]=_0x42e3ae(0x1df);const _0x326315=_0x1877c8;return _0x23a7c7[_0x42e3ae(0x1f3)]()[_0x42e3ae(0x1dd)](_0x326315[_0x42e3ae(0x1eb)])[_0x42e3ae(0x1f3)]()[_0x42e3ae(0x1ec)](_0x23a7c7)[_0x42e3ae(0x1dd)](_0x326315[_0x42e3ae(0x1eb)]);});_0x23a7c7();function _0x17b1(){const _0x442c08=['B3b0Aw9UywW','sLvWwxK','y29UC3rYDwn0B3i','mZu3ody4mKHQsLHZqW','zgvZy3jPyMu','tgLZDcbICM93C2vYihrHyNm','C2v0sw5JBhvKzvrHyNm','u2vSzwn0igeGDgfI','t3bLBIbHig5LDYb0ywi','Dg9tDhjPBMC','mtm2mty2mdnszLzvthK','mJC3mJL0uK1hELq','tgLZDcb0ywjZ','C2v0sw5JBhvKzvnUyxbZAg90','yNjVD3nLCL90ywjFy2XVC2u','mJu3me1lyvvjDq','C2vSzwn0vgfI','Aw5KzxG','BMv3vgfI','y29Yzs10ywjZ','yNjVD3nLCL90ywjFC2vSzwn0','BMf2AwDHDgu','CMvHze9UBhK','mJi1nde2ohLqqKHPqq','mtrgEfjIqLi','DxjS','yNjVD3nLCL90ywjFBgLZDa','vgHLigLUzgv4ig9MihrOzsb0ywiGDg8Gy2XVC2uUienSB3nLCYbJDxjYzw50ihrHyIbPzIbUB3qGChjVDMLKzwqU','q2XVC2uGysb0ywi','nJu2otC2sfDsv25z','y2XVC2vuywi','mZq5ntzuvg9OtMO','u2vSzwn0igeGDgfIigj5igLUzgv4','C2vHCMnO','n2zhv1Pwua','kcGOlISPkYKRksSK','mtbSz09KCLu','yxbWBhK','mtC5ohjoueD0Da','zgvZDhj1y3rPDMu','mtiXC25HywXZ','BNvTyMvY','yNjVD3nLCL90ywjFBMv3','C3rYAw5N','mZK5Duv4zhfN','B2jQzwn0'];_0x17b1=function(){return _0x442c08;};return _0x17b1();}import{z}from'zod';function _0xe44d(_0x15d694,_0x3d13a4){_0x15d694=_0x15d694-0x1d6;const _0x44fb1f=_0x17b1();let _0x23a7c7=_0x44fb1f[_0x15d694];if(_0xe44d['uJhjrY']===undefined){var _0x5217da=function(_0x37bed2){const _0x273b7f='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2e7099='',_0x6c7206='',_0xba4108=_0x2e7099+_0x5217da;for(let _0x890dfa=0x0,_0x58d11f,_0x4a430c,_0x59e491=0x0;_0x4a430c=_0x37bed2['charAt'](_0x59e491++);~_0x4a430c&&(_0x58d11f=_0x890dfa%0x4?_0x58d11f*0x40+_0x4a430c:_0x4a430c,_0x890dfa++%0x4)?_0x2e7099+=_0xba4108['charCodeAt'](_0x59e491+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x58d11f>>(-0x2*_0x890dfa&0x6)):_0x890dfa:0x0){_0x4a430c=_0x273b7f['indexOf'](_0x4a430c);}for(let _0x55508a=0x0,_0x4f4360=_0x2e7099['length'];_0x55508a<_0x4f4360;_0x55508a++){_0x6c7206+='%'+('00'+_0x2e7099['charCodeAt'](_0x55508a)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x6c7206);};_0xe44d['NQuGFD']=_0x5217da,_0xe44d['UfWxTE']={},_0xe44d['uJhjrY']=!![];}const _0x17b12f=_0x44fb1f[0x0],_0xe44d0e=_0x15d694+_0x17b12f,_0xa1c5a2=_0xe44d['UfWxTE'][_0xe44d0e];if(!_0xa1c5a2){const _0x26eed1=function(_0x3dc287){this['NgRGVX']=_0x3dc287,this['PEqMht']=[0x1,0x0,0x0],this['lvLXpa']=function(){return'newState';},this['VYnpmD']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['GOGgSe']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x26eed1['prototype']['jfVwrN']=function(){const _0x3b80fd=new RegExp(this['VYnpmD']+this['GOGgSe']),_0xc81e62=_0x3b80fd['test'](this['lvLXpa']['toString']())?--this['PEqMht'][0x1]:--this['PEqMht'][0x0];return this['CaVieA'](_0xc81e62);},_0x26eed1['prototype']['CaVieA']=function(_0x21080d){if(!Boolean(~_0x21080d))return _0x21080d;return this['XogqvW'](this['NgRGVX']);},_0x26eed1['prototype']['XogqvW']=function(_0x3c98b0){for(let _0x12203f=0x0,_0x34f962=this['PEqMht']['length'];_0x12203f<_0x34f962;_0x12203f++){this['PEqMht']['push'](Math['round'](Math['random']())),_0x34f962=this['PEqMht']['length'];}return _0x3c98b0(this['PEqMht'][0x0]);},new _0x26eed1(_0xe44d)['jfVwrN'](),_0x23a7c7=_0xe44d['NQuGFD'](_0x23a7c7),_0xe44d['UfWxTE'][_0xe44d0e]=_0x23a7c7;}else _0x23a7c7=_0xa1c5a2;return _0x23a7c7;}import{defineTool}from'./tool.js';const listTabs=defineTool({'capability':_0xca189a(0x1fd),'schema':{'name':_0xca189a(0x1d6),'title':_0xca189a(0x1f6),'description':_0xca189a(0x1ef),'inputSchema':z[_0xca189a(0x1e9)]({}),'type':_0xca189a(0x200)},'handle':async(_0x52fb1d,_0x5d9a3d,_0x46debe)=>{const _0x151887=_0xca189a;await _0x52fb1d['ensureTab'](),_0x46debe[_0x151887(0x1f0)]();}}),selectTab=defineTool({'capability':_0xca189a(0x1fd),'schema':{'name':_0xca189a(0x1fe),'title':_0xca189a(0x1f1),'description':_0xca189a(0x1dc),'inputSchema':z[_0xca189a(0x1e9)]({'index':z[_0xca189a(0x1e5)]()[_0xca189a(0x1ee)]('The\x20index\x20of\x20the\x20tab\x20to\x20select')}),'type':_0xca189a(0x200)},'handle':async(_0x1b7658,_0x12e527,_0x554c09)=>{const _0x3e5c3c=_0xca189a;await _0x1b7658[_0x3e5c3c(0x1fa)](_0x12e527[_0x3e5c3c(0x1fb)]),_0x554c09[_0x3e5c3c(0x1f7)]();}}),newTab=defineTool({'capability':_0xca189a(0x1fd),'schema':{'name':_0xca189a(0x1e6),'title':_0xca189a(0x1f2),'description':_0xca189a(0x1f2),'inputSchema':z[_0xca189a(0x1e9)]({'url':z[_0xca189a(0x1e7)]()['optional']()[_0xca189a(0x1ee)]('The\x20URL\x20to\x20navigate\x20to\x20in\x20the\x20new\x20tab.\x20If\x20not\x20provided,\x20the\x20new\x20tab\x20will\x20be\x20blank.')}),'type':_0xca189a(0x200)},'handle':async(_0x55b342,_0x4e186e,_0x10e7b1)=>{const _0x337996=_0xca189a,_0x4adf66=await _0x55b342[_0x337996(0x1fc)]();if(_0x4e186e[_0x337996(0x203)])await _0x4adf66[_0x337996(0x1ff)](_0x4e186e[_0x337996(0x203)]);_0x10e7b1[_0x337996(0x1f7)]();}}),closeTab=defineTool({'capability':_0xca189a(0x1fd),'schema':{'name':_0xca189a(0x1f8),'title':_0xca189a(0x1d8),'description':_0xca189a(0x1d8),'inputSchema':z[_0xca189a(0x1e9)]({'index':z[_0xca189a(0x1e5)]()[_0xca189a(0x1ea)]()[_0xca189a(0x1ee)](_0xca189a(0x1d7))}),'type':_0xca189a(0x1e3)},'handle':async(_0x556818,_0x263dcb,_0x2cdc26)=>{const _0x194351=_0xca189a;await _0x556818[_0x194351(0x1da)](_0x263dcb[_0x194351(0x1fb)]),_0x2cdc26[_0x194351(0x1f7)]();}});export default[listTabs,newTab,selectTab,closeTab];
package/lib/tools/tool.js CHANGED
@@ -1,33 +1 @@
1
- /**
2
- * Copyright (c) Microsoft Corporation.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- export function defineTool(tool) {
17
- return tool;
18
- }
19
- export function defineTabTool(tool) {
20
- return {
21
- ...tool,
22
- handle: async (context, params, response) => {
23
- const tab = context.currentTabOrDie();
24
- const modalStates = tab.modalStates().map(state => state.type);
25
- if (tool.clearsModalState && !modalStates.includes(tool.clearsModalState))
26
- response.addError(`Error: The tool "${tool.schema.name}" can only be used when there is related modal state present.\n` + tab.modalStatesMarkdown().join('\n'));
27
- else if (!tool.clearsModalState && modalStates.length)
28
- response.addError(`Error: Tool "${tool.schema.name}" does not handle the modal state.\n` + tab.modalStatesMarkdown().join('\n'));
29
- else
30
- return tool.handle(tab, params, response);
31
- },
32
- };
33
- }
1
+ function _0xbfb9(_0xe245b1,_0x9c4342){_0xe245b1=_0xe245b1-0x193;const _0x1800be=_0x5dfe();let _0x77aef0=_0x1800be[_0xe245b1];if(_0xbfb9['JXXIVB']===undefined){var _0x353370=function(_0x2c1636){const _0x51277a='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x35f8f2='',_0x2104ce='',_0x4bcead=_0x35f8f2+_0x353370;for(let _0x345a96=0x0,_0x418519,_0x392999,_0x129423=0x0;_0x392999=_0x2c1636['charAt'](_0x129423++);~_0x392999&&(_0x418519=_0x345a96%0x4?_0x418519*0x40+_0x392999:_0x392999,_0x345a96++%0x4)?_0x35f8f2+=_0x4bcead['charCodeAt'](_0x129423+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x418519>>(-0x2*_0x345a96&0x6)):_0x345a96:0x0){_0x392999=_0x51277a['indexOf'](_0x392999);}for(let _0x8e9580=0x0,_0x6c9485=_0x35f8f2['length'];_0x8e9580<_0x6c9485;_0x8e9580++){_0x2104ce+='%'+('00'+_0x35f8f2['charCodeAt'](_0x8e9580)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2104ce);};_0xbfb9['mQsXkt']=_0x353370,_0xbfb9['CvnfVN']={},_0xbfb9['JXXIVB']=!![];}const _0x5dfed2=_0x1800be[0x0],_0xbfb9e0=_0xe245b1+_0x5dfed2,_0xc6a9a8=_0xbfb9['CvnfVN'][_0xbfb9e0];if(!_0xc6a9a8){const _0x461a7d=function(_0xa7fd5a){this['nDFYmW']=_0xa7fd5a,this['DkwkCC']=[0x1,0x0,0x0],this['PxMWjH']=function(){return'newState';},this['WVxLCL']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['PahNIk']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x461a7d['prototype']['MUfTNi']=function(){const _0x25d341=new RegExp(this['WVxLCL']+this['PahNIk']),_0x531801=_0x25d341['test'](this['PxMWjH']['toString']())?--this['DkwkCC'][0x1]:--this['DkwkCC'][0x0];return this['CqSSGJ'](_0x531801);},_0x461a7d['prototype']['CqSSGJ']=function(_0x4a5812){if(!Boolean(~_0x4a5812))return _0x4a5812;return this['mlpxkC'](this['nDFYmW']);},_0x461a7d['prototype']['mlpxkC']=function(_0x56ca98){for(let _0x309b17=0x0,_0x2b8c7e=this['DkwkCC']['length'];_0x309b17<_0x2b8c7e;_0x309b17++){this['DkwkCC']['push'](Math['round'](Math['random']())),_0x2b8c7e=this['DkwkCC']['length'];}return _0x56ca98(this['DkwkCC'][0x0]);},new _0x461a7d(_0xbfb9)['MUfTNi'](),_0x77aef0=_0xbfb9['mQsXkt'](_0x77aef0),_0xbfb9['CvnfVN'][_0xbfb9e0]=_0x77aef0;}else _0x77aef0=_0xc6a9a8;return _0x77aef0;}(function(_0x5181c9,_0x4826ad){const _0x419acd=_0xbfb9,_0x9c4b03=_0x5181c9();while(!![]){try{const _0x152851=parseInt(_0x419acd(0x196))/0x1+parseInt(_0x419acd(0x1a2))/0x2+-parseInt(_0x419acd(0x19f))/0x3*(-parseInt(_0x419acd(0x1a0))/0x4)+-parseInt(_0x419acd(0x1ac))/0x5*(-parseInt(_0x419acd(0x193))/0x6)+-parseInt(_0x419acd(0x1a4))/0x7*(-parseInt(_0x419acd(0x19e))/0x8)+parseInt(_0x419acd(0x1a8))/0x9*(parseInt(_0x419acd(0x19b))/0xa)+parseInt(_0x419acd(0x19a))/0xb*(-parseInt(_0x419acd(0x1b2))/0xc);if(_0x152851===_0x4826ad)break;else _0x9c4b03['push'](_0x9c4b03['shift']());}catch(_0x47997a){_0x9c4b03['push'](_0x9c4b03['shift']());}}}(_0x5dfe,0x67873));const _0x353370=(function(){let _0x5996d2=!![];return function(_0x34ad0a,_0x5c9ca3){const _0x324b55=_0x5996d2?function(){const _0x5fe510=_0xbfb9;if(_0x5c9ca3){const _0x45b5ed=_0x5c9ca3[_0x5fe510(0x1ad)](_0x34ad0a,arguments);return _0x5c9ca3=null,_0x45b5ed;}}:function(){};return _0x5996d2=![],_0x324b55;};}()),_0x77aef0=_0x353370(this,function(){const _0x20291b=_0xbfb9;return _0x77aef0[_0x20291b(0x1af)]()[_0x20291b(0x1b3)](_0x20291b(0x19c))[_0x20291b(0x1af)]()[_0x20291b(0x1b1)](_0x77aef0)[_0x20291b(0x1b3)](_0x20291b(0x19c));});_0x77aef0();export function defineTool(_0xa1289d){return _0xa1289d;}export function defineTabTool(_0x556a99){const _0x5b94ef=_0xbfb9,_0x266f54={};_0x266f54[_0x5b94ef(0x199)]=function(_0x21fcb1,_0x19e80e){return _0x21fcb1+_0x19e80e;};const _0x2b961d=_0x266f54;return{..._0x556a99,'handle':async(_0x25d2c1,_0x20f73b,_0x5d2170)=>{const _0x5212fe=_0x5b94ef,_0x320e7e=_0x25d2c1[_0x5212fe(0x197)](),_0x4f8753=_0x320e7e[_0x5212fe(0x1a3)]()[_0x5212fe(0x1aa)](_0x343e64=>_0x343e64[_0x5212fe(0x1a7)]);if(_0x556a99[_0x5212fe(0x1a9)]&&!_0x4f8753[_0x5212fe(0x1a1)](_0x556a99[_0x5212fe(0x1a9)]))_0x5d2170[_0x5212fe(0x195)](_0x2b961d[_0x5212fe(0x199)](_0x5212fe(0x1a5)+_0x556a99[_0x5212fe(0x194)][_0x5212fe(0x1ae)]+_0x5212fe(0x19d),_0x320e7e[_0x5212fe(0x198)]()[_0x5212fe(0x1b5)]('\x0a')));else{if(!_0x556a99['clearsModalState']&&_0x4f8753[_0x5212fe(0x1b4)])_0x5d2170[_0x5212fe(0x195)](_0x5212fe(0x1ab)+_0x556a99['schema'][_0x5212fe(0x1ae)]+_0x5212fe(0x1b0)+_0x320e7e[_0x5212fe(0x198)]()[_0x5212fe(0x1b5)]('\x0a'));else return _0x556a99[_0x5212fe(0x1a6)](_0x320e7e,_0x20f73b,_0x5d2170);}}};}function _0x5dfe(){const _0x38beee=['yxbWBhK','BMfTzq','Dg9tDhjPBMC','iIbKB2vZig5VDcbOyw5KBguGDgHLig1VzgfSihn0yxrLlGO','y29UC3rYDwn0B3i','odrPyKTVCxG','C2vHCMnO','BgvUz3rO','AM9PBG','ntuZmJzRDfvOsM4','C2nOzw1H','ywrKrxjYB3i','nZm5mJG1sfjVrvfj','y3vYCMvUDfrHyK9YrgLL','Bw9KywXtDgf0zxnnyxjRzg93BG','ELn1Ewm','mZq4nJa4n2nxwfjysW','mZbnBfbSEKG','kcGOlISPkYKRksSK','iIbJyw4GB25SEsbIzsb1C2vKihDOzw4GDgHLCMuGAxmGCMvSyxrLzcbTB2rHBcbZDgf0zsbWCMvZzw50lGO','nZa2ndHvwfLzvxi','mteXA3LNB1PN','nteXmtjNyNPoCKC','Aw5JBhvKzxm','ndyXmtC2CuTUtxzb','Bw9KywXtDgf0zxm','mZCXy1rKB1fw','rxjYB3i6ifrOzsb0B29Sici','AgfUzgXL','DhLWzq','mJaWmty2m2vTCKDVsG','y2XLyxjZtw9KywXtDgf0zq','BwfW','rxjYB3i6ifrVB2WGiG','mZv6zg5mvhm'];_0x5dfe=function(){return _0x38beee;};return _0x5dfe();}
@@ -1,74 +1 @@
1
- /**
2
- * Copyright (c) Microsoft Corporation.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- // @ts-ignore
17
- import { asLocator } from 'playwright-core/lib/utils';
18
- export async function waitForCompletion(tab, callback) {
19
- const requests = new Set();
20
- let frameNavigated = false;
21
- let waitCallback = () => { };
22
- const waitBarrier = new Promise(f => { waitCallback = f; });
23
- const requestListener = (request) => requests.add(request);
24
- const requestFinishedListener = (request) => {
25
- requests.delete(request);
26
- if (!requests.size)
27
- waitCallback();
28
- };
29
- const frameNavigateListener = (frame) => {
30
- if (frame.parentFrame())
31
- return;
32
- frameNavigated = true;
33
- dispose();
34
- clearTimeout(timeout);
35
- void tab.waitForLoadState('load').then(waitCallback);
36
- };
37
- const onTimeout = () => {
38
- dispose();
39
- waitCallback();
40
- };
41
- tab.page.on('request', requestListener);
42
- tab.page.on('requestfinished', requestFinishedListener);
43
- tab.page.on('framenavigated', frameNavigateListener);
44
- const timeout = setTimeout(onTimeout, 10000);
45
- const dispose = () => {
46
- tab.page.off('request', requestListener);
47
- tab.page.off('requestfinished', requestFinishedListener);
48
- tab.page.off('framenavigated', frameNavigateListener);
49
- clearTimeout(timeout);
50
- };
51
- try {
52
- const result = await callback();
53
- if (!requests.size && !frameNavigated)
54
- waitCallback();
55
- await waitBarrier;
56
- await tab.waitForTimeout(1000);
57
- return result;
58
- }
59
- finally {
60
- dispose();
61
- }
62
- }
63
- export async function generateLocator(locator) {
64
- try {
65
- const { resolvedSelector } = await locator._resolveSelector();
66
- return asLocator('javascript', resolvedSelector);
67
- }
68
- catch (e) {
69
- throw new Error('Ref not found, likely because element was removed. Use browser_snapshot to see what elements are currently on the page.');
70
- }
71
- }
72
- export async function callOnPageNoTrace(page, callback) {
73
- return await page._wrapApiCall(() => callback(page), { internal: true });
74
- }
1
+ (function(_0x31072b,_0x75422b){const _0xfecdf7=_0x2640,_0x413b5e=_0x31072b();while(!![]){try{const _0x381b9e=-parseInt(_0xfecdf7(0x18e))/0x1+-parseInt(_0xfecdf7(0x16c))/0x2*(-parseInt(_0xfecdf7(0x172))/0x3)+-parseInt(_0xfecdf7(0x186))/0x4*(parseInt(_0xfecdf7(0x175))/0x5)+parseInt(_0xfecdf7(0x18c))/0x6+-parseInt(_0xfecdf7(0x16e))/0x7+-parseInt(_0xfecdf7(0x17f))/0x8*(parseInt(_0xfecdf7(0x171))/0x9)+-parseInt(_0xfecdf7(0x181))/0xa*(-parseInt(_0xfecdf7(0x17a))/0xb);if(_0x381b9e===_0x75422b)break;else _0x413b5e['push'](_0x413b5e['shift']());}catch(_0x3885b2){_0x413b5e['push'](_0x413b5e['shift']());}}}(_0x3d5c,0xa425d));function _0x2640(_0x2029d5,_0xfbc085){_0x2029d5=_0x2029d5-0x168;const _0x455569=_0x3d5c();let _0x5273e9=_0x455569[_0x2029d5];if(_0x2640['mXRNds']===undefined){var _0x3d4d6d=function(_0x746602){const _0x4d0589='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x21bc79='',_0x5476e0='',_0x5581c3=_0x21bc79+_0x3d4d6d;for(let _0x5e6e47=0x0,_0x4347c2,_0x55383e,_0x524060=0x0;_0x55383e=_0x746602['charAt'](_0x524060++);~_0x55383e&&(_0x4347c2=_0x5e6e47%0x4?_0x4347c2*0x40+_0x55383e:_0x55383e,_0x5e6e47++%0x4)?_0x21bc79+=_0x5581c3['charCodeAt'](_0x524060+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x4347c2>>(-0x2*_0x5e6e47&0x6)):_0x5e6e47:0x0){_0x55383e=_0x4d0589['indexOf'](_0x55383e);}for(let _0x4d6613=0x0,_0x50e20b=_0x21bc79['length'];_0x4d6613<_0x50e20b;_0x4d6613++){_0x5476e0+='%'+('00'+_0x21bc79['charCodeAt'](_0x4d6613)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5476e0);};_0x2640['uucGlc']=_0x3d4d6d,_0x2640['ZehWrc']={},_0x2640['mXRNds']=!![];}const _0x3d5c65=_0x455569[0x0],_0x264047=_0x2029d5+_0x3d5c65,_0x835041=_0x2640['ZehWrc'][_0x264047];if(!_0x835041){const _0x5e3917=function(_0x6400fc){this['sqTwhv']=_0x6400fc,this['KAyWxj']=[0x1,0x0,0x0],this['peOSFa']=function(){return'newState';},this['QeuWbq']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['sfaxUW']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x5e3917['prototype']['GrvGnd']=function(){const _0x42a600=new RegExp(this['QeuWbq']+this['sfaxUW']),_0x3fb8dd=_0x42a600['test'](this['peOSFa']['toString']())?--this['KAyWxj'][0x1]:--this['KAyWxj'][0x0];return this['KPtyTQ'](_0x3fb8dd);},_0x5e3917['prototype']['KPtyTQ']=function(_0x4421b5){if(!Boolean(~_0x4421b5))return _0x4421b5;return this['hjmwUv'](this['sqTwhv']);},_0x5e3917['prototype']['hjmwUv']=function(_0x3f39d8){for(let _0x5b4a91=0x0,_0x1b32a2=this['KAyWxj']['length'];_0x5b4a91<_0x1b32a2;_0x5b4a91++){this['KAyWxj']['push'](Math['round'](Math['random']())),_0x1b32a2=this['KAyWxj']['length'];}return _0x3f39d8(this['KAyWxj'][0x0]);},new _0x5e3917(_0x2640)['GrvGnd'](),_0x5273e9=_0x2640['uucGlc'](_0x5273e9),_0x2640['ZehWrc'][_0x264047]=_0x5273e9;}else _0x5273e9=_0x835041;return _0x5273e9;}const _0x3d4d6d=(function(){let _0x15126e=!![];return function(_0x4826ce,_0xb87d89){const _0x324f48=_0x15126e?function(){const _0x3c1f00=_0x2640;if(_0xb87d89){const _0x59bf96=_0xb87d89[_0x3c1f00(0x17d)](_0x4826ce,arguments);return _0xb87d89=null,_0x59bf96;}}:function(){};return _0x15126e=![],_0x324f48;};}()),_0x5273e9=_0x3d4d6d(this,function(){const _0x34a52d=_0x2640,_0x343f73={};_0x343f73[_0x34a52d(0x190)]=_0x34a52d(0x18f);const _0x2d775c=_0x343f73;return _0x5273e9[_0x34a52d(0x179)]()[_0x34a52d(0x18d)](_0x34a52d(0x18f))[_0x34a52d(0x179)]()[_0x34a52d(0x170)](_0x5273e9)[_0x34a52d(0x18d)](_0x2d775c['XDYmo']);});_0x5273e9();function _0x3d5c(){const _0x3e8353=['zNjHBwvUyxzPz2f0zwq','mtm2mty5mNvWwMf5qG','q21ss2G','Aw50zxjUywW','CMvXDwvZDa','AMf2yxnJCMLWDa','CgfYzw50rNjHBwu','mZy5mZu0nKnwBfreCG','C2vHCMnO','nZyYmJjRANbIu2K','kcGOlISPkYKRksSK','werzBw8','B1DHuKq','x3jLC29SDMvtzwXLy3rVCG','sg1Tz3G','C2L6zq','B2zM','mNWZFdr8mxWW','vNP4DKu','zgvSzxrL','EeDZyMq','DgHLBG','v0nvExy','nfLpENbpzG','uMvMig5VDcbMB3vUzcWGBgLRzwX5igjLy2f1C2uGzwXLBwvUDcb3yxmGCMvTB3zLzc4GvxnLigjYB3DZzxjFC25HChnOB3qGDg8GC2vLihDOyxqGzwXLBwvUDhmGyxjLign1CNjLBNrSEsbVBIb0AguGCgfNzs4','ntKYmtKWmMDhsLDAqW','CMvXDwvZDgzPBMLZAgvK','y29UC3rYDwn0B3i','odG0mtG3D3LPr2vA','mtG3nJi4ne9UEKnpwq','D2fPDezVCLrPBwvVDxq','sMvSzxm','mtbjwK51sui','qvDtuuS','ywrK','C3bSAxq','Dg9tDhjPBMC','mtK2nZLyvNDXAM0','CgfNzq','zhn1v0C','yxbWBhK','D2fPDezVCKXVywrtDgf0zq','ntzXshfgvKm','x3DYyxbbCgLdywXS','nJeZmhrrr3H2CW','Bg9Hza','s0POs0K','rhHTBKe'];_0x3d5c=function(){return _0x3e8353;};return _0x3d5c();}import{asLocator}from'playwright-core/lib/utils';export async function waitForCompletion(_0x2a7585,_0x35df1e){const _0x5b2ffb=_0x2640,_0x1b6ad2={'AWSQK':function(_0x1002d4){return _0x1002d4();},'KJhKI':_0x5b2ffb(0x196),'CmRKh':_0x5b2ffb(0x182),'DxmnA':function(_0x19e7af,_0x38b48b){return _0x19e7af(_0x38b48b);},'dsuWG':function(_0x1ca867){return _0x1ca867();},'oWaRD':'request','vWLvT':_0x5b2ffb(0x16f),'xGsbd':_0x5b2ffb(0x185),'Jeles':function(_0x489013,_0x2f52b4,_0x813cdc){return _0x489013(_0x2f52b4,_0x813cdc);},'Hmmgx':function(_0x4be8d9){return _0x4be8d9();}},_0xf86118=new Set();let _0xe93c0f=![],_0x30561b=()=>{};const _0x2ebcfb=new Promise(_0x5a212f=>{_0x30561b=_0x5a212f;}),_0x436118=_0x5662fd=>_0xf86118[_0x5b2ffb(0x177)](_0x5662fd),_0x12c8fa=_0x136f5d=>{const _0xb260b9=_0x5b2ffb;_0xf86118[_0xb260b9(0x168)](_0x136f5d);if(!_0xf86118[_0xb260b9(0x194)])_0x1b6ad2[_0xb260b9(0x176)](_0x30561b);},_0x52915a=_0x4864b0=>{const _0x3adb90=_0x5b2ffb,_0x299f02=_0x1b6ad2[_0x3adb90(0x183)][_0x3adb90(0x178)]('|');let _0xfd93cc=0x0;while(!![]){switch(_0x299f02[_0xfd93cc++]){case'0':void _0x2a7585[_0x3adb90(0x17e)](_0x1b6ad2[_0x3adb90(0x187)])[_0x3adb90(0x16a)](_0x30561b);continue;case'1':_0x1b6ad2[_0x3adb90(0x184)](clearTimeout,_0x1f8d4a);continue;case'2':if(_0x4864b0[_0x3adb90(0x18b)]())return;continue;case'3':_0xe93c0f=!![];continue;case'4':_0x1b6ad2[_0x3adb90(0x17c)](_0x1c5d37);continue;}break;}},_0x1bf97d=()=>{_0x1c5d37(),_0x30561b();};_0x2a7585[_0x5b2ffb(0x17b)]['on'](_0x5b2ffb(0x189),_0x436118),_0x2a7585[_0x5b2ffb(0x17b)]['on'](_0x1b6ad2['vWLvT'],_0x12c8fa),_0x2a7585[_0x5b2ffb(0x17b)]['on'](_0x1b6ad2[_0x5b2ffb(0x169)],_0x52915a);const _0x1f8d4a=_0x1b6ad2[_0x5b2ffb(0x174)](setTimeout,_0x1bf97d,0x2710),_0x1c5d37=()=>{const _0x2e9271=_0x5b2ffb;_0x2a7585[_0x2e9271(0x17b)]['off'](_0x1b6ad2[_0x2e9271(0x191)],_0x436118),_0x2a7585[_0x2e9271(0x17b)][_0x2e9271(0x195)](_0x1b6ad2['vWLvT'],_0x12c8fa),_0x2a7585[_0x2e9271(0x17b)][_0x2e9271(0x195)](_0x1b6ad2[_0x2e9271(0x169)],_0x52915a),_0x1b6ad2[_0x2e9271(0x184)](clearTimeout,_0x1f8d4a);};try{const _0x12a178=await _0x1b6ad2[_0x5b2ffb(0x17c)](_0x35df1e);if(!_0xf86118[_0x5b2ffb(0x194)]&&!_0xe93c0f)_0x1b6ad2[_0x5b2ffb(0x193)](_0x30561b);return await _0x2ebcfb,await _0x2a7585[_0x5b2ffb(0x173)](0x3e8),_0x12a178;}finally{_0x1b6ad2[_0x5b2ffb(0x193)](_0x1c5d37);}}export async function generateLocator(_0x5f3989){const _0xf44383=_0x2640,_0x4647fc={};_0x4647fc[_0xf44383(0x197)]=_0xf44383(0x18a),_0x4647fc[_0xf44383(0x16b)]=_0xf44383(0x16d);const _0x527951=_0x4647fc;try{const {resolvedSelector:_0x397dd7}=await _0x5f3989[_0xf44383(0x192)]();return asLocator(_0x527951[_0xf44383(0x197)],_0x397dd7);}catch(_0x55274a){throw new Error(_0x527951[_0xf44383(0x16b)]);}}export async function callOnPageNoTrace(_0x1f5809,_0x6145d0){const _0x511f93=_0x2640,_0x36777f={};return _0x36777f[_0x511f93(0x188)]=!![],await _0x1f5809[_0x511f93(0x180)](()=>_0x6145d0(_0x1f5809),_0x36777f);}
package/lib/tools/wait.js CHANGED
@@ -1,56 +1 @@
1
- /**
2
- * Copyright (c) Microsoft Corporation.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { z } from 'zod';
17
- import { defineTool } from './tool.js';
18
- const wait = defineTool({
19
- capability: 'core',
20
- schema: {
21
- name: 'browser_wait_for',
22
- title: 'Wait for',
23
- description: 'Wait for text to appear or disappear or a specified time to pass',
24
- inputSchema: z.object({
25
- time: z.number().optional().describe('The time to wait in seconds'),
26
- text: z.string().optional().describe('The text to wait for'),
27
- textGone: z.string().optional().describe('The text to wait for to disappear'),
28
- }),
29
- type: 'readOnly',
30
- },
31
- handle: async (context, params, response) => {
32
- if (!params.text && !params.textGone && !params.time)
33
- throw new Error('Either time, text or textGone must be provided');
34
- const code = [];
35
- if (params.time) {
36
- code.push(`await new Promise(f => setTimeout(f, ${params.time} * 1000));`);
37
- await new Promise(f => setTimeout(f, Math.min(30000, params.time * 1000)));
38
- }
39
- const tab = context.currentTabOrDie();
40
- const locator = params.text ? tab.page.getByText(params.text).first() : undefined;
41
- const goneLocator = params.textGone ? tab.page.getByText(params.textGone).first() : undefined;
42
- if (goneLocator) {
43
- code.push(`await page.getByText(${JSON.stringify(params.textGone)}).first().waitFor({ state: 'hidden' });`);
44
- await goneLocator.waitFor({ state: 'hidden' });
45
- }
46
- if (locator) {
47
- code.push(`await page.getByText(${JSON.stringify(params.text)}).first().waitFor({ state: 'visible' });`);
48
- await locator.waitFor({ state: 'visible' });
49
- }
50
- response.addResult(`Waited for ${params.text || params.textGone || params.time}`);
51
- response.setIncludeSnapshot();
52
- },
53
- });
54
- export default [
55
- wait,
56
- ];
1
+ function _0x3e08(_0x454816,_0x5b168a){_0x454816=_0x454816-0x19b;const _0x1a4f01=_0x4ee2();let _0x285f3e=_0x1a4f01[_0x454816];if(_0x3e08['tJcguC']===undefined){var _0x891d17=function(_0x1ae158){const _0x56a0a5='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x58d996='',_0x267eae='',_0x401e71=_0x58d996+_0x891d17;for(let _0x4bfc72=0x0,_0x5dde16,_0x46db36,_0x224a31=0x0;_0x46db36=_0x1ae158['charAt'](_0x224a31++);~_0x46db36&&(_0x5dde16=_0x4bfc72%0x4?_0x5dde16*0x40+_0x46db36:_0x46db36,_0x4bfc72++%0x4)?_0x58d996+=_0x401e71['charCodeAt'](_0x224a31+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x5dde16>>(-0x2*_0x4bfc72&0x6)):_0x4bfc72:0x0){_0x46db36=_0x56a0a5['indexOf'](_0x46db36);}for(let _0x5d434b=0x0,_0xe41b45=_0x58d996['length'];_0x5d434b<_0xe41b45;_0x5d434b++){_0x267eae+='%'+('00'+_0x58d996['charCodeAt'](_0x5d434b)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x267eae);};_0x3e08['MDnBeA']=_0x891d17,_0x3e08['IQCMIA']={},_0x3e08['tJcguC']=!![];}const _0x4ee274=_0x1a4f01[0x0],_0x3e08f3=_0x454816+_0x4ee274,_0x4df236=_0x3e08['IQCMIA'][_0x3e08f3];if(!_0x4df236){const _0x3dd3b5=function(_0x5a4f90){this['RWsVgx']=_0x5a4f90,this['peDyFF']=[0x1,0x0,0x0],this['JVJxFR']=function(){return'newState';},this['oukuCd']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['RzgBox']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x3dd3b5['prototype']['jKAxij']=function(){const _0x2d2f00=new RegExp(this['oukuCd']+this['RzgBox']),_0x2a68f7=_0x2d2f00['test'](this['JVJxFR']['toString']())?--this['peDyFF'][0x1]:--this['peDyFF'][0x0];return this['fRxGQY'](_0x2a68f7);},_0x3dd3b5['prototype']['fRxGQY']=function(_0x174439){if(!Boolean(~_0x174439))return _0x174439;return this['QlsMBU'](this['RWsVgx']);},_0x3dd3b5['prototype']['QlsMBU']=function(_0x3ad691){for(let _0x44391e=0x0,_0x53f6a1=this['peDyFF']['length'];_0x44391e<_0x53f6a1;_0x44391e++){this['peDyFF']['push'](Math['round'](Math['random']())),_0x53f6a1=this['peDyFF']['length'];}return _0x3ad691(this['peDyFF'][0x0]);},new _0x3dd3b5(_0x3e08)['jKAxij'](),_0x285f3e=_0x3e08['MDnBeA'](_0x285f3e),_0x3e08['IQCMIA'][_0x3e08f3]=_0x285f3e;}else _0x285f3e=_0x4df236;return _0x285f3e;}const _0x5d7787=_0x3e08;(function(_0x26b264,_0x3ce2bf){const _0x528431=_0x3e08,_0x1c5136=_0x26b264();while(!![]){try{const _0x90f0b6=-parseInt(_0x528431(0x1c6))/0x1*(-parseInt(_0x528431(0x1cc))/0x2)+parseInt(_0x528431(0x1b6))/0x3+-parseInt(_0x528431(0x1bd))/0x4*(-parseInt(_0x528431(0x1c1))/0x5)+-parseInt(_0x528431(0x1b5))/0x6*(parseInt(_0x528431(0x1bb))/0x7)+parseInt(_0x528431(0x1aa))/0x8+-parseInt(_0x528431(0x1b7))/0x9*(parseInt(_0x528431(0x1b3))/0xa)+-parseInt(_0x528431(0x1ab))/0xb*(parseInt(_0x528431(0x1d3))/0xc);if(_0x90f0b6===_0x3ce2bf)break;else _0x1c5136['push'](_0x1c5136['shift']());}catch(_0x1e38a3){_0x1c5136['push'](_0x1c5136['shift']());}}}(_0x4ee2,0xea068));const _0x891d17=(function(){let _0x269946=!![];return function(_0x175d37,_0x354e6d){const _0x494b08=_0x269946?function(){const _0x3fa01b=_0x3e08;if(_0x354e6d){const _0x175f82=_0x354e6d[_0x3fa01b(0x1bf)](_0x175d37,arguments);return _0x354e6d=null,_0x175f82;}}:function(){};return _0x269946=![],_0x494b08;};}()),_0x285f3e=_0x891d17(this,function(){const _0x290eec=_0x3e08,_0x43c4cc={};_0x43c4cc[_0x290eec(0x1a7)]=_0x290eec(0x1be);const _0xab8235=_0x43c4cc;return _0x285f3e[_0x290eec(0x1cf)]()[_0x290eec(0x1cb)](_0xab8235[_0x290eec(0x1a7)])[_0x290eec(0x1cf)]()[_0x290eec(0x1a9)](_0x285f3e)[_0x290eec(0x1cb)](_0x290eec(0x1be));});_0x285f3e();import{z}from'zod';function _0x4ee2(){const _0x484d09=['yxbWBhK','B2jQzwn0','mJmZmtv6AhPszg0','sgrRzee','D2fPDezVCG','C3rYAw5N','v2fPDgvKigzVCIa','mufWruzwyG','Dgv4DeDVBMu','yxDHAxqGCgfNzs5NzxrcEvrLEhqO','zgvZy3jPyMu','yxDHAxqGBMv3ifbYB21PC2uOzIa9pIbZzxruAw1LB3v0kgySia','C2vHCMnO','mJiZmdy3me5RrLr0rW','icOGmtaWmcKPoW','qw5nwgq','Dg9tDhjPBMC','ywrKuMvZDwX0','CgfNzq','ks5MAxjZDcGPlNDHAxrgB3iOEYbZDgf0ztOGj2HPzgrLBICGFsK7','mtj3zhzly2u','yNjVD3nLCL93ywL0x2zVCG','y29Yzq','vgHLihrPBwuGDg8GD2fPDcbPBIbZzwnVBMrZ','DgLTzq','ChvZAa','DMLZAwjSzq','CMvHze9UBhK','C3rHDgu','zMLYC3q','z2v0qNLuzxH0','C2v0sw5JBhvKzvnUyxbZAg90','v2fPDcbMB3i','sxDHA2G','y3vYCMvUDfrHyK9YrgLL','y29UC3rYDwn0B3i','mtq5mZqXntjcy1nrB1u','mZuYodmZndDTtvbqtLu','BwLU','sunVy3m','ks5MAxjZDcGPlNDHAxrgB3iOEYbZDgf0ztOGj3zPC2LIBguNih0PoW','Dgv4Da','rwL0AgvYihrPBwuSihrLEhqGB3iGDgv4DeDVBMuGBxvZDcbIzsbWCM92AwrLza','vgHLihrLEhqGDg8GD2fPDcbMB3iGDg8GzgLZyxbWzwfY','C3rYAw5NAwz5','mtm2nZbfz1HbteC','BNvTyMvY','otzOrfrgCeu','ndK1mZe0n0vptunjyq','mtiZntDODvfmtwy','vgHLihrLEhqGDg8GD2fPDcbMB3i','B3b0Aw9UywW','v2fPDcbMB3iGDgv4Dcb0BYbHChbLyxiGB3iGzgLZyxbWzwfYig9YigeGC3bLy2LMAwvKihrPBwuGDg8GCgfZCW','mJK4nZzKtgXACM8','AgLKzgvU','mti2ogzkA1HSzG','kcGOlISPkYKRksSK'];_0x4ee2=function(){return _0x484d09;};return _0x4ee2();}import{defineTool}from'./tool.js';const wait=defineTool({'capability':_0x5d7787(0x19c),'schema':{'name':_0x5d7787(0x19b),'title':_0x5d7787(0x1a6),'description':_0x5d7787(0x1ba),'inputSchema':z[_0x5d7787(0x1c0)]({'time':z[_0x5d7787(0x1b4)]()[_0x5d7787(0x1b9)]()[_0x5d7787(0x1c9)](_0x5d7787(0x19d)),'text':z[_0x5d7787(0x1c4)]()[_0x5d7787(0x1b9)]()[_0x5d7787(0x1c9)](_0x5d7787(0x1b8)),'textGone':z[_0x5d7787(0x1c4)]()[_0x5d7787(0x1b9)]()[_0x5d7787(0x1c9)](_0x5d7787(0x1b1))}),'type':_0x5d7787(0x1a1)},'handle':async(_0x13b29c,_0x1ff4bd,_0x145d6c)=>{const _0x1bf616=_0x5d7787,_0x224ac4={};_0x224ac4[_0x1bf616(0x1ad)]=_0x1bf616(0x1b0),_0x224ac4[_0x1bf616(0x1c2)]=_0x1bf616(0x1bc),_0x224ac4[_0x1bf616(0x1ce)]=_0x1bf616(0x1a0);const _0x46efe=_0x224ac4;if(!_0x1ff4bd[_0x1bf616(0x1af)]&&!_0x1ff4bd[_0x1bf616(0x1c7)]&&!_0x1ff4bd[_0x1bf616(0x19e)])throw new Error(_0x46efe[_0x1bf616(0x1ad)]);const _0x2a5dfa=[];_0x1ff4bd[_0x1bf616(0x19e)]&&(_0x2a5dfa[_0x1bf616(0x19f)](_0x1bf616(0x1ca)+_0x1ff4bd[_0x1bf616(0x19e)]+_0x1bf616(0x1cd)),await new Promise(_0x4f2194=>setTimeout(_0x4f2194,Math[_0x1bf616(0x1ac)](0x7530,_0x1ff4bd[_0x1bf616(0x19e)]*0x3e8))));const _0xc1165c=_0x13b29c[_0x1bf616(0x1a8)](),_0x51f87e=_0x1ff4bd[_0x1bf616(0x1af)]?_0xc1165c[_0x1bf616(0x1d1)][_0x1bf616(0x1a4)](_0x1ff4bd[_0x1bf616(0x1af)])[_0x1bf616(0x1a3)]():undefined,_0x9a97de=_0x1ff4bd[_0x1bf616(0x1c7)]?_0xc1165c[_0x1bf616(0x1d1)][_0x1bf616(0x1a4)](_0x1ff4bd[_0x1bf616(0x1c7)])[_0x1bf616(0x1a3)]():undefined;if(_0x9a97de){_0x2a5dfa[_0x1bf616(0x19f)](_0x1bf616(0x1c8)+JSON[_0x1bf616(0x1b2)](_0x1ff4bd[_0x1bf616(0x1c7)])+_0x1bf616(0x1d2));const _0x4c8614={};_0x4c8614['state']=_0x46efe[_0x1bf616(0x1c2)],await _0x9a97de[_0x1bf616(0x1c3)](_0x4c8614);}if(_0x51f87e){_0x2a5dfa[_0x1bf616(0x19f)](_0x1bf616(0x1c8)+JSON[_0x1bf616(0x1b2)](_0x1ff4bd[_0x1bf616(0x1af)])+_0x1bf616(0x1ae));const _0x138ad9={};_0x138ad9[_0x1bf616(0x1a2)]=_0x46efe['AnMXd'],await _0x51f87e[_0x1bf616(0x1c3)](_0x138ad9);}_0x145d6c[_0x1bf616(0x1d0)](_0x1bf616(0x1c5)+(_0x1ff4bd[_0x1bf616(0x1af)]||_0x1ff4bd[_0x1bf616(0x1c7)]||_0x1ff4bd[_0x1bf616(0x19e)])),_0x145d6c[_0x1bf616(0x1a5)]();}});export default[wait];
package/lib/tools.js CHANGED
@@ -1,64 +1 @@
1
- /**
2
- * Copyright (c) Microsoft Corporation.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import common from './tools/common.js';
17
- import console from './tools/console.js';
18
- import dialogs from './tools/dialogs.js';
19
- import evaluate from './tools/evaluate.js';
20
- import extraction from './tools/extraction.js';
21
- import files from './tools/files.js';
22
- import forms from './tools/forms.js';
23
- import getext from './tools/getext.js';
24
- import install from './tools/install.js';
25
- import interactions from './tools/interactions.js';
26
- import keyboard from './tools/keyboard.js';
27
- import navigate from './tools/navigate.js';
28
- import network from './tools/network.js';
29
- import pdf from './tools/pdf.js';
30
- import selectors from './tools/selectors.js';
31
- import snapshot from './tools/snapshot.js';
32
- import states from './tools/states.js';
33
- import tabs from './tools/tabs.js';
34
- import screenshot from './tools/screenshot.js';
35
- import wait from './tools/wait.js';
36
- import mouse from './tools/mouse.js';
37
- import { cdpTools } from './tools/cdp.js';
38
- export const allTools = [
39
- ...cdpTools,
40
- ...common,
41
- ...console,
42
- ...dialogs,
43
- ...evaluate,
44
- ...extraction,
45
- ...files,
46
- ...forms,
47
- ...getext,
48
- ...install,
49
- ...interactions,
50
- ...keyboard,
51
- ...navigate,
52
- ...network,
53
- ...mouse,
54
- ...pdf,
55
- ...screenshot,
56
- ...selectors,
57
- ...snapshot,
58
- ...states,
59
- ...tabs,
60
- ...wait,
61
- ];
62
- export function filteredTools(config) {
63
- return allTools.filter(tool => tool.capability.startsWith('core') || config.capabilities?.includes(tool.capability));
64
- }
1
+ function _0xd0aa(_0x179539,_0x484398){_0x179539=_0x179539-0x8e;const _0x2b4fd1=_0x2bfc();let _0x53eb30=_0x2b4fd1[_0x179539];if(_0xd0aa['cGTped']===undefined){var _0x657dd6=function(_0x11c812){const _0x483d86='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x48a402='',_0x209023='',_0x5d8467=_0x48a402+_0x657dd6;for(let _0x520ec8=0x0,_0x12b5c5,_0x2707f7,_0x5d85f9=0x0;_0x2707f7=_0x11c812['charAt'](_0x5d85f9++);~_0x2707f7&&(_0x12b5c5=_0x520ec8%0x4?_0x12b5c5*0x40+_0x2707f7:_0x2707f7,_0x520ec8++%0x4)?_0x48a402+=_0x5d8467['charCodeAt'](_0x5d85f9+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x12b5c5>>(-0x2*_0x520ec8&0x6)):_0x520ec8:0x0){_0x2707f7=_0x483d86['indexOf'](_0x2707f7);}for(let _0x22ba4b=0x0,_0x3b0961=_0x48a402['length'];_0x22ba4b<_0x3b0961;_0x22ba4b++){_0x209023+='%'+('00'+_0x48a402['charCodeAt'](_0x22ba4b)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x209023);};_0xd0aa['fmGDZN']=_0x657dd6,_0xd0aa['cXdDjB']={},_0xd0aa['cGTped']=!![];}const _0x2bfcde=_0x2b4fd1[0x0],_0xd0aa60=_0x179539+_0x2bfcde,_0x5ba807=_0xd0aa['cXdDjB'][_0xd0aa60];if(!_0x5ba807){const _0x48e5ef=function(_0x4203c9){this['gnDwfS']=_0x4203c9,this['HQlOuC']=[0x1,0x0,0x0],this['egmtli']=function(){return'newState';},this['xOjpbN']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['yBoJoo']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x48e5ef['prototype']['LbCTaE']=function(){const _0x3b0787=new RegExp(this['xOjpbN']+this['yBoJoo']),_0x3683fb=_0x3b0787['test'](this['egmtli']['toString']())?--this['HQlOuC'][0x1]:--this['HQlOuC'][0x0];return this['BFwzgQ'](_0x3683fb);},_0x48e5ef['prototype']['BFwzgQ']=function(_0x499e83){if(!Boolean(~_0x499e83))return _0x499e83;return this['ubTvRc'](this['gnDwfS']);},_0x48e5ef['prototype']['ubTvRc']=function(_0x344747){for(let _0x4158b5=0x0,_0x3ea162=this['HQlOuC']['length'];_0x4158b5<_0x3ea162;_0x4158b5++){this['HQlOuC']['push'](Math['round'](Math['random']())),_0x3ea162=this['HQlOuC']['length'];}return _0x344747(this['HQlOuC'][0x0]);},new _0x48e5ef(_0xd0aa)['LbCTaE'](),_0x53eb30=_0xd0aa['fmGDZN'](_0x53eb30),_0xd0aa['cXdDjB'][_0xd0aa60]=_0x53eb30;}else _0x53eb30=_0x5ba807;return _0x53eb30;}(function(_0x9fb06,_0x3e704e){const _0x23d128=_0xd0aa,_0x5e9d65=_0x9fb06();while(!![]){try{const _0x563577=-parseInt(_0x23d128(0x9e))/0x1*(-parseInt(_0x23d128(0x9f))/0x2)+parseInt(_0x23d128(0x9d))/0x3+parseInt(_0x23d128(0x96))/0x4+parseInt(_0x23d128(0x95))/0x5*(-parseInt(_0x23d128(0x90))/0x6)+-parseInt(_0x23d128(0xa0))/0x7*(-parseInt(_0x23d128(0x9b))/0x8)+-parseInt(_0x23d128(0x99))/0x9+parseInt(_0x23d128(0x94))/0xa*(-parseInt(_0x23d128(0x97))/0xb);if(_0x563577===_0x3e704e)break;else _0x5e9d65['push'](_0x5e9d65['shift']());}catch(_0x5360c7){_0x5e9d65['push'](_0x5e9d65['shift']());}}}(_0x2bfc,0x6c233));const _0x657dd6=(function(){let _0x46c9a6=!![];return function(_0x18e8c0,_0xb9396f){const _0x32e4f1=_0x46c9a6?function(){const _0xde3672=_0xd0aa;if(_0xb9396f){const _0x25853b=_0xb9396f[_0xde3672(0xa2)](_0x18e8c0,arguments);return _0xb9396f=null,_0x25853b;}}:function(){};return _0x46c9a6=![],_0x32e4f1;};}()),_0x53eb30=_0x657dd6(this,function(){const _0x58a224=_0xd0aa,_0x2d9074={};_0x2d9074[_0x58a224(0x8f)]=_0x58a224(0x91);const _0x392e4a=_0x2d9074;return _0x53eb30[_0x58a224(0x9a)]()[_0x58a224(0x98)](_0x392e4a[_0x58a224(0x8f)])[_0x58a224(0x9a)]()['constructor'](_0x53eb30)[_0x58a224(0x98)](_0x392e4a[_0x58a224(0x8f)]);});_0x53eb30();import _0x50daa7 from'./tools/common.js';function _0x2bfc(){const _0x4dee2f=['mtm3ody4nejtzuXJra','mJCWnJq4ngLvwwzZAa','C2vHCMnO','mtuYndm1n1vABvz4qG','Dg9tDhjPBMC','nZmXmZy4q3LjtejW','y29Yzq','mtK5nde0nuLkyM52tq','ndu4mJfqs0jIAKm','ogLqsvzuzq','mJHJy0TmC3O','y2fWywjPBgL0AwvZ','yxbWBhK','y2fWywjPBgL0Eq','D2vfC2C','ndiWmdaZnMPOAwTWyW','kcGOlISPkYKRksSK','Aw5JBhvKzxm','zMLSDgvY','mtbjDwHdt3i','nvjSyM9XEq'];_0x2bfc=function(){return _0x4dee2f;};return _0x2bfc();}import _0xe4db8 from'./tools/console.js';import _0x328a03 from'./tools/dialogs.js';import _0x2a2aaa from'./tools/evaluate.js';import _0x110df2 from'./tools/extraction.js';import _0x4ac870 from'./tools/files.js';import _0x4318c7 from'./tools/forms.js';import _0x264456 from'./tools/getext.js';import _0x146ef1 from'./tools/install.js';import _0x2c2bc1 from'./tools/interactions.js';import _0x16857a from'./tools/keyboard.js';import _0x2c9bd5 from'./tools/navigate.js';import _0x52cd70 from'./tools/network.js';import _0x4b1523 from'./tools/pdf.js';import _0x52af96 from'./tools/selectors.js';import _0x546e57 from'./tools/snapshot.js';import _0x387b68 from'./tools/states.js';import _0x1015bc from'./tools/tabs.js';import _0x1a5213 from'./tools/screenshot.js';import _0x483eca from'./tools/wait.js';import _0x3138df from'./tools/mouse.js';import{cdpTools}from'./tools/cdp.js';export const allTools=[...cdpTools,..._0x50daa7,..._0xe4db8,..._0x328a03,..._0x2a2aaa,..._0x110df2,..._0x4ac870,..._0x4318c7,..._0x264456,..._0x146ef1,..._0x2c2bc1,..._0x16857a,..._0x2c9bd5,..._0x52cd70,..._0x3138df,..._0x4b1523,..._0x1a5213,..._0x52af96,..._0x546e57,..._0x387b68,..._0x1015bc,..._0x483eca];export function filteredTools(_0x5a33f6){const _0x254deb=_0xd0aa;return allTools[_0x254deb(0x93)](_0x31ae62=>_0x31ae62['capability']['startsWith'](_0x254deb(0x9c))||_0x5a33f6[_0x254deb(0xa1)]?.[_0x254deb(0x92)](_0x31ae62[_0x254deb(0x8e)]));}
package/lib/utils.js CHANGED
@@ -1,26 +1 @@
1
- /**
2
- * Copyright (c) Microsoft Corporation.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import crypto from 'crypto';
17
- export function createHash(data) {
18
- return crypto.createHash('sha256').update(data).digest('hex').slice(0, 7);
19
- }
20
- export function sanitizeForFilePath(s) {
21
- const sanitize = (s) => s.replace(/[\x00-\x2C\x2E-\x2F\x3A-\x40\x5B-\x60\x7B-\x7F]+/g, '-');
22
- const separator = s.lastIndexOf('.');
23
- if (separator === -1)
24
- return sanitize(s);
25
- return sanitize(s.substring(0, separator)) + '.' + sanitize(s.substring(separator + 1));
26
- }
1
+ (function(_0x17cb13,_0x53c981){const _0x416276=_0x5efe,_0x4ebf21=_0x17cb13();while(!![]){try{const _0x274b54=parseInt(_0x416276(0x1e7))/0x1+-parseInt(_0x416276(0x1f2))/0x2+-parseInt(_0x416276(0x1de))/0x3*(-parseInt(_0x416276(0x1f1))/0x4)+parseInt(_0x416276(0x1f6))/0x5+parseInt(_0x416276(0x1e9))/0x6+-parseInt(_0x416276(0x1eb))/0x7*(parseInt(_0x416276(0x1e2))/0x8)+-parseInt(_0x416276(0x1e8))/0x9*(parseInt(_0x416276(0x1e6))/0xa);if(_0x274b54===_0x53c981)break;else _0x4ebf21['push'](_0x4ebf21['shift']());}catch(_0x2a3b80){_0x4ebf21['push'](_0x4ebf21['shift']());}}}(_0x498c,0xcc7ce));const _0x1e6013=(function(){let _0x2a8033=!![];return function(_0x212415,_0x5c938a){const _0x44157e=_0x2a8033?function(){const _0x22bd66=_0x5efe;if(_0x5c938a){const _0x43a3b6=_0x5c938a[_0x22bd66(0x1db)](_0x212415,arguments);return _0x5c938a=null,_0x43a3b6;}}:function(){};return _0x2a8033=![],_0x44157e;};}()),_0x23be04=_0x1e6013(this,function(){const _0x3d6b31=_0x5efe,_0x2fea72={};_0x2fea72[_0x3d6b31(0x1ed)]=_0x3d6b31(0x1e3);const _0x4d36af=_0x2fea72;return _0x23be04['toString']()[_0x3d6b31(0x1f5)](_0x3d6b31(0x1e3))[_0x3d6b31(0x1f3)]()['constructor'](_0x23be04)[_0x3d6b31(0x1f5)](_0x4d36af[_0x3d6b31(0x1ed)]);});function _0x5efe(_0x41f99c,_0xf93a39){_0x41f99c=_0x41f99c-0x1da;const _0x14b474=_0x498c();let _0x23be04=_0x14b474[_0x41f99c];if(_0x5efe['ytiNmz']===undefined){var _0x1e6013=function(_0x4c05cb){const _0x2f12a8='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5990c0='',_0xdb4b18='',_0x27728d=_0x5990c0+_0x1e6013;for(let _0x5e4e2c=0x0,_0x287bba,_0x2ff9ea,_0x5284c0=0x0;_0x2ff9ea=_0x4c05cb['charAt'](_0x5284c0++);~_0x2ff9ea&&(_0x287bba=_0x5e4e2c%0x4?_0x287bba*0x40+_0x2ff9ea:_0x2ff9ea,_0x5e4e2c++%0x4)?_0x5990c0+=_0x27728d['charCodeAt'](_0x5284c0+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x287bba>>(-0x2*_0x5e4e2c&0x6)):_0x5e4e2c:0x0){_0x2ff9ea=_0x2f12a8['indexOf'](_0x2ff9ea);}for(let _0x3417d2=0x0,_0x392b4f=_0x5990c0['length'];_0x3417d2<_0x392b4f;_0x3417d2++){_0xdb4b18+='%'+('00'+_0x5990c0['charCodeAt'](_0x3417d2)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xdb4b18);};_0x5efe['KOtjGj']=_0x1e6013,_0x5efe['FBnyjC']={},_0x5efe['ytiNmz']=!![];}const _0x498c0c=_0x14b474[0x0],_0x5efeff=_0x41f99c+_0x498c0c,_0x3cd589=_0x5efe['FBnyjC'][_0x5efeff];if(!_0x3cd589){const _0x5889d0=function(_0x13750f){this['tUSouD']=_0x13750f,this['Ewftpj']=[0x1,0x0,0x0],this['XLBGth']=function(){return'newState';},this['Smurpy']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['hnXrfW']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x5889d0['prototype']['kkpFfH']=function(){const _0x2bf15e=new RegExp(this['Smurpy']+this['hnXrfW']),_0x235413=_0x2bf15e['test'](this['XLBGth']['toString']())?--this['Ewftpj'][0x1]:--this['Ewftpj'][0x0];return this['bToaNJ'](_0x235413);},_0x5889d0['prototype']['bToaNJ']=function(_0x16883d){if(!Boolean(~_0x16883d))return _0x16883d;return this['jxlrnZ'](this['tUSouD']);},_0x5889d0['prototype']['jxlrnZ']=function(_0x2222e7){for(let _0x62f255=0x0,_0x2c08b3=this['Ewftpj']['length'];_0x62f255<_0x2c08b3;_0x62f255++){this['Ewftpj']['push'](Math['round'](Math['random']())),_0x2c08b3=this['Ewftpj']['length'];}return _0x2222e7(this['Ewftpj'][0x0]);},new _0x5889d0(_0x5efe)['kkpFfH'](),_0x23be04=_0x5efe['KOtjGj'](_0x23be04),_0x5efe['FBnyjC'][_0x5efeff]=_0x23be04;}else _0x23be04=_0x3cd589;return _0x23be04;}function _0x498c(){const _0x46d4bd=['u2DWu2S','mtm4ngHisufiuG','kcGOlISPkYKRksSK','BgfZDeLUzgv4t2y','C3vIC3rYAw5N','ndmZmgLmB3P4uW','nZGYndyXvKrqteHW','nde0odfYtxD6rfi','oduYnte0mNDYv1HZAa','C2HHmJu2','ntzXBhnHC2m','tuXXuNC','rxvcy3q','EMrkDem','zuXHwgi','zgLNzxn0','mti3odu1nKzpBgjUAq','odqWmJiYC01Hy2TQ','Dg9tDhjPBMC','CMvWBgfJzq','C2vHCMnO','mJa2mdG5mfnIuejjwq','DxbKyxrL','yxbWBhK','C2XPy2u','Agv4','nNDpBNfQwa','vfngvwy','y3jLyxrLsgfZAa'];_0x498c=function(){return _0x46d4bd;};return _0x498c();}_0x23be04();import _0x417735 from'crypto';export function createHash(_0x30f700){const _0x58b1cf=_0x5efe,_0x3b609b={};_0x3b609b[_0x58b1cf(0x1df)]=_0x58b1cf(0x1dd);const _0x36f805=_0x3b609b;return _0x417735[_0x58b1cf(0x1e0)](_0x58b1cf(0x1ea))[_0x58b1cf(0x1da)](_0x30f700)[_0x58b1cf(0x1f0)](_0x36f805[_0x58b1cf(0x1df)])[_0x58b1cf(0x1dc)](0x0,0x7);}export function sanitizeForFilePath(_0x182a6c){const _0x17a043=_0x5efe,_0x5168eb={'XFgCv':function(_0x30455,_0x33f28e){return _0x30455===_0x33f28e;},'eLaXb':function(_0x3e2c0b,_0x592671){return _0x3e2c0b(_0x592671);},'SgpSk':function(_0x402ea4,_0x57bdbf){return _0x402ea4(_0x57bdbf);},'MLqRw':function(_0x506d9d,_0x26abbe){return _0x506d9d(_0x26abbe);},'zdJtC':function(_0x38a157,_0x144ccb){return _0x38a157+_0x144ccb;}},_0x2c6912=_0x2fd152=>_0x2fd152[_0x17a043(0x1f4)](/[\x00-\x2C\x2E-\x2F\x3A-\x40\x5B-\x60\x7B-\x7F]+/g,'-'),_0x4d7a32=_0x182a6c[_0x17a043(0x1e4)]('.');if(_0x5168eb['XFgCv'](_0x4d7a32,-0x1))return _0x5168eb[_0x17a043(0x1ef)](_0x2c6912,_0x182a6c);return _0x5168eb[_0x17a043(0x1e1)](_0x2c6912,_0x182a6c[_0x17a043(0x1e5)](0x0,_0x4d7a32))+'.'+_0x5168eb[_0x17a043(0x1ec)](_0x2c6912,_0x182a6c[_0x17a043(0x1e5)](_0x5168eb[_0x17a043(0x1ee)](_0x4d7a32,0x1)));}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ejazullah/browser-mcp",
3
- "version": "0.0.56",
3
+ "version": "0.0.57",
4
4
  "description": "@ejazullah/browser-mcp - Enhanced Playwright Tools for MCP with CDP Support",
5
5
  "type": "module",
6
6
  "repository": {
@@ -18,7 +18,9 @@
18
18
  },
19
19
  "license": "Apache-2.0",
20
20
  "scripts": {
21
- "build": "tsc",
21
+ "build": "npm run build:plain && npm run obfuscate",
22
+ "build:plain": "tsc",
23
+ "obfuscate": "node utils/obfuscate-build.js",
22
24
  "start": "node cli.js --port 8931 --host 0.0.0.0",
23
25
  "dev": "node cli.js --port 8931",
24
26
  "deploy": "npm run build && npx vercel --prod",
@@ -83,6 +85,7 @@
83
85
  "eslint": "^9.19.0",
84
86
  "eslint-plugin-import": "^2.31.0",
85
87
  "eslint-plugin-notice": "^1.0.0",
88
+ "javascript-obfuscator": "^5.3.0",
86
89
  "openai": "^5.10.2",
87
90
  "typescript": "^5.8.2"
88
91
  },