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
@@ -127,4 +127,18 @@ export default class ProductInstance {
127
127
  }
128
128
  return this.data;
129
129
  }
130
+ /**
131
+ * Saves the product's data
132
+ * @returns Promise resolving to true if saving was successful
133
+ * @throws Error if the save operation fails
134
+ */
135
+ async save() {
136
+ try {
137
+ await this.productAPI.update(this.data, this.data.id);
138
+ return true;
139
+ }
140
+ catch (error) {
141
+ throw new Error('Failed to save product data');
142
+ }
143
+ }
130
144
  }
@@ -1,3 +1,4 @@
1
+ import { Message } from "../interfaces/message.js";
1
2
  import { UserDataAPI } from "../types/index.js";
2
3
  /**
3
4
  * User data instance class providing a fluent API for managing user data
@@ -33,4 +34,18 @@ export default class UserDataInstance {
33
34
  * @throws Error if the clear operation fails
34
35
  */
35
36
  clear(): Promise<boolean>;
37
+ /**
38
+ * Saves the user's data
39
+ * @returns Promise resolving to true if saving was successful
40
+ * @throws Error if the save operation fails
41
+ */
42
+ save(): Promise<boolean>;
43
+ /**
44
+ * Sends a message to a specific user conversation for the agent
45
+ * @param messages - An array of messages to send (can be text, image, or file types)
46
+ * @returns Promise resolving to the response data from the server
47
+ * @throws Error if the message sending fails or the request is unsuccessful
48
+ */
49
+ send(messages: Message[]): Promise<any>;
50
+ getChatHistory(): Promise<any>;
36
51
  }
@@ -129,4 +129,42 @@ export default class UserDataInstance {
129
129
  throw new Error('Failed to clear user data');
130
130
  }
131
131
  }
132
+ /**
133
+ * Saves the user's data
134
+ * @returns Promise resolving to true if saving was successful
135
+ * @throws Error if the save operation fails
136
+ */
137
+ async save() {
138
+ try {
139
+ await this.userAPI.update(this.data);
140
+ return true;
141
+ }
142
+ catch (error) {
143
+ throw new Error('Failed to save user data');
144
+ }
145
+ }
146
+ /**
147
+ * Sends a message to a specific user conversation for the agent
148
+ * @param messages - An array of messages to send (can be text, image, or file types)
149
+ * @returns Promise resolving to the response data from the server
150
+ * @throws Error if the message sending fails or the request is unsuccessful
151
+ */
152
+ async send(messages) {
153
+ try {
154
+ await this.userAPI.sendMessage(messages);
155
+ return true;
156
+ }
157
+ catch (error) {
158
+ throw new Error('Failed to send message');
159
+ }
160
+ }
161
+ //get chat history
162
+ async getChatHistory() {
163
+ try {
164
+ return await this.userAPI.getChatHistory();
165
+ }
166
+ catch (error) {
167
+ throw new Error('Failed to get chat history');
168
+ }
169
+ }
132
170
  }
@@ -2,9 +2,9 @@
2
2
  * Base URLs for the API, Auth, and Chat - Production
3
3
  */
4
4
  export declare const BASE_URLS: {
5
- readonly API: "https://api.heylua.ai";
5
+ readonly API: "http://localhost:3022";
6
6
  readonly AUTH: "https://auth.heylua.ai";
7
- readonly CHAT: "https://api.heylua.ai";
7
+ readonly CHAT: "http://localhost:3001";
8
8
  };
9
9
  /**
10
10
  * Base URLs for the API, Auth, and Chat - Development
@@ -2,15 +2,15 @@
2
2
  * Base URLs for the API, Auth, and Chat - Production
3
3
  */
4
4
  export const BASE_URLS = {
5
- API: 'https://api.heylua.ai',
5
+ API: 'http://localhost:3022',
6
6
  AUTH: 'https://auth.heylua.ai',
7
- CHAT: 'https://api.heylua.ai',
7
+ CHAT: 'http://localhost:3001',
8
8
  };
9
9
  /**
10
10
  * Base URLs for the API, Auth, and Chat - Development
11
11
  */
12
12
  // export const BASE_URLS = {
13
- // API: 'http://localhost:3022',
13
+ // API: 'https://api.heylua.ai',
14
14
  // AUTH: 'https://auth.heylua.ai',
15
- // CHAT: 'http://localhost:3001',
15
+ // CHAT: 'https://api.heylua.ai',
16
16
  // } as const;
package/dist/index.js CHANGED
@@ -37,13 +37,24 @@ Examples:
37
37
  $ lua init 🚀 Initialize a new project
38
38
  $ lua compile 📦 Compile your skills
39
39
  $ lua test 🧪 Test tools interactively
40
- $ lua push ☁️ Push to server
40
+ $ lua push ☁️ Push to server (interactive)
41
+ $ lua push skill ☁️ Push skill directly
42
+ $ lua push persona ☁️ Push persona directly
41
43
  $ lua deploy 🚀 Deploy to production
42
44
  $ lua chat 💬 Start interactive chat
43
- $ lua env ⚙️ Manage environment variables
44
- $ lua persona 🤖 Manage agent persona
45
+ $ lua env ⚙️ Manage environment variables (interactive)
46
+ $ lua env staging ⚙️ Manage staging env vars directly
47
+ $ lua env production ⚙️ Manage production env vars directly
48
+ $ lua persona 🤖 Manage agent persona (interactive)
49
+ $ lua persona staging 🤖 Manage staging persona directly
50
+ $ lua persona production 🤖 Manage production persona directly
51
+ $ lua skills ⚙️ Manage skills (interactive)
52
+ $ lua skills staging ⚙️ View staging skills directly
53
+ $ lua skills production ⚙️ Manage production skills directly
54
+ $ lua features 🎯 Manage agent features
45
55
  $ lua admin 🔧 Open admin dashboard
46
56
  $ lua docs 📖 Open documentation
57
+ $ lua completion 🎯 Enable shell autocomplete
47
58
 
48
59
  🌙 Documentation: https://docs.heylua.ai
49
60
  🌙 Support: https://heylua.ai/support
@@ -39,7 +39,8 @@ export interface CreateAgentRequest {
39
39
  features: Record<string, boolean>;
40
40
  channels: any[];
41
41
  org: {
42
- registeredName: string;
42
+ id?: string;
43
+ registeredName?: string;
43
44
  };
44
45
  }
45
46
  /**
@@ -307,3 +308,34 @@ export interface CreateEmailChannelResponse {
307
308
  forwardTo: string;
308
309
  status: string;
309
310
  }
311
+ /**
312
+ * Agent feature configuration.
313
+ * Represents a feature that can be enabled/disabled for an agent.
314
+ */
315
+ export interface AgentFeature {
316
+ name: string;
317
+ title: string;
318
+ context: string;
319
+ active: boolean;
320
+ }
321
+ /**
322
+ * Response from get agent features API.
323
+ */
324
+ export interface GetAgentFeaturesResponse {
325
+ features: AgentFeature[];
326
+ }
327
+ /**
328
+ * Request payload for updating an agent feature.
329
+ * At least one of active or featureContext must be provided.
330
+ */
331
+ export interface UpdateAgentFeatureRequest {
332
+ featureName: string;
333
+ active?: boolean;
334
+ featureContext?: string;
335
+ }
336
+ /**
337
+ * Response from updating an agent feature.
338
+ */
339
+ export interface UpdateAgentFeatureResponse {
340
+ message: string;
341
+ }
@@ -27,6 +27,7 @@ export interface ChatRequest {
27
27
  navigate: boolean;
28
28
  skillOverride: SkillOverride[];
29
29
  personaOverride?: string;
30
+ runtimeContext?: string;
30
31
  }
31
32
  /**
32
33
  * Chat response from API.
@@ -59,3 +60,24 @@ export interface DetailedChatResponse {
59
60
  steps: any[];
60
61
  sources: any[];
61
62
  }
63
+ /**
64
+ * Chat history message content item
65
+ */
66
+ export interface ChatHistoryContent {
67
+ type: 'text' | 'image' | 'file';
68
+ text?: string;
69
+ url?: string;
70
+ filename?: string;
71
+ }
72
+ /**
73
+ * Chat history message from conversation
74
+ */
75
+ export interface ChatHistoryMessage {
76
+ role: 'user' | 'assistant';
77
+ id: string;
78
+ createdAt: string;
79
+ resourceId: string;
80
+ threadId: string;
81
+ type: string;
82
+ content: ChatHistoryContent[];
83
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Interfaces Module - Barrel Export
3
+ *
4
+ * This file serves as the main entry point for all interface definitions.
5
+ * It re-exports interfaces and DTOs from various modules for convenient importing.
6
+ */
7
+ export { CreateWebhookDTO, PushWebhookVersionDTO, UpdateWebhookVersionDTO, WebhookVersion, Webhook, GetWebhooksResponse, DeleteWebhookResponse, CreateWebhookResponse, PushWebhookVersionResponse, } from './webhooks.js';
8
+ export { CreateJobDTO, PushJobVersionDTO, UpdateJobVersionDTO, JobSchedule, JobScheduleType, JobRetryConfig, JobVersion, JobExecutionStatus, JobExecution, JobStatus, Job, GetJobsResponse, DeleteJobResponse, CreateJobResponse, PushJobVersionResponse, JobExecutionResponse, GetJobExecutionsResponse, } from './jobs.js';
9
+ export { ApiResponse, Pagination, } from './common.js';
10
+ export { SkillTool, SkillVersion, Skill, GetSkillsResponse, DeleteSkillResponse, } from './skills.js';
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Interfaces Module - Barrel Export
3
+ *
4
+ * This file serves as the main entry point for all interface definitions.
5
+ * It re-exports interfaces and DTOs from various modules for convenient importing.
6
+ */
7
+ export {};
@@ -0,0 +1,172 @@
1
+ /**
2
+ * Jobs Interfaces
3
+ * Structures for job management
4
+ */
5
+ /**
6
+ * DTO for creating a new job
7
+ */
8
+ export interface CreateJobDTO {
9
+ name: string;
10
+ description?: string;
11
+ context?: string;
12
+ schedule: JobSchedule;
13
+ timeout?: number;
14
+ retry?: JobRetryConfig;
15
+ metadata?: Record<string, any>;
16
+ }
17
+ /**
18
+ * DTO for pushing a job version
19
+ */
20
+ export interface PushJobVersionDTO {
21
+ name: string;
22
+ version: string;
23
+ description?: string;
24
+ context?: string;
25
+ jobId: string;
26
+ schedule: JobSchedule;
27
+ timeout?: number;
28
+ retry?: JobRetryConfig;
29
+ code?: string;
30
+ executeFunction?: string;
31
+ metadata?: Record<string, any>;
32
+ }
33
+ /**
34
+ * DTO for updating a job version
35
+ */
36
+ export interface UpdateJobVersionDTO {
37
+ version?: string;
38
+ description?: string;
39
+ context?: string;
40
+ schedule?: JobSchedule;
41
+ timeout?: number;
42
+ retry?: JobRetryConfig;
43
+ code?: string;
44
+ executeFunction?: string;
45
+ metadata?: Record<string, any>;
46
+ }
47
+ /**
48
+ * Job schedule configuration
49
+ */
50
+ export type JobScheduleType = 'cron' | 'once' | 'interval';
51
+ export interface JobSchedule {
52
+ type: JobScheduleType;
53
+ expression?: string;
54
+ executeAt?: string;
55
+ seconds?: number;
56
+ timezone?: string;
57
+ }
58
+ /**
59
+ * Job retry configuration
60
+ */
61
+ export interface JobRetryConfig {
62
+ maxAttempts: number;
63
+ backoffSeconds?: number;
64
+ }
65
+ /**
66
+ * Job version information
67
+ */
68
+ export interface JobVersion {
69
+ id: string;
70
+ version: string;
71
+ description: string;
72
+ active: boolean;
73
+ context: string;
74
+ schedule: JobSchedule;
75
+ timeout?: number;
76
+ retry?: JobRetryConfig;
77
+ createdAt: string;
78
+ updatedAt: string;
79
+ }
80
+ /**
81
+ * Job execution status
82
+ */
83
+ export type JobExecutionStatus = 'pending' | 'running' | 'completed' | 'failed' | 'timeout';
84
+ /**
85
+ * Job execution record
86
+ */
87
+ export interface JobExecution {
88
+ id: string;
89
+ jobId: string;
90
+ versionId: string;
91
+ status: JobExecutionStatus;
92
+ startedAt: string;
93
+ completedAt?: string;
94
+ duration?: number;
95
+ result?: any;
96
+ error?: string;
97
+ retryCount?: number;
98
+ }
99
+ /**
100
+ * Job status
101
+ */
102
+ export type JobStatus = 'active' | 'paused' | 'failed' | 'inactive';
103
+ /**
104
+ * Job information
105
+ */
106
+ export interface Job {
107
+ id: string;
108
+ name: string;
109
+ description: string;
110
+ public: boolean;
111
+ active: boolean;
112
+ status: JobStatus;
113
+ createdAt: string;
114
+ updatedAt: string;
115
+ versions: JobVersion[];
116
+ activeVersionId?: string;
117
+ lastRunAt?: string;
118
+ nextRunAt?: string;
119
+ lastExecution?: JobExecution;
120
+ }
121
+ /**
122
+ * Response from get all jobs API endpoint
123
+ */
124
+ export interface GetJobsResponse {
125
+ jobs: Job[];
126
+ }
127
+ /**
128
+ * Response from delete job API endpoint
129
+ * If deleted is false and deactivated is true, the job has versions
130
+ * and cannot be deleted, so it was deactivated instead
131
+ */
132
+ export interface DeleteJobResponse {
133
+ message: string;
134
+ deleted: boolean;
135
+ deactivated: boolean;
136
+ }
137
+ /**
138
+ * Response from create job API endpoint
139
+ */
140
+ export interface CreateJobResponse {
141
+ id: string;
142
+ name: string;
143
+ description?: string;
144
+ agentId: string;
145
+ context?: string;
146
+ schedule: JobSchedule;
147
+ }
148
+ /**
149
+ * Response from push job version API endpoint
150
+ */
151
+ export interface PushJobVersionResponse {
152
+ versionId: string;
153
+ jobId: string;
154
+ version: string;
155
+ createdAt: string;
156
+ schedule: JobSchedule;
157
+ }
158
+ /**
159
+ * Response from job execution APIs
160
+ */
161
+ export interface JobExecutionResponse {
162
+ execution: JobExecution;
163
+ }
164
+ /**
165
+ * Response from get job executions API
166
+ */
167
+ export interface GetJobExecutionsResponse {
168
+ executions: JobExecution[];
169
+ total: number;
170
+ page?: number;
171
+ limit?: number;
172
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Jobs Interfaces
3
+ * Structures for job management
4
+ */
5
+ export {};
@@ -0,0 +1,18 @@
1
+ export type TextMessage = {
2
+ type: "text";
3
+ text: string;
4
+ };
5
+ export type ImageMessage = {
6
+ type: "image";
7
+ image: string;
8
+ mimeType: string;
9
+ };
10
+ export type FileMessage = {
11
+ type: "file";
12
+ data: string;
13
+ mimeType: string;
14
+ };
15
+ export type Message = TextMessage | ImageMessage | FileMessage;
16
+ export interface SendMessageRequest {
17
+ messages: Message[];
18
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,35 @@
1
+ /**
2
+ * PostProcessor Interfaces
3
+ */
4
+ /**
5
+ * DTO for creating a new postprocessor
6
+ */
7
+ export interface CreatePostProcessorDTO {
8
+ name: string;
9
+ description?: string;
10
+ context?: string;
11
+ }
12
+ /**
13
+ * DTO for pushing a postprocessor version
14
+ */
15
+ export interface PushPostProcessorVersionDTO {
16
+ name: string;
17
+ version: string;
18
+ description?: string;
19
+ context?: string;
20
+ postprocessorId: string;
21
+ code?: string;
22
+ executeFunction?: string;
23
+ }
24
+ /**
25
+ * PostProcessor version information
26
+ */
27
+ export interface PostProcessorVersion {
28
+ id: string;
29
+ version: string;
30
+ description: string;
31
+ active: boolean;
32
+ context: string;
33
+ createdAt: string;
34
+ updatedAt: string;
35
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * PostProcessor Interfaces
3
+ */
4
+ export {};
@@ -0,0 +1,35 @@
1
+ /**
2
+ * PreProcessor Interfaces
3
+ */
4
+ /**
5
+ * DTO for creating a new preprocessor
6
+ */
7
+ export interface CreatePreProcessorDTO {
8
+ name: string;
9
+ description?: string;
10
+ context?: string;
11
+ }
12
+ /**
13
+ * DTO for pushing a preprocessor version
14
+ */
15
+ export interface PushPreProcessorVersionDTO {
16
+ name: string;
17
+ version: string;
18
+ description?: string;
19
+ context?: string;
20
+ preprocessorId: string;
21
+ code?: string;
22
+ executeFunction?: string;
23
+ }
24
+ /**
25
+ * PreProcessor version information
26
+ */
27
+ export interface PreProcessorVersion {
28
+ id: string;
29
+ version: string;
30
+ description: string;
31
+ active: boolean;
32
+ context: string;
33
+ createdAt: string;
34
+ updatedAt: string;
35
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * PreProcessor Interfaces
3
+ */
4
+ export {};
@@ -0,0 +1,104 @@
1
+ /**
2
+ * Webhooks Interfaces
3
+ * Structures for webhook management
4
+ */
5
+ /**
6
+ * DTO for creating a new webhook
7
+ */
8
+ export interface CreateWebhookDTO {
9
+ name: string;
10
+ description?: string;
11
+ context?: string;
12
+ }
13
+ /**
14
+ * DTO for pushing a webhook version
15
+ */
16
+ export interface PushWebhookVersionDTO {
17
+ name: string;
18
+ version: string;
19
+ description?: string;
20
+ context?: string;
21
+ webhookId: string;
22
+ querySchema?: any;
23
+ headerSchema?: any;
24
+ bodySchema?: any;
25
+ code?: string;
26
+ executeFunction?: string;
27
+ }
28
+ /**
29
+ * DTO for updating a webhook version
30
+ */
31
+ export interface UpdateWebhookVersionDTO {
32
+ version?: string;
33
+ description?: string;
34
+ context?: string;
35
+ querySchema?: any;
36
+ headerSchema?: any;
37
+ bodySchema?: any;
38
+ code?: string;
39
+ executeFunction?: string;
40
+ }
41
+ /**
42
+ * Webhook version information
43
+ */
44
+ export interface WebhookVersion {
45
+ id: string;
46
+ version: string;
47
+ description: string;
48
+ active: boolean;
49
+ context: string;
50
+ querySchema?: any;
51
+ headerSchema?: any;
52
+ bodySchema?: any;
53
+ createdAt: string;
54
+ updatedAt: string;
55
+ }
56
+ /**
57
+ * Webhook information
58
+ */
59
+ export interface Webhook {
60
+ id: string;
61
+ name: string;
62
+ description: string;
63
+ public: boolean;
64
+ active: boolean;
65
+ createdAt: string;
66
+ updatedAt: string;
67
+ versions: WebhookVersion[];
68
+ activeVersionId?: string;
69
+ }
70
+ /**
71
+ * Response from get all webhooks API endpoint
72
+ */
73
+ export interface GetWebhooksResponse {
74
+ webhooks: Webhook[];
75
+ }
76
+ /**
77
+ * Response from delete webhook API endpoint
78
+ * If deleted is false and deactivated is true, the webhook has versions
79
+ * and cannot be deleted, so it was deactivated instead
80
+ */
81
+ export interface DeleteWebhookResponse {
82
+ message: string;
83
+ deleted: boolean;
84
+ deactivated: boolean;
85
+ }
86
+ /**
87
+ * Response from create webhook API endpoint
88
+ */
89
+ export interface CreateWebhookResponse {
90
+ id: string;
91
+ name: string;
92
+ description?: string;
93
+ agentId: string;
94
+ context?: string;
95
+ }
96
+ /**
97
+ * Response from push webhook version API endpoint
98
+ */
99
+ export interface PushWebhookVersionResponse {
100
+ versionId: string;
101
+ webhookId: string;
102
+ version: string;
103
+ createdAt: string;
104
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Webhooks Interfaces
3
+ * Structures for webhook management
4
+ */
5
+ export {};
@@ -1,3 +1,4 @@
1
+ import { Message } from "../interfaces/message.js";
1
2
  /**
2
3
  * API Contract Interfaces
3
4
  * TypeScript interfaces that API service classes must implement
@@ -26,6 +27,19 @@ export interface UserDataAPI {
26
27
  * @returns Promise resolving when data is cleared
27
28
  */
28
29
  clear(): Promise<any>;
30
+ /**
31
+ * Sends a message to a specific user conversation for the agent
32
+ * @param userId - The unique identifier of the user to send the message to
33
+ * @param messages - An array of messages to send (can be text, image, or file types)
34
+ * @returns Promise resolving to the response data from the server
35
+ * @throws Error if the message sending fails or the request is unsuccessful
36
+ */
37
+ sendMessage(messages: Message[]): Promise<any>;
38
+ /**
39
+ * Gets chat history.
40
+ * @returns Promise resolving to chat history
41
+ */
42
+ getChatHistory(): Promise<any>;
29
43
  }
30
44
  /**
31
45
  * Product API contract.
@@ -1,8 +1 @@
1
- /**
2
- * API Contract Interfaces
3
- * TypeScript interfaces that API service classes must implement
4
- *
5
- * These interfaces define the contract that API services must fulfill.
6
- * They ensure consistent method signatures across all API implementations.
7
- */
8
1
  export {};