lua-cli 1.1.4 โ†’ 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,44 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.2.1] - 2024-09-19
9
+
10
+ ### Fixed
11
+ - **Dependency Issue**: Moved `esbuild` from devDependencies to dependencies to fix bundling in global installations
12
+ - **TypeScript Errors**: Fixed implicit `any` type errors in template tool files
13
+
14
+ ## [1.2.0] - 2024-09-19
15
+
16
+ ### Added
17
+ - **Tool Development Framework**: Complete LuaSkill and LuaTool framework for building custom tools
18
+ - **Dependency Bundling**: Automatic bundling of npm packages using esbuild
19
+ - **Interactive Testing**: Real-time tool testing with `lua test` command
20
+ - **Code Compression**: Gzip compression for efficient storage of bundled code
21
+ - **In-Memory Execution**: VM-based execution without temporary files
22
+ - **Comprehensive Documentation**: Complete guides, API reference, and examples
23
+ - **Template System**: Rich template with 5 example tools and services
24
+ - **TypeScript Support**: Full TypeScript integration with Zod validation
25
+ - **Error Handling**: Robust error handling and validation throughout
26
+ - **Performance Optimization**: Optimized bundling and execution
27
+
28
+ ### New Commands
29
+ - **`lua compile`**: Bundle dependencies and compile LuaSkills
30
+ - **`lua test`**: Interactive testing interface for tools
31
+ - **`lua deploy`**: Deploy compiled skills to the Lua platform
32
+
33
+ ### Technical Improvements
34
+ - **esbuild Integration**: Fast bundling of external dependencies
35
+ - **VM Context**: Secure in-memory execution environment
36
+ - **Schema Validation**: Zod-based input/output validation
37
+ - **Service Architecture**: Reusable service components
38
+ - **Template Examples**: Calculator, Math, Weather, API, and File operation tools
39
+ - **Documentation Suite**: README, Developer Guide, API Reference, and Quick Start
40
+
41
+ ### Security
42
+ - **Sandboxed Execution**: Tools run in isolated VM contexts
43
+ - **Input Validation**: Comprehensive Zod schema validation
44
+ - **Error Isolation**: Proper error handling prevents crashes
45
+
8
46
  ## [1.1.0] - 2024-01-XX
9
47
 
10
48
  ### Added
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Lua CLI
2
2
 
3
- A command-line interface for the Lua AI platform that helps you manage agents, organizations, and skills with ease.
3
+ A powerful command-line interface for the Lua AI platform that helps you develop, test, and deploy LuaSkills with custom tools.
4
4
 
5
5
  ## Installation
6
6
 
@@ -22,8 +22,12 @@ lua --help
22
22
  - ๐Ÿข **Organization Management**: Select and manage multiple organizations
23
23
  - ๐Ÿค– **Agent Management**: Choose from available agents within your organizations
24
24
  - ๐Ÿ› ๏ธ **Skill Development**: Initialize new Lua skills with proper configuration
25
+ - ๐Ÿ”ง **Tool Development**: Create custom tools with TypeScript and Zod validation
26
+ - ๐Ÿ“ฆ **Dependency Bundling**: Automatic bundling of npm packages using esbuild
27
+ - ๐Ÿงช **Interactive Testing**: Test your tools with real-time execution
28
+ - ๐Ÿš€ **Deployment**: Compile and deploy skills to the Lua platform
25
29
  - ๐Ÿ”‘ **API Key Management**: Securely store, view, and manage your API keys
26
- - ๐Ÿ“ฆ **Template System**: Quick project setup with pre-configured templates
30
+ - ๐Ÿ“š **Comprehensive Documentation**: Complete guides and examples
27
31
 
28
32
  ## Quick Start
29
33
 
@@ -39,20 +43,29 @@ lua --help
39
43
  ```
40
44
  Select your organization and agent, then provide skill details.
41
45
 
42
- 3. **View your API key:**
46
+ 3. **Develop your tools:**
43
47
  ```bash
44
- lua apiKey
48
+ # Create tools in the tools/ directory
49
+ # See template/README.md for examples
45
50
  ```
46
51
 
47
- 4. **List your agents:**
52
+ 4. **Compile your skill:**
48
53
  ```bash
49
- lua agents
54
+ lua compile
50
55
  ```
56
+ Bundles dependencies and creates deployable files.
51
57
 
52
- 5. **Delete your stored credentials:**
58
+ 5. **Test your tools:**
53
59
  ```bash
54
- lua destroy
60
+ lua test
55
61
  ```
62
+ Interactive testing interface for your tools.
63
+
64
+ 6. **Deploy your skill:**
65
+ ```bash
66
+ lua deploy
67
+ ```
68
+ Deploy to the Lua platform.
56
69
 
57
70
  ## Commands
58
71
 
@@ -107,6 +120,109 @@ Delete your stored API key and credentials.
107
120
  lua destroy
108
121
  ```
109
122
 
123
+ ### `lua compile`
124
+
125
+ Compile your LuaSkill and bundle all dependencies.
126
+
127
+ ```bash
128
+ lua compile
129
+ ```
130
+
131
+ This command will:
132
+ - Scan your tools for imports and dependencies
133
+ - Bundle external packages using esbuild
134
+ - Compress the generated code for efficient storage
135
+ - Create `.lua/deploy.json` with compiled skill data
136
+ - Generate individual tool files in `.lua/` directory
137
+
138
+ **Options:**
139
+ - `--watch` - Watch for changes and recompile automatically
140
+ - `--minify` - Minify the bundled code
141
+
142
+ ### `lua test`
143
+
144
+ Interactive testing interface for your tools.
145
+
146
+ ```bash
147
+ lua test
148
+ ```
149
+
150
+ Features:
151
+ - Tool selection menu
152
+ - Input validation with Zod schemas
153
+ - Real-time execution in isolated VM context
154
+ - Error reporting and debugging
155
+ - Mock data support
156
+
157
+ ### `lua deploy`
158
+
159
+ Deploy your compiled skill to the Lua platform.
160
+
161
+ ```bash
162
+ lua deploy
163
+ ```
164
+
165
+ **Requirements:**
166
+ - Valid API key (configured with `lua configure`)
167
+ - Compiled skill (run `lua compile` first)
168
+ - Active internet connection
169
+
170
+ **Output:**
171
+ - Skill deployed to your selected agent
172
+ - Deployment confirmation and status
173
+
174
+ ## Template System
175
+
176
+ The Lua CLI includes a comprehensive template system with examples and documentation:
177
+
178
+ ### Template Structure
179
+ ```
180
+ template/
181
+ โ”œโ”€โ”€ README.md # Complete user guide
182
+ โ”œโ”€โ”€ DEVELOPER.md # Technical documentation
183
+ โ”œโ”€โ”€ API.md # API reference
184
+ โ”œโ”€โ”€ QUICKSTART.md # Quick start guide
185
+ โ”œโ”€โ”€ tools/ # Example tools
186
+ โ”‚ โ”œโ”€โ”€ GetWeatherTool.ts
187
+ โ”‚ โ”œโ”€โ”€ GetUserDataTool.ts
188
+ โ”‚ โ”œโ”€โ”€ CreatePostTool.ts
189
+ โ”‚ โ”œโ”€โ”€ CalculatorTool.ts
190
+ โ”‚ โ””โ”€โ”€ AdvancedMathTool.ts
191
+ โ”œโ”€โ”€ services/ # Example services
192
+ โ”‚ โ”œโ”€โ”€ ApiService.ts
193
+ โ”‚ โ”œโ”€โ”€ GetWeather.ts
194
+ โ”‚ โ””โ”€โ”€ MathService.ts
195
+ โ””โ”€โ”€ index.ts # Main skill definition
196
+ ```
197
+
198
+ ### Getting Started with Templates
199
+
200
+ 1. **Copy the template:**
201
+ ```bash
202
+ cp -r template/ my-skill/
203
+ cd my-skill
204
+ ```
205
+
206
+ 2. **Install dependencies:**
207
+ ```bash
208
+ npm install
209
+ ```
210
+
211
+ 3. **Read the documentation:**
212
+ ```bash
213
+ # Start with the quick start guide
214
+ cat QUICKSTART.md
215
+
216
+ # Then read the full documentation
217
+ cat README.md
218
+ ```
219
+
220
+ 4. **Create your tools:**
221
+ ```bash
222
+ # Modify existing tools or create new ones
223
+ # See tools/ directory for examples
224
+ ```
225
+
110
226
  ## Configuration File
111
227
 
112
228
  The `lua.skill.toml` file is created when you run `lua init`:
@@ -146,10 +262,57 @@ description = "Description of your skill"
146
262
  - Confirmation prompts prevent accidental exposure of sensitive information
147
263
  - No credentials are stored in plain text
148
264
 
265
+ ## Development Workflow
266
+
267
+ ### 1. Project Setup
268
+ ```bash
269
+ # Initialize a new skill project
270
+ lua init
271
+
272
+ # Or copy the template
273
+ cp -r template/ my-skill/
274
+ cd my-skill
275
+ npm install
276
+ ```
277
+
278
+ ### 2. Tool Development
279
+ ```bash
280
+ # Create tools in tools/ directory
281
+ # Use TypeScript with Zod validation
282
+ # See template/tools/ for examples
283
+ ```
284
+
285
+ ### 3. Testing
286
+ ```bash
287
+ # Compile your skill
288
+ lua compile
289
+
290
+ # Test your tools interactively
291
+ lua test
292
+ ```
293
+
294
+ ### 4. Deployment
295
+ ```bash
296
+ # Deploy to Lua platform
297
+ lua deploy
298
+ ```
299
+
300
+ ### 5. Iteration
301
+ ```bash
302
+ # Make changes to your tools
303
+ # Recompile and test
304
+ lua compile && lua test
305
+
306
+ # Deploy updates
307
+ lua deploy
308
+ ```
309
+
149
310
  ## Requirements
150
311
 
151
312
  - Node.js 16.0.0 or higher
152
313
  - Valid Lua AI platform account
314
+ - TypeScript knowledge (for tool development)
315
+ - Basic understanding of Zod schemas
153
316
 
154
317
  ## Development
155
318
 
@@ -174,6 +337,18 @@ For support and questions:
174
337
 
175
338
  ## Changelog
176
339
 
340
+ ### 1.2.0
341
+ - **Tool Development Framework**: Complete LuaSkill and LuaTool framework
342
+ - **Dependency Bundling**: Automatic bundling of npm packages using esbuild
343
+ - **Interactive Testing**: Real-time tool testing with `lua test` command
344
+ - **Code Compression**: Gzip compression for efficient storage
345
+ - **In-Memory Execution**: VM-based execution without temporary files
346
+ - **Comprehensive Documentation**: Complete guides, API reference, and examples
347
+ - **Template System**: Rich template with 5 example tools and services
348
+ - **TypeScript Support**: Full TypeScript integration with Zod validation
349
+ - **Error Handling**: Robust error handling and validation
350
+ - **Performance Optimization**: Optimized bundling and execution
351
+
177
352
  ### 1.1.0
178
353
  - **Major Refactoring**: Complete codebase reorganization into modular structure
179
354
  - **Email Authentication**: Added OTP-based email authentication
@@ -1,5 +1,16 @@
1
1
  import fs from "fs";
2
2
  import path from "path";
3
+ import { gzipSync, gunzipSync } from "zlib";
4
+ import { Buffer } from "buffer";
5
+ // Compression utilities
6
+ function compressCode(code) {
7
+ const compressed = gzipSync(code);
8
+ return compressed.toString('base64');
9
+ }
10
+ function decompressCode(compressedCode) {
11
+ const buffer = Buffer.from(compressedCode, 'base64');
12
+ return gunzipSync(buffer).toString('utf8');
13
+ }
3
14
  export async function deployCommand() {
4
15
  try {
5
16
  console.log("๐Ÿ”จ Compiling Lua skill...");
@@ -19,11 +30,14 @@ export async function deployCommand() {
19
30
  const indexContent = fs.readFileSync(indexPath, "utf8");
20
31
  // Extract skill information
21
32
  const skillInfo = await extractSkillInfo(indexContent);
22
- // Create deployment data
33
+ // Create deployment data with compressed execute code
23
34
  const deployData = {
24
35
  version,
25
36
  skillsName,
26
- tools: skillInfo
37
+ tools: skillInfo.map(tool => ({
38
+ ...tool,
39
+ execute: compressCode(tool.execute)
40
+ }))
27
41
  };
28
42
  // Create .lua directory
29
43
  const luaDir = path.join(process.cwd(), ".lua");
@@ -323,8 +337,8 @@ async function bundlePackageCode(packagePath, namedImports, defaultImport) {
323
337
  if (!fs.existsSync(luaDir)) {
324
338
  fs.mkdirSync(luaDir, { recursive: true });
325
339
  }
326
- const entryFile = path.join(luaDir, `${packagePath}-entry.js`);
327
- const outputFile = path.join(luaDir, `${packagePath}-bundle.js`);
340
+ const entryFile = path.join(luaDir, `${packagePath}-entry.cjs`);
341
+ const outputFile = path.join(luaDir, `${packagePath}-bundle.cjs`);
328
342
  // Create entry file based on import type
329
343
  let entryContent = '';
330
344
  if (defaultImport) {
@@ -629,21 +643,66 @@ async function createClassBasedExecute(executeBody, toolContent, className) {
629
643
  }
630
644
  continue;
631
645
  }
632
- // Handle axios
646
+ // Handle axios - bundle it properly
633
647
  if (packagePath === 'axios') {
634
- bundledPackages.add(`const axios = require('axios');`);
648
+ const packageCode = await bundlePackageCode(packagePath, namedImports, defaultImport);
649
+ if (packageCode) {
650
+ bundledPackages.add(packageCode);
651
+ }
635
652
  continue;
636
653
  }
637
654
  // Handle local service imports
638
655
  if (packagePath.startsWith('./') || packagePath.startsWith('../')) {
639
656
  // The tool files are in tools/ subdirectory, so we need to resolve from there
640
657
  const toolDir = path.join(process.cwd(), 'tools');
641
- const serviceFilePath = path.resolve(toolDir, packagePath + '.ts');
658
+ // Resolve the service file path correctly
659
+ // If the import is ../services/ApiService, resolve it relative to the tools directory
660
+ const serviceFilePath = path.resolve(process.cwd(), 'tools', packagePath + '.ts');
642
661
  if (fs.existsSync(serviceFilePath)) {
643
662
  const serviceContent = fs.readFileSync(serviceFilePath, 'utf8');
644
- // Check for axios import in service file
645
- if (serviceContent.includes("import axios from \"axios\"")) {
646
- bundledPackages.add(`const axios = require('axios');`);
663
+ // Process all imports in the service file
664
+ const serviceImportRegex = /import\s+(?:(?:\{([^}]+)\})|(\w+))\s+from\s+["']([^"']+)["']/g;
665
+ let serviceImportMatch;
666
+ while ((serviceImportMatch = serviceImportRegex.exec(serviceContent)) !== null) {
667
+ const namedImports = serviceImportMatch[1];
668
+ const defaultImport = serviceImportMatch[2];
669
+ const packagePath = serviceImportMatch[3];
670
+ // Skip lua-cli imports
671
+ if (packagePath.startsWith('lua-cli')) {
672
+ continue;
673
+ }
674
+ // Handle zod
675
+ if (packagePath === 'zod') {
676
+ if (namedImports) {
677
+ const importsList = namedImports.split(',').map(imp => imp.trim());
678
+ const usedImports = importsList.filter(imp => serviceContent.includes(`${imp}.`));
679
+ if (usedImports.length > 0) {
680
+ const requireStatement = usedImports.length === 1
681
+ ? `const { ${usedImports[0]} } = require('zod');`
682
+ : `const { ${usedImports.join(', ')} } = require('zod');`;
683
+ bundledPackages.add(requireStatement);
684
+ }
685
+ }
686
+ else if (defaultImport) {
687
+ bundledPackages.add(`const ${defaultImport} = require('zod');`);
688
+ }
689
+ continue;
690
+ }
691
+ // Handle axios - bundle it properly
692
+ if (packagePath === 'axios') {
693
+ const packageCode = await bundlePackageCode(packagePath, namedImports, defaultImport);
694
+ if (packageCode) {
695
+ bundledPackages.add(packageCode);
696
+ }
697
+ continue;
698
+ }
699
+ // Bundle other external packages
700
+ if (namedImports || defaultImport) {
701
+ const packageCode = await bundlePackageCode(packagePath, namedImports, defaultImport);
702
+ if (packageCode) {
703
+ bundledPackages.add(packageCode);
704
+ }
705
+ }
647
706
  }
648
707
  // Extract the service class with proper brace matching
649
708
  const classRegex = /class\s+(\w+)(?:\s+extends\s+\w+)?\s*\{/g;
@@ -2,6 +2,15 @@ import fs from "fs";
2
2
  import path from "path";
3
3
  import inquirer from "inquirer";
4
4
  import { deployCommand } from "./deploy.js";
5
+ import { gunzipSync } from "zlib";
6
+ import { Buffer } from "buffer";
7
+ import { createRequire } from "module";
8
+ import vm from "vm";
9
+ // Decompression utility
10
+ function decompressCode(compressedCode) {
11
+ const buffer = Buffer.from(compressedCode, 'base64');
12
+ return gunzipSync(buffer).toString('utf8');
13
+ }
5
14
  export async function testCommand() {
6
15
  try {
7
16
  console.log("๐Ÿงช Testing Lua skill...");
@@ -101,12 +110,56 @@ export async function testCommand() {
101
110
  }
102
111
  console.log("\n๐Ÿš€ Executing tool...");
103
112
  console.log(`Input: ${JSON.stringify(inputValues, null, 2)}`);
104
- // Get the execute function string directly from the selected tool
105
- const toolCode = selectedTool.execute;
113
+ // Get the execute function string directly from the selected tool and decompress it
114
+ const toolCode = decompressCode(selectedTool.execute);
106
115
  // Execute the tool
107
116
  try {
108
- // Create a temporary CommonJS file to run the tool
109
- const tempFile = path.join(luaDir, `temp-${selectedTool.name}.cjs`);
117
+ // Create a CommonJS context for execution
118
+ const require = createRequire(process.cwd() + '/package.json');
119
+ // Create a sandbox context with require and other necessary globals
120
+ const sandbox = {
121
+ require,
122
+ console,
123
+ Buffer,
124
+ setTimeout,
125
+ setInterval,
126
+ clearTimeout,
127
+ clearInterval,
128
+ process,
129
+ global: globalThis,
130
+ __dirname: process.cwd(),
131
+ __filename: path.join(process.cwd(), 'index.ts'),
132
+ module: { exports: {} },
133
+ exports: {},
134
+ // Web APIs
135
+ fetch: globalThis.fetch,
136
+ URLSearchParams: globalThis.URLSearchParams,
137
+ URL: globalThis.URL,
138
+ Headers: globalThis.Headers,
139
+ Request: globalThis.Request,
140
+ Response: globalThis.Response,
141
+ // Additional Node.js globals that might be needed
142
+ Object,
143
+ Array,
144
+ String,
145
+ Number,
146
+ Boolean,
147
+ Date,
148
+ Math,
149
+ JSON,
150
+ Error,
151
+ TypeError,
152
+ ReferenceError,
153
+ SyntaxError,
154
+ // Node.js specific globals
155
+ globalThis,
156
+ // Additional globals that might be referenced
157
+ undefined: undefined,
158
+ null: null,
159
+ Infinity: Infinity,
160
+ NaN: NaN
161
+ };
162
+ // Create the CommonJS wrapper code
110
163
  const commonJsWrapper = `
111
164
  const executeFunction = ${toolCode};
112
165
 
@@ -115,14 +168,12 @@ module.exports = async (input) => {
115
168
  return await executeFunction(input);
116
169
  };
117
170
  `;
118
- fs.writeFileSync(tempFile, commonJsWrapper);
119
- // Import and execute the CommonJS module
120
- const { createRequire } = await import('module');
121
- const require = createRequire(import.meta.url);
122
- const executeFunction = require(tempFile);
171
+ // Execute the code in the sandbox
172
+ const context = vm.createContext(sandbox);
173
+ vm.runInContext(commonJsWrapper, context);
174
+ // Get the exported function
175
+ const executeFunction = context.module.exports;
123
176
  const result = await executeFunction(inputValues);
124
- // Clean up temp file
125
- fs.unlinkSync(tempFile);
126
177
  console.log("\nโœ… Tool execution successful!");
127
178
  console.log(`Output: ${JSON.stringify(result, null, 2)}`);
128
179
  }
package/dist/skill.d.ts CHANGED
@@ -2,9 +2,8 @@ import { ZodType } from "zod";
2
2
  import { LuaTool } from "./types/index.js";
3
3
  export { LuaTool };
4
4
  export declare class LuaSkill {
5
- private readonly apiKey;
6
5
  private readonly tools;
7
- constructor(apiKey: string);
6
+ constructor();
8
7
  addTool<TInput extends ZodType, TOutput extends ZodType>(tool: LuaTool<TInput, TOutput>): void;
9
8
  run(input: Record<string, any>): Promise<any>;
10
9
  }
package/dist/skill.js CHANGED
@@ -1,6 +1,5 @@
1
1
  export class LuaSkill {
2
- constructor(apiKey) {
3
- this.apiKey = apiKey;
2
+ constructor() {
4
3
  this.tools = [];
5
4
  }
6
5
  addTool(tool) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lua-cli",
3
- "version": "1.1.4",
4
- "description": "Command-line interface for Lua AI platform - manage agents, organizations, and skills",
3
+ "version": "1.2.1",
4
+ "description": "Command-line interface for Lua AI platform - develop, test, and deploy LuaSkills with custom tools",
5
5
  "readmeFilename": "README.md",
6
6
  "main": "dist/index.js",
7
7
  "exports": {
@@ -25,7 +25,12 @@
25
25
  "automation",
26
26
  "agents",
27
27
  "api",
28
- "typescript"
28
+ "typescript",
29
+ "tools",
30
+ "bundling",
31
+ "testing",
32
+ "deployment",
33
+ "skills"
29
34
  ],
30
35
  "author": "Stefan Kruger <stefan@heylua.ai>",
31
36
  "license": "MIT",
@@ -51,6 +56,7 @@
51
56
  ],
52
57
  "dependencies": {
53
58
  "commander": "^14.0.1",
59
+ "esbuild": "^0.25.10",
54
60
  "inquirer": "^12.9.6",
55
61
  "keytar": "^7.9.0",
56
62
  "node-fetch": "^3.3.2",
@@ -61,7 +67,6 @@
61
67
  "@types/jest": "^29.5.8",
62
68
  "@types/node": "^24.5.1",
63
69
  "@types/node-fetch": "^2.6.13",
64
- "esbuild": "^0.25.10",
65
70
  "jest": "^29.7.0",
66
71
  "ts-jest": "^29.1.1",
67
72
  "ts-node": "^10.9.2",
@@ -27,7 +27,7 @@
27
27
  "city"
28
28
  ]
29
29
  },
30
- "execute": "async (input) => {\nconst { z } = require('zod');\nclass GetWeatherMain {\n\n constructor() {\n }\n\n async getWeather(city) {\n return { weather: \"sunny\", city: city };\n }\n\n}\n\n return { weather: \"sunny\", city: input.city \n}"
30
+ "execute": "H4sIAAAAAAAAE31U22rbQBB991cMfokMquOEpoQYF4oLbSBtTRMIpfRhuppYi1e76u7KQk787x1doujSRg9Cqzm758yZmUVXaAGB1GnmZ7B6D48TYbTz8AgHOMIKLP3JpKXg5GCik9lyIhQ6B5/I3xP6mOwt2b0UxPsmwM/pKXwxYgd5HYUIPcIbkBqQj0IFmKYh+Fg6yE2mIhCo+GeL/7C5rs5p1h95+7I+uZJlM+GNDWZMB81TnjXvwFnzS7B8psroyOjpFefU4K5gKpTJomIagpC+4PVNDWJtlKRk0WeWruDsIoQ4S2RUgS4XIUTkhJWpl0bzrm97sgLZrlz6GJTcxh4sSj2FY9gXkaKVbqDBZVp3JGwqyEDB+XlXwbuRgrUitOB2ktyY1JtdYQakpbwO6V0FGaZ92Uv7Ykj6mXBfVIk+cPnGvJpyKIzdvZ7vV0b9KFHDlHumX4zY2SevCmgqOCJ3RaSpeJ36tsYMiXtpvx0R116jjiBHmzBzS3xcVp/HulWxGqptOyNBydrt2XrEtLEJKnmgaM1x7tsSNvfmxuRk1+gomM29lUkwW7Y72w8etO/EsjVPkIgpqidNPgDuUSr8rSgEU5Ln0hGPXgXdkiYrBS9dyhJoIKix61o/GFYzHKyffb2/4OlpMGkvdmd6p03O49SL1+aX7/7/fhEW/WCnEwaRfnHuuzeONv7FiGm3TF0Db2WSKfRU3jp8msKijWKOkivEHbqxJmELA/bMqD2Vd6QjfycTMpl//hvC2WIx+1edGuc71ratcpz0bH++SVcV7eiGLbvgP6c2iHmn46oLfV71Xc03Of4FAe0AJusFAAA="
31
31
  },
32
32
  {
33
33
  "name": "get_user_data",
@@ -54,7 +54,7 @@
54
54
  "userId"
55
55
  ]
56
56
  },
57
- "execute": "async (input) => {\nconst { z } = require('zod');\nconst axios = require('axios');\nclass ApiService {\n\n baseUrl;\n timeout;\n \n constructor() {\n this.baseUrl = \"https://httpbin.org\";\n this.timeout = 5000;\n }\n\n async fetchUserData(userId) {\n try {\n const response = await axios.get(`${this.baseUrl}/get`, {\n params: { userId },\n timeout: this.timeout,\n headers: {\n 'Content-Type': 'application/json',\n 'User-Agent': 'Lua-Skill/1.0'\n }\n });\n \n return {\n id: userId,\n name: response.data.args.userId || 'Unknown',\n url: response.data.url,\n status: 'success',\n timestamp: new Date().toISOString()\n };\n } catch (error) {\n return {\n id: userId,\n name: 'Unknown',\n url: null,\n status: 'error',\n error: error.message,\n timestamp: new Date().toISOString()\n };\n }\n }\n\n async createPost(title, content) {\n try {\n const response = await axios.post(`${this.baseUrl}/post`, {\n title,\n content,\n publishedAt: new Date().toISOString()\n }, {\n timeout: this.timeout,\n headers: {\n 'Content-Type': 'application/json'\n }\n });\n \n return {\n id: response.data.json.title || 'generated-id',\n title: response.data.json.title,\n status: 'created',\n url: response.data.url\n };\n } catch (error) {\n return {\n id: null,\n title,\n status: 'error',\n error: error.message,\n url: null\n };\n }\n }\n\n}\nconst apiService = new ApiService();\n\n return apiService.fetchUserData(input.userId);\n \n}"
57
+ "execute": "H4sIAAAAAAAAE+1Y32+jRhB+918xPUUySA5OH/pClJ6iO6u9Kmqis62+egNjexvM0t0lvpyP/72z7GKDIcmliatKNbIMzM7Mzo/vW1iYekgj8Hia5dqHi59h04tEqjRs4CsUcAES/8q5RK//VcR9/7zXGw7hDyHveLoA9oULBXyVJbjCVDPNRQq5MkMp3dwjzFFHS/DmQoJG8orpPZciNdrKdzNZLxc0M8ACdQjMxpTLZACkMucLM1q48IAOa6iQyWh5wyRbGfsU1zD9fDWuST1rHmRW59s34+a85mKeJ8lUJmRddxZoMdaS0vB8eA+zkw2FUrw/2dR1ihmEQHLrreZSosroAsknWzOubQ08N9PAZQCwQr0UcQj9X0aT/sAJl8hilCrcagH0P4hUU71OJw8Z9kmfZVnCo7LYwz+VSLfGAEEQuIydIzdSlOcq9fKPz8H7oYo1EHf+dkqbBkpJTbNVHZlrb/aZoGCaOGc8wRjWXC9BUddzBSebrSsrKWZuMrCeglpZNs4qhD2jgRuY4BfdGjRCKCqneinF2rq2omK/DzHTbNuDrS9TMM+FJlHnMqVwnE9jMahuHg2xMf5opK2GbnWcZLCrNvUrdGebigmvMAr0y4Tao4QN8yliPALBvBN+N9fjw+OvUrkV8UMIv42vf6daGYbx+YNnEvL/hwitzD/+I6SGDfv/Hm7zA8N2ekTtEbVvjdoYE9T4/a8gL4Lsx9HVaDI6PuuPmHzZSsoIUoddSy8nH349rqZH5L4Vcnt06kUJUwouMz5Gec8jpNaVKrdM4bTaOGm+QpHr/V2UzCNNzfRrGNRLrgJnS5V6t9Q6U+FwaM63PA2EXLw7b2o756T909nZWdWB8mTZVJJiqlCa8nk5XXyKG3PKh9rdE+wq97AB7V492i3WIy2GJJwN9ryYw+5JiWVg590RZHe4BMJGOm21DsbWj5ewt2FnKnN6uSBTY3WVs9PxHU+S4Y/BWb9lUTQkhX/euG/cVFBu+eC0GtlqtCNK2QprUDTwD5hcqMCVjzb3/Wl6l4p1Vz608O0bm7WwpVdRp6/yKEKlOlyZNpDaKgvLZYegg54faPFpfF19NWiWYleJAiJWfhAplwR/rwKvKMtzmad58lSyZTgdtqU8dGsjZa3YAt+2IG1ORhLJwQ1tez3NdYLlc87A9xXENJvoNjONtJOadt6W2MXRHsjy24SrJcaX+ntL0D3tv8P2g1G3yS8zV1CWsuQmLSMoqS7xKY87WUWKj7t4ArwWMF0+u0l/AHJ20+u5wF/Hui2vn+VWUX1o3T2K7RvT7tlsXjK2hi7VnXrQfE6WH4vdslu9rBV/A/Xl9GpJFgAA"
58
58
  },
59
59
  {
60
60
  "name": "create_post",
@@ -89,7 +89,57 @@
89
89
  "content"
90
90
  ]
91
91
  },
92
- "execute": "async (input) => {\nconst { z } = require('zod');\nconst axios = require('axios');\nclass ApiService {\n\n baseUrl;\n timeout;\n \n constructor() {\n this.baseUrl = \"https://httpbin.org\";\n this.timeout = 5000;\n }\n\n async fetchUserData(userId) {\n try {\n const response = await axios.get(`${this.baseUrl}/get`, {\n params: { userId },\n timeout: this.timeout,\n headers: {\n 'Content-Type': 'application/json',\n 'User-Agent': 'Lua-Skill/1.0'\n }\n });\n \n return {\n id: userId,\n name: response.data.args.userId || 'Unknown',\n url: response.data.url,\n status: 'success',\n timestamp: new Date().toISOString()\n };\n } catch (error) {\n return {\n id: userId,\n name: 'Unknown',\n url: null,\n status: 'error',\n error: error.message,\n timestamp: new Date().toISOString()\n };\n }\n }\n\n async createPost(title, content) {\n try {\n const response = await axios.post(`${this.baseUrl}/post`, {\n title,\n content,\n publishedAt: new Date().toISOString()\n }, {\n timeout: this.timeout,\n headers: {\n 'Content-Type': 'application/json'\n }\n });\n \n return {\n id: response.data.json.title || 'generated-id',\n title: response.data.json.title,\n status: 'created',\n url: response.data.url\n };\n } catch (error) {\n return {\n id: null,\n title,\n status: 'error',\n error: error.message,\n url: null\n };\n }\n }\n\n}\nconst apiService = new ApiService();\n\n return apiService.createPost(input.title, input.content);\n \n}"
92
+ "execute": "H4sIAAAAAAAAE+1Y32/bNhB+919xKwJYAhw5e9iLgqwIWmPrECxBbWOvZqSzzUUWNZKKm7r633cUKVuylKRZ4mHALASRebw73o/vo0Qx9ZBG4PE0y7UPFz/DpheJVGnYwFco4AIk/pVziV7/q4j7/nmvNxzCH0Le8XQB7AsXCvgqS3CFqWaaixRyZaZSGtwjzFFHS/DmQoJG8orpPZciNdrKdytZLxe0MsACdQjMxpTLZACkMucLM1u48IAua6iQyWh5wyRbGfsU1zD9fDWuST1rHmRW59s34+a85mKeJ8lUJmRddxZoMdaS0vB8eA+zkw2FUrw/2dR1ihmEQHLrreZSosroB5JPtmZc2xp4bqWBywBghXop4hD6v4wm/YETLpHFKFW41QLofxCppnqdTh4y7JM+y7KER2Wxh38qkW6NAYIgcBk7R26mKO9V6uU/PgfvhyrWQNz52yVtGiglNc1WdWR+e7PPBAXTxDnjCcaw5noJirqeKzjZbF1ZSTFzi4H1FNTKsnFWIewZDdzEBL/o1qQRQlE51Usp1ta1FRX7fYiZZtsebH2ZgnkuNIk6lymF43wai0E1eDTExvyjkbYautVxksGu2tSv0N1tKia8wijQXybUHiVsmE8R4xEI5p3wu7keHx5/lcqtiB9C+G18/TvVyjCMzx88k5D/P0RoZf7xHyE1bNj/93CbHxi20yNqj6h9a9TGmKDG738FeRFkP46uRpPR8Vl/xOTLdlJGkDrsXno5+fDrcTc9IvetkNujWy9KmFJwmfExynseIbWuVLllCqfVwUnzFYpc75+iZB5paqZfw6BechU4W6rUu6XWmQqHQ3O/5Wkg5OLdeVPbOSftn87OzqoOlDfLppIUU4XSlM/L6cenuLGmfKiNnmBXeYYN6PTq0WmxHmkxJOFssOfFXPZMSiwDu+6OILvLJRA20mmrdTC2fr2EvQ07U5nTywWZGqurnJ2O73iSDH8Mzvoti6IhKfzzxrgxqKDc8sFpN7LVaEeUshXWoGjgHzC5UIErHx3u+9P0LhXrrnxo49s3NnthS6+iTl/lUYRKdbgybSC1VRaW2w5BBz0/0OLT+Lr6atAsxa4SBUSs/CBSbgn+XgVeUZbnMk/z5Klky3A6bEt56PZGylqxBb5tQdqcjCSSgxs69nqa6wTL55yB7yuIaQ7RbWYaaSc17botsYujPZHltwlXS4wv9feWoHvZf4ftB6Nuk19mraAsZclN2kZQUl3iUx53sooUH3fxBHgtYLp8dpP+AOTsptdzgb+OdVteP8utovrQunsU2zem3bPZvGRsDV2qO/WgxsnyS7HrCdhBxU/3EC/+Bog6A2JUFgAA"
93
+ },
94
+ {
95
+ "name": "calculator",
96
+ "description": "Perform basic mathematical operations",
97
+ "inputSchema": {
98
+ "type": "object",
99
+ "properties": {
100
+ "a": {
101
+ "type": "number"
102
+ },
103
+ "b": {
104
+ "type": "number"
105
+ }
106
+ },
107
+ "required": [
108
+ "a",
109
+ "b"
110
+ ]
111
+ },
112
+ "outputSchema": {
113
+ "type": "object",
114
+ "properties": {
115
+ "a": {
116
+ "type": "number"
117
+ },
118
+ "b": {
119
+ "type": "number"
120
+ }
121
+ },
122
+ "required": [
123
+ "a",
124
+ "b"
125
+ ]
126
+ },
127
+ "execute": "H4sIAAAAAAAAE0WNYQrDIAyF/3uKRxm0ZbADTLqzzKkwoajTyLZK777QSpcfIXn58p7KX68xOB8LjZhuqEIHnwkVC1ZMSPZVXLJDvwTTj1IIcM2W+JDLTPLY7SeylF3wu7a1/Hakn83/EqJNipgYOQZbaZUtOmVMd20KmjNn718K5zY95MH805i7n2pDxfoDDan6y9EAAAA="
128
+ },
129
+ {
130
+ "name": "advanced_math",
131
+ "description": "Perform advanced mathematical operations",
132
+ "inputSchema": {
133
+ "type": "object",
134
+ "properties": {},
135
+ "required": []
136
+ },
137
+ "outputSchema": {
138
+ "type": "object",
139
+ "properties": {},
140
+ "required": []
141
+ },
142
+ "execute": "H4sIAAAAAAAAE31UyY7bMAy95yvYAMXYyTRbb824l6LTU4ECPQY+yAodC5UljyQnnSX/Xsq7k0wDxLZIinp8pB6zz4pDIFRRuhCir/A64VpZB6/wAmeIwOBTKQwGdy96fxduJ1wya+Enc9lvNEfBkXZMAJazGT1hBt+Y5KVkDsFlCCnjThvBJOgUGKgyT9BUgUt6dt5AhZSGzCBSCBQ8wCqk/UafQOEJvhujTTB97JIJC0o72GMqFO4h1YbiDsyJIzZn2Clh7RNGUQQreHuD+nMdUl2uNArWdVSzUlSAy4RdDJDBJwr3UWf6jyrNkP/x+du6PKzCiBy7AoX95dfX5W06ACmTFi+h9m5nypH3I2zqYm4lqB6ejECiA0Hd+7yl10NU9Wthn4wjKN40r86oMfWpxfupz/0BF8guafmBCo3v/6NItGKcC7A0Q6hoVMoCnCaWHZrc9mPQBhK4XTxmaghnF1/y1Pdxt7pybgbOe1jHA47qEe9gRaOIEYGbikBQ9JrPe8barYuitFnQrnbCD0sMcxhZNnH4Holt3M35Gt2kg0H6JNRc57lWsBdHYXV/lw58H7B7SFqMp0xIhCCBD3VLW+R16Q7zgqpLto01oQWjCegMjAw+aAi8wVzNEktswG5fixFsiazHnJfSiUL290PyfAT66gTKR85lfSm7EutjJ+dGqvKBGEWVYAzkKaDoKrfvqEFLEAaDYE/C8azRv4Uu/OQKrQZ0MYsw7eRg+qWx14NWb2sUZyFRHVxWEb7uM/jff6Ss0VcL+Jds8hm0ajWslbAK7fkf9WWqmqoFAAA="
93
143
  }
94
144
  ]
95
145
  }