@purpleschool/gptbot 0.13.15 → 0.13.18

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 (81) hide show
  1. package/api/controllers/http/agents/agent.ts +6 -0
  2. package/api/controllers/http/index.ts +1 -0
  3. package/api/controllers/http/photo-studio.ts +21 -0
  4. package/build/api/controllers/http/agents/agent.js +3 -0
  5. package/build/api/controllers/http/index.js +1 -0
  6. package/build/api/controllers/http/photo-studio.js +21 -0
  7. package/build/commands/agents/agent-dialog/get-cabinet-price-preview.command.js +26 -0
  8. package/build/commands/agents/agent-dialog/get-dialog-context-length.command.js +30 -0
  9. package/build/commands/agents/agent-dialog/index.js +3 -0
  10. package/build/commands/agents/agent-dialog/send-cabinet-message.command.js +4 -4
  11. package/build/commands/agents/agent-dialog/stop-cabinet-stream.command.js +15 -0
  12. package/build/commands/agents/agent-lead/find-agent-leads.command.js +2 -4
  13. package/build/commands/index.js +1 -0
  14. package/build/commands/photo-studio/add-photo-studio-checkpoint.command.js +17 -0
  15. package/build/commands/photo-studio/clear-photo-studio-checkpoints.command.js +12 -0
  16. package/build/commands/photo-studio/create-photo-studio-canvas.command.js +15 -0
  17. package/build/commands/photo-studio/delete-photo-studio-canvas.command.js +11 -0
  18. package/build/commands/photo-studio/delete-photo-studio-checkpoint.command.js +14 -0
  19. package/build/commands/photo-studio/execute-photo-studio-action.command.js +47 -0
  20. package/build/commands/photo-studio/find-photo-studio-canvas-by-uuid.query.js +12 -0
  21. package/build/commands/photo-studio/find-photo-studio-canvases.query.js +18 -0
  22. package/build/commands/photo-studio/find-photo-studio-checkpoints.query.js +12 -0
  23. package/build/commands/photo-studio/find-photo-studio-job-by-id.query.js +32 -0
  24. package/build/commands/photo-studio/find-photo-studio-jobs.query.js +18 -0
  25. package/build/commands/photo-studio/get-photo-studio-actions.query.js +11 -0
  26. package/build/commands/photo-studio/index.js +31 -0
  27. package/build/commands/photo-studio/save-photo-studio-canvas.command.js +18 -0
  28. package/build/commands/photo-studio/update-photo-studio-canvas.command.js +15 -0
  29. package/build/commands/photo-studio/update-photo-studio-checkpoint.command.js +19 -0
  30. package/build/constants/index.js +1 -0
  31. package/build/constants/photo-studio/enums/index.js +17 -0
  32. package/build/constants/photo-studio/enums/photo-studio-checkpoint-action-type.enum.js +11 -0
  33. package/build/constants/photo-studio/index.js +17 -0
  34. package/build/models/agents/index.js +1 -0
  35. package/build/models/agents/message-attachment.schema.js +21 -0
  36. package/build/models/file.schema.js +7 -1
  37. package/build/models/index.js +1 -0
  38. package/build/models/photo-studio/index.js +20 -0
  39. package/build/models/photo-studio/photo-studio-action.schema.js +17 -0
  40. package/build/models/photo-studio/photo-studio-checkpoint.schema.js +21 -0
  41. package/build/models/photo-studio/photo-studio-image-node.schema.js +19 -0
  42. package/build/models/photo-studio/photo-studio.schema.js +15 -0
  43. package/build/models/tools/image-generation/image-generation-job.schema.js +3 -0
  44. package/commands/agents/agent-dialog/get-cabinet-price-preview.command.ts +28 -0
  45. package/commands/agents/agent-dialog/get-dialog-context-length.command.ts +33 -0
  46. package/commands/agents/agent-dialog/index.ts +3 -0
  47. package/commands/agents/agent-dialog/send-cabinet-message.command.ts +18 -10
  48. package/commands/agents/agent-dialog/stop-cabinet-stream.command.ts +15 -0
  49. package/commands/agents/agent-lead/find-agent-leads.command.ts +2 -4
  50. package/commands/index.ts +1 -0
  51. package/commands/photo-studio/add-photo-studio-checkpoint.command.ts +23 -0
  52. package/commands/photo-studio/clear-photo-studio-checkpoints.command.ts +12 -0
  53. package/commands/photo-studio/create-photo-studio-canvas.command.ts +16 -0
  54. package/commands/photo-studio/delete-photo-studio-canvas.command.ts +11 -0
  55. package/commands/photo-studio/delete-photo-studio-checkpoint.command.ts +14 -0
  56. package/commands/photo-studio/execute-photo-studio-action.command.ts +49 -0
  57. package/commands/photo-studio/find-photo-studio-canvas-by-uuid.query.ts +12 -0
  58. package/commands/photo-studio/find-photo-studio-canvases.query.ts +20 -0
  59. package/commands/photo-studio/find-photo-studio-checkpoints.query.ts +12 -0
  60. package/commands/photo-studio/find-photo-studio-job-by-id.query.ts +36 -0
  61. package/commands/photo-studio/find-photo-studio-jobs.query.ts +20 -0
  62. package/commands/photo-studio/get-photo-studio-actions.query.ts +10 -0
  63. package/commands/photo-studio/index.ts +15 -0
  64. package/commands/photo-studio/save-photo-studio-canvas.command.ts +24 -0
  65. package/commands/photo-studio/update-photo-studio-canvas.command.ts +17 -0
  66. package/commands/photo-studio/update-photo-studio-checkpoint.command.ts +25 -0
  67. package/constants/index.ts +1 -0
  68. package/constants/photo-studio/enums/index.ts +1 -0
  69. package/constants/photo-studio/enums/photo-studio-checkpoint-action-type.enum.ts +7 -0
  70. package/constants/photo-studio/index.ts +1 -0
  71. package/models/agents/index.ts +1 -0
  72. package/models/agents/message-attachment.schema.ts +22 -0
  73. package/models/file.schema.ts +8 -0
  74. package/models/index.ts +1 -0
  75. package/models/photo-studio/index.ts +4 -0
  76. package/models/photo-studio/photo-studio-action.schema.ts +18 -0
  77. package/models/photo-studio/photo-studio-checkpoint.schema.ts +22 -0
  78. package/models/photo-studio/photo-studio-image-node.schema.ts +22 -0
  79. package/models/photo-studio/photo-studio.schema.ts +16 -0
  80. package/models/tools/image-generation/image-generation-job.schema.ts +3 -0
  81. package/package.json +1 -1
@@ -18,6 +18,7 @@ export * from './order';
18
18
  export * from './page';
19
19
  export * from './payment';
20
20
  export * from './presentation';
21
+ export * from './photo-studio';
21
22
  export * from './product';
22
23
  export * from './referral';
23
24
  export * from './roles';
@@ -0,0 +1 @@
1
+ export * from './photo-studio-checkpoint-action-type.enum';
@@ -0,0 +1,7 @@
1
+ export enum PHOTO_STUDIO_CHECKPOINT_ACTION_TYPE {
2
+ ACTION = 'action',
3
+ IMAGE_GENERATED = 'image_generated',
4
+ IMAGE_ADDED = 'image_added',
5
+ IMAGE_DELETED = 'image_deleted',
6
+ CANVAS_SAVED = 'canvas_saved',
7
+ }
@@ -0,0 +1 @@
1
+ export * from './enums';
@@ -24,3 +24,4 @@ export * from './agent.schema';
24
24
  export * from './agent-aggregate.schema';
25
25
  export * from './agent-statistics.schema';
26
26
  export * from './channel.schema';
27
+ export * from './message-attachment.schema';
@@ -0,0 +1,22 @@
1
+ import { z } from 'zod';
2
+
3
+ export const MessageAttachmentTypeEnum = z.enum([
4
+ 'image',
5
+ 'document',
6
+ 'text',
7
+ 'audio',
8
+ 'video',
9
+ 'other',
10
+ ]);
11
+ export type MessageAttachmentType = z.infer<typeof MessageAttachmentTypeEnum>;
12
+
13
+ export const MessageAttachmentInputSchema = z.object({
14
+ fileId: z.string().uuid().optional(),
15
+ url: z.string(),
16
+ mimeType: z.string(),
17
+ type: MessageAttachmentTypeEnum,
18
+ originalName: z.string().optional(),
19
+ content: z.string().optional(),
20
+ contentLength: z.number().int().optional(),
21
+ });
22
+ export type MessageAttachmentInput = z.infer<typeof MessageAttachmentInputSchema>;
@@ -1,10 +1,18 @@
1
1
  import { z } from 'zod';
2
2
  import { FILE_TYPE } from '../constants';
3
3
 
4
+ export const FileResolutionSchema = z.object({
5
+ width: z.number().int().positive(),
6
+ height: z.number().int().positive(),
7
+ });
8
+ export type FileResolution = z.infer<typeof FileResolutionSchema>;
9
+
4
10
  export const FileSchema = z.object({
5
11
  uuid: z.string().uuid(),
6
12
  name: z.string(),
7
13
  size: z.number(),
14
+ originalName: z.string().nullable().optional(),
15
+ resolution: FileResolutionSchema.nullable().optional(),
8
16
  mimeType: z.string(),
9
17
  url: z.string(),
10
18
  key: z.string(),
package/models/index.ts CHANGED
@@ -22,6 +22,7 @@ export * from './file.schema';
22
22
  export * from './key-value.schema';
23
23
  export * from './form-submission.schema';
24
24
  export * from './icon-variants.schema';
25
+ export * from './photo-studio';
25
26
  export * from './lesson.schema';
26
27
  export * from './lesson-translation.schema';
27
28
  export * from './message.schema';
@@ -0,0 +1,4 @@
1
+ export * from './photo-studio-action.schema';
2
+ export * from './photo-studio-checkpoint.schema';
3
+ export * from './photo-studio-image-node.schema';
4
+ export * from './photo-studio.schema';
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+
3
+ export const PhotoStudioImageSettingsSchema = z.object({
4
+ minImages: z.number().int().min(0),
5
+ maxImages: z.number().int().min(1),
6
+ });
7
+ export type PhotoStudioImageSettings = z.infer<typeof PhotoStudioImageSettingsSchema>;
8
+
9
+ export const PhotoStudioActionSchema = z.object({
10
+ alias: z.string().min(1),
11
+ title: z.string().min(1),
12
+ icon: z.string().min(1),
13
+ allowUserPrompt: z.boolean(),
14
+ systemPrompt: z.string().nullable(),
15
+ imageSettings: PhotoStudioImageSettingsSchema,
16
+ params: z.record(z.string(), z.unknown()).default({}),
17
+ });
18
+ export type PhotoStudioAction = z.infer<typeof PhotoStudioActionSchema>;
@@ -0,0 +1,22 @@
1
+ import { z } from 'zod';
2
+ import { PHOTO_STUDIO_CHECKPOINT_ACTION_TYPE } from '../../constants';
3
+ import { PhotoStudioImageNodeSchema } from './photo-studio-image-node.schema';
4
+
5
+ export const PhotoStudioCheckpointActionSchema = z.object({
6
+ type: z.nativeEnum(PHOTO_STUDIO_CHECKPOINT_ACTION_TYPE),
7
+ actionAlias: z.string().nullable().optional(),
8
+ title: z.string().nullable().optional(),
9
+ params: z.record(z.string(), z.unknown()).nullable().optional(),
10
+ });
11
+ export type PhotoStudioCheckpointAction = z.infer<typeof PhotoStudioCheckpointActionSchema>;
12
+
13
+ export const PhotoStudioCheckpointSchema = z.object({
14
+ uuid: z.string().uuid(),
15
+ canvasId: z.string().uuid(),
16
+ sequence: z.number().int().positive(),
17
+ action: PhotoStudioCheckpointActionSchema,
18
+ images: z.array(PhotoStudioImageNodeSchema),
19
+ createdAt: z.date(),
20
+ updatedAt: z.date(),
21
+ });
22
+ export type PhotoStudioCheckpoint = z.infer<typeof PhotoStudioCheckpointSchema>;
@@ -0,0 +1,22 @@
1
+ import { z } from 'zod';
2
+ import { CanvasNodePositionSchema } from '../canvas-node.schema';
3
+ import { FileResolutionSchema } from '../file.schema';
4
+
5
+ export const PhotoStudioImageResolutionSchema = FileResolutionSchema;
6
+ export type PhotoStudioImageResolution = z.infer<typeof PhotoStudioImageResolutionSchema>;
7
+
8
+ export const PhotoStudioImageNodeSchema = z.object({
9
+ uuid: z.string().uuid(),
10
+ fileId: z.string().uuid(),
11
+ url: z.string().url(),
12
+ originalName: z.string().nullable().optional(),
13
+ resolution: PhotoStudioImageResolutionSchema.nullable().optional(),
14
+ position: CanvasNodePositionSchema,
15
+ });
16
+ export type PhotoStudioImageNode = z.infer<typeof PhotoStudioImageNodeSchema>;
17
+
18
+ export const PhotoStudioImageInputSchema = z.object({
19
+ fileId: z.string().uuid(),
20
+ position: CanvasNodePositionSchema,
21
+ });
22
+ export type PhotoStudioImageInput = z.infer<typeof PhotoStudioImageInputSchema>;
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ import { PhotoStudioImageNodeSchema } from './photo-studio-image-node.schema';
3
+
4
+ export const PhotoStudioCanvasSchema = z.object({
5
+ uuid: z.string().uuid(),
6
+ name: z.string(),
7
+ userId: z.string().uuid(),
8
+ createdAt: z.date(),
9
+ updatedAt: z.date(),
10
+ });
11
+ export type PhotoStudioCanvas = z.infer<typeof PhotoStudioCanvasSchema>;
12
+
13
+ export const PhotoStudioCanvasWithImagesSchema = PhotoStudioCanvasSchema.extend({
14
+ images: z.array(PhotoStudioImageNodeSchema),
15
+ });
16
+ export type PhotoStudioCanvasWithImages = z.infer<typeof PhotoStudioCanvasWithImagesSchema>;
@@ -1,6 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { ToolJobSchema } from '../../tool-job.schema';
3
3
  import { IMAGE_GENERATION_RESOLUTION, USER_REACTION } from '../../../constants';
4
+ import { FileResolutionSchema } from '../../file.schema';
4
5
 
5
6
  export const ImageGenerationFileAttachmentSchema = z.object({
6
7
  uuid: z.string(),
@@ -32,6 +33,8 @@ export const ImageGenerationJobSchema = ToolJobSchema.extend({
32
33
  z.object({
33
34
  uuid: z.string(),
34
35
  url: z.string(),
36
+ originalName: z.string().nullable().optional(),
37
+ resolution: FileResolutionSchema.nullable().optional(),
35
38
  }),
36
39
  )
37
40
  .nullable(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.13.15",
3
+ "version": "0.13.18",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",