lua-cli 3.1.0-alpha.3 → 3.1.0-alpha.5

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 (125) hide show
  1. package/README.md +0 -4
  2. package/dist/api/cdn.api.service.d.ts +18 -0
  3. package/dist/api/cdn.api.service.js +43 -0
  4. package/dist/api/custom.data.api.service.d.ts +4 -3
  5. package/dist/api/custom.data.api.service.js +4 -3
  6. package/dist/api/developer.api.service.d.ts +54 -1
  7. package/dist/api/developer.api.service.js +89 -0
  8. package/dist/api/job.api.service.d.ts +33 -100
  9. package/dist/api/job.api.service.js +27 -11
  10. package/dist/api/lazy-instances.d.ts +16 -0
  11. package/dist/api/lazy-instances.js +32 -0
  12. package/dist/api/postprocessor.api.service.d.ts +3 -13
  13. package/dist/api/postprocessor.api.service.js +2 -4
  14. package/dist/api/preprocessor.api.service.d.ts +1 -8
  15. package/dist/api/preprocessor.api.service.js +1 -2
  16. package/dist/api/webhook.api.service.d.ts +1 -3
  17. package/dist/api/webhook.api.service.js +1 -1
  18. package/dist/api/whatsapp-templates.api.service.d.ts +40 -0
  19. package/dist/api/whatsapp-templates.api.service.js +78 -0
  20. package/dist/api-exports.d.ts +153 -6
  21. package/dist/api-exports.js +177 -21
  22. package/dist/cli/command-definitions.js +34 -7
  23. package/dist/commands/admin.js +1 -1
  24. package/dist/commands/channels.js +1 -1
  25. package/dist/commands/chat.js +2 -4
  26. package/dist/commands/compile.js +23 -4
  27. package/dist/commands/evals.d.ts +8 -0
  28. package/dist/commands/evals.js +41 -0
  29. package/dist/commands/index.d.ts +2 -0
  30. package/dist/commands/index.js +2 -0
  31. package/dist/commands/init.d.ts +10 -1
  32. package/dist/commands/init.js +23 -46
  33. package/dist/commands/jobs.js +5 -5
  34. package/dist/commands/mcp.d.ts +18 -0
  35. package/dist/commands/mcp.js +393 -0
  36. package/dist/commands/push.js +174 -23
  37. package/dist/common/data.entry.instance.d.ts +1 -1
  38. package/dist/common/data.entry.instance.js +4 -4
  39. package/dist/common/job.instance.d.ts +59 -7
  40. package/dist/common/job.instance.js +84 -19
  41. package/dist/config/constants.d.ts +1 -0
  42. package/dist/config/constants.js +1 -0
  43. package/dist/index.js +1 -0
  44. package/dist/interfaces/agent.d.ts +0 -3
  45. package/dist/interfaces/cdn.d.ts +24 -0
  46. package/dist/interfaces/cdn.js +5 -0
  47. package/dist/interfaces/compile.d.ts +1 -0
  48. package/dist/interfaces/custom.data.d.ts +3 -3
  49. package/dist/interfaces/index.d.ts +2 -1
  50. package/dist/interfaces/init.d.ts +0 -1
  51. package/dist/interfaces/jobs.d.ts +88 -132
  52. package/dist/interfaces/jobs.js +1 -1
  53. package/dist/interfaces/mcp.d.ts +64 -0
  54. package/dist/interfaces/mcp.js +5 -0
  55. package/dist/interfaces/postprocessors.d.ts +0 -3
  56. package/dist/interfaces/preprocessors.d.ts +0 -3
  57. package/dist/interfaces/webhooks.d.ts +0 -5
  58. package/dist/interfaces/whatsapp-templates.d.ts +104 -0
  59. package/dist/interfaces/whatsapp-templates.js +5 -0
  60. package/dist/types/api-contracts.d.ts +68 -14
  61. package/dist/types/compile.types.d.ts +5 -6
  62. package/dist/types/index.d.ts +2 -2
  63. package/dist/types/index.js +3 -1
  64. package/dist/types/skill.d.ts +181 -103
  65. package/dist/types/skill.js +123 -91
  66. package/dist/utils/agent-management.d.ts +3 -5
  67. package/dist/utils/agent-management.js +6 -8
  68. package/dist/utils/bundling.d.ts +4 -11
  69. package/dist/utils/bundling.js +24 -33
  70. package/dist/utils/compile.d.ts +17 -9
  71. package/dist/utils/compile.js +72 -88
  72. package/dist/utils/deployment.js +13 -7
  73. package/dist/utils/dev-api.js +1 -4
  74. package/dist/utils/dev-server.js +1 -1
  75. package/dist/utils/files.d.ts +11 -4
  76. package/dist/utils/files.js +17 -14
  77. package/dist/utils/init-agent.d.ts +1 -2
  78. package/dist/utils/init-agent.js +4 -6
  79. package/dist/utils/init-helpers.d.ts +4 -4
  80. package/dist/utils/init-helpers.js +10 -11
  81. package/dist/utils/job-management.js +0 -2
  82. package/dist/utils/mcp-server-management.d.ts +23 -0
  83. package/dist/utils/mcp-server-management.js +212 -0
  84. package/dist/utils/postprocessor-management.js +2 -4
  85. package/dist/utils/preprocessor-management.js +2 -4
  86. package/dist/utils/sandbox.d.ts +4 -2
  87. package/dist/utils/sandbox.js +38 -9
  88. package/dist/utils/webhook-management.js +1 -3
  89. package/dist/web/app.css +1505 -14
  90. package/dist/web/app.js +79 -64
  91. package/package.json +2 -6
  92. package/template/QUICKSTART.md +57 -774
  93. package/template/README.md +80 -907
  94. package/template/examples/README.md +106 -0
  95. package/template/{src → examples}/jobs/AbandonedBasketProcessorJob.ts +67 -14
  96. package/template/{src → examples}/jobs/DailyCleanupJob.ts +0 -3
  97. package/template/{src → examples}/jobs/DataMigrationJob.ts +0 -3
  98. package/template/{src → examples}/jobs/HealthCheckJob.ts +0 -3
  99. package/template/{src → examples}/postprocessors/modifyResponse.ts +3 -4
  100. package/template/examples/preprocessors/messageMatching.ts +35 -0
  101. package/template/{src → examples}/skills/basket.skill.ts +0 -1
  102. package/template/{src → examples}/skills/product.skill.ts +0 -1
  103. package/template/{src → examples}/skills/tools/GameScoreTrackerTool.ts +11 -15
  104. package/template/{src → examples}/skills/tools/OrderTool.ts +25 -0
  105. package/template/examples/skills/tools/PremiumFeatureTool.ts +98 -0
  106. package/template/{src → examples}/skills/tools/UserDataTool.ts +34 -0
  107. package/template/{src → examples}/skills/user.skill.ts +0 -1
  108. package/template/examples/webhooks/FileUploadWebhook.ts +86 -0
  109. package/template/{src → examples}/webhooks/PaymentWebhook.ts +12 -9
  110. package/template/examples/webhooks/UserEventWebhook.ts +105 -0
  111. package/template/package-lock.json +7895 -0
  112. package/template/package.json +1 -1
  113. package/template/src/index.ts +40 -22
  114. package/template/src/preprocessors/messageMatching.ts +0 -22
  115. package/template/src/webhooks/UserEventWebhook.ts +0 -77
  116. /package/template/{src → examples}/services/ApiService.ts +0 -0
  117. /package/template/{src → examples}/services/GetWeather.ts +0 -0
  118. /package/template/{src → examples}/skills/tools/BasketTool.ts +0 -0
  119. /package/template/{src → examples}/skills/tools/CreateInlineJob.ts +0 -0
  120. /package/template/{src → examples}/skills/tools/CreatePostTool.ts +0 -0
  121. /package/template/{src → examples}/skills/tools/CustomDataTool.ts +0 -0
  122. /package/template/{src → examples}/skills/tools/GetWeatherTool.ts +0 -0
  123. /package/template/{src → examples}/skills/tools/PaymentTool.ts +0 -0
  124. /package/template/{src → examples}/skills/tools/ProductsTool.ts +0 -0
  125. /package/template/{src → examples}/skills/tools/SmartBasketTool.ts +0 -0
@@ -1,4 +1,6 @@
1
1
  import { Message } from "../interfaces/message.js";
2
+ import { GetCustomDataResponse, UpdateCustomDataResponse, DeleteCustomDataResponse } from "../interfaces/custom.data.js";
3
+ import DataEntryInstance from "../common/data.entry.instance.js";
2
4
  /**
3
5
  * API Contract Interfaces
4
6
  * TypeScript interfaces that API service classes must implement
@@ -178,48 +180,100 @@ export interface CustomDataAPI {
178
180
  /**
179
181
  * Creates a new entry in a custom data collection.
180
182
  * @param collectionName - Collection name
181
- * @param data - Data to store
182
- * @returns Promise resolving to created entry
183
+ * @param data - Data object to store
184
+ * @param searchText - Optional text for vector search indexing
185
+ * @returns Promise resolving to created entry (DataEntryInstance)
183
186
  */
184
- create(collectionName: string, data: any): Promise<any>;
187
+ create(collectionName: string, data: Record<string, any>, searchText?: string): Promise<DataEntryInstance>;
185
188
  /**
186
189
  * Gets entries from a collection with filtering and pagination.
187
190
  * @param collectionName - Collection name
188
191
  * @param filter - Optional filter criteria
189
192
  * @param page - Page number
190
193
  * @param limit - Items per page
191
- * @returns Promise resolving to entries
194
+ * @returns Promise resolving to paginated entries
192
195
  */
193
- get(collectionName: string, filter?: any, page?: number, limit?: number): Promise<any>;
196
+ get(collectionName: string, filter?: Record<string, any>, page?: number, limit?: number): Promise<GetCustomDataResponse>;
194
197
  /**
195
198
  * Gets a specific entry by ID.
196
199
  * @param collectionName - Collection name
197
200
  * @param entryId - Entry ID
198
- * @returns Promise resolving to entry data
201
+ * @returns Promise resolving to entry (DataEntryInstance)
199
202
  */
200
- getEntry(collectionName: string, entryId: string): Promise<any>;
203
+ getEntry(collectionName: string, entryId: string): Promise<DataEntryInstance>;
201
204
  /**
202
205
  * Updates an existing entry.
203
206
  * @param collectionName - Collection name
204
207
  * @param entryId - Entry ID
205
- * @param data - Updated data
206
- * @returns Promise resolving to updated entry
208
+ * @param data - Data object to update
209
+ * @param searchText - Optional text for vector search indexing
210
+ * @returns Promise resolving to update response
207
211
  */
208
- update(collectionName: string, entryId: string, data: any): Promise<any>;
212
+ update(collectionName: string, entryId: string, data: Record<string, any>, searchText?: string): Promise<UpdateCustomDataResponse>;
209
213
  /**
210
214
  * Performs vector search on a collection.
211
215
  * @param collectionName - Collection name
212
216
  * @param searchText - Text to search for
213
217
  * @param limit - Maximum results
214
218
  * @param scoreThreshold - Minimum similarity score
215
- * @returns Promise resolving to search results
219
+ * @returns Promise resolving to array of matching entries (DataEntryInstance[])
216
220
  */
217
- search(collectionName: string, searchText: string, limit?: number, scoreThreshold?: number): Promise<any>;
221
+ search(collectionName: string, searchText: string, limit?: number, scoreThreshold?: number): Promise<DataEntryInstance[]>;
218
222
  /**
219
223
  * Deletes an entry from a collection.
220
224
  * @param collectionName - Collection name
221
225
  * @param entryId - Entry ID to delete
222
- * @returns Promise resolving when deletion is complete
226
+ * @returns Promise resolving to delete response
227
+ */
228
+ delete(collectionName: string, entryId: string): Promise<DeleteCustomDataResponse>;
229
+ }
230
+ /**
231
+ * WhatsApp Templates API contract.
232
+ * Defines operations for managing WhatsApp templates.
233
+ */
234
+ export interface WhatsAppTemplatesAPI {
235
+ /**
236
+ * Lists WhatsApp templates for a channel with optional pagination and search.
237
+ * @param channelId - The WhatsApp channel identifier
238
+ * @param options - Optional pagination and search options
239
+ * @returns Promise resolving to paginated templates response
240
+ */
241
+ list(channelId: string, options?: {
242
+ page?: number;
243
+ limit?: number;
244
+ search?: string;
245
+ }): Promise<any>;
246
+ /**
247
+ * Gets a specific WhatsApp template by ID.
248
+ * @param channelId - The WhatsApp channel identifier
249
+ * @param templateId - The template identifier
250
+ * @returns Promise resolving to the template
251
+ */
252
+ get(channelId: string, templateId: string): Promise<any>;
253
+ /**
254
+ * Sends a WhatsApp template message to one or more phone numbers.
255
+ * @param channelId - The WhatsApp channel identifier
256
+ * @param templateId - The template identifier
257
+ * @param data - Send data including phone numbers and template values
258
+ * @returns Promise resolving to the send response
259
+ */
260
+ send(channelId: string, templateId: string, data: any): Promise<any>;
261
+ }
262
+ /**
263
+ * CDN API contract.
264
+ * Defines operations for uploading and retrieving files from the CDN.
265
+ */
266
+ export interface CdnAPI {
267
+ /**
268
+ * Uploads a file to the CDN.
269
+ * @param file - The File object to upload
270
+ * @returns Promise resolving to the file ID
271
+ */
272
+ upload(file: File): Promise<string>;
273
+ /**
274
+ * Retrieves a file from the CDN by its ID.
275
+ * @param fileId - The unique identifier of the file
276
+ * @returns Promise resolving to a File object
223
277
  */
224
- delete(collectionName: string, entryId: string): Promise<any>;
278
+ get(fileId: string): Promise<File>;
225
279
  }
@@ -15,7 +15,6 @@ export type ASTNode = any;
15
15
  */
16
16
  export interface SkillMetadata {
17
17
  name: string;
18
- version: string;
19
18
  description: string;
20
19
  context: string;
21
20
  constructorTools: string[];
@@ -25,18 +24,14 @@ export interface SkillMetadata {
25
24
  */
26
25
  export interface WebhookMetadata {
27
26
  name: string;
28
- version: string;
29
27
  description: string;
30
- context: string;
31
28
  }
32
29
  /**
33
30
  * Job metadata extracted from source code
34
31
  */
35
32
  export interface JobMetadata {
36
33
  name: string;
37
- version: string;
38
34
  description: string;
39
- context: string;
40
35
  schedule: any;
41
36
  timeout?: number;
42
37
  retry?: {
@@ -59,7 +54,6 @@ export interface YamlConfigAgent {
59
54
  agentId?: string;
60
55
  orgId?: string;
61
56
  persona?: string;
62
- welcomeMessage?: string;
63
57
  }
64
58
  export interface YamlConfigSkill {
65
59
  name: string;
@@ -87,6 +81,10 @@ export interface YamlConfigPostprocessor {
87
81
  version: string;
88
82
  postprocessorId: string;
89
83
  }
84
+ export interface YamlConfigMCPServer {
85
+ name: string;
86
+ mcpServerId: string;
87
+ }
90
88
  export interface YamlConfig {
91
89
  skill?: LegacyYamlConfigSkill;
92
90
  agent?: YamlConfigAgent;
@@ -95,6 +93,7 @@ export interface YamlConfig {
95
93
  jobs?: YamlConfigJob[];
96
94
  preprocessors?: YamlConfigPreprocessor[];
97
95
  postprocessors?: YamlConfigPostprocessor[];
96
+ mcpServers?: YamlConfigMCPServer[];
98
97
  }
99
98
  /**
100
99
  * Deployment data format for new deployment system
@@ -14,9 +14,9 @@
14
14
  * import { validateToolName } from './types/tool-validation.js';
15
15
  * ```
16
16
  */
17
- export { LuaSkill, LuaTool, LuaSkillConfig, LuaWebhook, LuaWebhookConfig, LuaJob, LuaJobConfig, JobSchedule, env } from './skill.js';
17
+ export { LuaSkill, LuaTool, LuaSkillConfig, LuaWebhook, LuaWebhookConfig, LuaJob, LuaJobConfig, JobSchedule, env, LuaMCPServer, LuaMCPServerConfig, MCPStdioServerConfig, MCPSSEServerConfig, MCPTransport, MCPServerBaseConfig, } from './skill.js';
18
18
  export { validateToolName, assertValidToolName } from './tool-validation.js';
19
- export { UserDataAPI, ProductAPI, BasketAPI, OrderAPI, CustomDataAPI } from './api-contracts.js';
19
+ export { UserDataAPI, ProductAPI, BasketAPI, OrderAPI, CustomDataAPI, WhatsAppTemplatesAPI, CdnAPI } from './api-contracts.js';
20
20
  export { UserData, EmailAddress, Country, Admin, Organization, AgentAuth, OTPResponse, ApiKeyResponse } from '../interfaces/admin.js';
21
21
  export { Agent, AgentType, CreateAgentRequest, CreateAgentResponse, AgentDetailsResponse } from '../interfaces/agent.js';
22
22
  export { BasketStatus, BasketItem, Basket } from '../interfaces/baskets.js';
@@ -18,7 +18,9 @@
18
18
  // SKILL SYSTEM EXPORTS
19
19
  // ============================================================================
20
20
  // Core skill classes and utilities
21
- export { LuaSkill, LuaWebhook, LuaJob, env } from './skill.js';
21
+ export { LuaSkill, LuaWebhook, LuaJob, env,
22
+ // MCP Server config types (for defining servers)
23
+ LuaMCPServer, } from './skill.js';
22
24
  // Tool validation utilities
23
25
  export { validateToolName, assertValidToolName } from './tool-validation.js';
24
26
  // Basket types