@purpleschool/gptbot 0.13.26 → 0.13.28

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.
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AddDocumentFromUrlCommand = void 0;
4
4
  const zod_1 = require("zod");
5
+ const enums_1 = require("../../../constants/agents/enums");
5
6
  var AddDocumentFromUrlCommand;
6
7
  (function (AddDocumentFromUrlCommand) {
7
8
  AddDocumentFromUrlCommand.RequestParamsSchema = zod_1.z.object({
@@ -11,8 +12,9 @@ var AddDocumentFromUrlCommand;
11
12
  url: zod_1.z.string().url(),
12
13
  });
13
14
  AddDocumentFromUrlCommand.ResponseDataSchema = zod_1.z.object({
14
- sourceId: zod_1.z.string().uuid(),
15
- accepted: zod_1.z.literal(true),
15
+ documentId: zod_1.z.string().uuid(),
16
+ filename: zod_1.z.string(),
17
+ status: zod_1.z.nativeEnum(enums_1.AGENT_DOCUMENT_STATUS),
16
18
  });
17
19
  AddDocumentFromUrlCommand.ResponseSchema = zod_1.z.object({
18
20
  data: AddDocumentFromUrlCommand.ResponseDataSchema,
@@ -17,6 +17,6 @@ var VideoCommand;
17
17
  params: models_1.VideoGenerationRequestParamsSchema,
18
18
  });
19
19
  VideoCommand.ResponseSchema = zod_1.z.object({
20
- data: models_1.ToolJobSchema,
20
+ data: zod_1.z.array(models_1.ToolJobSchema),
21
21
  });
22
22
  })(VideoCommand || (exports.VideoCommand = VideoCommand = {}));
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ChannelConnectionInstructionSchema = exports.WebChannelConnectionInstructionSchema = exports.AvitoChannelConnectionInstructionSchema = exports.TelegramChannelConnectionInstructionSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const enums_1 = require("../../constants/agents/enums");
6
+ exports.TelegramChannelConnectionInstructionSchema = zod_1.z.object({
7
+ type: zod_1.z.literal(enums_1.AGENT_CHANNEL_TYPE.TELEGRAM),
8
+ instruction: zod_1.z.string(),
9
+ });
10
+ exports.AvitoChannelConnectionInstructionSchema = zod_1.z.object({
11
+ type: zod_1.z.literal(enums_1.AGENT_CHANNEL_TYPE.AVITO),
12
+ instruction: zod_1.z.string(),
13
+ });
14
+ exports.WebChannelConnectionInstructionSchema = zod_1.z.object({
15
+ type: zod_1.z.literal(enums_1.AGENT_CHANNEL_TYPE.WEB),
16
+ instruction: zod_1.z.string(),
17
+ script: zod_1.z.string(),
18
+ });
19
+ exports.ChannelConnectionInstructionSchema = zod_1.z.discriminatedUnion('type', [
20
+ exports.TelegramChannelConnectionInstructionSchema,
21
+ exports.WebChannelConnectionInstructionSchema,
22
+ exports.AvitoChannelConnectionInstructionSchema,
23
+ ]);
@@ -3,11 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ChannelSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const enums_1 = require("../../constants/agents/enums");
6
+ const channel_connection_instruction_schema_1 = require("./channel-connection-instruction.schema");
6
7
  exports.ChannelSchema = zod_1.z.object({
7
8
  type: zod_1.z.nativeEnum(enums_1.AGENT_CHANNEL_TYPE),
8
9
  displayName: zod_1.z.string(),
9
10
  icon: zod_1.z.string(),
10
- connectionInstruction: zod_1.z.string().nullable().optional(),
11
+ connectionInstruction: channel_connection_instruction_schema_1.ChannelConnectionInstructionSchema.nullable().optional(),
11
12
  description: zod_1.z.string().nullable().optional(),
12
13
  order: zod_1.z.number(),
13
14
  createdAt: zod_1.z.date(),
@@ -40,4 +40,5 @@ __exportStar(require("./agent.schema"), exports);
40
40
  __exportStar(require("./agent-aggregate.schema"), exports);
41
41
  __exportStar(require("./agent-statistics.schema"), exports);
42
42
  __exportStar(require("./channel.schema"), exports);
43
+ __exportStar(require("./channel-connection-instruction.schema"), exports);
43
44
  __exportStar(require("./message-attachment.schema"), exports);
@@ -17,6 +17,7 @@ exports.VideoJobParamsSchema = zod_1.z.object({
17
17
  resolution: zod_1.z.string().optional(),
18
18
  sound: zod_1.z.boolean().optional(),
19
19
  multiShots: zod_1.z.boolean().optional(),
20
+ batching: zod_1.z.number().int().min(1).max(4).optional(),
20
21
  });
21
22
  exports.VideoJobSchema = tool_job_schema_1.ToolJobSchema.extend({
22
23
  title: zod_1.z.string(),
@@ -52,6 +52,7 @@ exports.VideoGenerationRequestParamsSchema = zod_1.z.object({
52
52
  resolution: zod_1.z.string().optional(),
53
53
  sound: zod_1.z.boolean().optional(),
54
54
  multiShots: zod_1.z.boolean().optional(),
55
+ batching: zod_1.z.number().int().min(1).max(4).optional(),
55
56
  });
56
57
  exports.VideoModelPricingRuleConditionSchema = zod_1.z.object({
57
58
  aspectRatio: zod_1.z.string().optional(),
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { AGENT_DOCUMENT_STATUS } from '../../../constants/agents/enums';
2
3
 
3
4
  export namespace AddDocumentFromUrlCommand {
4
5
  export const RequestParamsSchema = z.object({
@@ -12,8 +13,9 @@ export namespace AddDocumentFromUrlCommand {
12
13
  export type RequestBody = z.infer<typeof RequestBodySchema>;
13
14
 
14
15
  export const ResponseDataSchema = z.object({
15
- sourceId: z.string().uuid(),
16
- accepted: z.literal(true),
16
+ documentId: z.string().uuid(),
17
+ filename: z.string(),
18
+ status: z.nativeEnum(AGENT_DOCUMENT_STATUS),
17
19
  });
18
20
  export type ResponseData = z.infer<typeof ResponseDataSchema>;
19
21
 
@@ -16,7 +16,7 @@ export namespace VideoCommand {
16
16
  export type Request = z.infer<typeof RequestSchema>;
17
17
 
18
18
  export const ResponseSchema = z.object({
19
- data: ToolJobSchema,
19
+ data: z.array(ToolJobSchema),
20
20
  });
21
21
 
22
22
  export type Response = z.infer<typeof ResponseSchema>;
@@ -0,0 +1,36 @@
1
+ import { z } from 'zod';
2
+ import { AGENT_CHANNEL_TYPE } from '../../constants/agents/enums';
3
+
4
+ export const TelegramChannelConnectionInstructionSchema = z.object({
5
+ type: z.literal(AGENT_CHANNEL_TYPE.TELEGRAM),
6
+ instruction: z.string(),
7
+ });
8
+
9
+ export type TelegramChannelConnectionInstruction = z.infer<
10
+ typeof TelegramChannelConnectionInstructionSchema
11
+ >;
12
+
13
+ export const AvitoChannelConnectionInstructionSchema = z.object({
14
+ type: z.literal(AGENT_CHANNEL_TYPE.AVITO),
15
+ instruction: z.string(),
16
+ });
17
+
18
+ export type AvitoChannelConnectionInstruction = z.infer<
19
+ typeof AvitoChannelConnectionInstructionSchema
20
+ >;
21
+
22
+ export const WebChannelConnectionInstructionSchema = z.object({
23
+ type: z.literal(AGENT_CHANNEL_TYPE.WEB),
24
+ instruction: z.string(),
25
+ script: z.string(),
26
+ });
27
+
28
+ export type WebChannelConnectionInstruction = z.infer<typeof WebChannelConnectionInstructionSchema>;
29
+
30
+ export const ChannelConnectionInstructionSchema = z.discriminatedUnion('type', [
31
+ TelegramChannelConnectionInstructionSchema,
32
+ WebChannelConnectionInstructionSchema,
33
+ AvitoChannelConnectionInstructionSchema,
34
+ ]);
35
+
36
+ export type ChannelConnectionInstruction = z.infer<typeof ChannelConnectionInstructionSchema>;
@@ -1,11 +1,12 @@
1
1
  import { z } from 'zod';
2
2
  import { AGENT_CHANNEL_TYPE } from '../../constants/agents/enums';
3
+ import { ChannelConnectionInstructionSchema } from './channel-connection-instruction.schema';
3
4
 
4
5
  export const ChannelSchema = z.object({
5
6
  type: z.nativeEnum(AGENT_CHANNEL_TYPE),
6
7
  displayName: z.string(),
7
8
  icon: z.string(),
8
- connectionInstruction: z.string().nullable().optional(),
9
+ connectionInstruction: ChannelConnectionInstructionSchema.nullable().optional(),
9
10
  description: z.string().nullable().optional(),
10
11
  order: z.number(),
11
12
  createdAt: z.date(),
@@ -24,4 +24,5 @@ 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 './channel-connection-instruction.schema';
27
28
  export * from './message-attachment.schema';
@@ -15,6 +15,7 @@ export const VideoJobParamsSchema = z.object({
15
15
  resolution: z.string().optional(),
16
16
  sound: z.boolean().optional(),
17
17
  multiShots: z.boolean().optional(),
18
+ batching: z.number().int().min(1).max(4).optional(),
18
19
  });
19
20
 
20
21
  export type VideoJobParams = z.infer<typeof VideoJobParamsSchema>;
@@ -51,6 +51,7 @@ export const VideoGenerationRequestParamsSchema = z.object({
51
51
  resolution: z.string().optional(),
52
52
  sound: z.boolean().optional(),
53
53
  multiShots: z.boolean().optional(),
54
+ batching: z.number().int().min(1).max(4).optional(),
54
55
  });
55
56
  export type VideoGenerationRequestParams = z.infer<typeof VideoGenerationRequestParamsSchema>;
56
57
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.13.26",
3
+ "version": "0.13.28",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",