lua-cli 2.1.0-alpha.6 → 2.1.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lua-cli",
3
- "version": "2.1.0-alpha.6",
3
+ "version": "2.1.0",
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",
@@ -8,7 +8,8 @@
8
8
  ".": "./dist/index.js",
9
9
  "./types": "./dist/types.js",
10
10
  "./skill": "./dist/skill.js",
11
- "./user-data-api": "./dist/user-data-api.js"
11
+ "./user-data-api": "./dist/user-data-api.js",
12
+ "./product-api": "./dist/product-api.js"
12
13
  },
13
14
  "scripts": {
14
15
  "clean": "rm -rf dist",
@@ -34,7 +35,7 @@
34
35
  "deployment",
35
36
  "skills"
36
37
  ],
37
- "author": "Stefan Kruger <stefan@lua.dev>",
38
+ "author": "Stefan Kruger <stefan@heylua.ai>",
38
39
  "license": "MIT",
39
40
  "type": "module",
40
41
  "repository": {
@@ -2,12 +2,3 @@ agent:
2
2
  agentId: baseAgent_agent_1759165790010_cmu8t35ta
3
3
  orgId: 845c77a8-88b9-4381-ba4a-fd7496ef1f57
4
4
  skills:
5
- - name: general-skill
6
- version: 0.0.2
7
- skillId: 5d990e43-6204-43af-8246-67dedeb80c68
8
- - name: user-data-skill
9
- version: 0.0.1
10
- skillId: 457bb68a-a136-4671-9bb0-9263a262eb41
11
- - name: eccomerce-skill
12
- version: 0.0.1
13
- skillId: e1976320-2bdb-4622-bfde-fe20eabe8360
@@ -19,8 +19,9 @@
19
19
  "axios": "^1.6.0",
20
20
  "inquirer": "^12.9.6",
21
21
  "js-yaml": "^4.1.0",
22
- "lua-cli": "2.1.0-alpha.6",
22
+ "lua-cli": "2.1.0",
23
23
  "openai": "^5.23.0",
24
+ "uuid": "^13.0.0",
24
25
  "zod": "^3.24.1"
25
26
  },
26
27
  "devDependencies": {
@@ -1,6 +1,7 @@
1
1
  import { env, LuaTool } from "lua-cli/skill";
2
2
  import { z } from "zod";
3
- import { product } from 'lua-cli';
3
+ import { product } from 'lua-cli/product-api';
4
+ import { v4 as uuidv4 } from 'uuid';
4
5
  export class SearchProductsTool implements LuaTool {
5
6
  name = "search_products";
6
7
  description = "Search for products";
@@ -11,17 +12,20 @@ export class SearchProductsTool implements LuaTool {
11
12
  constructor() {}
12
13
 
13
14
  async execute(input: z.infer<typeof this.inputSchema>) {
14
- const products = await product.data.search(input.query);
15
+ return await product.data.search(input.query);
15
16
  }
16
17
  }
17
18
 
18
19
  export class GetAllProductsTool implements LuaTool {
19
20
  name = "get_all_products";
20
21
  description = "Get all products";
21
- inputSchema = z.object({ });
22
+ inputSchema = z.object({
23
+ page: z.number().optional(),
24
+ limit: z.number().optional()
25
+ });
22
26
 
23
27
  async execute(input: z.infer<typeof this.inputSchema>) {
24
- return product.data.get();
28
+ return product.data.get(input.page, input.limit);
25
29
  }
26
30
  }
27
31
 
@@ -37,7 +41,7 @@ export class CreateProductTool implements LuaTool {
37
41
  });
38
42
 
39
43
  async execute(input: z.infer<typeof this.inputSchema>) {
40
- return product.data.create(input.product);
44
+ return product.data.create({...input.product, id: uuidv4()});
41
45
  }
42
46
  }
43
47
 
@@ -54,7 +58,7 @@ export class UpdateProductTool implements LuaTool {
54
58
  });
55
59
 
56
60
  async execute(input: z.infer<typeof this.inputSchema>) {
57
- return product.data.update(input.product, input.product.id);
61
+ return product.data.update({...input.product, id: uuidv4()}, input.product.id);
58
62
  }
59
63
  }
60
64