lua-cli 1.3.2-alpha.0 → 1.3.2-alpha.3

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.
@@ -48,7 +48,7 @@
48
48
 
49
49
  .tools-header h3 {
50
50
  margin: 0 0 4px 0;
51
- font-size: 18px;
51
+ font-size: 14px;
52
52
  font-weight: 600;
53
53
  color: #ffffff;
54
54
  font-family: inherit;
@@ -56,7 +56,7 @@
56
56
 
57
57
  .tools-header p {
58
58
  margin: 0;
59
- font-size: 14px;
59
+ font-size: 12px;
60
60
  color: #cccccc;
61
61
  font-family: inherit;
62
62
  }
@@ -75,13 +75,13 @@
75
75
  background: #252526;
76
76
  border: 1px solid #3e3e42;
77
77
  border-radius: 8px;
78
- padding: 12px;
78
+ padding: 8px 12px;
79
79
  cursor: pointer;
80
80
  transition: all 0.2s;
81
81
  display: flex;
82
82
  flex-direction: column;
83
83
  height: fit-content;
84
- min-height: 100px;
84
+ min-height: 50px;
85
85
  }
86
86
 
87
87
  .tool-card:hover {
@@ -92,45 +92,18 @@
92
92
  }
93
93
 
94
94
  .tool-card-header {
95
- margin-bottom: 12px;
95
+ margin-bottom: 0;
96
96
  }
97
97
 
98
98
  .tool-card-header h4 {
99
99
  margin: 0;
100
- font-size: 16px;
100
+ font-size: 13px;
101
101
  font-weight: 600;
102
102
  color: #ffffff;
103
103
  font-family: inherit;
104
104
  }
105
105
 
106
- .tool-card-body {
107
- display: flex;
108
- flex-direction: column;
109
- gap: 8px;
110
- }
111
-
112
- .tool-card-body p {
113
- margin: 0;
114
- font-size: 14px;
115
- color: #cccccc;
116
- line-height: 1.4;
117
- font-family: inherit;
118
- }
119
-
120
- .tool-card-meta {
121
- display: flex;
122
- justify-content: space-between;
123
- align-items: center;
124
- }
125
-
126
- .input-count {
127
- font-size: 12px;
128
- color: #8c8c8c;
129
- background: #1e1e1e;
130
- padding: 4px 8px;
131
- border-radius: 4px;
132
- font-family: inherit;
133
- }
106
+ /* Tool card body styles removed - now empty for compact design */
134
107
 
135
108
  /* Tool Form View */
136
109
  .tool-form {
@@ -152,27 +125,35 @@
152
125
  }
153
126
 
154
127
  .back-button {
155
- background: #3e3e42;
128
+ background: #333333;
156
129
  color: #cccccc;
157
130
  border: none;
158
131
  border-radius: 4px;
159
- padding: 8px 12px;
132
+ padding: 6px;
160
133
  font-size: 14px;
161
134
  font-family: inherit;
162
135
  cursor: pointer;
163
136
  transition: background-color 0.2s;
137
+ width: 28px;
138
+ height: 28px;
164
139
  display: flex;
165
140
  align-items: center;
166
- gap: 4px;
141
+ justify-content: center;
142
+ }
143
+
144
+ .back-button:hover:not(:disabled) {
145
+ background: #000000;
167
146
  }
168
147
 
169
- .back-button:hover {
170
- background: #4e4e52;
148
+ .back-button:disabled {
149
+ background: #2d2d30;
150
+ color: #8c8c8c;
151
+ cursor: not-allowed;
171
152
  }
172
153
 
173
154
  .tool-form-header h3 {
174
155
  margin: 0;
175
- font-size: 18px;
156
+ font-size: 14px;
176
157
  font-weight: 600;
177
158
  color: #ffffff;
178
159
  font-family: inherit;
@@ -190,7 +171,7 @@
190
171
 
191
172
  .tool-info p {
192
173
  margin: 0;
193
- font-size: 14px;
174
+ font-size: 12px;
194
175
  color: #cccccc;
195
176
  line-height: 1.5;
196
177
  font-family: inherit;
@@ -202,7 +183,7 @@
202
183
 
203
184
  .tool-inputs h4 {
204
185
  margin: 0 0 16px 0;
205
- font-size: 16px;
186
+ font-size: 13px;
206
187
  font-weight: 600;
207
188
  color: #ffffff;
208
189
  font-family: inherit;
@@ -221,7 +202,7 @@
221
202
  }
222
203
 
223
204
  .input-field label {
224
- font-size: 14px;
205
+ font-size: 12px;
225
206
  font-weight: 500;
226
207
  color: #cccccc;
227
208
  font-family: inherit;
@@ -237,8 +218,8 @@
237
218
  color: #cccccc;
238
219
  border: 1px solid #3e3e42;
239
220
  border-radius: 4px;
240
- padding: 8px 12px;
241
- font-size: 14px;
221
+ padding: 6px 10px;
222
+ font-size: 12px;
242
223
  font-family: inherit;
243
224
  outline: none;
244
225
  transition: border-color 0.2s;
@@ -255,14 +236,50 @@
255
236
  }
256
237
 
257
238
  .input-description {
258
- font-size: 12px;
239
+ font-size: 10px;
259
240
  color: #8c8c8c;
260
241
  font-style: italic;
261
242
  font-family: inherit;
262
243
  }
263
244
 
245
+ /* Nested Object Styles */
246
+ .nested-object {
247
+ background: #252526;
248
+ border: 1px solid #3e3e42;
249
+ border-radius: 6px;
250
+ padding: 12px;
251
+ margin-top: 8px;
252
+ }
253
+
254
+ .nested-object-label {
255
+ font-size: 12px;
256
+ font-weight: 600;
257
+ color: #ffffff;
258
+ margin-bottom: 12px;
259
+ font-family: inherit;
260
+ }
261
+
262
+ .nested-fields {
263
+ display: flex;
264
+ flex-direction: column;
265
+ gap: 12px;
266
+ }
267
+
268
+ .nested-field {
269
+ display: flex;
270
+ flex-direction: column;
271
+ gap: 6px;
272
+ }
273
+
274
+ .nested-label {
275
+ font-size: 11px;
276
+ font-weight: 500;
277
+ color: #cccccc;
278
+ font-family: inherit;
279
+ }
280
+
264
281
  .no-inputs {
265
- font-size: 14px;
282
+ font-size: 12px;
266
283
  color: #8c8c8c;
267
284
  font-style: italic;
268
285
  font-family: inherit;
@@ -277,8 +294,8 @@
277
294
  color: white;
278
295
  border: none;
279
296
  border-radius: 6px;
280
- padding: 12px 24px;
281
- font-size: 14px;
297
+ padding: 8px 16px;
298
+ font-size: 12px;
282
299
  font-weight: 500;
283
300
  font-family: inherit;
284
301
  cursor: pointer;
@@ -304,7 +321,7 @@
304
321
 
305
322
  .test-result h4 {
306
323
  margin: 0 0 12px 0;
307
- font-size: 16px;
324
+ font-size: 13px;
308
325
  font-weight: 600;
309
326
  color: #ffffff;
310
327
  font-family: inherit;
@@ -327,7 +344,7 @@
327
344
  }
328
345
 
329
346
  .result-label {
330
- font-size: 14px;
347
+ font-size: 12px;
331
348
  font-weight: 600;
332
349
  margin-bottom: 8px;
333
350
  font-family: inherit;
@@ -346,7 +363,7 @@
346
363
  color: #cccccc;
347
364
  padding: 12px;
348
365
  border-radius: 4px;
349
- font-size: 12px;
366
+ font-size: 10px;
350
367
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
351
368
  overflow-x: auto;
352
369
  margin: 0;
@@ -356,7 +373,7 @@
356
373
 
357
374
  .result-error {
358
375
  color: #f85149;
359
- font-size: 14px;
376
+ font-size: 12px;
360
377
  font-family: inherit;
361
378
  }
362
379
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lua-cli",
3
- "version": "1.3.2-alpha.0",
3
+ "version": "1.3.2-alpha.3",
4
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",
@@ -66,6 +66,7 @@
66
66
  "react": "^18.2.0",
67
67
  "react-dom": "^18.2.0",
68
68
  "socket.io-client": "^4.7.2",
69
+ "ts-morph": "^27.0.0",
69
70
  "ws": "^8.18.3",
70
71
  "zod": "^4.1.9"
71
72
  },
@@ -0,0 +1,39 @@
1
+ const fs = require('fs');
2
+
3
+ // Read the compiled search_movies.js file
4
+ const searchMoviesCode = fs.readFileSync('.lua/search_movies.js', 'utf8');
5
+
6
+ // Create a test function with env function
7
+ const testFunction = `
8
+ // Mock env function
9
+ const env = (key) => {
10
+ const envVars = {
11
+ 'PINECONE_API_KEY': 'test-pinecone-key',
12
+ 'OPENAI_API_KEY': 'test-openai-key'
13
+ };
14
+ return envVars[key];
15
+ };
16
+
17
+ ${searchMoviesCode}
18
+
19
+ // Test the function
20
+ (async () => {
21
+ try {
22
+ console.log('Testing SearchMovies tool...');
23
+ const result = await module.exports({ query: 'avatar' });
24
+ console.log('✅ Success:', result);
25
+ } catch (error) {
26
+ console.log('❌ Error:', error.message);
27
+ if (error.message.includes('FormData is not defined')) {
28
+ console.log('❌ FormData error still exists - recursive bundling not working');
29
+ } else {
30
+ console.log('✅ FormData error resolved - recursive bundling working');
31
+ }
32
+ }
33
+ })();
34
+ `;
35
+
36
+ // Write test file
37
+ fs.writeFileSync('test-searchmovies.cjs', testFunction);
38
+
39
+ console.log('Test file created. Run: node test-searchmovies.cjs');
@@ -0,0 +1,17 @@
1
+ agent:
2
+ agentId: "baseAgent_agent_1758705162448_cyu7ybbhx"
3
+ orgId: "ae25d3f8-5446-4135-806f-daf4ec55d010"
4
+ persona: |
5
+ Your name is Richard always remember that
6
+ welcomeMessage: "Hi, I am your AI assistant. How can I help you today?"
7
+
8
+ skill:
9
+ name: "test-3"
10
+ version: "0.0.1"
11
+ skillId: "0aa3b6fe-45b2-40a9-a19c-b7bf85cbc798"
12
+ env:
13
+ PINECONE_API_KEY: "your-pinecone-api-key-here"
14
+ OPENAI_API_KEY: "your-openai-api-key-here"
15
+ STRIPE_SECRET_KEY: "your-stripe-secret-key-here"
16
+ BASE_URL: "http://localhost:3000"
17
+ API_KEY: "1234567890"
@@ -9,12 +9,14 @@
9
9
  "version": "1.0.1-beta.0",
10
10
  "license": "ISC",
11
11
  "dependencies": {
12
+ "@pinecone-database/pinecone": "^6.1.2",
12
13
  "@types/inquirer": "^9.0.9",
13
14
  "@types/js-yaml": "^4.0.9",
14
15
  "axios": "^1.6.0",
15
16
  "inquirer": "^12.9.6",
16
17
  "js-yaml": "^4.1.0",
17
- "lua-cli": "file:..",
18
+ "lua-cli": "1.3.2-alpha.2",
19
+ "openai": "^5.23.0",
18
20
  "zod": "^4.1.9"
19
21
  },
20
22
  "devDependencies": {
@@ -24,7 +26,7 @@
24
26
  }
25
27
  },
26
28
  "..": {
27
- "version": "1.3.0-alpha.1",
29
+ "version": "1.3.2-alpha.2",
28
30
  "license": "MIT",
29
31
  "dependencies": {
30
32
  "commander": "^14.0.1",
@@ -33,6 +35,10 @@
33
35
  "keytar": "^7.9.0",
34
36
  "node-fetch": "^3.3.2",
35
37
  "open": "^10.1.0",
38
+ "react": "^18.2.0",
39
+ "react-dom": "^18.2.0",
40
+ "socket.io-client": "^4.7.2",
41
+ "ws": "^8.18.3",
36
42
  "zod": "^4.1.9"
37
43
  },
38
44
  "bin": {
@@ -41,8 +47,12 @@
41
47
  "devDependencies": {
42
48
  "@types/inquirer": "^9.0.9",
43
49
  "@types/jest": "^29.5.8",
50
+ "@types/js-yaml": "^4.0.9",
44
51
  "@types/node": "^24.5.1",
45
52
  "@types/node-fetch": "^2.6.13",
53
+ "@types/react": "^18.2.0",
54
+ "@types/react-dom": "^18.2.0",
55
+ "@types/ws": "^8.18.1",
46
56
  "@typescript-eslint/parser": "^8.44.1",
47
57
  "@typescript-eslint/typescript-estree": "^8.44.1",
48
58
  "jest": "^29.7.0",
@@ -830,6 +840,15 @@
830
840
  }
831
841
  }
832
842
  },
843
+ "node_modules/@pinecone-database/pinecone": {
844
+ "version": "6.1.2",
845
+ "resolved": "https://registry.npmjs.org/@pinecone-database/pinecone/-/pinecone-6.1.2.tgz",
846
+ "integrity": "sha512-ydIlbtgIIHFgBL08sPzua5ckmOgtjgDz8xg21CnP1fqnnEgDmOlnfd10MRKU+fvFRhDlh4Md37SwZDr0d4cBqg==",
847
+ "license": "Apache-2.0",
848
+ "engines": {
849
+ "node": ">=18.0.0"
850
+ }
851
+ },
833
852
  "node_modules/@types/inquirer": {
834
853
  "version": "9.0.9",
835
854
  "resolved": "https://registry.npmjs.org/@types/inquirer/-/inquirer-9.0.9.tgz",
@@ -1352,6 +1371,27 @@
1352
1371
  "node": "^18.17.0 || >=20.5.0"
1353
1372
  }
1354
1373
  },
1374
+ "node_modules/openai": {
1375
+ "version": "5.23.0",
1376
+ "resolved": "https://registry.npmjs.org/openai/-/openai-5.23.0.tgz",
1377
+ "integrity": "sha512-Cfq155NHzI7VWR67LUNJMIgPZy2oSh7Fld/OKhxq648BiUjELAvcge7g30xJ6vAfwwXf6TVK0KKuN+3nmIJG/A==",
1378
+ "license": "Apache-2.0",
1379
+ "bin": {
1380
+ "openai": "bin/cli"
1381
+ },
1382
+ "peerDependencies": {
1383
+ "ws": "^8.18.0",
1384
+ "zod": "^3.23.8"
1385
+ },
1386
+ "peerDependenciesMeta": {
1387
+ "ws": {
1388
+ "optional": true
1389
+ },
1390
+ "zod": {
1391
+ "optional": true
1392
+ }
1393
+ }
1394
+ },
1355
1395
  "node_modules/proxy-from-env": {
1356
1396
  "version": "1.1.0",
1357
1397
  "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
@@ -5,20 +5,22 @@
5
5
  "license": "ISC",
6
6
  "author": "",
7
7
  "type": "module",
8
- "main": "index.ts",
8
+ "main": "src/index.ts",
9
9
  "scripts": {
10
- "start": "tsx index.ts",
11
- "dev": "tsx watch index.ts",
10
+ "start": "tsx src/index.ts",
11
+ "dev": "tsx watch src/index.ts",
12
12
  "build": "tsc",
13
13
  "test": "echo \"Error: no test specified\" && exit 1"
14
14
  },
15
15
  "dependencies": {
16
+ "@pinecone-database/pinecone": "^6.1.2",
16
17
  "@types/inquirer": "^9.0.9",
17
18
  "@types/js-yaml": "^4.0.9",
18
19
  "axios": "^1.6.0",
19
20
  "inquirer": "^12.9.6",
20
21
  "js-yaml": "^4.1.0",
21
- "lua-cli": "file:..",
22
+ "lua-cli": "1.3.2-alpha.2",
23
+ "openai": "^5.23.0",
22
24
  "zod": "^4.1.9"
23
25
  },
24
26
  "devDependencies": {
@@ -1,30 +1,30 @@
1
1
  import { LuaSkill } from "lua-cli/skill";
2
+
2
3
  import GetWeatherTool from "./tools/GetWeatherTool";
3
- import GetUserDataTool from "./tools/GetUserDataTool";
4
+ import { GetUserDataTool, CreateUserDataTool, UpdateUserDataTool } from "./tools/UserDataTool";
4
5
  import CreatePostTool from "./tools/CreatePostTool";
5
- import CalculatorTool from "./tools/CalculatorTool";
6
- import AdvancedMathTool from "./tools/AdvancedMathTool";
7
-
6
+ import { SearchProductsTool } from "./tools/SearchProducts";
7
+ import CreatePaymentLinkTool from "./tools/PaymentTool";
8
8
 
9
9
  // Initialize skill with tools
10
10
  const skill = new LuaSkill({
11
11
  description: "A comprehensive Lua skill with weather, user data, post creation, and mathematical tools",
12
12
  context: "This skill provides various utilities including weather information, user data retrieval, post creation, basic calculator operations, and advanced mathematical functions. Use get_weather to fetch current weather conditions for any city, get_user_data to retrieve user information, create_post to publish new posts, calculator for basic arithmetic operations, and advanced_math for complex mathematical computations like factorials, prime checking, fibonacci sequences, and greatest common divisor calculations."
13
13
  });
14
- skill.addTool(new GetWeatherTool());
15
- skill.addTool(new GetUserDataTool());
16
- skill.addTool(new CreatePostTool());
17
- skill.addTool(new CalculatorTool());
18
- skill.addTool(new AdvancedMathTool());
14
+ skill.addTools([
15
+ new GetWeatherTool(),
16
+ new GetUserDataTool(),
17
+ new CreateUserDataTool(),
18
+ new UpdateUserDataTool(),
19
+ new CreatePostTool(),
20
+ new SearchProductsTool(),
21
+ new CreatePaymentLinkTool()]
22
+ );
19
23
 
20
24
  // Test cases
21
25
  const testCases = [
22
26
  { tool: "get_weather", city: "London" },
23
27
  { tool: "get_user_data", userId: "user123" },
24
- { tool: "user_preferences", action: "get" },
25
- { tool: "user_preferences", action: "set", key: "theme", value: "dark" },
26
- { tool: "user_preferences", action: "set", key: "language", value: "en" },
27
- { tool: "user_preferences", action: "get" },
28
28
  { tool: "create_post", title: "Test Post", content: "This is a test post content" },
29
29
  { tool: "calculator", operation: "add", a: 5, b: 3 },
30
30
  { tool: "advanced_math", operation: "factorial", numbers: [5] },
@@ -36,8 +36,9 @@ const testCases = [
36
36
  ];
37
37
 
38
38
  async function runTests() {
39
+ // await seedProducts();
39
40
  console.log("🧪 Running tool tests...\n");
40
-
41
+
41
42
  for (const [index, testCase] of testCases.entries()) {
42
43
  try {
43
44
  console.log(`Test ${index + 1}: ${testCase.tool}`);
@@ -0,0 +1,46 @@
1
+ import fetch from "node-fetch";
2
+ import OpenAI from "openai";
3
+ import { Pinecone } from "@pinecone-database/pinecone";
4
+ import { env } from "lua-cli/skill";
5
+
6
+ const openai = new OpenAI({ apiKey: env("OPENAI_API_KEY") || "" });
7
+ const pinecone = new Pinecone({ apiKey: env("PINECONE_API_KEY") || "" });
8
+ const indexName = "products-demo";
9
+
10
+ async function embed(text: string) {
11
+ const res = await openai.embeddings.create({
12
+ model: "text-embedding-3-small",
13
+ input: text,
14
+ });
15
+ return res.data[0].embedding;
16
+ }
17
+
18
+ export default async function seedProducts() {
19
+ const index = pinecone.Index(indexName);
20
+
21
+ // Example: Fake Store API
22
+ const response = await fetch("https://fakestoreapi.com/products");
23
+ const products = await response.json() as any[];
24
+
25
+ const vectors = await Promise.all(
26
+ products.map(async (product) => {
27
+ const embedding = await embed(`${product.title}. ${product.description}`);
28
+ return {
29
+ id: product.id.toString(),
30
+ values: embedding,
31
+ metadata: {
32
+ title: product.title,
33
+ description: product.description,
34
+ category: product.category,
35
+ price: product.price,
36
+ image: product.image,
37
+ },
38
+ };
39
+ })
40
+ );
41
+
42
+ await index.upsert(vectors);
43
+ console.log("Dummy products inserted!");
44
+ }
45
+
46
+ seedProducts().catch(console.error);
@@ -2,37 +2,29 @@ import { LuaTool } from "lua-cli/skill";
2
2
  import { z } from "zod";
3
3
  import ApiService from "../services/ApiService";
4
4
 
5
- // Define schemas as static properties for Lua CLI detection
6
- const inputSchema = z.object({
7
- title: z.string(),
8
- content: z.string()
9
- });
10
5
 
11
- const outputSchema = z.object({
12
- id: z.string().nullable(),
13
- title: z.string(),
14
- status: z.string(),
15
- error: z.string().optional(),
16
- url: z.string().nullable()
17
- });
18
-
19
- export default class CreatePostTool implements LuaTool<typeof inputSchema, typeof outputSchema> {
20
- name: string;
21
- description: string;
22
- inputSchema: typeof inputSchema;
23
- outputSchema: typeof outputSchema;
6
+ export default class CreatePostTool implements LuaTool {
7
+ name = "create_post";
8
+ description = "Create a new post";
9
+ inputSchema = z.object({
10
+ title: z.string(),
11
+ content: z.string()
12
+ });
13
+ outputSchema = z.object({
14
+ id: z.string().nullable(),
15
+ title: z.string(),
16
+ status: z.string(),
17
+ error: z.string().optional(),
18
+ url: z.string().nullable()
19
+ });
24
20
 
25
21
  apiService: ApiService;
26
22
 
27
23
  constructor() {
28
- this.name = "create_post";
29
- this.description = "Create a new post";
30
- this.inputSchema = inputSchema;
31
- this.outputSchema = outputSchema;
32
24
  this.apiService = new ApiService();
33
25
  }
34
26
 
35
- async execute(input: z.infer<typeof inputSchema>) {
27
+ async execute(input: z.infer<typeof this.inputSchema>) {
36
28
  return this.apiService.createPost(input.title, input.content);
37
29
  }
38
30
  }