lua-cli 2.5.7 → 3.0.0-alpha.1

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.
Files changed (124) hide show
  1. package/dist/api/agent.api.service.d.ts +45 -0
  2. package/dist/api/agent.api.service.js +54 -0
  3. package/dist/api/job.api.service.d.ts +210 -0
  4. package/dist/api/job.api.service.js +200 -0
  5. package/dist/api/lazy-instances.d.ts +24 -0
  6. package/dist/api/lazy-instances.js +48 -0
  7. package/dist/api/postprocessor.api.service.d.ts +98 -0
  8. package/dist/api/postprocessor.api.service.js +76 -0
  9. package/dist/api/preprocessor.api.service.d.ts +98 -0
  10. package/dist/api/preprocessor.api.service.js +76 -0
  11. package/dist/api/user.data.api.service.d.ts +28 -0
  12. package/dist/api/user.data.api.service.js +51 -0
  13. package/dist/api/webhook.api.service.d.ts +151 -0
  14. package/dist/api/webhook.api.service.js +134 -0
  15. package/dist/api-exports.d.ts +156 -41
  16. package/dist/api-exports.js +182 -21
  17. package/dist/cli/command-definitions.js +149 -7
  18. package/dist/commands/compile.js +124 -5
  19. package/dist/commands/completion.d.ts +11 -0
  20. package/dist/commands/completion.js +209 -0
  21. package/dist/commands/env.d.ts +3 -2
  22. package/dist/commands/env.js +42 -17
  23. package/dist/commands/features.d.ts +16 -0
  24. package/dist/commands/features.js +352 -0
  25. package/dist/commands/index.d.ts +7 -0
  26. package/dist/commands/index.js +7 -0
  27. package/dist/commands/init.js +53 -7
  28. package/dist/commands/jobs.d.ts +20 -0
  29. package/dist/commands/jobs.js +533 -0
  30. package/dist/commands/logs.js +2 -5
  31. package/dist/commands/persona.d.ts +3 -2
  32. package/dist/commands/persona.js +43 -18
  33. package/dist/commands/postprocessors.d.ts +8 -0
  34. package/dist/commands/postprocessors.js +431 -0
  35. package/dist/commands/preprocessors.d.ts +8 -0
  36. package/dist/commands/preprocessors.js +431 -0
  37. package/dist/commands/push.d.ts +9 -13
  38. package/dist/commands/push.js +937 -69
  39. package/dist/commands/skills.d.ts +16 -0
  40. package/dist/commands/skills.js +438 -0
  41. package/dist/commands/test.d.ts +9 -18
  42. package/dist/commands/test.js +558 -82
  43. package/dist/commands/webhooks.d.ts +18 -0
  44. package/dist/commands/webhooks.js +424 -0
  45. package/dist/common/data.entry.instance.d.ts +7 -0
  46. package/dist/common/data.entry.instance.js +15 -0
  47. package/dist/common/job.instance.d.ts +77 -0
  48. package/dist/common/job.instance.js +108 -0
  49. package/dist/common/order.instance.d.ts +6 -0
  50. package/dist/common/order.instance.js +14 -0
  51. package/dist/common/product.instance.d.ts +6 -0
  52. package/dist/common/product.instance.js +14 -0
  53. package/dist/common/user.instance.d.ts +15 -0
  54. package/dist/common/user.instance.js +38 -0
  55. package/dist/config/constants.d.ts +2 -2
  56. package/dist/config/constants.js +4 -4
  57. package/dist/index.js +14 -3
  58. package/dist/interfaces/agent.d.ts +33 -1
  59. package/dist/interfaces/chat.d.ts +22 -0
  60. package/dist/interfaces/index.d.ts +10 -0
  61. package/dist/interfaces/index.js +7 -0
  62. package/dist/interfaces/jobs.d.ts +172 -0
  63. package/dist/interfaces/jobs.js +5 -0
  64. package/dist/interfaces/message.d.ts +18 -0
  65. package/dist/interfaces/message.js +1 -0
  66. package/dist/interfaces/postprocessors.d.ts +35 -0
  67. package/dist/interfaces/postprocessors.js +4 -0
  68. package/dist/interfaces/preprocessors.d.ts +35 -0
  69. package/dist/interfaces/preprocessors.js +4 -0
  70. package/dist/interfaces/webhooks.d.ts +104 -0
  71. package/dist/interfaces/webhooks.js +5 -0
  72. package/dist/types/api-contracts.d.ts +14 -0
  73. package/dist/types/api-contracts.js +0 -7
  74. package/dist/types/compile.types.d.ts +49 -0
  75. package/dist/types/index.d.ts +1 -1
  76. package/dist/types/index.js +1 -1
  77. package/dist/types/skill.d.ts +502 -0
  78. package/dist/types/skill.js +477 -0
  79. package/dist/utils/agent-management.d.ts +25 -0
  80. package/dist/utils/agent-management.js +67 -0
  81. package/dist/utils/bundling.d.ts +31 -1
  82. package/dist/utils/bundling.js +653 -10
  83. package/dist/utils/compile.d.ts +63 -0
  84. package/dist/utils/compile.js +691 -36
  85. package/dist/utils/deployment.d.ts +2 -1
  86. package/dist/utils/deployment.js +16 -2
  87. package/dist/utils/init-agent.d.ts +3 -1
  88. package/dist/utils/init-agent.js +6 -4
  89. package/dist/utils/init-prompts.d.ts +2 -1
  90. package/dist/utils/init-prompts.js +14 -9
  91. package/dist/utils/job-management.d.ts +24 -0
  92. package/dist/utils/job-management.js +264 -0
  93. package/dist/utils/postprocessor-management.d.ts +9 -0
  94. package/dist/utils/postprocessor-management.js +118 -0
  95. package/dist/utils/preprocessor-management.d.ts +9 -0
  96. package/dist/utils/preprocessor-management.js +118 -0
  97. package/dist/utils/sandbox.d.ts +61 -1
  98. package/dist/utils/sandbox.js +283 -72
  99. package/dist/utils/tool-detection.d.ts +3 -2
  100. package/dist/utils/tool-detection.js +18 -4
  101. package/dist/utils/webhook-management.d.ts +24 -0
  102. package/dist/utils/webhook-management.js +256 -0
  103. package/dist/web/app.css +152 -736
  104. package/dist/web/app.js +45 -45
  105. package/package.json +2 -2
  106. package/template/AGENT_CONFIGURATION.md +251 -0
  107. package/template/COMPLEX_JOB_EXAMPLES.md +795 -0
  108. package/template/DYNAMIC_JOB_CREATION.md +371 -0
  109. package/template/README.md +30 -2
  110. package/template/WEBHOOKS_JOBS_QUICKSTART.md +318 -0
  111. package/template/WEBHOOK_JOB_EXAMPLES.md +817 -0
  112. package/template/package.json +1 -1
  113. package/template/src/index-agent-example.ts +201 -0
  114. package/template/src/index.ts +39 -0
  115. package/template/src/jobs/AbandonedBasketProcessorJob.ts +139 -0
  116. package/template/src/jobs/DailyCleanupJob.ts +100 -0
  117. package/template/src/jobs/DataMigrationJob.ts +133 -0
  118. package/template/src/jobs/HealthCheckJob.ts +87 -0
  119. package/template/src/postprocessors/ResponseFormatter.ts +151 -0
  120. package/template/src/preprocessors/MessageFilter.ts +91 -0
  121. package/template/src/tools/GameScoreTrackerTool.ts +356 -0
  122. package/template/src/tools/SmartBasketTool.ts +188 -0
  123. package/template/src/webhooks/PaymentWebhook.ts +113 -0
  124. package/template/src/webhooks/UserEventWebhook.ts +77 -0
@@ -0,0 +1,134 @@
1
+ import { HttpClient } from "../common/http.client.js";
2
+ /**
3
+ * Webhook API Service
4
+ * Handles all webhook-related API calls
5
+ */
6
+ export default class WebhookApi extends HttpClient {
7
+ /**
8
+ * Creates an instance of WebhookApi
9
+ * @param baseUrl - The base URL for the API
10
+ * @param apiKey - The API key for authentication
11
+ * @param agentId - The unique identifier of the agent
12
+ */
13
+ constructor(baseUrl, apiKey, agentId) {
14
+ super(baseUrl);
15
+ this.apiKey = apiKey;
16
+ this.agentId = agentId;
17
+ }
18
+ /**
19
+ * Retrieves all webhooks for the agent
20
+ * @returns Promise resolving to an ApiResponse containing an array of webhooks with their versions
21
+ * @throws Error if the API request fails or the agent is not found
22
+ */
23
+ async getWebhooks() {
24
+ return this.httpGet(`/developer/webhooks/${this.agentId}`, {
25
+ Authorization: `Bearer ${this.apiKey}`,
26
+ });
27
+ }
28
+ /**
29
+ * Creates a new webhook for the agent
30
+ * @param webhookData - The webhook data including name, description, and optional context
31
+ * @returns Promise resolving to an ApiResponse containing the created webhook details
32
+ * @throws Error if the webhook creation fails or validation errors occur
33
+ */
34
+ async createWebhook(webhookData) {
35
+ return this.httpPost(`/developer/webhooks/${this.agentId}`, webhookData, {
36
+ Authorization: `Bearer ${this.apiKey}`,
37
+ });
38
+ }
39
+ /**
40
+ * Pushes a new version of a webhook to production
41
+ * @param webhookId - The unique identifier of the webhook
42
+ * @param versionData - The version data including code, configuration, and metadata
43
+ * @returns Promise resolving to an ApiResponse containing the created version details
44
+ * @throws Error if the webhook is not found or the push operation fails
45
+ */
46
+ async pushWebhook(webhookId, versionData) {
47
+ return this.httpPost(`/developer/webhooks/${this.agentId}/${webhookId}/version`, versionData, {
48
+ Authorization: `Bearer ${this.apiKey}`,
49
+ });
50
+ }
51
+ /**
52
+ * Pushes a new development/sandbox version of a webhook for testing
53
+ * @param webhookId - The unique identifier of the webhook
54
+ * @param versionData - The version data including code, configuration, and metadata
55
+ * @returns Promise resolving to an ApiResponse containing the development version details
56
+ * @throws Error if the webhook is not found or the push operation fails
57
+ */
58
+ async pushDevWebhook(webhookId, versionData) {
59
+ return this.httpPost(`/developer/webhooks/${this.agentId}/${webhookId}/version/sandbox`, versionData, {
60
+ Authorization: `Bearer ${this.apiKey}`,
61
+ });
62
+ }
63
+ /**
64
+ * Updates an existing development/sandbox version of a webhook
65
+ * @param webhookId - The unique identifier of the webhook
66
+ * @param sandboxVersionId - The unique identifier of the sandbox version to update
67
+ * @param versionData - The updated version data including code, configuration, and metadata
68
+ * @returns Promise resolving to an ApiResponse containing the updated version details
69
+ * @throws Error if the webhook or version is not found or the update fails
70
+ */
71
+ async updateDevWebhook(webhookId, sandboxVersionId, versionData) {
72
+ return this.httpPut(`/developer/webhooks/${this.agentId}/${webhookId}/version/sandbox/${sandboxVersionId}`, versionData, {
73
+ Authorization: `Bearer ${this.apiKey}`,
74
+ });
75
+ }
76
+ /**
77
+ * Retrieves all versions of a specific webhook
78
+ * @param webhookId - The unique identifier of the webhook
79
+ * @returns Promise resolving to an ApiResponse containing an array of webhook versions
80
+ * @throws Error if the webhook is not found or the request fails
81
+ */
82
+ async getWebhookVersions(webhookId) {
83
+ return this.httpGet(`/developer/webhooks/${this.agentId}/${webhookId}/versions`, {
84
+ Authorization: `Bearer ${this.apiKey}`,
85
+ });
86
+ }
87
+ /**
88
+ * Publishes a specific version of a webhook to production
89
+ * @param webhookId - The unique identifier of the webhook
90
+ * @param version - The version identifier to publish
91
+ * @returns Promise resolving to an ApiResponse containing publication confirmation details
92
+ * @throws Error if the webhook or version is not found or the publish operation fails
93
+ */
94
+ async publishWebhookVersion(webhookId, version) {
95
+ return this.httpPut(`/developer/webhooks/${this.agentId}/${webhookId}/${version}/publish`, undefined, {
96
+ Authorization: `Bearer ${this.apiKey}`,
97
+ });
98
+ }
99
+ /**
100
+ * Activates a webhook (enables it to receive requests)
101
+ * @param webhookId - The unique identifier of the webhook to activate
102
+ * @returns Promise resolving to an ApiResponse with activation status
103
+ * @throws Error if the webhook is not found or the operation fails
104
+ */
105
+ async activateWebhook(webhookId) {
106
+ return this.httpPost(`/developer/webhooks/${this.agentId}/${webhookId}/activate`, {}, {
107
+ Authorization: `Bearer ${this.apiKey}`,
108
+ });
109
+ }
110
+ /**
111
+ * Deactivates a webhook (stops it from receiving requests)
112
+ * @param webhookId - The unique identifier of the webhook to deactivate
113
+ * @returns Promise resolving to an ApiResponse with deactivation status
114
+ * @throws Error if the webhook is not found or the operation fails
115
+ */
116
+ async deactivateWebhook(webhookId) {
117
+ return this.httpPost(`/developer/webhooks/${this.agentId}/${webhookId}/deactivate`, {}, {
118
+ Authorization: `Bearer ${this.apiKey}`,
119
+ });
120
+ }
121
+ /**
122
+ * Deletes a webhook and all its versions, or deactivates it if it has versions
123
+ * @param webhookId - The unique identifier of the webhook to delete
124
+ * @returns Promise resolving to an ApiResponse with deletion status
125
+ * - If deleted is true: webhook was successfully deleted
126
+ * - If deleted is false and deactivated is true: webhook has versions and was deactivated instead
127
+ * @throws Error if the webhook is not found or the delete operation fails
128
+ */
129
+ async deleteWebhook(webhookId) {
130
+ return this.httpDelete(`/developer/webhooks/${this.agentId}/${webhookId}`, {
131
+ Authorization: `Bearer ${this.apiKey}`,
132
+ });
133
+ }
134
+ }
@@ -26,20 +26,42 @@
26
26
  * const products = await Products.search('laptop');
27
27
  * ```
28
28
  */
29
- import { LuaSkill, LuaTool, env } from "./types/skill.js";
30
- import { BasketStatus } from "./interfaces/baskets.js";
31
- import { OrderStatus } from "./interfaces/orders.js";
32
- /**
33
- * User Data API
34
- * Access user information and preferences
35
- */
29
+ import { LuaSkill, LuaTool, LuaWebhook, LuaWebhookConfig, LuaJob, LuaJobConfig, JobSchedule, PreProcessor, PreProcessorConfig, PostProcessor, PostProcessorConfig, LuaAgent, LuaAgentConfig, env } from "./types/skill.js";
30
+ import { Basket, BasketStatus, UpdateBasketMetadataResponse } from "./interfaces/baskets.js";
31
+ import { OrderResponse, OrderStatus } from "./interfaces/orders.js";
32
+ import { ChatHistoryMessage, ChatHistoryContent } from "./interfaces/chat.js";
33
+ import { JobInstance } from "./common/job.instance.js";
34
+ import { DeleteProductResponse, Product } from "./interfaces/product.js";
35
+ import ProductInstance from "./common/product.instance.js";
36
+ import ProductPaginationInstance from "./common/product.pagination.instance.js";
37
+ import ProductSearchInstance from "./common/product.search.instance.js";
38
+ import DataEntryInstance from "./common/data.entry.instance.js";
39
+ import { DeleteCustomDataResponse, GetCustomDataResponse, UpdateCustomDataResponse } from "./interfaces/custom.data.js";
40
+ import UserDataInstance from "./common/user.instance.js";
41
+ import BasketInstance from "./common/basket.instance.js";
42
+ import OrderInstance from "./common/order.instance.js";
36
43
  export declare const User: {
37
44
  /**
38
45
  * Retrieves current user data.
39
46
  *
40
47
  * @returns Promise resolving to user data
41
48
  */
42
- get(): Promise<import("./common/user.instance.js").default>;
49
+ get(): Promise<UserDataInstance>;
50
+ /**
51
+ * Gets the chat history for the current user.
52
+ *
53
+ * @returns Promise resolving to array of chat messages
54
+ *
55
+ * @example
56
+ * ```typescript
57
+ * const history = await User.getChatHistory();
58
+ * // Returns: [
59
+ * // { role: 'user', content: [{type: 'text', text: 'hello'}], createdAt: '...', id: '...', threadId: '...' },
60
+ * // { role: 'assistant', content: [{type: 'text', text: 'hi'}], createdAt: '...', id: '...', threadId: '...' }
61
+ * // ]
62
+ * ```
63
+ */
64
+ getChatHistory(): Promise<import("./interfaces/chat.js").ChatHistoryMessage[]>;
43
65
  };
44
66
  /**
45
67
  * Custom Data API
@@ -54,7 +76,7 @@ export declare const Data: {
54
76
  * @param searchText - Optional text for vector search indexing
55
77
  * @returns Promise resolving to created entry
56
78
  */
57
- create(collectionName: string, data: any, searchText?: string): Promise<import("./common/data.entry.instance.js").default>;
79
+ create(collectionName: string, data: any, searchText?: string): Promise<DataEntryInstance>;
58
80
  /**
59
81
  * Retrieves entries from a collection with optional filtering and pagination.
60
82
  *
@@ -64,7 +86,7 @@ export declare const Data: {
64
86
  * @param limit - Items per page (default: 10)
65
87
  * @returns Promise resolving to array of entries
66
88
  */
67
- get(collectionName: string, filter?: any, page?: number, limit?: number): Promise<import("./interfaces/custom.data.js").GetCustomDataResponse>;
89
+ get(collectionName: string, filter?: any, page?: number, limit?: number): Promise<GetCustomDataResponse>;
68
90
  /**
69
91
  * Retrieves a specific entry by ID.
70
92
  *
@@ -72,7 +94,7 @@ export declare const Data: {
72
94
  * @param entryId - ID of the entry
73
95
  * @returns Promise resolving to entry data
74
96
  */
75
- getEntry(collectionName: string, entryId: string): Promise<import("./common/data.entry.instance.js").default>;
97
+ getEntry(collectionName: string, entryId: string): Promise<DataEntryInstance>;
76
98
  /**
77
99
  * Updates an existing entry.
78
100
  *
@@ -81,7 +103,7 @@ export declare const Data: {
81
103
  * @param data - Updated data
82
104
  * @returns Promise resolving to updated entry
83
105
  */
84
- update(collectionName: string, entryId: string, data: any): Promise<import("./interfaces/custom.data.js").UpdateCustomDataResponse>;
106
+ update(collectionName: string, entryId: string, data: any): Promise<UpdateCustomDataResponse>;
85
107
  /**
86
108
  * Performs vector search on a collection.
87
109
  *
@@ -91,7 +113,7 @@ export declare const Data: {
91
113
  * @param scoreThreshold - Minimum similarity score (0-1)
92
114
  * @returns Promise resolving to search results
93
115
  */
94
- search(collectionName: string, searchText: string, limit?: number, scoreThreshold?: number): Promise<import("./common/data.entry.instance.js").default[]>;
116
+ search(collectionName: string, searchText: string, limit?: number, scoreThreshold?: number): Promise<DataEntryInstance[]>;
95
117
  /**
96
118
  * Deletes an entry from a collection.
97
119
  *
@@ -99,7 +121,7 @@ export declare const Data: {
99
121
  * @param entryId - ID of the entry to delete
100
122
  * @returns Promise resolving when deletion is complete
101
123
  */
102
- delete(collectionName: string, entryId: string): Promise<import("./interfaces/custom.data.js").DeleteCustomDataResponse>;
124
+ delete(collectionName: string, entryId: string): Promise<DeleteCustomDataResponse>;
103
125
  };
104
126
  /**
105
127
  * Products API
@@ -113,43 +135,35 @@ export declare const Products: {
113
135
  * @param page - Page number
114
136
  * @returns Promise resolving to product list
115
137
  */
116
- get(limit?: number, page?: number): Promise<import("./common/product.pagination.instance.js").default>;
138
+ get(limit?: number, page?: number): Promise<ProductPaginationInstance>;
117
139
  /**
118
140
  * Creates a new product.
119
141
  *
120
142
  * @param product - Product data
121
143
  * @returns Promise resolving to created product
122
144
  */
123
- create(product: any): Promise<import("./common/product.instance.js").default>;
124
- /**
125
- * Updates an existing product.
126
- *
127
- * @param data - Updated product data
128
- * @param id - Product ID
129
- * @returns Promise resolving to updated product
130
- */
131
- update(data: any, id: string): Promise<import("./interfaces/product.js").UpdateProductResponse>;
145
+ create(product: Product): Promise<ProductInstance>;
132
146
  /**
133
147
  * Deletes a product.
134
148
  *
135
149
  * @param id - Product ID
136
150
  * @returns Promise resolving when deletion is complete
137
151
  */
138
- delete(id: string): Promise<import("./interfaces/product.js").DeleteProductResponse>;
152
+ delete(id: string): Promise<DeleteProductResponse>;
139
153
  /**
140
154
  * Searches products by query string.
141
155
  *
142
156
  * @param query - Search query
143
157
  * @returns Promise resolving to search results
144
158
  */
145
- search(query: string): Promise<import("./common/product.search.instance.js").default>;
159
+ search(query: string): Promise<ProductSearchInstance>;
146
160
  /**
147
161
  * Retrieves a specific product by ID.
148
162
  *
149
163
  * @param id - Product ID
150
164
  * @returns Promise resolving to product data
151
165
  */
152
- getById(id: string): Promise<import("./common/product.instance.js").default>;
166
+ getById(id: string): Promise<ProductInstance>;
153
167
  };
154
168
  /**
155
169
  * Baskets API
@@ -162,14 +176,14 @@ export declare const Baskets: {
162
176
  * @param basketData - Basket initialization data
163
177
  * @returns Promise resolving to created basket
164
178
  */
165
- create(basketData: any): Promise<import("./common/basket.instance.js").default>;
179
+ create(basketData: any): Promise<BasketInstance>;
166
180
  /**
167
181
  * Retrieves baskets, optionally filtered by status.
168
182
  *
169
183
  * @param status - Optional basket status filter
170
184
  * @returns Promise resolving to basket list
171
185
  */
172
- get(status?: any): Promise<import("./common/basket.instance.js").default[]>;
186
+ get(status?: any): Promise<BasketInstance[]>;
173
187
  /**
174
188
  * Adds an item to a basket.
175
189
  *
@@ -177,7 +191,7 @@ export declare const Baskets: {
177
191
  * @param itemData - Item data to add
178
192
  * @returns Promise resolving to updated basket
179
193
  */
180
- addItem(basketId: string, itemData: any): Promise<import("./interfaces/baskets.js").Basket>;
194
+ addItem(basketId: string, itemData: any): Promise<Basket>;
181
195
  /**
182
196
  * Removes an item from a basket.
183
197
  *
@@ -185,14 +199,14 @@ export declare const Baskets: {
185
199
  * @param itemId - Item ID to remove
186
200
  * @returns Promise resolving to updated basket
187
201
  */
188
- removeItem(basketId: string, itemId: string): Promise<import("./interfaces/baskets.js").Basket>;
202
+ removeItem(basketId: string, itemId: string): Promise<Basket>;
189
203
  /**
190
204
  * Clears all items from a basket.
191
205
  *
192
206
  * @param basketId - Basket ID
193
207
  * @returns Promise resolving to cleared basket
194
208
  */
195
- clear(basketId: string): Promise<import("./interfaces/baskets.js").Basket>;
209
+ clear(basketId: string): Promise<Basket>;
196
210
  /**
197
211
  * Updates basket status.
198
212
  *
@@ -208,7 +222,7 @@ export declare const Baskets: {
208
222
  * @param metadata - Metadata to update
209
223
  * @returns Promise resolving to updated basket
210
224
  */
211
- updateMetadata(basketId: string, metadata: any): Promise<import("./interfaces/baskets.js").UpdateBasketMetadataResponse>;
225
+ updateMetadata(basketId: string, metadata: any): Promise<UpdateBasketMetadataResponse>;
212
226
  /**
213
227
  * Converts basket to order.
214
228
  *
@@ -216,14 +230,14 @@ export declare const Baskets: {
216
230
  * @param basketId - Basket ID to convert
217
231
  * @returns Promise resolving to created order
218
232
  */
219
- placeOrder(data: Record<string, any>, basketId: string): Promise<import("./common/order.instance.js").default>;
233
+ placeOrder(data: Record<string, any>, basketId: string): Promise<OrderInstance>;
220
234
  /**
221
235
  * Retrieves a specific basket by ID.
222
236
  *
223
237
  * @param basketId - Basket ID
224
238
  * @returns Promise resolving to basket data
225
239
  */
226
- getById(basketId: string): Promise<import("./common/basket.instance.js").default>;
240
+ getById(basketId: string): Promise<BasketInstance>;
227
241
  };
228
242
  /**
229
243
  * Orders API
@@ -236,7 +250,7 @@ export declare const Orders: {
236
250
  * @param orderData - Order data
237
251
  * @returns Promise resolving to created order
238
252
  */
239
- create(orderData: any): Promise<import("./common/order.instance.js").default>;
253
+ create(orderData: any): Promise<OrderInstance>;
240
254
  /**
241
255
  * Updates order status.
242
256
  *
@@ -244,7 +258,7 @@ export declare const Orders: {
244
258
  * @param orderId - Order ID
245
259
  * @returns Promise resolving to updated order
246
260
  */
247
- updateStatus(status: any, orderId: string): Promise<import("./interfaces/orders.js").OrderResponse>;
261
+ updateStatus(status: any, orderId: string): Promise<OrderResponse>;
248
262
  /**
249
263
  * Updates order data.
250
264
  *
@@ -252,20 +266,121 @@ export declare const Orders: {
252
266
  * @param orderId - Order ID
253
267
  * @returns Promise resolving to updated order
254
268
  */
255
- updateData(data: Record<string, any>, orderId: string): Promise<import("./interfaces/orders.js").OrderResponse>;
269
+ updateData(data: Record<string, any>, orderId: string): Promise<OrderResponse>;
256
270
  /**
257
271
  * Retrieves orders, optionally filtered by status.
258
272
  *
259
273
  * @param status - Optional order status filter
260
274
  * @returns Promise resolving to order list
261
275
  */
262
- get(status?: any): Promise<import("./common/order.instance.js").default[]>;
276
+ get(status?: any): Promise<OrderInstance[]>;
263
277
  /**
264
278
  * Retrieves a specific order by ID.
265
279
  *
266
280
  * @param orderId - Order ID
267
281
  * @returns Promise resolving to order data
268
282
  */
269
- getById(orderId: string): Promise<import("./common/order.instance.js").default>;
283
+ getById(orderId: string): Promise<OrderInstance>;
284
+ };
285
+ /**
286
+ * Jobs API
287
+ * Manage and trigger scheduled jobs from within your tools
288
+ */
289
+ export declare const Jobs: {
290
+ /**
291
+ * Creates a new job dynamically from within a tool.
292
+ * This allows tools to schedule one-time or recurring jobs programmatically.
293
+ *
294
+ * @param config - Job configuration
295
+ * @param config.name - Unique job name
296
+ * @param config.description - Job description
297
+ * @param config.schedule - Schedule configuration (cron, once, or interval)
298
+ * @param config.execute - Async function to execute
299
+ * @param config.timeout - Optional timeout in seconds
300
+ * @param config.retry - Optional retry configuration
301
+ * @returns Promise resolving to created job details
302
+ *
303
+ * @example
304
+ * ```typescript
305
+ * // Create a one-time job to check basket in 3 hours
306
+ * await Jobs.create({
307
+ * name: `check-basket-${basketId}`,
308
+ * description: 'Check if basket was abandoned',
309
+ * schedule: {
310
+ * type: 'once',
311
+ * executeAt: new Date(Date.now() + 3 * 60 * 60 * 1000)
312
+ * },
313
+ * execute: async () => {
314
+ * const basket = await Baskets.getById(basketId);
315
+ * if (basket.status === 'active') {
316
+ * // Send reminder
317
+ * }
318
+ * return { checked: true };
319
+ * }
320
+ * });
321
+ * ```
322
+ */
323
+ create(config: {
324
+ name: string;
325
+ description?: string;
326
+ schedule: any;
327
+ execute: (job: JobInstance) => Promise<any>;
328
+ timeout?: number;
329
+ retry?: {
330
+ maxAttempts: number;
331
+ backoffSeconds?: number;
332
+ };
333
+ metadata?: Record<string, any>;
334
+ }): Promise<JobInstance>;
335
+ /**
336
+ * Retrieves a job by its unique identifier
337
+ * @param jobId - The unique identifier of the job to retrieve
338
+ * @returns Promise resolving to an JobInstance representing the job
339
+ * @throws Error if the job is not found or the request fails
340
+ */
341
+ getJob(jobId: string): Promise<JobInstance>;
342
+ };
343
+ /**
344
+ * AI API
345
+ * Generate AI responses with custom context
346
+ */
347
+ export declare const AI: {
348
+ /**
349
+ * Generates an AI response with custom runtime context.
350
+ *
351
+ * @param context - Runtime context to provide to the AI
352
+ * @param messages - Array of messages (text, image, file, etc.)
353
+ * @param agentId - Optional agent ID to use (defaults to current agent)
354
+ * @returns Promise resolving to AI response text
355
+ *
356
+ * @example
357
+ * ```typescript
358
+ * // Simple text message with current agent
359
+ * const response = await AI.generate(
360
+ * 'You are a helpful sales assistant for our e-commerce store.',
361
+ * [{ type: 'text', text: 'What products do you recommend for beginners?' }]
362
+ * );
363
+ * console.log(response); // AI-generated recommendation
364
+ *
365
+ * // Multiple messages with images
366
+ * const response2 = await AI.generate(
367
+ * 'You are an image analysis expert.',
368
+ * [
369
+ * { type: 'text', text: 'What do you see in this image?' },
370
+ * { type: 'image', url: 'https://example.com/image.jpg' }
371
+ * ]
372
+ * );
373
+ *
374
+ * // Use a different agent
375
+ * const response3 = await AI.generate(
376
+ * 'You are a specialized assistant.',
377
+ * [{ type: 'text', text: 'Help me with this task' }],
378
+ * 'agent_different_123'
379
+ * );
380
+ * ```
381
+ */
382
+ generate(context: string, messages: import("./interfaces/chat.js").ChatMessage[], agentId?: string): Promise<string>;
270
383
  };
271
- export { LuaSkill, LuaTool, BasketStatus, OrderStatus, env };
384
+ export { LuaSkill, LuaTool, LuaWebhook, LuaWebhookConfig, LuaJob, LuaJobConfig, JobSchedule, PreProcessor, PreProcessorConfig, PostProcessor, PostProcessorConfig, LuaAgent, LuaAgentConfig, BasketStatus, OrderStatus, env };
385
+ export { JobInstance };
386
+ export { ChatHistoryMessage, ChatHistoryContent };