@purpleschool/gptbot-tools 0.1.133 → 0.2.0-stage

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 (305) hide show
  1. package/account-merge/commands/index.ts +1 -0
  2. package/account-merge/commands/transfer-user-jobs.command.ts +13 -0
  3. package/account-merge/index.ts +2 -0
  4. package/account-merge/routes/account-merge.amqp.routes.ts +3 -0
  5. package/account-merge/routes/index.ts +1 -0
  6. package/ai-proxy/routes/ai-proxy.routes.ts +1 -0
  7. package/analytics/index.ts +1 -0
  8. package/analytics/job-model-analytics/commands/get-job-model-analytics.command.ts +12 -0
  9. package/analytics/job-model-analytics/commands/index.ts +1 -0
  10. package/analytics/job-model-analytics/index.ts +2 -0
  11. package/analytics/job-model-analytics/routes/index.ts +1 -0
  12. package/analytics/job-model-analytics/routes/job-model-analytics.http.routes.ts +5 -0
  13. package/build/account-merge/commands/index.js +17 -0
  14. package/build/account-merge/commands/transfer-user-jobs.command.js +13 -0
  15. package/build/account-merge/index.js +18 -0
  16. package/build/account-merge/routes/account-merge.amqp.routes.js +6 -0
  17. package/build/account-merge/routes/index.js +17 -0
  18. package/build/ai-proxy/routes/ai-proxy.routes.js +1 -0
  19. package/build/analytics/index.js +17 -0
  20. package/build/analytics/job-model-analytics/commands/get-job-model-analytics.command.js +11 -0
  21. package/build/analytics/job-model-analytics/commands/index.js +17 -0
  22. package/build/analytics/job-model-analytics/index.js +18 -0
  23. package/build/analytics/job-model-analytics/routes/index.js +17 -0
  24. package/build/analytics/job-model-analytics/routes/job-model-analytics.http.routes.js +7 -0
  25. package/build/common/enums/file-type.enum.js +8 -0
  26. package/build/common/enums/index.js +1 -0
  27. package/build/common/enums/reasoning-effort.enum.js +6 -1
  28. package/build/image-editor/commands/image-editor.command.js +1 -0
  29. package/build/image-editor/models/image-editor-job.schema.js +2 -0
  30. package/build/image-editor/models/image-editor-model.schema.js +6 -0
  31. package/build/image-generation/models/image-generation-job.schema.js +1 -0
  32. package/build/image-generation/models/image-generation-model.schema.js +1 -0
  33. package/build/image-generation/queries/find-image-generation-jobs.query.js +2 -0
  34. package/build/index.js +18 -0
  35. package/build/marketplace-card/commands/execute-marketplace-card.command.js +34 -0
  36. package/build/marketplace-card/commands/get-marketplace-card-price.command.js +13 -0
  37. package/build/marketplace-card/commands/index.js +23 -0
  38. package/build/marketplace-card/commands/retry-marketplace-card-job.command.js +26 -0
  39. package/build/marketplace-card/commands/set-reaction-to-marketplace-card-job.command.js +27 -0
  40. package/build/marketplace-card/commands/soft-delete-all-marketplace-card-jobs.command.js +13 -0
  41. package/build/marketplace-card/commands/soft-delete-marketplace-card-job-by-uuid.command.js +14 -0
  42. package/build/marketplace-card/commands/update-title-marketplace-card-job.command.js +16 -0
  43. package/build/marketplace-card/enums/index.js +17 -0
  44. package/build/marketplace-card/enums/marketplace-card-strategy.enum.js +10 -0
  45. package/build/marketplace-card/index.js +21 -0
  46. package/build/marketplace-card/models/index.js +20 -0
  47. package/build/marketplace-card/models/marketplace-card-config.schema.js +10 -0
  48. package/build/marketplace-card/models/marketplace-card-job.schema.js +34 -0
  49. package/build/marketplace-card/models/marketplace-card-model.schema.js +31 -0
  50. package/build/marketplace-card/models/marketplace-card-style-preset.schema.js +13 -0
  51. package/build/marketplace-card/queries/find-marketplace-card-job-by-uuid.query.js +15 -0
  52. package/build/marketplace-card/queries/find-marketplace-card-jobs.query.js +28 -0
  53. package/build/marketplace-card/queries/get-marketplace-card-config.query.js +11 -0
  54. package/build/marketplace-card/queries/index.js +19 -0
  55. package/build/marketplace-card/routes/index.js +17 -0
  56. package/build/marketplace-card/routes/marketplace-card.amqp.routes.js +15 -0
  57. package/build/presentation/commands/create-presentation.command.js +3 -0
  58. package/build/presentation/commands/generate-slides.command.js +1 -0
  59. package/build/presentation/commands/get-presentation-slides-generation-price.command.js +1 -0
  60. package/build/presentation/commands/index.js +1 -0
  61. package/build/presentation/commands/reposition-slide.command.js +16 -0
  62. package/build/presentation/enums/index.js +1 -0
  63. package/build/presentation/enums/presentation-target-audience.enum.js +10 -0
  64. package/build/presentation/models/index.js +1 -0
  65. package/build/presentation/models/presentation-template.schema.js +2 -0
  66. package/build/presentation/models/presentation-title-page.schema.js +9 -0
  67. package/build/presentation/models/presentation.schema.js +4 -0
  68. package/build/presentation/models/slide-content-edit.schema.js +24 -12
  69. package/build/presentation/models/slide-content.schema.js +215 -73
  70. package/build/presentation/routes/presentation.routes.js +4 -1
  71. package/build/solving-edu-task/commands/delete-all-solving-edu-task-jobs.command.js +13 -0
  72. package/build/solving-edu-task/commands/delete-solving-edu-task-job-by-uuid.command.js +14 -0
  73. package/build/solving-edu-task/commands/get-solving-edu-task-price.command.js +15 -0
  74. package/build/solving-edu-task/commands/index.js +23 -0
  75. package/build/solving-edu-task/commands/retry-solving-edu-task-job.command.js +25 -0
  76. package/build/solving-edu-task/commands/set-reaction-to-solving-edu-task-job.command.js +27 -0
  77. package/build/solving-edu-task/commands/solving-edu-task.command.js +22 -0
  78. package/build/solving-edu-task/commands/update-solving-edu-task-job-title.command.js +16 -0
  79. package/build/solving-edu-task/index.js +20 -0
  80. package/build/solving-edu-task/models/index.js +19 -0
  81. package/build/solving-edu-task/models/solving-edu-task-config.schema.js +8 -0
  82. package/build/solving-edu-task/models/solving-edu-task-job.schema.js +32 -0
  83. package/build/solving-edu-task/models/solving-edu-task-model.schema.js +27 -0
  84. package/build/solving-edu-task/queries/find-solving-edu-task-job-by-id.query.js +15 -0
  85. package/build/solving-edu-task/queries/find-solving-edu-task-jobs.query.js +28 -0
  86. package/build/solving-edu-task/queries/get-solving-edu-task-config.query.js +11 -0
  87. package/build/solving-edu-task/queries/index.js +19 -0
  88. package/build/solving-edu-task/routes/index.js +17 -0
  89. package/build/solving-edu-task/routes/solving-edu-task.amqp.routes.js +15 -0
  90. package/build/spell-corrector/commands/delete-all-spell-corrector-jobs.command.js +13 -0
  91. package/build/spell-corrector/commands/delete-spell-corrector-job-by-uuid.command.js +14 -0
  92. package/build/spell-corrector/commands/get-spell-corrector-price.command.js +15 -0
  93. package/build/spell-corrector/commands/index.js +23 -0
  94. package/build/spell-corrector/commands/retry-spell-corrector-job.command.js +17 -0
  95. package/build/spell-corrector/commands/set-reaction-to-spell-corrector-job.command.js +27 -0
  96. package/build/spell-corrector/commands/spell-corrector.command.js +18 -0
  97. package/build/spell-corrector/commands/update-spell-corrector-job-title.command.js +16 -0
  98. package/build/spell-corrector/index.js +20 -0
  99. package/build/spell-corrector/models/index.js +19 -0
  100. package/build/spell-corrector/models/spell-corrector-job.schema.js +25 -0
  101. package/build/spell-corrector/models/spell-corrector-model.schema.js +18 -0
  102. package/build/spell-corrector/models/spell-corrector-tool-config.schema.js +9 -0
  103. package/build/spell-corrector/queries/find-spell-corrector-job-by-uuid.query.js +10 -0
  104. package/build/spell-corrector/queries/find-spell-corrector-jobs.query.js +28 -0
  105. package/build/spell-corrector/queries/get-spell-corrector-tool-config.query.js +9 -0
  106. package/build/spell-corrector/queries/index.js +19 -0
  107. package/build/spell-corrector/routes/index.js +17 -0
  108. package/build/spell-corrector/routes/spell-corrector.amqp.routes.js +15 -0
  109. package/build/stt/models/stt-response.schema.js +2 -0
  110. package/build/tool-workspace/commands/index.js +18 -0
  111. package/build/tool-workspace/commands/soft-delete-tool-workspace.command.js +21 -0
  112. package/build/tool-workspace/commands/update-tool-workspace.command.js +26 -0
  113. package/build/tool-workspace/enums/index.js +18 -0
  114. package/build/tool-workspace/enums/tool-workspace-item-slot.enum.js +9 -0
  115. package/build/tool-workspace/enums/tool-workspace-status.enum.js +8 -0
  116. package/build/tool-workspace/index.js +21 -0
  117. package/build/tool-workspace/models/index.js +20 -0
  118. package/build/tool-workspace/models/tool-workspace-contents.schema.js +10 -0
  119. package/build/tool-workspace/models/tool-workspace-item.schema.js +17 -0
  120. package/build/tool-workspace/models/tool-workspace-job.schema.js +17 -0
  121. package/build/tool-workspace/models/tool-workspace.schema.js +17 -0
  122. package/build/tool-workspace/queries/find-tool-workspace-by-uuid.query.js +22 -0
  123. package/build/tool-workspace/queries/find-tool-workspaces.query.js +30 -0
  124. package/build/tool-workspace/queries/index.js +18 -0
  125. package/build/tool-workspace/routes/index.js +17 -0
  126. package/build/tool-workspace/routes/tool-workspace.amqp.routes.js +9 -0
  127. package/build/tools/enums/tool-content-type.enum.js +3 -0
  128. package/build/tools/enums/tool-type.enum.js +3 -0
  129. package/build/tools/models/global-tools-config.schema.js +6 -0
  130. package/build/tools/models/tools-with-configs.schema.js +15 -0
  131. package/build/video/commands/video.command.js +7 -0
  132. package/build/video/const/videoMaxDuration.js +1 -1
  133. package/build/video/enums/video-resolution.enum.js +1 -0
  134. package/build/video/enums/video-strategy.enum.js +1 -0
  135. package/build/video/models/video-config.schema.js +2 -0
  136. package/build/video/models/video-model.schema.js +1 -0
  137. package/build/video-editor/commands/edit-video.command.js +1 -0
  138. package/build/video-editor/commands/get-video-editor-price.command.js +2 -0
  139. package/build/video-editor/commands/retry-video-editor-job.command.js +1 -0
  140. package/build/video-editor/enums/index.js +1 -0
  141. package/build/video-editor/enums/video-editor-pricing-rule-type.enum.js +8 -0
  142. package/build/video-editor/models/video-editor-job.schema.js +7 -1
  143. package/build/video-editor/models/video-editor-model.schema.js +28 -1
  144. package/build/video-editor/utils/calculate-video-editing-price.js +24 -2
  145. package/build/writer/commands/collect-sources.command.js +15 -0
  146. package/build/writer/commands/confirm-source-citation-metadata.command.js +18 -0
  147. package/build/writer/commands/discard-writer-source.command.js +16 -0
  148. package/build/writer/commands/generate-document-outline.command.js +17 -0
  149. package/build/writer/commands/index.js +5 -0
  150. package/build/writer/commands/update-writer-document-outline.command.js +1 -0
  151. package/build/writer/commands/upload-writer-source.command.js +18 -0
  152. package/build/writer/enums/index.js +3 -0
  153. package/build/writer/enums/writer-document-stage.enum.js +6 -0
  154. package/build/writer/enums/writer-source-origin.enum.js +8 -0
  155. package/build/writer/enums/writer-source-status.enum.js +9 -0
  156. package/build/writer/enums/writer-source-type.enum.js +8 -0
  157. package/build/writer/models/index.js +2 -0
  158. package/build/writer/models/writer-document-type.schema.js +1 -1
  159. package/build/writer/models/writer-document.schema.js +3 -0
  160. package/build/writer/models/writer-source-bibliographic-metadata.schema.js +27 -0
  161. package/build/writer/models/writer-source.schema.js +22 -0
  162. package/build/writer/queries/get-writer-document-sources.query.js +15 -0
  163. package/build/writer/queries/index.js +1 -0
  164. package/build/writer/routes/writer.routes.js +6 -0
  165. package/common/enums/file-type.enum.ts +4 -0
  166. package/common/enums/index.ts +1 -0
  167. package/common/enums/reasoning-effort.enum.ts +5 -0
  168. package/image-editor/commands/image-editor.command.ts +1 -0
  169. package/image-editor/models/image-editor-job.schema.ts +2 -0
  170. package/image-editor/models/image-editor-model.schema.ts +9 -0
  171. package/image-generation/models/image-generation-job.schema.ts +2 -1
  172. package/image-generation/models/image-generation-model.schema.ts +1 -0
  173. package/image-generation/queries/find-image-generation-jobs.query.ts +2 -0
  174. package/index.ts +18 -0
  175. package/marketplace-card/commands/execute-marketplace-card.command.ts +34 -0
  176. package/marketplace-card/commands/get-marketplace-card-price.command.ts +15 -0
  177. package/marketplace-card/commands/index.ts +7 -0
  178. package/marketplace-card/commands/retry-marketplace-card-job.command.ts +26 -0
  179. package/marketplace-card/commands/set-reaction-to-marketplace-card-job.command.ts +30 -0
  180. package/marketplace-card/commands/soft-delete-all-marketplace-card-jobs.command.ts +13 -0
  181. package/marketplace-card/commands/soft-delete-marketplace-card-job-by-uuid.command.ts +14 -0
  182. package/marketplace-card/commands/update-title-marketplace-card-job.command.ts +16 -0
  183. package/marketplace-card/enums/index.ts +1 -0
  184. package/marketplace-card/enums/marketplace-card-strategy.enum.ts +6 -0
  185. package/marketplace-card/index.ts +5 -0
  186. package/marketplace-card/models/index.ts +4 -0
  187. package/marketplace-card/models/marketplace-card-config.schema.ts +9 -0
  188. package/marketplace-card/models/marketplace-card-job.schema.ts +33 -0
  189. package/marketplace-card/models/marketplace-card-model.schema.ts +34 -0
  190. package/marketplace-card/models/marketplace-card-style-preset.schema.ts +12 -0
  191. package/marketplace-card/queries/find-marketplace-card-job-by-uuid.query.ts +16 -0
  192. package/marketplace-card/queries/find-marketplace-card-jobs.query.ts +33 -0
  193. package/marketplace-card/queries/get-marketplace-card-config.query.ts +10 -0
  194. package/marketplace-card/queries/index.ts +3 -0
  195. package/marketplace-card/routes/index.ts +1 -0
  196. package/marketplace-card/routes/marketplace-card.amqp.routes.ts +12 -0
  197. package/package.json +1 -1
  198. package/presentation/commands/create-presentation.command.ts +3 -0
  199. package/presentation/commands/generate-slides.command.ts +2 -1
  200. package/presentation/commands/get-presentation-slides-generation-price.command.ts +1 -0
  201. package/presentation/commands/index.ts +1 -0
  202. package/presentation/commands/reposition-slide.command.ts +16 -0
  203. package/presentation/enums/index.ts +1 -0
  204. package/presentation/enums/presentation-target-audience.enum.ts +6 -0
  205. package/presentation/models/index.ts +1 -0
  206. package/presentation/models/presentation-template.schema.ts +2 -0
  207. package/presentation/models/presentation-title-page.schema.ts +9 -0
  208. package/presentation/models/presentation.schema.ts +5 -1
  209. package/presentation/models/slide-content-edit.schema.ts +36 -24
  210. package/presentation/models/slide-content.schema.ts +294 -90
  211. package/presentation/routes/presentation.routes.ts +4 -0
  212. package/solving-edu-task/commands/delete-all-solving-edu-task-jobs.command.ts +13 -0
  213. package/solving-edu-task/commands/delete-solving-edu-task-job-by-uuid.command.ts +14 -0
  214. package/solving-edu-task/commands/get-solving-edu-task-price.command.ts +17 -0
  215. package/solving-edu-task/commands/index.ts +7 -0
  216. package/solving-edu-task/commands/retry-solving-edu-task-job.command.ts +25 -0
  217. package/solving-edu-task/commands/set-reaction-to-solving-edu-task-job.command.ts +31 -0
  218. package/solving-edu-task/commands/solving-edu-task.command.ts +22 -0
  219. package/solving-edu-task/commands/update-solving-edu-task-job-title.command.ts +16 -0
  220. package/solving-edu-task/index.ts +4 -0
  221. package/solving-edu-task/models/index.ts +3 -0
  222. package/solving-edu-task/models/solving-edu-task-config.schema.ts +8 -0
  223. package/solving-edu-task/models/solving-edu-task-job.schema.ts +35 -0
  224. package/solving-edu-task/models/solving-edu-task-model.schema.ts +30 -0
  225. package/solving-edu-task/queries/find-solving-edu-task-job-by-id.query.ts +16 -0
  226. package/solving-edu-task/queries/find-solving-edu-task-jobs.query.ts +33 -0
  227. package/solving-edu-task/queries/get-solving-edu-task-config.query.ts +11 -0
  228. package/solving-edu-task/queries/index.ts +3 -0
  229. package/solving-edu-task/routes/index.ts +1 -0
  230. package/solving-edu-task/routes/solving-edu-task.amqp.routes.ts +12 -0
  231. package/spell-corrector/commands/delete-all-spell-corrector-jobs.command.ts +13 -0
  232. package/spell-corrector/commands/delete-spell-corrector-job-by-uuid.command.ts +14 -0
  233. package/spell-corrector/commands/get-spell-corrector-price.command.ts +16 -0
  234. package/spell-corrector/commands/index.ts +7 -0
  235. package/spell-corrector/commands/retry-spell-corrector-job.command.ts +17 -0
  236. package/spell-corrector/commands/set-reaction-to-spell-corrector-job.command.ts +30 -0
  237. package/spell-corrector/commands/spell-corrector.command.ts +18 -0
  238. package/spell-corrector/commands/update-spell-corrector-job-title.command.ts +16 -0
  239. package/spell-corrector/index.ts +4 -0
  240. package/spell-corrector/models/index.ts +3 -0
  241. package/spell-corrector/models/spell-corrector-job.schema.ts +25 -0
  242. package/spell-corrector/models/spell-corrector-model.schema.ts +18 -0
  243. package/spell-corrector/models/spell-corrector-tool-config.schema.ts +9 -0
  244. package/spell-corrector/queries/find-spell-corrector-job-by-uuid.query.ts +11 -0
  245. package/spell-corrector/queries/find-spell-corrector-jobs.query.ts +33 -0
  246. package/spell-corrector/queries/get-spell-corrector-tool-config.query.ts +8 -0
  247. package/spell-corrector/queries/index.ts +3 -0
  248. package/spell-corrector/routes/index.ts +1 -0
  249. package/spell-corrector/routes/spell-corrector.amqp.routes.ts +12 -0
  250. package/stt/models/stt-response.schema.ts +2 -0
  251. package/tool-workspace/commands/index.ts +2 -0
  252. package/tool-workspace/commands/soft-delete-tool-workspace.command.ts +25 -0
  253. package/tool-workspace/commands/update-tool-workspace.command.ts +30 -0
  254. package/tool-workspace/enums/index.ts +2 -0
  255. package/tool-workspace/enums/tool-workspace-item-slot.enum.ts +5 -0
  256. package/tool-workspace/enums/tool-workspace-status.enum.ts +4 -0
  257. package/tool-workspace/index.ts +5 -0
  258. package/tool-workspace/models/index.ts +4 -0
  259. package/tool-workspace/models/tool-workspace-contents.schema.ts +10 -0
  260. package/tool-workspace/models/tool-workspace-item.schema.ts +17 -0
  261. package/tool-workspace/models/tool-workspace-job.schema.ts +17 -0
  262. package/tool-workspace/models/tool-workspace.schema.ts +17 -0
  263. package/tool-workspace/queries/find-tool-workspace-by-uuid.query.ts +26 -0
  264. package/tool-workspace/queries/find-tool-workspaces.query.ts +37 -0
  265. package/tool-workspace/queries/index.ts +2 -0
  266. package/tool-workspace/routes/index.ts +1 -0
  267. package/tool-workspace/routes/tool-workspace.amqp.routes.ts +6 -0
  268. package/tools/enums/tool-content-type.enum.ts +3 -0
  269. package/tools/enums/tool-type.enum.ts +3 -0
  270. package/tools/models/global-tools-config.schema.ts +6 -0
  271. package/tools/models/tools-with-configs.schema.ts +21 -0
  272. package/video/commands/video.command.ts +7 -0
  273. package/video/const/videoMaxDuration.ts +1 -1
  274. package/video/enums/video-resolution.enum.ts +1 -0
  275. package/video/enums/video-strategy.enum.ts +1 -0
  276. package/video/models/video-config.schema.ts +2 -0
  277. package/video/models/video-model.schema.ts +1 -0
  278. package/video-editor/commands/edit-video.command.ts +2 -1
  279. package/video-editor/commands/get-video-editor-price.command.ts +2 -0
  280. package/video-editor/commands/retry-video-editor-job.command.ts +5 -1
  281. package/video-editor/enums/index.ts +1 -0
  282. package/video-editor/enums/video-editor-pricing-rule-type.enum.ts +4 -0
  283. package/video-editor/models/video-editor-job.schema.ts +9 -0
  284. package/video-editor/models/video-editor-model.schema.ts +45 -1
  285. package/video-editor/utils/calculate-video-editing-price.ts +45 -2
  286. package/writer/commands/collect-sources.command.ts +15 -0
  287. package/writer/commands/confirm-source-citation-metadata.command.ts +18 -0
  288. package/writer/commands/discard-writer-source.command.ts +18 -0
  289. package/writer/commands/generate-document-outline.command.ts +17 -0
  290. package/writer/commands/index.ts +5 -0
  291. package/writer/commands/update-writer-document-outline.command.ts +1 -0
  292. package/writer/commands/upload-writer-source.command.ts +18 -0
  293. package/writer/enums/index.ts +3 -0
  294. package/writer/enums/writer-document-stage.enum.ts +8 -0
  295. package/writer/enums/writer-source-origin.enum.ts +4 -0
  296. package/writer/enums/writer-source-status.enum.ts +5 -0
  297. package/writer/enums/writer-source-type.enum.ts +4 -0
  298. package/writer/models/index.ts +2 -0
  299. package/writer/models/writer-document-type.schema.ts +1 -1
  300. package/writer/models/writer-document.schema.ts +3 -0
  301. package/writer/models/writer-source-bibliographic-metadata.schema.ts +31 -0
  302. package/writer/models/writer-source.schema.ts +22 -0
  303. package/writer/queries/get-writer-document-sources.query.ts +15 -0
  304. package/writer/queries/index.ts +1 -0
  305. package/writer/routes/writer.routes.ts +6 -0
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+ import { MarketplaceCardJobSchema } from '../../marketplace-card';
3
+ import { TOOL_TYPE } from '../../tools';
4
+ import { VideoJobSchema } from '../../video';
5
+
6
+ export const ToolWorkspaceJobSchema = z.discriminatedUnion('type', [
7
+ z.object({
8
+ type: z.literal(TOOL_TYPE.MARKETPLACE_CARD_GENERATION),
9
+ job: MarketplaceCardJobSchema,
10
+ }),
11
+ z.object({
12
+ type: z.literal(TOOL_TYPE.VIDEO),
13
+ job: VideoJobSchema,
14
+ }),
15
+ ]);
16
+
17
+ export type ToolWorkspaceJob = z.infer<typeof ToolWorkspaceJobSchema>;
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+ import { TOOL_CONTENT_TYPE } from '../../tools';
3
+ import { TOOL_WORKSPACE_STATUS } from '../enums';
4
+
5
+ export const ToolWorkspaceSchema = z.object({
6
+ uuid: z.string().uuid(),
7
+ toolType: z.nativeEnum(TOOL_CONTENT_TYPE),
8
+ title: z.string(),
9
+ coverUrl: z.string().nullable(),
10
+ status: z.nativeEnum(TOOL_WORKSPACE_STATUS),
11
+ userId: z.string().uuid().nullable().optional(),
12
+ unregisteredUserId: z.string().uuid().nullable().optional(),
13
+ createdAt: z.date(),
14
+ updatedAt: z.date(),
15
+ });
16
+
17
+ export type ToolWorkspace = z.infer<typeof ToolWorkspaceSchema>;
@@ -0,0 +1,26 @@
1
+ import { z } from 'zod';
2
+ import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
+ import { ToolWorkspaceContentsSchema } from '../models';
4
+
5
+ export namespace FindToolWorkspaceByUuidQuery {
6
+ export const RequestSchema = z
7
+ .object({
8
+ uuid: z.string().uuid(),
9
+ userId: z.string().uuid().optional(),
10
+ unregisteredUserId: z.string().uuid().optional(),
11
+ })
12
+ .refine(
13
+ (data) => {
14
+ return Boolean(data.userId) !== Boolean(data.unregisteredUserId);
15
+ },
16
+ {
17
+ message: 'At least userId or unregisteredUserId must be present',
18
+ path: ['userId', 'unregisteredUserId'],
19
+ },
20
+ );
21
+
22
+ export type Request = z.infer<typeof RequestSchema>;
23
+
24
+ export const ResponseSchema = ICommandResponseSchema(ToolWorkspaceContentsSchema.nullable());
25
+ export type Response = z.infer<typeof ResponseSchema>;
26
+ }
@@ -0,0 +1,37 @@
1
+ import { z } from 'zod';
2
+ import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
+ import { TOOL_CONTENT_TYPE } from '../../tools';
4
+ import { ToolWorkspaceSchema } from '../models';
5
+
6
+ export namespace FindToolWorkspacesQuery {
7
+ export const RequestSchema = z
8
+ .object({
9
+ toolType: z.nativeEnum(TOOL_CONTENT_TYPE).optional(),
10
+ title: z.string().optional(),
11
+ userId: z.string().uuid().optional(),
12
+ unregisteredUserId: z.string().uuid().optional(),
13
+ limit: z.coerce.number().min(1).optional(),
14
+ offset: z.coerce.number().min(0).default(0).optional(),
15
+ })
16
+ .refine(
17
+ (data) => {
18
+ return Boolean(data.userId) !== Boolean(data.unregisteredUserId);
19
+ },
20
+ {
21
+ message: 'At least userId or unregisteredUserId must be present',
22
+ path: ['userId', 'unregisteredUserId'],
23
+ },
24
+ );
25
+
26
+ export type Request = z.infer<typeof RequestSchema>;
27
+
28
+ export const ResponseSchema = ICommandResponseSchema(
29
+ z.object({
30
+ data: z.array(ToolWorkspaceSchema),
31
+ page: z.number(),
32
+ totalPages: z.number(),
33
+ }),
34
+ );
35
+
36
+ export type Response = z.infer<typeof ResponseSchema>;
37
+ }
@@ -0,0 +1,2 @@
1
+ export * from './find-tool-workspaces.query';
2
+ export * from './find-tool-workspace-by-uuid.query';
@@ -0,0 +1 @@
1
+ export * from './tool-workspace.amqp.routes';
@@ -0,0 +1,6 @@
1
+ export const TOOL_WORKSPACE_AMQP_ROUTES = {
2
+ UPDATE: 'tools.workspace.update.rpc',
3
+ SOFT_DELETE: 'tools.workspace.soft-delete.rpc',
4
+ GET: 'tools.workspace.get.rpc',
5
+ LIST: 'tools.workspace.list.rpc',
6
+ } as const;
@@ -11,4 +11,7 @@ export enum TOOL_CONTENT_TYPE {
11
11
  MUSIC = 'MUSIC',
12
12
  INTERIOR_DESIGN = 'INTERIOR_DESIGN',
13
13
  NONE = 'NONE',
14
+ MARKETPLACE_CARD_GENERATION = 'MARKETPLACE_CARD',
15
+ SOLVING_EDU_TASK = 'SOLVING_EDU_TASK',
16
+ SPELL_CORRECTOR = 'SPELL_CORRECTOR',
14
17
  }
@@ -12,5 +12,8 @@ export enum TOOL_TYPE {
12
12
  MUSIC = 'MUSIC',
13
13
  MUSIC_ACTION = 'MUSIC_ACTION',
14
14
  IMAGE_GENERATION = 'IMAGE_GENERATION',
15
+ MARKETPLACE_CARD_GENERATION = 'MARKETPLACE_CARD_GENERATION',
15
16
  INTERIOR_DESIGN = 'INTERIOR_DESIGN',
17
+ SPELL_CORRECTOR = 'SPELL_CORRECTOR',
18
+ SOLVING_EDU_TASK = 'SOLVING_EDU_TASK',
16
19
  }
@@ -10,7 +10,10 @@ import { PresentationConfigSchema } from '../../presentation';
10
10
  import { VideoEditorConfigSchema } from '../../video-editor';
11
11
  import { TTSConfigSchema } from '../../tts';
12
12
  import { STTConfigSchema } from '../../stt';
13
+ import { MarketplaceCardConfigSchema } from '../../marketplace-card/models';
13
14
  import { InteriorDesignConfigSchema } from '../../interior-design';
15
+ import { SolvingEduTaskConfigSchema } from '../../solving-edu-task';
16
+ import { SpellCorrectorToolConfigSchema } from '../../spell-corrector';
14
17
 
15
18
  export const GlobalToolsConfigSchema = z.object({
16
19
  [TOOL_CONTENT_TYPE.VIDEO]: VideoConfigSchema,
@@ -23,7 +26,10 @@ export const GlobalToolsConfigSchema = z.object({
23
26
  [TOOL_CONTENT_TYPE.VIDEO_EDITOR]: VideoEditorConfigSchema,
24
27
  [TOOL_CONTENT_TYPE.TEXT_TO_SPEECH]: TTSConfigSchema,
25
28
  [TOOL_CONTENT_TYPE.SPEECH_TO_TEXT]: STTConfigSchema,
29
+ [TOOL_CONTENT_TYPE.MARKETPLACE_CARD_GENERATION]: MarketplaceCardConfigSchema,
26
30
  [TOOL_CONTENT_TYPE.INTERIOR_DESIGN]: InteriorDesignConfigSchema,
31
+ [TOOL_CONTENT_TYPE.SOLVING_EDU_TASK]: SolvingEduTaskConfigSchema,
32
+ [TOOL_CONTENT_TYPE.SPELL_CORRECTOR]: SpellCorrectorToolConfigSchema,
27
33
  });
28
34
 
29
35
  export type GlobalToolsConfig = z.infer<typeof GlobalToolsConfigSchema>;
@@ -10,8 +10,11 @@ import { PresentationConfigSchema } from '../../presentation';
10
10
  import { VideoEditorConfigSchema } from '../../video-editor';
11
11
  import { TTSConfigSchema } from '../../tts';
12
12
  import { STTConfigSchema } from '../../stt';
13
+ import { MarketplaceCardConfigSchema } from '../../marketplace-card/models';
13
14
  import { ToolSchema } from './tool.schema';
14
15
  import { InteriorDesignConfigSchema } from '../../interior-design';
16
+ import { SolvingEduTaskConfigSchema } from '../../solving-edu-task';
17
+ import { SpellCorrectorToolConfigSchema } from '../../spell-corrector';
15
18
 
16
19
  // Discriminated union array: Tools with their configs
17
20
  export const ToolWithConfigSchema = z.discriminatedUnion('contentType', [
@@ -75,12 +78,30 @@ export const ToolWithConfigSchema = z.discriminatedUnion('contentType', [
75
78
  config: STTConfigSchema,
76
79
  }),
77
80
  ),
81
+ ToolSchema.merge(
82
+ z.object({
83
+ contentType: z.literal(TOOL_CONTENT_TYPE.MARKETPLACE_CARD_GENERATION),
84
+ config: MarketplaceCardConfigSchema,
85
+ }),
86
+ ),
78
87
  ToolSchema.merge(
79
88
  z.object({
80
89
  contentType: z.literal(TOOL_CONTENT_TYPE.INTERIOR_DESIGN),
81
90
  config: InteriorDesignConfigSchema,
82
91
  }),
83
92
  ),
93
+ ToolSchema.merge(
94
+ z.object({
95
+ contentType: z.literal(TOOL_CONTENT_TYPE.SOLVING_EDU_TASK),
96
+ config: SolvingEduTaskConfigSchema,
97
+ }),
98
+ ),
99
+ ToolSchema.merge(
100
+ z.object({
101
+ contentType: z.literal(TOOL_CONTENT_TYPE.SPELL_CORRECTOR),
102
+ config: SpellCorrectorToolConfigSchema,
103
+ }),
104
+ ),
84
105
  ]);
85
106
 
86
107
  export type ToolWithConfig = z.infer<typeof ToolWithConfigSchema>;
@@ -1,5 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
+ import { TOOL_WORKSPACE_ITEM_SLOT } from '../../tool-workspace';
4
+ import { TOOL_CONTENT_TYPE } from '../../tools';
3
5
  import { VideoJobSchema } from '../models/video-job.schema';
4
6
  import { VideoGenerationRequestParamsSchema } from '../models';
5
7
 
@@ -7,6 +9,11 @@ export namespace VideoCommand {
7
9
  export const RequestSchema = z.object({
8
10
  userId: z.string().uuid().nullable().optional(),
9
11
  unregisteredUserId: z.string().uuid().nullable().optional(),
12
+ workspaceId: z.string().uuid().nullable().optional(),
13
+ workspaceItemId: z.string().uuid().nullable().optional(),
14
+ workspaceToolType: z.nativeEnum(TOOL_CONTENT_TYPE).nullable().optional(),
15
+ workspaceSlot: z.nativeEnum(TOOL_WORKSPACE_ITEM_SLOT).optional(),
16
+ workspaceOrder: z.number().int().min(0).optional(),
10
17
  prompt: z.string(),
11
18
  modelId: z.string(),
12
19
  params: VideoGenerationRequestParamsSchema,
@@ -1 +1 @@
1
- export const videoMaxDuration = 8;
1
+ export const videoMaxDuration = 15;
@@ -1,4 +1,5 @@
1
1
  export enum VIDEO_RESOLUTION {
2
+ LOW = '480p',
2
3
  STANDART = '720p',
3
4
  HIGH = '1080p',
4
5
  }
@@ -8,4 +8,5 @@ export enum VIDEO_GENERATION_STRATEGY {
8
8
  SEEDANCE_VIDEO_GENERATION_CALLBACK = 'SEEDANCE_VIDEO_GENERATION_CALLBACK',
9
9
  KLING_VIDEO_GENERATION_CALLBACK = 'KLING_VIDEO_GENERATION_CALLBACK',
10
10
  WAN_2_6_VIDEO_GENERATION_CALLBACK = 'WAN_2_6_VIDEO_GENERATION_CALLBACK',
11
+ GROK_VIDEO_GENERATION_CALLBACK = 'GROK_VIDEO_GENERATION_CALLBACK',
11
12
  }
@@ -1,7 +1,9 @@
1
1
  import { z } from 'zod';
2
2
  import { VideoModelSchema } from './video-model.schema';
3
+ import { AiVendorSchema } from '../../ai-vendor';
3
4
 
4
5
  export const VideoConfigSchema = z.object({
6
+ vendors: z.array(AiVendorSchema),
5
7
  models: z.array(VideoModelSchema),
6
8
  });
7
9
 
@@ -83,6 +83,7 @@ export const VideoModelSchema = z.object({
83
83
  params: VideoModelParamsSchema,
84
84
  pricingRules: VideoModelPricingRulesSchema,
85
85
  limitations: z.array(z.nativeEnum(VIDEO_GENERATION_MODEL_LIMITATION)),
86
+ vendorId: z.string().uuid(),
86
87
  createdAt: z.date(),
87
88
  updatedAt: z.date(),
88
89
  });
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
- import { VideoEditorJobSchema } from '../models';
3
+ import { VideoEditorJobSchema, VideoEditorJobParamsSchema } from '../models';
4
4
 
5
5
  export namespace EditVideoCommand {
6
6
  export const RequestSchema = z.object({
@@ -13,6 +13,7 @@ export namespace EditVideoCommand {
13
13
  modelId: z.string().uuid(),
14
14
  tokenReservationId: z.string().uuid(),
15
15
  precalculatedPrice: z.number(),
16
+ params: VideoEditorJobParamsSchema.optional(),
16
17
  });
17
18
  export type Request = z.infer<typeof RequestSchema>;
18
19
 
@@ -1,9 +1,11 @@
1
1
  import { z } from 'zod';
2
2
  import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
+ import { VideoEditorPricingRequestParamsSchema } from '../models';
3
4
 
4
5
  export namespace GetVideoEditorPriceCommand {
5
6
  export const RequestSchema = z.object({
6
7
  modelId: z.string(),
8
+ params: VideoEditorPricingRequestParamsSchema,
7
9
  });
8
10
  export type Request = z.infer<typeof RequestSchema>;
9
11
 
@@ -1,6 +1,9 @@
1
1
  import { z } from 'zod';
2
2
  import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
- import { VideoEditorJobSchema } from '../models/video-editor-job.schema';
3
+ import {
4
+ VideoEditorJobParamsSchema,
5
+ VideoEditorJobSchema,
6
+ } from '../models/video-editor-job.schema';
4
7
 
5
8
  export namespace RetryVideoEditorJobCommand {
6
9
  export const RequestSchema = z.object({
@@ -14,6 +17,7 @@ export namespace RetryVideoEditorJobCommand {
14
17
  modelId: z.string().uuid().optional(),
15
18
  tokenReservationId: z.string().uuid(),
16
19
  precalculatedPrice: z.number(),
20
+ params: VideoEditorJobParamsSchema.optional(),
17
21
  });
18
22
  export type Request = z.infer<typeof RequestSchema>;
19
23
 
@@ -1,2 +1,3 @@
1
1
  export * from './video-editor-model-limitation.enum';
2
+ export * from './video-editor-pricing-rule-type.enum';
2
3
  export * from './video-editor-model-strategy.enum';
@@ -0,0 +1,4 @@
1
+ export enum VIDEO_EDITOR_PRICING_RULE_TYPE {
2
+ FLAT = 'flat',
3
+ PER_SECOND = 'per_second',
4
+ }
@@ -2,6 +2,13 @@ import { z } from 'zod';
2
2
  import { JOB_STATUS } from '../../tools';
3
3
  import { USER_REACTION } from '../../common';
4
4
 
5
+ export const VideoEditorJobParamsSchema = z.object({
6
+ duration: z.number().optional(),
7
+ resolution: z.string().optional(),
8
+ });
9
+
10
+ export type VideoEditorJobParams = z.infer<typeof VideoEditorJobParamsSchema>;
11
+
5
12
  export const VideoEditorJobSchema = z.object({
6
13
  uuid: z.string(),
7
14
  prompt: z.string(),
@@ -17,6 +24,8 @@ export const VideoEditorJobSchema = z.object({
17
24
  inputVideoId: z.string().nullable(),
18
25
  outputVideoUrl: z.string().nullable(),
19
26
  outputVideoId: z.string().nullable(),
27
+ previewUrl: z.string().nullable(),
28
+ params: VideoEditorJobParamsSchema.optional(),
20
29
  duration: z.number(),
21
30
  attempts: z.array(z.any()),
22
31
  userId: z.string().nullable().optional(),
@@ -1,6 +1,48 @@
1
1
  import { z } from 'zod';
2
2
  import { IconVariantsSchema, TOOL_MODEL_STATUS } from '../../common';
3
- import { VIDEO_EDITOR_MODEL_LIMITATION, VIDEO_EDITOR_MODEL_STRATEGY } from '../enums';
3
+ import {
4
+ VIDEO_EDITOR_MODEL_LIMITATION,
5
+ VIDEO_EDITOR_MODEL_STRATEGY,
6
+ VIDEO_EDITOR_PRICING_RULE_TYPE,
7
+ } from '../enums';
8
+
9
+ export const VideoEditorModelParamsSchema = z.object({
10
+ duration: z
11
+ .object({
12
+ options: z.array(z.number()),
13
+ })
14
+ .optional(),
15
+ resolution: z
16
+ .object({
17
+ options: z.array(z.string()),
18
+ })
19
+ .optional(),
20
+ });
21
+
22
+ export type VideoEditorModelParams = z.infer<typeof VideoEditorModelParamsSchema>;
23
+
24
+ export const VideoEditorPricingRequestParamsSchema = z.object({
25
+ duration: z.number(),
26
+ resolution: z.string().optional(),
27
+ });
28
+ export type VideoEditorPricingRequestParams = z.infer<typeof VideoEditorPricingRequestParamsSchema>;
29
+
30
+ export const VideoEditorModelPricingRuleConditionSchema = z.object({
31
+ duration: z.number().optional(),
32
+ resolution: z.string().optional(),
33
+ });
34
+ export type VideoEditorModelPricingRuleCondition = z.infer<
35
+ typeof VideoEditorModelPricingRuleConditionSchema
36
+ >;
37
+
38
+ export const VideoEditorModelPricingRulesSchema = z.array(
39
+ z.object({
40
+ type: z.nativeEnum(VIDEO_EDITOR_PRICING_RULE_TYPE),
41
+ condition: VideoEditorModelPricingRuleConditionSchema,
42
+ value: z.number(),
43
+ }),
44
+ );
45
+ export type VideoEditorModelPricingRules = z.infer<typeof VideoEditorModelPricingRulesSchema>;
4
46
 
5
47
  export const VideoEditorModelSchema = z.object({
6
48
  uuid: z.string(),
@@ -15,6 +57,8 @@ export const VideoEditorModelSchema = z.object({
15
57
  maxInputVideoSizeBytes: z.number(),
16
58
  maxInputVideoDurationInSeconds: z.number(),
17
59
  supportedFormats: z.array(z.string()),
60
+ params: VideoEditorModelParamsSchema,
61
+ pricingRules: VideoEditorModelPricingRulesSchema,
18
62
  needsTranslation: z.boolean(),
19
63
  pricePerCall: z.number(),
20
64
  limitations: z.array(z.nativeEnum(VIDEO_EDITOR_MODEL_LIMITATION)),
@@ -1,3 +1,46 @@
1
- export function calculateVideoEditingPrice({ pricePerCall }: { pricePerCall: number }): number {
2
- return pricePerCall;
1
+ import { VIDEO_EDITOR_PRICING_RULE_TYPE } from '../enums';
2
+ import {
3
+ VideoEditorModelPricingRuleCondition,
4
+ VideoEditorModelPricingRules,
5
+ VideoEditorPricingRequestParams,
6
+ } from '../models';
7
+
8
+ function matchesCondition(
9
+ condition: VideoEditorModelPricingRuleCondition,
10
+ params: VideoEditorPricingRequestParams,
11
+ ): boolean {
12
+ const keys = Object.keys(condition) as (keyof VideoEditorModelPricingRuleCondition)[];
13
+
14
+ return keys.every((key) => {
15
+ const expected = condition[key];
16
+ if (expected === undefined || expected === null || expected === '') return true;
17
+
18
+ const value = params[key];
19
+ if (value === undefined || value === null) return false;
20
+
21
+ return value === expected;
22
+ });
23
+ }
24
+
25
+ export function calculateVideoEditingPrice({
26
+ pricePerCall,
27
+ params,
28
+ rules,
29
+ }: {
30
+ pricePerCall: number;
31
+ params: VideoEditorPricingRequestParams;
32
+ rules: VideoEditorModelPricingRules;
33
+ }): number {
34
+ const perSecondRule = rules
35
+ .filter((r) => r.type === VIDEO_EDITOR_PRICING_RULE_TYPE.PER_SECOND)
36
+ .find((r) => matchesCondition(r.condition, params));
37
+
38
+ const base = perSecondRule ? perSecondRule.value * params.duration : pricePerCall;
39
+
40
+ const flatMarkup = rules.reduce((sum, r) => {
41
+ if (r.type !== VIDEO_EDITOR_PRICING_RULE_TYPE.FLAT) return sum;
42
+ return matchesCondition(r.condition, params) ? sum + r.value : sum;
43
+ }, 0);
44
+
45
+ return Math.ceil(base + flatMarkup);
3
46
  }
@@ -0,0 +1,15 @@
1
+ import { z } from 'zod';
2
+ import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
+ import { WriterDocumentSchema } from '../models';
4
+
5
+ export namespace CollectWriterDocumentSourcesCommand {
6
+ export const RequestSchema = z.object({
7
+ uuid: z.string().uuid(),
8
+ userId: z.string().uuid().nullable().optional(),
9
+ unregisteredUserId: z.string().uuid().nullable().optional(),
10
+ });
11
+ export type Request = z.infer<typeof RequestSchema>;
12
+
13
+ export const ResponseSchema = ICommandResponseSchema(WriterDocumentSchema);
14
+ export type Response = z.infer<typeof ResponseSchema>;
15
+ }
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+ import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
+ import { WriterSourceSchema } from '../models/writer-source.schema';
4
+ import { WriterSourceBibliographicMetadataSchema } from '../models/writer-source-bibliographic-metadata.schema';
5
+
6
+ export namespace ConfirmSourceCitationMetadataCommand {
7
+ export const RequestSchema = z.object({
8
+ documentId: z.string().uuid(),
9
+ sourceId: z.string().uuid(),
10
+ bibliographicMetadata: WriterSourceBibliographicMetadataSchema,
11
+ userId: z.string().uuid().nullable().optional(),
12
+ unregisteredUserId: z.string().uuid().nullable().optional(),
13
+ });
14
+ export type Request = z.infer<typeof RequestSchema>;
15
+
16
+ export const ResponseSchema = ICommandResponseSchema(WriterSourceSchema);
17
+ export type Response = z.infer<typeof ResponseSchema>;
18
+ }
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+ import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
+
4
+ export namespace DiscardWriterSourceCommand {
5
+ export const RequestSchema = z.object({
6
+ sourceId: z.string().uuid(),
7
+ userId: z.string().uuid().nullable().optional(),
8
+ unregisteredUserId: z.string().uuid().nullable().optional(),
9
+ });
10
+ export type Request = z.infer<typeof RequestSchema>;
11
+
12
+ export const ResponseSchema = ICommandResponseSchema(
13
+ z.object({
14
+ isDiscarded: z.boolean(),
15
+ }),
16
+ );
17
+ export type Response = z.infer<typeof ResponseSchema>;
18
+ }
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+ import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
+ import { WriterDocumentSchema } from '../models';
4
+
5
+ export namespace GenerateWriterDocumentOutlineCommand {
6
+ export const RequestSchema = z.object({
7
+ uuid: z.string().uuid(),
8
+ numPages: z.number(),
9
+ description: z.string().nullable().optional(),
10
+ userId: z.string().uuid().nullable().optional(),
11
+ unregisteredUserId: z.string().uuid().nullable().optional(),
12
+ });
13
+ export type Request = z.infer<typeof RequestSchema>;
14
+
15
+ export const ResponseSchema = ICommandResponseSchema(WriterDocumentSchema);
16
+ export type Response = z.infer<typeof ResponseSchema>;
17
+ }
@@ -6,6 +6,7 @@ export * from './update-writer-document-title-page.command';
6
6
  export * from './toggle-writer-document-title-page.command';
7
7
  export * from './export-writer-document-as-docx.command';
8
8
  export * from './generate-document-contents.command';
9
+ export * from './generate-document-outline.command';
9
10
  export * from './get-writer-content-generation-price.command';
10
11
  export * from './writer-paraphrase.command';
11
12
  export * from './writer-extend-text.command';
@@ -14,3 +15,7 @@ export * from './writer-fix-errors.command';
14
15
  export * from './writer-generate-text.command';
15
16
  export * from './update-writer-document-contents.command';
16
17
  export * from './set-reaction-writer-document.command';
18
+ export * from './collect-sources.command';
19
+ export * from './upload-writer-source.command';
20
+ export * from './confirm-source-citation-metadata.command';
21
+ export * from './discard-writer-source.command';
@@ -8,6 +8,7 @@ export namespace UpdateWriterDocumentOutlineCommand {
8
8
  unregisteredUserId: z.string().uuid().nullable().optional(),
9
9
  documentId: z.string().uuid(),
10
10
  data: WriterDocumentOutlineSchema,
11
+ modelId: z.string().uuid().nullable().optional(),
11
12
  });
12
13
  export type Request = z.infer<typeof RequestSchema>;
13
14
 
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+ import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
+ import { WriterSourceSchema } from '../models';
4
+
5
+ export namespace UploadWriterSourceCommand {
6
+ export const RequestSchema = z.object({
7
+ documentId: z.string().uuid(),
8
+ fileId: z.string().uuid(),
9
+ fileUrl: z.string().url(),
10
+ fileMimetype: z.string(),
11
+ userId: z.string().uuid().nullable().optional(),
12
+ unregisteredUserId: z.string().uuid().nullable().optional(),
13
+ });
14
+ export type Request = z.infer<typeof RequestSchema>;
15
+
16
+ export const ResponseSchema = ICommandResponseSchema(WriterSourceSchema);
17
+ export type Response = z.infer<typeof ResponseSchema>;
18
+ }
@@ -4,3 +4,6 @@ export * from './writer-ai-action-type.enum';
4
4
  export * from './writer-document-section-type.enum';
5
5
  export * from './writer-document-stage.enum';
6
6
  export * from './writer-content-generation-strategy.enum';
7
+ export * from './writer-source-type.enum';
8
+ export * from './writer-source-origin.enum';
9
+ export * from './writer-source-status.enum';
@@ -1,10 +1,18 @@
1
1
  export enum WRITER_DOCUMENT_STAGE {
2
2
  CREATED = 'CREATED',
3
3
 
4
+ ANALYZING_TOPIC = 'ANALYZING_TOPIC',
5
+ TOPIC_ANALYZED = 'TOPIC_ANALYZED',
6
+ TOPIC_ANALYSIS_FAILED = 'TOPIC_ANALYSIS_FAILED',
7
+
4
8
  GENERATING_OUTLINE = 'GENERATING_OUTLINE',
5
9
  OUTLINE_GENERATED = 'OUTLINE_GENERATED',
6
10
  OUTLINE_GENERATION_FAILED = 'OUTLINE_GENERATION_FAILED',
7
11
 
12
+ COLLECTING_SOURCES = 'COLLECTING_SOURCES',
13
+ SOURCES_COLLECTED = 'SOURCES_COLLECTED',
14
+ SOURCES_COLLECTION_FAILED = 'SOURCES_COLLECTION_FAILED',
15
+
8
16
  GENERATING_CONTENT = 'GENERATING_CONTENT',
9
17
  CONTENT_GENERATED = 'CONTENT_GENERATED',
10
18
  CONTENT_GENERATION_FAILED = 'CONTENT_GENERATION_FAILED',
@@ -0,0 +1,4 @@
1
+ export enum WRITER_SOURCE_ORIGIN {
2
+ WEB_SEARCH = 'WEB_SEARCH',
3
+ USER_UPLOAD = 'USER_UPLOAD',
4
+ }
@@ -0,0 +1,5 @@
1
+ export enum WRITER_SOURCE_STATUS {
2
+ READY = 'READY',
3
+ REQUIRES_CITATION_METADATA_CONFIRMATION = 'REQUIRES_CITATION_METADATA_CONFIRMATION',
4
+ DISCARDED = 'DISCARDED',
5
+ }
@@ -0,0 +1,4 @@
1
+ export enum WRITER_SOURCE_TYPE {
2
+ JOURNAL_ARTICLE = 'JOURNAL_ARTICLE',
3
+ BOOK = 'BOOK',
4
+ }
@@ -5,3 +5,5 @@ export * from './writer-document-outline.schema';
5
5
  export * from './writer-document-title-page.schema';
6
6
  export * from './writer-document.schema';
7
7
  export * from './writer-document-type.schema';
8
+ export * from './writer-source.schema';
9
+ export * from './writer-source-bibliographic-metadata.schema';
@@ -8,9 +8,9 @@ export const WriterDocumentTypeSchema = z.object({
8
8
  order: z.number(),
9
9
  minPages: z.number(),
10
10
  maxPages: z.number(),
11
+ skipSources: z.boolean(),
11
12
  pageRange: z.array(z.number()),
12
13
  needsTableOfContents: z.boolean(),
13
- needsCitations: z.boolean(),
14
14
  createdAt: z.date(),
15
15
  updatedAt: z.date(),
16
16
  });
@@ -20,6 +20,9 @@ export const WriterDocumentSchema = z.object({
20
20
  modelId: z.string().nullable(),
21
21
  reaction: z.nativeEnum(USER_REACTION).nullable(),
22
22
  dislikeReason: z.string().nullable(),
23
+ description: z.string().nullable(),
24
+ internalError: z.string().nullable(),
25
+ skipSources: z.boolean(),
23
26
  pages: z.number(),
24
27
  isDeleted: z.boolean(),
25
28
  tokenReservationId: z.string().nullable().optional(),