lua-cli 2.0.5 → 2.0.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/README.md +2 -2
- package/dist/services/api.d.ts +62 -0
- package/dist/services/api.js +50 -4
- package/dist/web/app.js +2 -2
- package/package.json +2 -2
- package/template/package.json +1 -1
package/README.md
CHANGED
|
@@ -195,7 +195,7 @@ This command will:
|
|
|
195
195
|
- Available at `http://localhost:3000` (opens automatically)
|
|
196
196
|
- **Live Log Panel**:
|
|
197
197
|
- Real-time log feed showing execution details
|
|
198
|
-
- WebSocket connection to `wss://api.
|
|
198
|
+
- WebSocket connection to `wss://api.lua.dev/feed`
|
|
199
199
|
- Console-style interface with color-coded log levels
|
|
200
200
|
- Shows tool calls, errors, metrics, and execution metadata
|
|
201
201
|
- Displays detailed information in expandable sections
|
|
@@ -498,7 +498,7 @@ For more details, see [USER_DATA_API.md](./USER_DATA_API.md).
|
|
|
498
498
|
|
|
499
499
|
For support and questions:
|
|
500
500
|
- Create an issue on [GitHub](https://github.com/lua-ai-global/lua-cli/issues)
|
|
501
|
-
- Contact: stefan@
|
|
501
|
+
- Contact: stefan@lua.dev
|
|
502
502
|
|
|
503
503
|
## Changelog
|
|
504
504
|
|
package/dist/services/api.d.ts
CHANGED
|
@@ -122,6 +122,42 @@ export interface ChatResponse {
|
|
|
122
122
|
text?: string;
|
|
123
123
|
error?: string;
|
|
124
124
|
}
|
|
125
|
+
export interface Product {
|
|
126
|
+
id: string;
|
|
127
|
+
[key: string]: any;
|
|
128
|
+
}
|
|
129
|
+
export interface ProductsResponse {
|
|
130
|
+
success: boolean;
|
|
131
|
+
data: Product[];
|
|
132
|
+
pagination: {
|
|
133
|
+
currentPage: number;
|
|
134
|
+
totalPages: number;
|
|
135
|
+
totalCount: number;
|
|
136
|
+
limit: number;
|
|
137
|
+
hasNextPage: boolean;
|
|
138
|
+
hasPrevPage: boolean;
|
|
139
|
+
nextPage: number | null;
|
|
140
|
+
prevPage: number | null;
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
export interface CreateProductResponse {
|
|
144
|
+
updated: boolean;
|
|
145
|
+
isNew: boolean;
|
|
146
|
+
product: Product;
|
|
147
|
+
}
|
|
148
|
+
export interface UpdateProductResponse {
|
|
149
|
+
updated: boolean;
|
|
150
|
+
isNew: boolean;
|
|
151
|
+
product: Product;
|
|
152
|
+
}
|
|
153
|
+
export interface DeleteProductResponse {
|
|
154
|
+
deleted: boolean;
|
|
155
|
+
}
|
|
156
|
+
export interface SearchProductsResponse {
|
|
157
|
+
success: boolean;
|
|
158
|
+
message: string;
|
|
159
|
+
data: Product[];
|
|
160
|
+
}
|
|
125
161
|
/**
|
|
126
162
|
* Authentication API calls
|
|
127
163
|
*/
|
|
@@ -176,6 +212,31 @@ export declare class SkillApi {
|
|
|
176
212
|
export declare class ChatApi {
|
|
177
213
|
static sendMessage(agentId: string, chatData: ChatRequest, apiKey: string): Promise<ApiResponse<ChatResponse>>;
|
|
178
214
|
}
|
|
215
|
+
/**
|
|
216
|
+
* Product API calls
|
|
217
|
+
*/
|
|
218
|
+
export declare class ProductApi {
|
|
219
|
+
/**
|
|
220
|
+
* Get all products for an agent with pagination
|
|
221
|
+
*/
|
|
222
|
+
static getProducts(apiKey: string, agentId: string, page?: number, limit?: number): Promise<ApiResponse<ProductsResponse>>;
|
|
223
|
+
/**
|
|
224
|
+
* Create a new product
|
|
225
|
+
*/
|
|
226
|
+
static createProduct(apiKey: string, agentId: string, productData: Product): Promise<ApiResponse<CreateProductResponse>>;
|
|
227
|
+
/**
|
|
228
|
+
* Update an existing product
|
|
229
|
+
*/
|
|
230
|
+
static updateProduct(apiKey: string, agentId: string, productData: Product): Promise<ApiResponse<UpdateProductResponse>>;
|
|
231
|
+
/**
|
|
232
|
+
* Delete a product
|
|
233
|
+
*/
|
|
234
|
+
static deleteProduct(apiKey: string, agentId: string, productId: string): Promise<ApiResponse<DeleteProductResponse>>;
|
|
235
|
+
/**
|
|
236
|
+
* Search products by text query
|
|
237
|
+
*/
|
|
238
|
+
static searchProducts(apiKey: string, agentId: string, searchQuery: string): Promise<ApiResponse<SearchProductsResponse>>;
|
|
239
|
+
}
|
|
179
240
|
/**
|
|
180
241
|
* Tool API calls (for compile command)
|
|
181
242
|
*/
|
|
@@ -200,5 +261,6 @@ export declare const ApiService: {
|
|
|
200
261
|
Agent: typeof AgentApi;
|
|
201
262
|
Skill: typeof SkillApi;
|
|
202
263
|
Chat: typeof ChatApi;
|
|
264
|
+
Product: typeof ProductApi;
|
|
203
265
|
Tool: typeof ToolApi;
|
|
204
266
|
};
|
package/dist/services/api.js
CHANGED
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
// Base URLs for different environments
|
|
6
6
|
const BASE_URLS = {
|
|
7
|
-
LOCAL: 'https://api.
|
|
8
|
-
API: 'https://api.
|
|
9
|
-
AUTH: 'https://auth.
|
|
10
|
-
CHAT: 'https://api.
|
|
7
|
+
LOCAL: 'https://api.lua.dev',
|
|
8
|
+
API: 'https://api.lua.dev',
|
|
9
|
+
AUTH: 'https://auth.lua.dev',
|
|
10
|
+
CHAT: 'https://api.lua.dev'
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
13
|
* Generic HTTP client with common error handling
|
|
@@ -168,6 +168,51 @@ export class ChatApi {
|
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
|
+
/**
|
|
172
|
+
* Product API calls
|
|
173
|
+
*/
|
|
174
|
+
export class ProductApi {
|
|
175
|
+
/**
|
|
176
|
+
* Get all products for an agent with pagination
|
|
177
|
+
*/
|
|
178
|
+
static async getProducts(apiKey, agentId, page = 1, limit = 10) {
|
|
179
|
+
return httpClient.get(`${BASE_URLS.API}/developer/agents/${agentId}/products?page=${page}&limit=${limit}`, {
|
|
180
|
+
Authorization: `Bearer ${apiKey}`,
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Create a new product
|
|
185
|
+
*/
|
|
186
|
+
static async createProduct(apiKey, agentId, productData) {
|
|
187
|
+
return httpClient.post(`${BASE_URLS.API}/developer/agents/${agentId}/products`, productData, {
|
|
188
|
+
Authorization: `Bearer ${apiKey}`,
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Update an existing product
|
|
193
|
+
*/
|
|
194
|
+
static async updateProduct(apiKey, agentId, productData) {
|
|
195
|
+
return httpClient.put(`${BASE_URLS.API}/developer/agents/${agentId}/products`, productData, {
|
|
196
|
+
Authorization: `Bearer ${apiKey}`,
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Delete a product
|
|
201
|
+
*/
|
|
202
|
+
static async deleteProduct(apiKey, agentId, productId) {
|
|
203
|
+
return httpClient.delete(`${BASE_URLS.API}/developer/agents/${agentId}/products/${productId}`, {
|
|
204
|
+
Authorization: `Bearer ${apiKey}`,
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Search products by text query
|
|
209
|
+
*/
|
|
210
|
+
static async searchProducts(apiKey, agentId, searchQuery) {
|
|
211
|
+
return httpClient.get(`${BASE_URLS.API}/developer/agents/${agentId}/products/search?searchQuery=${encodeURIComponent(searchQuery)}`, {
|
|
212
|
+
Authorization: `Bearer ${apiKey}`,
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
}
|
|
171
216
|
/**
|
|
172
217
|
* Tool API calls (for compile command)
|
|
173
218
|
*/
|
|
@@ -233,5 +278,6 @@ export const ApiService = {
|
|
|
233
278
|
Agent: AgentApi,
|
|
234
279
|
Skill: SkillApi,
|
|
235
280
|
Chat: ChatApi,
|
|
281
|
+
Product: ProductApi,
|
|
236
282
|
Tool: ToolApi,
|
|
237
283
|
};
|