From 03c4b6982293c5be31d7eda89b6dcb8c1a7a8059 Mon Sep 17 00:00:00 2001 From: sigoden Date: Sun, 19 May 2024 22:43:49 +0800 Subject: feat: supports functions in bash/js/python/ruby (#6) --- js/may_execute_js_code.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 js/may_execute_js_code.js (limited to 'js') diff --git a/js/may_execute_js_code.js b/js/may_execute_js_code.js new file mode 100644 index 0000000..9575582 --- /dev/null +++ b/js/may_execute_js_code.js @@ -0,0 +1,22 @@ +exports.declarate = function declarate() { + return { + "name": "may_execute_js_code", + "description": "Runs the javascript code in node.js.", + "parameters": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Javascript code to execute, such as `console.log(\"hello world\")`" + } + }, + "required": [ + "code" + ] + } + } +} + +exports.execute = function execute(data) { + eval(data.code) +} -- cgit v1.2.3