lua-cli 2.1.0-alpha.3 → 2.1.0-alpha.6
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/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/product-api.d.ts +48 -0
- package/dist/product-api.js +27 -0
- package/package.json +1 -1
- package/template/lua.skill.yaml +5 -7
- package/template/package-lock.json +88 -2279
- package/template/package.json +1 -1
- package/template/src/index.ts +6 -1
- package/template/src/tools/ProductsTool.ts +56 -28
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export interface Product {
|
|
2
|
+
id: string;
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
export interface ProductsResponse {
|
|
6
|
+
success: boolean;
|
|
7
|
+
data: Product[];
|
|
8
|
+
pagination: {
|
|
9
|
+
currentPage: number;
|
|
10
|
+
totalPages: number;
|
|
11
|
+
totalCount: number;
|
|
12
|
+
limit: number;
|
|
13
|
+
hasNextPage: boolean;
|
|
14
|
+
hasPrevPage: boolean;
|
|
15
|
+
nextPage: number | null;
|
|
16
|
+
prevPage: number | null;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export interface CreateProductResponse {
|
|
20
|
+
updated: boolean;
|
|
21
|
+
isNew: boolean;
|
|
22
|
+
product: Product;
|
|
23
|
+
}
|
|
24
|
+
export interface UpdateProductResponse {
|
|
25
|
+
updated: boolean;
|
|
26
|
+
isNew: boolean;
|
|
27
|
+
product: Product;
|
|
28
|
+
}
|
|
29
|
+
export interface DeleteProductResponse {
|
|
30
|
+
deleted: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface SearchProductsResponse {
|
|
33
|
+
success: boolean;
|
|
34
|
+
message: string;
|
|
35
|
+
data: Product[];
|
|
36
|
+
}
|
|
37
|
+
export declare class ProductAPI {
|
|
38
|
+
products: any;
|
|
39
|
+
constructor();
|
|
40
|
+
get(page?: number, limit?: number): Promise<ProductsResponse>;
|
|
41
|
+
create(data: Record<string, any>): Promise<CreateProductResponse>;
|
|
42
|
+
update(data: Record<string, any>, productId: string): Promise<UpdateProductResponse>;
|
|
43
|
+
delete(productId: string): Promise<DeleteProductResponse>;
|
|
44
|
+
search(searchQuery: string): Promise<SearchProductsResponse>;
|
|
45
|
+
}
|
|
46
|
+
export declare const product: {
|
|
47
|
+
data: ProductAPI;
|
|
48
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export class ProductAPI {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.products = {};
|
|
4
|
+
}
|
|
5
|
+
async get(page = 1, limit = 10) {
|
|
6
|
+
return { success: true, data: this.products, pagination: { currentPage: page, totalPages: 1, totalCount: this.products.length, limit: limit, hasNextPage: false, hasPrevPage: false, nextPage: null, prevPage: null } };
|
|
7
|
+
}
|
|
8
|
+
async create(data) {
|
|
9
|
+
this.products = data;
|
|
10
|
+
return { updated: true, isNew: true, product: this.products };
|
|
11
|
+
}
|
|
12
|
+
async update(data, productId) {
|
|
13
|
+
// Update is the same as create for this API
|
|
14
|
+
this.products = { ...this.products, ...data };
|
|
15
|
+
return { updated: true, isNew: false, product: this.products };
|
|
16
|
+
}
|
|
17
|
+
async delete(productId) {
|
|
18
|
+
this.products = this.products.filter((product) => product.id !== productId);
|
|
19
|
+
return { deleted: true };
|
|
20
|
+
}
|
|
21
|
+
async search(searchQuery) {
|
|
22
|
+
return { success: true, message: 'Products searched successfully', data: this.products };
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export const product = {
|
|
26
|
+
data: new ProductAPI()
|
|
27
|
+
};
|
package/package.json
CHANGED
package/template/lua.skill.yaml
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
agent:
|
|
2
|
-
agentId:
|
|
3
|
-
orgId:
|
|
4
|
-
persona: Your name is Stefan always remember that
|
|
5
|
-
welcomeMessage: 'Hi, I am your AI assistant. How can I help you today?'
|
|
2
|
+
agentId: baseAgent_agent_1759165790010_cmu8t35ta
|
|
3
|
+
orgId: 845c77a8-88b9-4381-ba4a-fd7496ef1f57
|
|
6
4
|
skills:
|
|
7
5
|
- name: general-skill
|
|
8
6
|
version: 0.0.2
|
|
9
|
-
skillId:
|
|
7
|
+
skillId: 5d990e43-6204-43af-8246-67dedeb80c68
|
|
10
8
|
- name: user-data-skill
|
|
11
9
|
version: 0.0.1
|
|
12
|
-
skillId:
|
|
10
|
+
skillId: 457bb68a-a136-4671-9bb0-9263a262eb41
|
|
13
11
|
- name: eccomerce-skill
|
|
14
12
|
version: 0.0.1
|
|
15
|
-
skillId:
|
|
13
|
+
skillId: e1976320-2bdb-4622-bfde-fe20eabe8360
|