@purpleschool/gptbot 0.13.26 → 0.13.27
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.
- package/build/commands/agents/agent-document/add-document-from-url.command.js +4 -2
- package/build/models/agents/channel-connection-instruction.schema.js +23 -0
- package/build/models/agents/channel.schema.js +2 -1
- package/build/models/agents/index.js +1 -0
- package/commands/agents/agent-document/add-document-from-url.command.ts +4 -2
- package/models/agents/channel-connection-instruction.schema.ts +36 -0
- package/models/agents/channel.schema.ts +2 -1
- package/models/agents/index.ts +1 -0
- package/package.json +1 -1
|
@@ -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
|
-
|
|
15
|
-
|
|
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,
|
|
@@ -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:
|
|
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);
|
|
@@ -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
|
-
|
|
16
|
-
|
|
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
|
|
|
@@ -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:
|
|
9
|
+
connectionInstruction: ChannelConnectionInstructionSchema.nullable().optional(),
|
|
9
10
|
description: z.string().nullable().optional(),
|
|
10
11
|
order: z.number(),
|
|
11
12
|
createdAt: z.date(),
|
package/models/agents/index.ts
CHANGED