@purpleschool/gptbot 0.13.4 → 0.13.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.
Files changed (237) hide show
  1. package/api/controllers/http/agents/agent-ai-model.ts +6 -0
  2. package/api/controllers/http/agents/agent-channel.ts +10 -0
  3. package/api/controllers/http/agents/agent-dialog.ts +9 -0
  4. package/api/controllers/http/agents/agent-document.ts +8 -0
  5. package/api/controllers/http/agents/agent-lead-form.ts +7 -0
  6. package/api/controllers/http/agents/agent-lead.ts +8 -0
  7. package/api/controllers/http/agents/agent-template.ts +11 -0
  8. package/api/controllers/http/agents/agent-tool.ts +8 -0
  9. package/api/controllers/http/agents/agent.ts +17 -0
  10. package/api/controllers/http/agents/index.ts +9 -0
  11. package/api/controllers/http/index.ts +2 -0
  12. package/api/controllers/http/support-feedback.ts +7 -0
  13. package/api/routes.ts +97 -0
  14. package/build/api/controllers/http/agents/agent-ai-model.js +8 -0
  15. package/build/api/controllers/http/agents/agent-channel.js +12 -0
  16. package/build/api/controllers/http/agents/agent-dialog.js +11 -0
  17. package/build/api/controllers/http/agents/agent-document.js +10 -0
  18. package/build/api/controllers/http/agents/agent-lead-form.js +9 -0
  19. package/build/api/controllers/http/agents/agent-lead.js +10 -0
  20. package/build/api/controllers/http/agents/agent-template.js +13 -0
  21. package/build/api/controllers/http/agents/agent-tool.js +10 -0
  22. package/build/api/controllers/http/agents/agent.js +17 -0
  23. package/build/api/controllers/http/agents/index.js +25 -0
  24. package/build/api/controllers/http/index.js +2 -0
  25. package/build/api/controllers/http/support-feedback.js +9 -0
  26. package/build/api/routes.js +68 -0
  27. package/build/commands/agents/agent-ai-model/find-agent-ai-models.command.js +11 -0
  28. package/build/commands/agents/agent-ai-model/get-agent-ai-model-by-id.command.js +14 -0
  29. package/build/commands/agents/agent-ai-model/index.js +18 -0
  30. package/build/commands/agents/agent-channel/create-agent-channel.command.js +20 -0
  31. package/build/commands/agents/agent-channel/delete-agent-channel.command.js +14 -0
  32. package/build/commands/agents/agent-channel/find-agent-channels-catalog.command.js +11 -0
  33. package/build/commands/agents/agent-channel/find-agent-channels.command.js +14 -0
  34. package/build/commands/agents/agent-channel/index.js +21 -0
  35. package/build/commands/agents/agent-channel/update-agent-channel.command.js +31 -0
  36. package/build/commands/agents/agent-dialog/clear-agent-dialog-history.command.js +14 -0
  37. package/build/commands/agents/agent-dialog/find-agent-dialogs.command.js +21 -0
  38. package/build/commands/agents/agent-dialog/get-agent-dialog-by-id.command.js +15 -0
  39. package/build/commands/agents/agent-dialog/index.js +23 -0
  40. package/build/commands/agents/agent-dialog/send-agent-dialog-admin-reply.command.js +22 -0
  41. package/build/commands/agents/agent-dialog/send-cabinet-message.command.js +28 -0
  42. package/build/commands/agents/agent-dialog/start-cabinet-dialog.command.js +18 -0
  43. package/build/commands/agents/agent-dialog/update-agent-dialog-status.command.js +19 -0
  44. package/build/commands/agents/agent-document/delete-agent-document.command.js +14 -0
  45. package/build/commands/agents/agent-document/find-agent-documents.command.js +18 -0
  46. package/build/commands/agents/agent-document/index.js +20 -0
  47. package/build/commands/agents/agent-document/search-agent-documents.command.js +19 -0
  48. package/build/commands/agents/agent-document/upload-agent-document.command.js +19 -0
  49. package/build/commands/agents/agent-lead/create-agent-lead.command.js +16 -0
  50. package/build/commands/agents/agent-lead/delete-agent-lead.command.js +13 -0
  51. package/build/commands/agents/agent-lead/find-agent-leads.command.js +16 -0
  52. package/build/commands/agents/agent-lead/get-agent-lead-by-id.command.js +14 -0
  53. package/build/commands/agents/agent-lead/index.js +21 -0
  54. package/build/commands/agents/agent-lead/update-agent-lead.command.js +19 -0
  55. package/build/commands/agents/agent-lead-form/delete-agent-lead-form.command.js +14 -0
  56. package/build/commands/agents/agent-lead-form/find-agent-lead-forms.command.js +16 -0
  57. package/build/commands/agents/agent-lead-form/get-agent-lead-form-by-agent.command.js +14 -0
  58. package/build/commands/agents/agent-lead-form/get-agent-lead-form-by-id.command.js +14 -0
  59. package/build/commands/agents/agent-lead-form/index.js +21 -0
  60. package/build/commands/agents/agent-lead-form/upsert-agent-lead-form.command.js +19 -0
  61. package/build/commands/agents/agent-template/create-agent-template-category.command.js +17 -0
  62. package/build/commands/agents/agent-template/create-agent-template-instruction.command.js +20 -0
  63. package/build/commands/agents/agent-template/create-agent-template.command.js +21 -0
  64. package/build/commands/agents/agent-template/delete-agent-template-category.command.js +13 -0
  65. package/build/commands/agents/agent-template/delete-agent-template-instruction.command.js +14 -0
  66. package/build/commands/agents/agent-template/delete-agent-template.command.js +13 -0
  67. package/build/commands/agents/agent-template/find-agent-template-catalog.command.js +11 -0
  68. package/build/commands/agents/agent-template/find-agent-template-categories.command.js +19 -0
  69. package/build/commands/agents/agent-template/find-agent-template-instructions.command.js +20 -0
  70. package/build/commands/agents/agent-template/find-agent-templates.command.js +19 -0
  71. package/build/commands/agents/agent-template/index.js +29 -0
  72. package/build/commands/agents/agent-template/update-agent-template-category.command.js +21 -0
  73. package/build/commands/agents/agent-template/update-agent-template-instruction.command.js +22 -0
  74. package/build/commands/agents/agent-template/update-agent-template.command.js +25 -0
  75. package/build/commands/agents/agent-tool/connect-agent-tool.command.js +20 -0
  76. package/build/commands/agents/agent-tool/disconnect-agent-tool.command.js +14 -0
  77. package/build/commands/agents/agent-tool/find-agent-tools-catalog.command.js +15 -0
  78. package/build/commands/agents/agent-tool/find-agent-tools.command.js +14 -0
  79. package/build/commands/agents/agent-tool/index.js +21 -0
  80. package/build/commands/agents/agent-tool/update-agent-tool.command.js +21 -0
  81. package/build/commands/agents/agents/create-agent.command.js +24 -0
  82. package/build/commands/agents/agents/delete-agent.command.js +13 -0
  83. package/build/commands/agents/agents/find-agents.command.js +18 -0
  84. package/build/commands/agents/agents/get-agent-by-id.command.js +14 -0
  85. package/build/commands/agents/agents/get-agent-public-info.command.js +19 -0
  86. package/build/commands/agents/agents/index.js +22 -0
  87. package/build/commands/agents/agents/update-agent.command.js +30 -0
  88. package/build/commands/agents/index.js +25 -0
  89. package/build/commands/index.js +2 -0
  90. package/build/commands/support-feedback/check-support-feedback.command.js +24 -0
  91. package/build/commands/support-feedback/index.js +18 -0
  92. package/build/commands/support-feedback/upsert-support-feedback.command.js +18 -0
  93. package/build/constants/agents/enums/agent-channel-status.enum.js +9 -0
  94. package/build/constants/agents/enums/agent-channel-type.enum.js +9 -0
  95. package/build/constants/agents/enums/agent-document-status.enum.js +9 -0
  96. package/build/constants/agents/enums/agent-interaction-mode.enum.js +8 -0
  97. package/build/constants/agents/enums/agent-status.enum.js +9 -0
  98. package/build/constants/agents/enums/agent-tool-status.enum.js +9 -0
  99. package/build/constants/agents/enums/agent-tool-type.enum.js +9 -0
  100. package/build/constants/agents/enums/dialog-status.enum.js +11 -0
  101. package/build/constants/agents/enums/index.js +24 -0
  102. package/build/constants/agents/index.js +17 -0
  103. package/build/constants/index.js +1 -0
  104. package/build/models/agents/agent-ai-model.schema.js +14 -0
  105. package/build/models/agents/agent-channel-credentials.schema.js +23 -0
  106. package/build/models/agents/agent-channel.schema.js +17 -0
  107. package/build/models/agents/agent-dialog-lead.schema.js +13 -0
  108. package/build/models/agents/agent-dialog-message.schema.js +13 -0
  109. package/build/models/agents/agent-document-chunk.schema.js +15 -0
  110. package/build/models/agents/agent-document-find-result.schema.js +11 -0
  111. package/build/models/agents/agent-document-search-result.schema.js +13 -0
  112. package/build/models/agents/agent-document.schema.js +18 -0
  113. package/build/models/agents/agent-lead-find-result.schema.js +11 -0
  114. package/build/models/agents/agent-lead-form-field.schema.js +10 -0
  115. package/build/models/agents/agent-lead-form.schema.js +14 -0
  116. package/build/models/agents/agent-lead.schema.js +13 -0
  117. package/build/models/agents/agent-template-catalog.schema.js +16 -0
  118. package/build/models/agents/agent-template-category.schema.js +14 -0
  119. package/build/models/agents/agent-template-instruction.schema.js +15 -0
  120. package/build/models/agents/agent-template.schema.js +18 -0
  121. package/build/models/agents/agent-tool-catalog.schema.js +16 -0
  122. package/build/models/agents/agent-tool-credentials.schema.js +24 -0
  123. package/build/models/agents/agent-tool.schema.js +15 -0
  124. package/build/models/agents/agent.schema.js +25 -0
  125. package/build/models/agents/channel.schema.js +15 -0
  126. package/build/models/agents/dialog-find-result.schema.js +9 -0
  127. package/build/models/agents/dialog-with-messages.schema.js +9 -0
  128. package/build/models/agents/dialog.schema.js +32 -0
  129. package/build/models/agents/index.js +41 -0
  130. package/build/models/index.js +2 -0
  131. package/build/models/support-feedback.schema.js +14 -0
  132. package/commands/agents/agent-ai-model/find-agent-ai-models.command.ts +9 -0
  133. package/commands/agents/agent-ai-model/get-agent-ai-model-by-id.command.ts +14 -0
  134. package/commands/agents/agent-ai-model/index.ts +2 -0
  135. package/commands/agents/agent-channel/create-agent-channel.command.ts +22 -0
  136. package/commands/agents/agent-channel/delete-agent-channel.command.ts +14 -0
  137. package/commands/agents/agent-channel/find-agent-channels-catalog.command.ts +9 -0
  138. package/commands/agents/agent-channel/find-agent-channels.command.ts +14 -0
  139. package/commands/agents/agent-channel/index.ts +5 -0
  140. package/commands/agents/agent-channel/update-agent-channel.command.ts +36 -0
  141. package/commands/agents/agent-dialog/clear-agent-dialog-history.command.ts +16 -0
  142. package/commands/agents/agent-dialog/find-agent-dialogs.command.ts +21 -0
  143. package/commands/agents/agent-dialog/get-agent-dialog-by-id.command.ts +17 -0
  144. package/commands/agents/agent-dialog/index.ts +7 -0
  145. package/commands/agents/agent-dialog/send-agent-dialog-admin-reply.command.ts +26 -0
  146. package/commands/agents/agent-dialog/send-cabinet-message.command.ts +34 -0
  147. package/commands/agents/agent-dialog/start-cabinet-dialog.command.ts +20 -0
  148. package/commands/agents/agent-dialog/update-agent-dialog-status.command.ts +23 -0
  149. package/commands/agents/agent-document/delete-agent-document.command.ts +14 -0
  150. package/commands/agents/agent-document/find-agent-documents.command.ts +20 -0
  151. package/commands/agents/agent-document/index.ts +4 -0
  152. package/commands/agents/agent-document/search-agent-documents.command.ts +21 -0
  153. package/commands/agents/agent-document/upload-agent-document.command.ts +21 -0
  154. package/commands/agents/agent-lead/create-agent-lead.command.ts +16 -0
  155. package/commands/agents/agent-lead/delete-agent-lead.command.ts +13 -0
  156. package/commands/agents/agent-lead/find-agent-leads.command.ts +16 -0
  157. package/commands/agents/agent-lead/get-agent-lead-by-id.command.ts +14 -0
  158. package/commands/agents/agent-lead/index.ts +5 -0
  159. package/commands/agents/agent-lead/update-agent-lead.command.ts +21 -0
  160. package/commands/agents/agent-lead-form/delete-agent-lead-form.command.ts +14 -0
  161. package/commands/agents/agent-lead-form/find-agent-lead-forms.command.ts +16 -0
  162. package/commands/agents/agent-lead-form/get-agent-lead-form-by-agent.command.ts +14 -0
  163. package/commands/agents/agent-lead-form/get-agent-lead-form-by-id.command.ts +14 -0
  164. package/commands/agents/agent-lead-form/index.ts +5 -0
  165. package/commands/agents/agent-lead-form/upsert-agent-lead-form.command.ts +21 -0
  166. package/commands/agents/agent-template/create-agent-template-category.command.ts +17 -0
  167. package/commands/agents/agent-template/create-agent-template-instruction.command.ts +22 -0
  168. package/commands/agents/agent-template/create-agent-template.command.ts +21 -0
  169. package/commands/agents/agent-template/delete-agent-template-category.command.ts +13 -0
  170. package/commands/agents/agent-template/delete-agent-template-instruction.command.ts +14 -0
  171. package/commands/agents/agent-template/delete-agent-template.command.ts +13 -0
  172. package/commands/agents/agent-template/find-agent-template-catalog.command.ts +9 -0
  173. package/commands/agents/agent-template/find-agent-template-categories.command.ts +19 -0
  174. package/commands/agents/agent-template/find-agent-template-instructions.command.ts +22 -0
  175. package/commands/agents/agent-template/find-agent-templates.command.ts +19 -0
  176. package/commands/agents/agent-template/index.ts +13 -0
  177. package/commands/agents/agent-template/update-agent-template-category.command.ts +23 -0
  178. package/commands/agents/agent-template/update-agent-template-instruction.command.ts +24 -0
  179. package/commands/agents/agent-template/update-agent-template.command.ts +27 -0
  180. package/commands/agents/agent-tool/connect-agent-tool.command.ts +22 -0
  181. package/commands/agents/agent-tool/disconnect-agent-tool.command.ts +14 -0
  182. package/commands/agents/agent-tool/find-agent-tools-catalog.command.ts +15 -0
  183. package/commands/agents/agent-tool/find-agent-tools.command.ts +14 -0
  184. package/commands/agents/agent-tool/index.ts +5 -0
  185. package/commands/agents/agent-tool/update-agent-tool.command.ts +23 -0
  186. package/commands/agents/agents/create-agent.command.ts +24 -0
  187. package/commands/agents/agents/delete-agent.command.ts +13 -0
  188. package/commands/agents/agents/find-agents.command.ts +18 -0
  189. package/commands/agents/agents/get-agent-by-id.command.ts +14 -0
  190. package/commands/agents/agents/get-agent-public-info.command.ts +22 -0
  191. package/commands/agents/agents/index.ts +6 -0
  192. package/commands/agents/agents/update-agent.command.ts +32 -0
  193. package/commands/agents/index.ts +9 -0
  194. package/commands/index.ts +2 -0
  195. package/commands/support-feedback/check-support-feedback.command.ts +26 -0
  196. package/commands/support-feedback/index.ts +2 -0
  197. package/commands/support-feedback/upsert-support-feedback.command.ts +20 -0
  198. package/constants/agents/enums/agent-channel-status.enum.ts +5 -0
  199. package/constants/agents/enums/agent-channel-type.enum.ts +5 -0
  200. package/constants/agents/enums/agent-document-status.enum.ts +5 -0
  201. package/constants/agents/enums/agent-interaction-mode.enum.ts +4 -0
  202. package/constants/agents/enums/agent-status.enum.ts +5 -0
  203. package/constants/agents/enums/agent-tool-status.enum.ts +5 -0
  204. package/constants/agents/enums/agent-tool-type.enum.ts +5 -0
  205. package/constants/agents/enums/dialog-status.enum.ts +7 -0
  206. package/constants/agents/enums/index.ts +8 -0
  207. package/constants/agents/index.ts +1 -0
  208. package/constants/index.ts +1 -0
  209. package/models/agents/agent-ai-model.schema.ts +14 -0
  210. package/models/agents/agent-channel-credentials.schema.ts +32 -0
  211. package/models/agents/agent-channel.schema.ts +17 -0
  212. package/models/agents/agent-dialog-lead.schema.ts +13 -0
  213. package/models/agents/agent-dialog-message.schema.ts +13 -0
  214. package/models/agents/agent-document-chunk.schema.ts +15 -0
  215. package/models/agents/agent-document-find-result.schema.ts +11 -0
  216. package/models/agents/agent-document-search-result.schema.ts +16 -0
  217. package/models/agents/agent-document.schema.ts +18 -0
  218. package/models/agents/agent-lead-find-result.schema.ts +11 -0
  219. package/models/agents/agent-lead-form-field.schema.ts +10 -0
  220. package/models/agents/agent-lead-form.schema.ts +14 -0
  221. package/models/agents/agent-lead.schema.ts +13 -0
  222. package/models/agents/agent-template-catalog.schema.ts +22 -0
  223. package/models/agents/agent-template-category.schema.ts +14 -0
  224. package/models/agents/agent-template-instruction.schema.ts +15 -0
  225. package/models/agents/agent-template.schema.ts +18 -0
  226. package/models/agents/agent-tool-catalog.schema.ts +16 -0
  227. package/models/agents/agent-tool-credentials.schema.ts +33 -0
  228. package/models/agents/agent-tool.schema.ts +15 -0
  229. package/models/agents/agent.schema.ts +25 -0
  230. package/models/agents/channel.schema.ts +15 -0
  231. package/models/agents/dialog-find-result.schema.ts +9 -0
  232. package/models/agents/dialog-with-messages.schema.ts +9 -0
  233. package/models/agents/dialog.schema.ts +32 -0
  234. package/models/agents/index.ts +25 -0
  235. package/models/index.ts +2 -0
  236. package/models/support-feedback.schema.ts +12 -0
  237. package/package.json +1 -1
@@ -0,0 +1,9 @@
1
+ import { z } from 'zod';
2
+ import { AgentTemplateCatalogSchema } from '../../../models/agents/agent-template-catalog.schema';
3
+
4
+ export namespace FindAgentTemplateCatalogCommand {
5
+ export const ResponseSchema = z.object({
6
+ data: AgentTemplateCatalogSchema,
7
+ });
8
+ export type Response = z.infer<typeof ResponseSchema>;
9
+ }
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ import { AgentTemplateCategorySchema } from '../../../models/agents/agent-template-category.schema';
3
+
4
+ export namespace FindAgentTemplateCategoriesCommand {
5
+ export const RequestQuerySchema = z.object({
6
+ id: z.string().uuid().optional(),
7
+ slug: z.string().optional(),
8
+ name: z.string().optional(),
9
+ isActive: z.coerce.boolean().optional(),
10
+ limit: z.coerce.number().optional(),
11
+ offset: z.coerce.number().optional(),
12
+ });
13
+ export type RequestQuery = z.infer<typeof RequestQuerySchema>;
14
+
15
+ export const ResponseSchema = z.object({
16
+ data: z.array(AgentTemplateCategorySchema),
17
+ });
18
+ export type Response = z.infer<typeof ResponseSchema>;
19
+ }
@@ -0,0 +1,22 @@
1
+ import { z } from 'zod';
2
+ import { AgentTemplateInstructionSchema } from '../../../models/agents/agent-template-instruction.schema';
3
+
4
+ export namespace FindAgentTemplateInstructionsCommand {
5
+ export const RequestParamsSchema = z.object({
6
+ templateId: z.string().uuid(),
7
+ });
8
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
9
+
10
+ export const RequestQuerySchema = z.object({
11
+ title: z.string().optional(),
12
+ isActive: z.coerce.boolean().optional(),
13
+ limit: z.coerce.number().optional(),
14
+ offset: z.coerce.number().optional(),
15
+ });
16
+ export type RequestQuery = z.infer<typeof RequestQuerySchema>;
17
+
18
+ export const ResponseSchema = z.object({
19
+ data: z.array(AgentTemplateInstructionSchema),
20
+ });
21
+ export type Response = z.infer<typeof ResponseSchema>;
22
+ }
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ import { AgentTemplateSchema } from '../../../models/agents/agent-template.schema';
3
+
4
+ export namespace FindAgentTemplatesCommand {
5
+ export const RequestQuerySchema = z.object({
6
+ id: z.string().uuid().optional(),
7
+ categoryId: z.string().uuid().optional(),
8
+ name: z.string().optional(),
9
+ isActive: z.coerce.boolean().optional(),
10
+ limit: z.coerce.number().optional(),
11
+ offset: z.coerce.number().optional(),
12
+ });
13
+ export type RequestQuery = z.infer<typeof RequestQuerySchema>;
14
+
15
+ export const ResponseSchema = z.object({
16
+ data: z.array(AgentTemplateSchema),
17
+ });
18
+ export type Response = z.infer<typeof ResponseSchema>;
19
+ }
@@ -0,0 +1,13 @@
1
+ export * from './create-agent-template-category.command';
2
+ export * from './create-agent-template-instruction.command';
3
+ export * from './create-agent-template.command';
4
+ export * from './delete-agent-template-category.command';
5
+ export * from './delete-agent-template-instruction.command';
6
+ export * from './delete-agent-template.command';
7
+ export * from './find-agent-template-catalog.command';
8
+ export * from './find-agent-template-categories.command';
9
+ export * from './find-agent-template-instructions.command';
10
+ export * from './find-agent-templates.command';
11
+ export * from './update-agent-template-category.command';
12
+ export * from './update-agent-template-instruction.command';
13
+ export * from './update-agent-template.command';
@@ -0,0 +1,23 @@
1
+ import { z } from 'zod';
2
+ import { AgentTemplateCategorySchema } from '../../../models/agents/agent-template-category.schema';
3
+
4
+ export namespace UpdateAgentTemplateCategoryCommand {
5
+ export const RequestParamsSchema = z.object({
6
+ id: z.string().uuid(),
7
+ });
8
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
9
+
10
+ export const RequestBodySchema = z.object({
11
+ slug: z.string().optional(),
12
+ name: z.string().optional(),
13
+ description: z.string().optional(),
14
+ order: z.number().optional(),
15
+ isActive: z.boolean().optional(),
16
+ });
17
+ export type RequestBody = z.infer<typeof RequestBodySchema>;
18
+
19
+ export const ResponseSchema = z.object({
20
+ data: AgentTemplateCategorySchema,
21
+ });
22
+ export type Response = z.infer<typeof ResponseSchema>;
23
+ }
@@ -0,0 +1,24 @@
1
+ import { z } from 'zod';
2
+ import { AgentTemplateInstructionSchema } from '../../../models/agents/agent-template-instruction.schema';
3
+
4
+ export namespace UpdateAgentTemplateInstructionCommand {
5
+ export const RequestParamsSchema = z.object({
6
+ templateId: z.string().uuid(),
7
+ id: z.string().uuid(),
8
+ });
9
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
10
+
11
+ export const RequestBodySchema = z.object({
12
+ title: z.string().optional(),
13
+ description: z.string().optional(),
14
+ prompt: z.string().optional(),
15
+ order: z.number().optional(),
16
+ isActive: z.boolean().optional(),
17
+ });
18
+ export type RequestBody = z.infer<typeof RequestBodySchema>;
19
+
20
+ export const ResponseSchema = z.object({
21
+ data: AgentTemplateInstructionSchema,
22
+ });
23
+ export type Response = z.infer<typeof ResponseSchema>;
24
+ }
@@ -0,0 +1,27 @@
1
+ import { z } from 'zod';
2
+ import { AGENT_INTERACTION_MODE } from '../../../constants/agents/enums/agent-interaction-mode.enum';
3
+ import { AgentTemplateSchema } from '../../../models/agents/agent-template.schema';
4
+
5
+ export namespace UpdateAgentTemplateCommand {
6
+ export const RequestParamsSchema = z.object({
7
+ id: z.string().uuid(),
8
+ });
9
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
10
+
11
+ export const RequestBodySchema = z.object({
12
+ categoryId: z.string().uuid().optional(),
13
+ name: z.string().optional(),
14
+ description: z.string().optional(),
15
+ iconUrl: z.string().nullable().optional(),
16
+ systemPrompt: z.string().nullable().optional(),
17
+ interactionMode: z.nativeEnum(AGENT_INTERACTION_MODE).optional(),
18
+ order: z.number().optional(),
19
+ isActive: z.boolean().optional(),
20
+ });
21
+ export type RequestBody = z.infer<typeof RequestBodySchema>;
22
+
23
+ export const ResponseSchema = z.object({
24
+ data: AgentTemplateSchema,
25
+ });
26
+ export type Response = z.infer<typeof ResponseSchema>;
27
+ }
@@ -0,0 +1,22 @@
1
+ import { z } from 'zod';
2
+ import { AGENT_TOOL_TYPE } from '../../../constants/agents/enums';
3
+ import { AgentToolCredentialsSchema } from '../../../models/agents/agent-tool-credentials.schema';
4
+ import { AgentToolSchema } from '../../../models/agents/agent-tool.schema';
5
+
6
+ export namespace ConnectAgentToolCommand {
7
+ export const RequestParamsSchema = z.object({
8
+ agentId: z.string().uuid(),
9
+ });
10
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
11
+
12
+ export const RequestBodySchema = z.object({
13
+ toolType: z.nativeEnum(AGENT_TOOL_TYPE),
14
+ credentials: AgentToolCredentialsSchema.nullable().optional(),
15
+ });
16
+ export type RequestBody = z.infer<typeof RequestBodySchema>;
17
+
18
+ export const ResponseSchema = z.object({
19
+ data: AgentToolSchema,
20
+ });
21
+ export type Response = z.infer<typeof ResponseSchema>;
22
+ }
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace DisconnectAgentToolCommand {
4
+ export const RequestParamsSchema = z.object({
5
+ agentId: z.string().uuid(),
6
+ id: z.string().uuid(),
7
+ });
8
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
9
+
10
+ export const ResponseSchema = z.object({
11
+ success: z.boolean(),
12
+ });
13
+ export type Response = z.infer<typeof ResponseSchema>;
14
+ }
@@ -0,0 +1,15 @@
1
+ import { z } from 'zod';
2
+ import { AGENT_TOOL_TYPE } from '../../../constants/agents/enums';
3
+ import { AgentToolCatalogSchema } from '../../../models/agents/agent-tool-catalog.schema';
4
+
5
+ export namespace FindAgentToolsCatalogCommand {
6
+ export const RequestQuerySchema = z.object({
7
+ type: z.nativeEnum(AGENT_TOOL_TYPE).optional(),
8
+ });
9
+ export type RequestQuery = z.infer<typeof RequestQuerySchema>;
10
+
11
+ export const ResponseSchema = z.object({
12
+ data: z.array(AgentToolCatalogSchema),
13
+ });
14
+ export type Response = z.infer<typeof ResponseSchema>;
15
+ }
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+ import { AgentToolSchema } from '../../../models/agents/agent-tool.schema';
3
+
4
+ export namespace FindAgentToolsCommand {
5
+ export const RequestParamsSchema = z.object({
6
+ agentId: z.string().uuid(),
7
+ });
8
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
9
+
10
+ export const ResponseSchema = z.object({
11
+ data: z.array(AgentToolSchema),
12
+ });
13
+ export type Response = z.infer<typeof ResponseSchema>;
14
+ }
@@ -0,0 +1,5 @@
1
+ export * from './find-agent-tools-catalog.command';
2
+ export * from './find-agent-tools.command';
3
+ export * from './connect-agent-tool.command';
4
+ export * from './update-agent-tool.command';
5
+ export * from './disconnect-agent-tool.command';
@@ -0,0 +1,23 @@
1
+ import { z } from 'zod';
2
+ import { AGENT_TOOL_STATUS } from '../../../constants/agents/enums';
3
+ import { AgentToolCredentialsSchema } from '../../../models/agents/agent-tool-credentials.schema';
4
+ import { AgentToolSchema } from '../../../models/agents/agent-tool.schema';
5
+
6
+ export namespace UpdateAgentToolCommand {
7
+ export const RequestParamsSchema = z.object({
8
+ agentId: z.string().uuid(),
9
+ id: z.string().uuid(),
10
+ });
11
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
12
+
13
+ export const RequestBodySchema = z.object({
14
+ credentials: AgentToolCredentialsSchema.nullable().optional(),
15
+ status: z.nativeEnum(AGENT_TOOL_STATUS).optional(),
16
+ });
17
+ export type RequestBody = z.infer<typeof RequestBodySchema>;
18
+
19
+ export const ResponseSchema = z.object({
20
+ data: AgentToolSchema,
21
+ });
22
+ export type Response = z.infer<typeof ResponseSchema>;
23
+ }
@@ -0,0 +1,24 @@
1
+ import { z } from 'zod';
2
+ import { AGENT_INTERACTION_MODE } from '../../../constants/agents/enums/agent-interaction-mode.enum';
3
+ import { AgentSchema } from '../../../models/agents/agent.schema';
4
+
5
+ export namespace CreateAgentCommand {
6
+ export const RequestBodySchema = z.object({
7
+ templateId: z.string().uuid().nullable().optional(),
8
+ name: z.string(),
9
+ icon: z.string().nullable().optional(),
10
+ avatar: z.string().nullable().optional(),
11
+ greetingPhrase: z.string().nullable().optional(),
12
+ instructions: z.string().nullable().optional(),
13
+ aiModelId: z.string().uuid(),
14
+ interactionMode: z.nativeEnum(AGENT_INTERACTION_MODE).optional(),
15
+ isHumanHelp: z.boolean().optional(),
16
+ useDocuments: z.boolean().optional(),
17
+ });
18
+ export type RequestBody = z.infer<typeof RequestBodySchema>;
19
+
20
+ export const ResponseSchema = z.object({
21
+ data: AgentSchema,
22
+ });
23
+ export type Response = z.infer<typeof ResponseSchema>;
24
+ }
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace DeleteAgentCommand {
4
+ export const RequestParamsSchema = z.object({
5
+ id: z.string().uuid(),
6
+ });
7
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
8
+
9
+ export const ResponseSchema = z.object({
10
+ success: z.boolean(),
11
+ });
12
+ export type Response = z.infer<typeof ResponseSchema>;
13
+ }
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+ import { AgentSchema } from '../../../models/agents/agent.schema';
3
+
4
+ export namespace FindAgentsCommand {
5
+ export const RequestQuerySchema = z.object({
6
+ id: z.string().uuid().optional(),
7
+ name: z.string().optional(),
8
+ isHumanHelp: z.coerce.boolean().optional(),
9
+ page: z.coerce.number().optional(),
10
+ limit: z.coerce.number().optional(),
11
+ });
12
+ export type RequestQuery = z.infer<typeof RequestQuerySchema>;
13
+
14
+ export const ResponseSchema = z.object({
15
+ data: z.array(AgentSchema),
16
+ });
17
+ export type Response = z.infer<typeof ResponseSchema>;
18
+ }
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+ import { AgentSchema } from '../../../models/agents/agent.schema';
3
+
4
+ export namespace GetAgentByIdCommand {
5
+ export const RequestParamsSchema = z.object({
6
+ id: z.string().uuid(),
7
+ });
8
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
9
+
10
+ export const ResponseSchema = z.object({
11
+ data: AgentSchema,
12
+ });
13
+ export type Response = z.infer<typeof ResponseSchema>;
14
+ }
@@ -0,0 +1,22 @@
1
+ import { z } from 'zod';
2
+
3
+ export const AgentPublicInfoSchema = z.object({
4
+ greetingPhrase: z.string().nullable(),
5
+ activity: z.boolean(),
6
+ icon: z.string().nullable(),
7
+ avatar: z.string().nullable(),
8
+ });
9
+
10
+ export type AgentPublicInfo = z.infer<typeof AgentPublicInfoSchema>;
11
+
12
+ export namespace GetAgentPublicInfoCommand {
13
+ export const RequestParamsSchema = z.object({
14
+ id: z.string().uuid(),
15
+ });
16
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
17
+
18
+ export const ResponseSchema = z.object({
19
+ data: AgentPublicInfoSchema,
20
+ });
21
+ export type Response = z.infer<typeof ResponseSchema>;
22
+ }
@@ -0,0 +1,6 @@
1
+ export * from './create-agent.command';
2
+ export * from './delete-agent.command';
3
+ export * from './find-agents.command';
4
+ export * from './get-agent-by-id.command';
5
+ export * from './get-agent-public-info.command';
6
+ export * from './update-agent.command';
@@ -0,0 +1,32 @@
1
+ import { z } from 'zod';
2
+ import { AGENT_INTERACTION_MODE } from '../../../constants/agents/enums/agent-interaction-mode.enum';
3
+ import { AGENT_STATUS } from '../../../constants/agents/enums/agent-status.enum';
4
+ import { AgentSchema } from '../../../models/agents/agent.schema';
5
+
6
+ export namespace UpdateAgentCommand {
7
+ export const RequestParamsSchema = z.object({
8
+ id: z.string().uuid(),
9
+ });
10
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
11
+
12
+ export const RequestBodySchema = z.object({
13
+ templateId: z.string().uuid().nullable().optional(),
14
+ name: z.string().optional(),
15
+ description: z.string().optional(),
16
+ icon: z.string().nullable().optional(),
17
+ avatar: z.string().nullable().optional(),
18
+ greetingPhrase: z.string().nullable().optional(),
19
+ instructions: z.string().nullable().optional(),
20
+ aiModelId: z.string().uuid().optional(),
21
+ isHumanHelp: z.boolean().optional(),
22
+ useDocuments: z.boolean().optional(),
23
+ interactionMode: z.nativeEnum(AGENT_INTERACTION_MODE).optional(),
24
+ status: z.nativeEnum(AGENT_STATUS).optional(),
25
+ });
26
+ export type RequestBody = z.infer<typeof RequestBodySchema>;
27
+
28
+ export const ResponseSchema = z.object({
29
+ data: AgentSchema,
30
+ });
31
+ export type Response = z.infer<typeof ResponseSchema>;
32
+ }
@@ -0,0 +1,9 @@
1
+ export * from './agent-ai-model';
2
+ export * from './agent-channel';
3
+ export * from './agent-dialog';
4
+ export * from './agent-lead-form';
5
+ export * from './agent-lead';
6
+ export * from './agent-tool';
7
+ export * from './agent-document';
8
+ export * from './agent-template';
9
+ export * from './agents';
package/commands/index.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './account-merge';
2
+ export * from './agents';
2
3
  export * from './ai-model';
3
4
  export * from './ai-vendor';
4
5
  export * from './auth';
@@ -24,6 +25,7 @@ export * from './product';
24
25
  export * from './question';
25
26
  export * from './referral';
26
27
  export * from './subscription';
28
+ export * from './support-feedback';
27
29
  export * from './task';
28
30
  export * from './telegram';
29
31
  export * from './telegram-auth';
@@ -0,0 +1,26 @@
1
+ import { z } from 'zod';
2
+ import { SupportFeedbackSchema } from '../../models';
3
+
4
+ export namespace CheckSupportFeedbackCommand {
5
+ export const RequestQuerySchema = z.object({
6
+ supportDialogId: z.string().min(1),
7
+ });
8
+
9
+ export type RequestQuery = z.infer<typeof RequestQuerySchema>;
10
+
11
+ export const ResponseSchema = z.object({
12
+ data: z.object({
13
+ hasFeedback: z.boolean(),
14
+ feedback: SupportFeedbackSchema.pick({
15
+ uuid: true,
16
+ supportDialogId: true,
17
+ rating: true,
18
+ comment: true,
19
+ createdAt: true,
20
+ updatedAt: true,
21
+ }).nullable(),
22
+ }),
23
+ });
24
+
25
+ export type Response = z.infer<typeof ResponseSchema>;
26
+ }
@@ -0,0 +1,2 @@
1
+ export * from './check-support-feedback.command';
2
+ export * from './upsert-support-feedback.command';
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ import { SupportFeedbackSchema } from '../../models';
3
+
4
+ export namespace UpsertSupportFeedbackCommand {
5
+ export const RequestSchema = SupportFeedbackSchema.pick({
6
+ supportDialogId: true,
7
+ rating: true,
8
+ comment: true,
9
+ }).partial({
10
+ comment: true,
11
+ });
12
+
13
+ export type Request = z.infer<typeof RequestSchema>;
14
+
15
+ export const ResponseSchema = z.object({
16
+ data: SupportFeedbackSchema,
17
+ });
18
+
19
+ export type Response = z.infer<typeof ResponseSchema>;
20
+ }
@@ -0,0 +1,5 @@
1
+ export enum AGENT_CHANNEL_STATUS {
2
+ ACTIVE = 'active',
3
+ ERROR = 'error',
4
+ PENDING = 'pending',
5
+ }
@@ -0,0 +1,5 @@
1
+ export enum AGENT_CHANNEL_TYPE {
2
+ TELEGRAM = 'telegram',
3
+ WEB = 'web',
4
+ AVITO = 'avito',
5
+ }
@@ -0,0 +1,5 @@
1
+ export enum AGENT_DOCUMENT_STATUS {
2
+ INDEXING = 'indexing',
3
+ UPLOADED = 'uploaded',
4
+ ERROR = 'error',
5
+ }
@@ -0,0 +1,4 @@
1
+ export enum AGENT_INTERACTION_MODE {
2
+ EXTERNAL_ONLY = 'external_only',
3
+ INTERNAL_ONLY = 'internal_only',
4
+ }
@@ -0,0 +1,5 @@
1
+ export enum AGENT_STATUS {
2
+ ACTIVE = 'active',
3
+ STOPPED = 'stopped',
4
+ DRAFT = 'draft',
5
+ }
@@ -0,0 +1,5 @@
1
+ export enum AGENT_TOOL_STATUS {
2
+ ACTIVE = 'active',
3
+ DISABLED = 'disabled',
4
+ ERROR = 'error',
5
+ }
@@ -0,0 +1,5 @@
1
+ export enum AGENT_TOOL_TYPE {
2
+ BITRIX_LEAD = 'BITRIX_LEAD',
3
+ AMO_LEAD = 'AMO_LEAD',
4
+ EMAIL_LEAD = 'EMAIL_LEAD',
5
+ }
@@ -0,0 +1,7 @@
1
+ export enum DIALOG_STATUS {
2
+ IN_PROGRESS = 'inProgress',
3
+ TRANSFERRED_TO_HUMAN = 'transferredToHuman',
4
+ GATHERED_LEAD = 'gatheredLead',
5
+ BANNED = 'banned',
6
+ CLOSED = 'closed',
7
+ }
@@ -0,0 +1,8 @@
1
+ export * from './agent-channel-status.enum';
2
+ export * from './agent-channel-type.enum';
3
+ export * from './agent-interaction-mode.enum';
4
+ export * from './agent-status.enum';
5
+ export * from './agent-tool-type.enum';
6
+ export * from './agent-tool-status.enum';
7
+ export * from './agent-document-status.enum';
8
+ export * from './dialog-status.enum';
@@ -0,0 +1 @@
1
+ export * from './enums';
@@ -1,4 +1,5 @@
1
1
  export * from './ai-model';
2
+ export * from './agents';
2
3
  export * from './blog';
3
4
  export * from './billing';
4
5
  export * from './category';
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+
3
+ export const AgentAiModelSchema = z.object({
4
+ id: z.string().uuid(),
5
+ model: z.string(),
6
+ name: z.string(),
7
+ icon: z.string().nullable(),
8
+ isActive: z.boolean(),
9
+ order: z.number(),
10
+ createdAt: z.date(),
11
+ updatedAt: z.date(),
12
+ });
13
+
14
+ export type AgentAiModel = z.infer<typeof AgentAiModelSchema>;
@@ -0,0 +1,32 @@
1
+ import { z } from 'zod';
2
+ import { AGENT_CHANNEL_TYPE } from '../../constants/agents/enums';
3
+
4
+ export const TelegramChannelCredentialsSchema = z.object({
5
+ type: z.literal(AGENT_CHANNEL_TYPE.TELEGRAM),
6
+ token: z.string().min(1),
7
+ });
8
+
9
+ export type TelegramChannelCredentials = z.infer<typeof TelegramChannelCredentialsSchema>;
10
+
11
+ export const WebChannelCredentialsSchema = z.object({
12
+ type: z.literal(AGENT_CHANNEL_TYPE.WEB),
13
+ domain: z.string().url().optional(),
14
+ });
15
+
16
+ export type WebChannelCredentials = z.infer<typeof WebChannelCredentialsSchema>;
17
+
18
+ export const AvitoChannelCredentialsSchema = z.object({
19
+ type: z.literal(AGENT_CHANNEL_TYPE.AVITO),
20
+ clientId: z.string().min(1),
21
+ clientSecret: z.string().min(1),
22
+ });
23
+
24
+ export type AvitoChannelCredentials = z.infer<typeof AvitoChannelCredentialsSchema>;
25
+
26
+ export const AgentChannelCredentialsSchema = z.discriminatedUnion('type', [
27
+ TelegramChannelCredentialsSchema,
28
+ WebChannelCredentialsSchema,
29
+ AvitoChannelCredentialsSchema,
30
+ ]);
31
+
32
+ export type AgentChannelCredentials = z.infer<typeof AgentChannelCredentialsSchema>;
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+ import { AGENT_CHANNEL_STATUS, AGENT_CHANNEL_TYPE } from '../../constants/agents/enums';
3
+ import { AgentChannelCredentialsSchema } from './agent-channel-credentials.schema';
4
+
5
+ export const AgentChannelSchema = z.object({
6
+ id: z.string().uuid(),
7
+ agentId: z.string().uuid(),
8
+ channelType: z.nativeEnum(AGENT_CHANNEL_TYPE),
9
+ status: z.nativeEnum(AGENT_CHANNEL_STATUS),
10
+ credentials: AgentChannelCredentialsSchema,
11
+ lastCheckedAt: z.date().nullable(),
12
+ lastError: z.string().nullable(),
13
+ createdAt: z.date(),
14
+ updatedAt: z.date(),
15
+ });
16
+
17
+ export type AgentChannel = z.infer<typeof AgentChannelSchema>;
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+
3
+ export const AgentDialogLeadSchema = z.object({
4
+ id: z.string().uuid(),
5
+ dialogId: z.string().uuid(),
6
+ leadFormId: z.string().uuid(),
7
+ data: z.record(z.string(), z.string()),
8
+ isDeleted: z.boolean(),
9
+ createdAt: z.date(),
10
+ updatedAt: z.date(),
11
+ });
12
+
13
+ export type AgentDialogLead = z.infer<typeof AgentDialogLeadSchema>;