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/README.md +2 -2
- package/dist/commands/compile.js +18 -2
- package/dist/product-api.d.ts +1 -1
- package/dist/product-api.js +43 -9
- package/dist/services/api.d.ts +20 -5
- package/dist/services/api.js +54 -9
- package/dist/utils/files.js +2 -2
- package/dist/utils/sandbox.js +8 -5
- package/dist/web/app.css +447 -0
- package/dist/web/app.js +20 -20
- package/package.json +4 -3
- package/template/lua.skill.yaml +0 -9
- package/template/package.json +2 -1
- package/template/src/tools/ProductsTool.ts +10 -6
- package/template/package-lock.json +0 -1511
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lua-cli",
|
|
3
|
-
"version": "2.1.0
|
|
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@
|
|
38
|
+
"author": "Stefan Kruger <stefan@heylua.ai>",
|
|
38
39
|
"license": "MIT",
|
|
39
40
|
"type": "module",
|
|
40
41
|
"repository": {
|
package/template/lua.skill.yaml
CHANGED
|
@@ -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
|
package/template/package.json
CHANGED
|
@@ -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
|
-
|
|
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
|
|