@purpleschool/gptbot 0.13.10 → 0.13.12
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/api/controllers/http/agents/agent-channel.ts +0 -1
- package/api/controllers/http/agents/agent-document.ts +1 -1
- package/api/controllers/http/agents/agent.ts +2 -0
- package/api/controllers/http/canvas-var-generation.ts +7 -0
- package/api/controllers/http/index.ts +1 -0
- package/api/routes.ts +8 -4
- package/build/api/controllers/http/agents/agent-channel.js +0 -1
- package/build/api/controllers/http/agents/agent-document.js +1 -1
- package/build/api/controllers/http/agents/agent.js +2 -0
- package/build/api/controllers/http/canvas-var-generation.js +9 -0
- package/build/api/controllers/http/index.js +1 -0
- package/build/api/routes.js +4 -2
- package/build/commands/agents/agent-channel/update-agent-channel.command.js +1 -13
- package/build/commands/agents/agent-document/get-agent-document-by-id.command.js +15 -0
- package/build/commands/agents/agent-document/index.js +1 -1
- package/build/commands/agents/agent-template/create-agent-template.command.js +2 -1
- package/build/commands/agents/agent-template/find-agent-template-categories.command.js +0 -1
- package/build/commands/agents/agent-template/find-agent-template-instructions.command.js +0 -1
- package/build/commands/agents/agent-template/find-agent-templates.command.js +0 -1
- package/build/commands/agents/agent-template/update-agent-template.command.js +2 -1
- package/build/commands/agents/agents/activate-agent.command.js +14 -0
- package/build/commands/agents/agents/create-agent.command.js +0 -9
- package/build/commands/agents/agents/index.js +2 -0
- package/build/commands/agents/agents/stop-agent.command.js +14 -0
- package/build/commands/ai-studio/canvas-tool/index.js +1 -0
- package/build/commands/ai-studio/canvas-tool/var-gen/generate-variables.command.js +18 -0
- package/build/commands/ai-studio/canvas-tool/var-gen/get-var-gen-config.command.js +11 -0
- package/build/commands/ai-studio/canvas-tool/var-gen/get-var-gen-price.command.js +18 -0
- package/build/commands/ai-studio/canvas-tool/var-gen/index.js +19 -0
- package/build/constants/agents/enums/index.js +1 -1
- package/build/constants/agents/enums/message-sender-type.enum.js +9 -0
- package/build/models/agents/agent-ai-model.schema.js +2 -1
- package/build/models/agents/agent-channel-credentials.schema.js +5 -0
- package/build/models/agents/agent-channel.schema.js +2 -3
- package/build/models/agents/agent-dialog-message.schema.js +2 -1
- package/build/models/agents/agent-template.schema.js +2 -1
- package/build/models/agents/index.js +0 -1
- package/build/models/canvas-node.schema.js +2 -2
- package/commands/agents/agent-channel/update-agent-channel.command.ts +0 -15
- package/commands/agents/agent-document/get-agent-document-by-id.command.ts +15 -0
- package/commands/agents/agent-document/index.ts +1 -1
- package/commands/agents/agent-template/create-agent-template.command.ts +2 -1
- package/commands/agents/agent-template/find-agent-template-categories.command.ts +0 -1
- package/commands/agents/agent-template/find-agent-template-instructions.command.ts +0 -1
- package/commands/agents/agent-template/find-agent-templates.command.ts +0 -1
- package/commands/agents/agent-template/update-agent-template.command.ts +2 -1
- package/commands/agents/agents/activate-agent.command.ts +14 -0
- package/commands/agents/agents/create-agent.command.ts +0 -9
- package/commands/agents/agents/index.ts +2 -0
- package/commands/agents/agents/stop-agent.command.ts +14 -0
- package/commands/ai-studio/canvas-tool/index.ts +1 -0
- package/commands/ai-studio/canvas-tool/var-gen/generate-variables.command.ts +20 -0
- package/commands/ai-studio/canvas-tool/var-gen/get-var-gen-config.command.ts +9 -0
- package/commands/ai-studio/canvas-tool/var-gen/get-var-gen-price.command.ts +18 -0
- package/commands/ai-studio/canvas-tool/var-gen/index.ts +3 -0
- package/commands/b2b/create-api-key.command.ts +3 -1
- package/constants/agents/enums/index.ts +1 -1
- package/constants/agents/enums/message-sender-type.enum.ts +5 -0
- package/models/agents/agent-ai-model.schema.ts +2 -1
- package/models/agents/agent-channel-credentials.schema.ts +5 -0
- package/models/agents/agent-channel.schema.ts +3 -4
- package/models/agents/agent-dialog-message.schema.ts +2 -1
- package/models/agents/agent-template.schema.ts +2 -1
- package/models/agents/index.ts +0 -1
- package/models/canvas-node.schema.ts +2 -2
- package/package.json +1 -1
- package/build/commands/agents/agent-document/search-agent-documents.command.js +0 -19
- package/build/constants/agents/enums/agent-channel-status.enum.js +0 -9
- package/build/models/agents/agent-document-search-result.schema.js +0 -13
- package/commands/agents/agent-document/search-agent-documents.command.ts +0 -21
- package/constants/agents/enums/agent-channel-status.enum.ts +0 -5
- package/models/agents/agent-document-search-result.schema.ts +0 -16
|
@@ -6,5 +6,4 @@ export const AGENT_CHANNEL_ROUTES = {
|
|
|
6
6
|
CREATE: (agentId: string) => `${agentId}`,
|
|
7
7
|
UPDATE: (agentId: string, id: string) => `${agentId}/${id}`,
|
|
8
8
|
DELETE: (agentId: string, id: string) => `${agentId}/${id}`,
|
|
9
|
-
VALIDATE: (agentId: string, id: string) => `${agentId}/${id}/validate`,
|
|
10
9
|
} as const;
|
|
@@ -2,7 +2,7 @@ export const AGENT_DOCUMENT_CONTROLLER_PRIVATE = 'private/agents-documents' as c
|
|
|
2
2
|
|
|
3
3
|
export const AGENT_DOCUMENT_ROUTES = {
|
|
4
4
|
LIST: (agentId: string) => `${agentId}`,
|
|
5
|
-
|
|
5
|
+
GET_BY_ID: (agentId: string, documentId: string) => `${agentId}/${documentId}`,
|
|
6
6
|
DELETE: (agentId: string, documentId: string) => `${agentId}/${documentId}`,
|
|
7
7
|
UPLOAD: (agentId: string) => `${agentId}/upload`,
|
|
8
8
|
} as const;
|
|
@@ -7,6 +7,8 @@ export const AGENT_ROUTES = {
|
|
|
7
7
|
GET_BY_ID: (id: string) => `${id}`,
|
|
8
8
|
GET_AGGREGATE: (id: string) => `${id}/aggregate`,
|
|
9
9
|
UPDATE: (id: string) => `${id}`,
|
|
10
|
+
ACTIVATE: (id: string) => `${id}/activate`,
|
|
11
|
+
STOP: (id: string) => `${id}/stop`,
|
|
10
12
|
DELETE: (id: string) => `${id}`,
|
|
11
13
|
CABINET_START_DIALOG: (agentId: string) => `${agentId}/dialogs/cabinet/start`,
|
|
12
14
|
CABINET_SEND_MESSAGE: (agentId: string, dialogId: string) =>
|
package/api/routes.ts
CHANGED
|
@@ -129,8 +129,14 @@ export const REST_API = {
|
|
|
129
129
|
CREATE: `${ROOT}/${CONTROLLERS.AGENT_CONTROLLER_PRIVATE}`,
|
|
130
130
|
GET_BY_ID: (id: string): string =>
|
|
131
131
|
`${ROOT}/${CONTROLLERS.AGENT_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_ROUTES.GET_BY_ID(id)}`,
|
|
132
|
+
GET_AGGREGATE: (id: string): string =>
|
|
133
|
+
`${ROOT}/${CONTROLLERS.AGENT_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_ROUTES.GET_AGGREGATE(id)}`,
|
|
132
134
|
UPDATE: (id: string): string =>
|
|
133
135
|
`${ROOT}/${CONTROLLERS.AGENT_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_ROUTES.UPDATE(id)}`,
|
|
136
|
+
ACTIVATE: (id: string): string =>
|
|
137
|
+
`${ROOT}/${CONTROLLERS.AGENT_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_ROUTES.ACTIVATE(id)}`,
|
|
138
|
+
STOP: (id: string): string =>
|
|
139
|
+
`${ROOT}/${CONTROLLERS.AGENT_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_ROUTES.STOP(id)}`,
|
|
134
140
|
DELETE: (id: string): string =>
|
|
135
141
|
`${ROOT}/${CONTROLLERS.AGENT_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_ROUTES.DELETE(id)}`,
|
|
136
142
|
CABINET_START_DIALOG: (agentId: string): string =>
|
|
@@ -152,8 +158,6 @@ export const REST_API = {
|
|
|
152
158
|
`${ROOT}/${CONTROLLERS.AGENT_CHANNEL_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_CHANNEL_ROUTES.UPDATE(agentId, id)}`,
|
|
153
159
|
DELETE: (agentId: string, id: string): string =>
|
|
154
160
|
`${ROOT}/${CONTROLLERS.AGENT_CHANNEL_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_CHANNEL_ROUTES.DELETE(agentId, id)}`,
|
|
155
|
-
VALIDATE: (agentId: string, id: string): string =>
|
|
156
|
-
`${ROOT}/${CONTROLLERS.AGENT_CHANNEL_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_CHANNEL_ROUTES.VALIDATE(agentId, id)}`,
|
|
157
161
|
},
|
|
158
162
|
AGENT_LEAD_FORM_PRIVATE: {
|
|
159
163
|
LIST: `${ROOT}/${CONTROLLERS.AGENT_LEAD_FORM_CONTROLLER_PRIVATE}`,
|
|
@@ -179,8 +183,8 @@ export const REST_API = {
|
|
|
179
183
|
AGENT_DOCUMENT_PRIVATE: {
|
|
180
184
|
LIST: (agentId: string): string =>
|
|
181
185
|
`${ROOT}/${CONTROLLERS.AGENT_DOCUMENT_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_DOCUMENT_ROUTES.LIST(agentId)}`,
|
|
182
|
-
|
|
183
|
-
`${ROOT}/${CONTROLLERS.AGENT_DOCUMENT_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_DOCUMENT_ROUTES.
|
|
186
|
+
GET_BY_ID: (agentId: string, documentId: string): string =>
|
|
187
|
+
`${ROOT}/${CONTROLLERS.AGENT_DOCUMENT_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_DOCUMENT_ROUTES.GET_BY_ID(agentId, documentId)}`,
|
|
184
188
|
DELETE: (agentId: string, documentId: string): string =>
|
|
185
189
|
`${ROOT}/${CONTROLLERS.AGENT_DOCUMENT_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_DOCUMENT_ROUTES.DELETE(agentId, documentId)}`,
|
|
186
190
|
},
|
|
@@ -4,7 +4,7 @@ exports.AGENT_DOCUMENT_ROUTES = exports.AGENT_DOCUMENT_CONTROLLER_PRIVATE = void
|
|
|
4
4
|
exports.AGENT_DOCUMENT_CONTROLLER_PRIVATE = 'private/agents-documents';
|
|
5
5
|
exports.AGENT_DOCUMENT_ROUTES = {
|
|
6
6
|
LIST: (agentId) => `${agentId}`,
|
|
7
|
-
|
|
7
|
+
GET_BY_ID: (agentId, documentId) => `${agentId}/${documentId}`,
|
|
8
8
|
DELETE: (agentId, documentId) => `${agentId}/${documentId}`,
|
|
9
9
|
UPLOAD: (agentId) => `${agentId}/upload`,
|
|
10
10
|
};
|
|
@@ -9,6 +9,8 @@ exports.AGENT_ROUTES = {
|
|
|
9
9
|
GET_BY_ID: (id) => `${id}`,
|
|
10
10
|
GET_AGGREGATE: (id) => `${id}/aggregate`,
|
|
11
11
|
UPDATE: (id) => `${id}`,
|
|
12
|
+
ACTIVATE: (id) => `${id}/activate`,
|
|
13
|
+
STOP: (id) => `${id}/stop`,
|
|
12
14
|
DELETE: (id) => `${id}`,
|
|
13
15
|
CABINET_START_DIALOG: (agentId) => `${agentId}/dialogs/cabinet/start`,
|
|
14
16
|
CABINET_SEND_MESSAGE: (agentId, dialogId) => `${agentId}/dialogs/${dialogId}/cabinet/messages`,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CANVAS_VAR_GENERATION_ROUTES = exports.CANVAS_VAR_GENERATION_PRIVATE = void 0;
|
|
4
|
+
exports.CANVAS_VAR_GENERATION_PRIVATE = 'private/ai-canvas/tools/var-gen';
|
|
5
|
+
exports.CANVAS_VAR_GENERATION_ROUTES = {
|
|
6
|
+
CONFIG: 'config',
|
|
7
|
+
PRICE: 'price',
|
|
8
|
+
GENERATE: 'generate',
|
|
9
|
+
};
|
|
@@ -91,4 +91,5 @@ __exportStar(require("./spell-corrector"), exports);
|
|
|
91
91
|
__exportStar(require("./tool-workspace"), exports);
|
|
92
92
|
__exportStar(require("./html-page-builder"), exports);
|
|
93
93
|
__exportStar(require("./palette"), exports);
|
|
94
|
+
__exportStar(require("./canvas-var-generation"), exports);
|
|
94
95
|
__exportStar(require("./canvas-template"), exports);
|
package/build/api/routes.js
CHANGED
|
@@ -139,7 +139,10 @@ exports.REST_API = {
|
|
|
139
139
|
LIST: `${exports.ROOT}/${CONTROLLERS.AGENT_CONTROLLER_PRIVATE}`,
|
|
140
140
|
CREATE: `${exports.ROOT}/${CONTROLLERS.AGENT_CONTROLLER_PRIVATE}`,
|
|
141
141
|
GET_BY_ID: (id) => `${exports.ROOT}/${CONTROLLERS.AGENT_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_ROUTES.GET_BY_ID(id)}`,
|
|
142
|
+
GET_AGGREGATE: (id) => `${exports.ROOT}/${CONTROLLERS.AGENT_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_ROUTES.GET_AGGREGATE(id)}`,
|
|
142
143
|
UPDATE: (id) => `${exports.ROOT}/${CONTROLLERS.AGENT_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_ROUTES.UPDATE(id)}`,
|
|
144
|
+
ACTIVATE: (id) => `${exports.ROOT}/${CONTROLLERS.AGENT_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_ROUTES.ACTIVATE(id)}`,
|
|
145
|
+
STOP: (id) => `${exports.ROOT}/${CONTROLLERS.AGENT_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_ROUTES.STOP(id)}`,
|
|
143
146
|
DELETE: (id) => `${exports.ROOT}/${CONTROLLERS.AGENT_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_ROUTES.DELETE(id)}`,
|
|
144
147
|
CABINET_START_DIALOG: (agentId) => `${exports.ROOT}/${CONTROLLERS.AGENT_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_ROUTES.CABINET_START_DIALOG(agentId)}`,
|
|
145
148
|
CABINET_SEND_MESSAGE: (agentId, dialogId) => `${exports.ROOT}/${CONTROLLERS.AGENT_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_ROUTES.CABINET_SEND_MESSAGE(agentId, dialogId)}`,
|
|
@@ -153,7 +156,6 @@ exports.REST_API = {
|
|
|
153
156
|
CREATE: (agentId) => `${exports.ROOT}/${CONTROLLERS.AGENT_CHANNEL_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_CHANNEL_ROUTES.CREATE(agentId)}`,
|
|
154
157
|
UPDATE: (agentId, id) => `${exports.ROOT}/${CONTROLLERS.AGENT_CHANNEL_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_CHANNEL_ROUTES.UPDATE(agentId, id)}`,
|
|
155
158
|
DELETE: (agentId, id) => `${exports.ROOT}/${CONTROLLERS.AGENT_CHANNEL_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_CHANNEL_ROUTES.DELETE(agentId, id)}`,
|
|
156
|
-
VALIDATE: (agentId, id) => `${exports.ROOT}/${CONTROLLERS.AGENT_CHANNEL_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_CHANNEL_ROUTES.VALIDATE(agentId, id)}`,
|
|
157
159
|
},
|
|
158
160
|
AGENT_LEAD_FORM_PRIVATE: {
|
|
159
161
|
LIST: `${exports.ROOT}/${CONTROLLERS.AGENT_LEAD_FORM_CONTROLLER_PRIVATE}`,
|
|
@@ -172,7 +174,7 @@ exports.REST_API = {
|
|
|
172
174
|
},
|
|
173
175
|
AGENT_DOCUMENT_PRIVATE: {
|
|
174
176
|
LIST: (agentId) => `${exports.ROOT}/${CONTROLLERS.AGENT_DOCUMENT_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_DOCUMENT_ROUTES.LIST(agentId)}`,
|
|
175
|
-
|
|
177
|
+
GET_BY_ID: (agentId, documentId) => `${exports.ROOT}/${CONTROLLERS.AGENT_DOCUMENT_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_DOCUMENT_ROUTES.GET_BY_ID(agentId, documentId)}`,
|
|
176
178
|
DELETE: (agentId, documentId) => `${exports.ROOT}/${CONTROLLERS.AGENT_DOCUMENT_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_DOCUMENT_ROUTES.DELETE(agentId, documentId)}`,
|
|
177
179
|
},
|
|
178
180
|
AGENT_DIALOG_PRIVATE: {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.UpdateAgentChannelCommand = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const enums_1 = require("../../../constants/agents/enums");
|
|
6
5
|
const agent_channel_credentials_schema_1 = require("../../../models/agents/agent-channel-credentials.schema");
|
|
7
6
|
const agent_channel_schema_1 = require("../../../models/agents/agent-channel.schema");
|
|
8
7
|
var UpdateAgentChannelCommand;
|
|
@@ -13,19 +12,8 @@ var UpdateAgentChannelCommand;
|
|
|
13
12
|
});
|
|
14
13
|
UpdateAgentChannelCommand.RequestBodySchema = zod_1.z.object({
|
|
15
14
|
credentials: agent_channel_credentials_schema_1.AgentChannelCredentialsSchema.optional(),
|
|
16
|
-
status: zod_1.z.nativeEnum(enums_1.AGENT_CHANNEL_STATUS).optional(),
|
|
17
15
|
});
|
|
18
16
|
UpdateAgentChannelCommand.ResponseSchema = zod_1.z.object({
|
|
19
17
|
data: agent_channel_schema_1.AgentChannelSchema,
|
|
20
18
|
});
|
|
21
19
|
})(UpdateAgentChannelCommand || (exports.UpdateAgentChannelCommand = UpdateAgentChannelCommand = {}));
|
|
22
|
-
var ValidateAgentChannelCommand;
|
|
23
|
-
(function (ValidateAgentChannelCommand) {
|
|
24
|
-
ValidateAgentChannelCommand.RequestParamsSchema = zod_1.z.object({
|
|
25
|
-
agentId: zod_1.z.string().uuid(),
|
|
26
|
-
id: zod_1.z.string().uuid(),
|
|
27
|
-
});
|
|
28
|
-
ValidateAgentChannelCommand.ResponseSchema = zod_1.z.object({
|
|
29
|
-
data: agent_channel_schema_1.AgentChannelSchema,
|
|
30
|
-
});
|
|
31
|
-
})(ValidateAgentChannelCommand || (exports.ValidateAgentChannelCommand = ValidateAgentChannelCommand = {}));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetAgentDocumentByIdCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const agent_document_schema_1 = require("../../../models/agents/agent-document.schema");
|
|
6
|
+
var GetAgentDocumentByIdCommand;
|
|
7
|
+
(function (GetAgentDocumentByIdCommand) {
|
|
8
|
+
GetAgentDocumentByIdCommand.RequestParamsSchema = zod_1.z.object({
|
|
9
|
+
agentId: zod_1.z.string().uuid(),
|
|
10
|
+
documentId: zod_1.z.string().uuid(),
|
|
11
|
+
});
|
|
12
|
+
GetAgentDocumentByIdCommand.ResponseSchema = zod_1.z.object({
|
|
13
|
+
data: agent_document_schema_1.AgentDocumentSchema,
|
|
14
|
+
});
|
|
15
|
+
})(GetAgentDocumentByIdCommand || (exports.GetAgentDocumentByIdCommand = GetAgentDocumentByIdCommand = {}));
|
|
@@ -15,6 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./find-agent-documents.command"), exports);
|
|
18
|
-
__exportStar(require("./
|
|
18
|
+
__exportStar(require("./get-agent-document-by-id.command"), exports);
|
|
19
19
|
__exportStar(require("./delete-agent-document.command"), exports);
|
|
20
20
|
__exportStar(require("./upload-agent-document.command"), exports);
|
|
@@ -13,7 +13,8 @@ var CreateAgentTemplateCommand;
|
|
|
13
13
|
description: zod_1.z.string(),
|
|
14
14
|
icons: icon_variants_schema_1.IconVariantsSchema.optional(),
|
|
15
15
|
altIcons: icon_variants_schema_1.IconVariantsSchema.optional(),
|
|
16
|
-
|
|
16
|
+
greetingPhrase: zod_1.z.string().nullable().optional(),
|
|
17
|
+
defaultInstructions: zod_1.z.string().nullable().optional(),
|
|
17
18
|
interactionMode: zod_1.z.nativeEnum(agent_interaction_mode_enum_1.AGENT_INTERACTION_MODE).optional(),
|
|
18
19
|
isHumanHelp: zod_1.z.boolean().optional(),
|
|
19
20
|
useDocuments: zod_1.z.boolean().optional(),
|
|
@@ -9,7 +9,6 @@ var FindAgentTemplateCategoriesCommand;
|
|
|
9
9
|
id: zod_1.z.string().uuid().optional(),
|
|
10
10
|
slug: zod_1.z.string().optional(),
|
|
11
11
|
name: zod_1.z.string().optional(),
|
|
12
|
-
isActive: zod_1.z.coerce.boolean().optional(),
|
|
13
12
|
limit: zod_1.z.coerce.number().optional(),
|
|
14
13
|
offset: zod_1.z.coerce.number().optional(),
|
|
15
14
|
});
|
|
@@ -10,7 +10,6 @@ var FindAgentTemplateInstructionsCommand;
|
|
|
10
10
|
});
|
|
11
11
|
FindAgentTemplateInstructionsCommand.RequestQuerySchema = zod_1.z.object({
|
|
12
12
|
title: zod_1.z.string().optional(),
|
|
13
|
-
isActive: zod_1.z.coerce.boolean().optional(),
|
|
14
13
|
limit: zod_1.z.coerce.number().optional(),
|
|
15
14
|
offset: zod_1.z.coerce.number().optional(),
|
|
16
15
|
});
|
|
@@ -9,7 +9,6 @@ var FindAgentTemplatesCommand;
|
|
|
9
9
|
id: zod_1.z.string().uuid().optional(),
|
|
10
10
|
categoryId: zod_1.z.string().uuid().optional(),
|
|
11
11
|
name: zod_1.z.string().optional(),
|
|
12
|
-
isActive: zod_1.z.coerce.boolean().optional(),
|
|
13
12
|
limit: zod_1.z.coerce.number().optional(),
|
|
14
13
|
offset: zod_1.z.coerce.number().optional(),
|
|
15
14
|
});
|
|
@@ -16,7 +16,8 @@ var UpdateAgentTemplateCommand;
|
|
|
16
16
|
description: zod_1.z.string().optional(),
|
|
17
17
|
icons: icon_variants_schema_1.IconVariantsSchema.optional(),
|
|
18
18
|
altIcons: icon_variants_schema_1.IconVariantsSchema.optional(),
|
|
19
|
-
|
|
19
|
+
greetingPhrase: zod_1.z.string().nullable().optional(),
|
|
20
|
+
defaultInstructions: zod_1.z.string().nullable().optional(),
|
|
20
21
|
interactionMode: zod_1.z.nativeEnum(agent_interaction_mode_enum_1.AGENT_INTERACTION_MODE).optional(),
|
|
21
22
|
isHumanHelp: zod_1.z.boolean().optional(),
|
|
22
23
|
useDocuments: zod_1.z.boolean().optional(),
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ActivateAgentCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const agent_schema_1 = require("../../../models/agents/agent.schema");
|
|
6
|
+
var ActivateAgentCommand;
|
|
7
|
+
(function (ActivateAgentCommand) {
|
|
8
|
+
ActivateAgentCommand.RequestParamsSchema = zod_1.z.object({
|
|
9
|
+
id: zod_1.z.string().uuid(),
|
|
10
|
+
});
|
|
11
|
+
ActivateAgentCommand.ResponseSchema = zod_1.z.object({
|
|
12
|
+
data: agent_schema_1.AgentSchema,
|
|
13
|
+
});
|
|
14
|
+
})(ActivateAgentCommand || (exports.ActivateAgentCommand = ActivateAgentCommand = {}));
|
|
@@ -2,22 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CreateAgentCommand = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const agent_interaction_mode_enum_1 = require("../../../constants/agents/enums/agent-interaction-mode.enum");
|
|
6
5
|
const agent_schema_1 = require("../../../models/agents/agent.schema");
|
|
7
|
-
const icon_variants_schema_1 = require("../../../models/icon-variants.schema");
|
|
8
6
|
var CreateAgentCommand;
|
|
9
7
|
(function (CreateAgentCommand) {
|
|
10
8
|
CreateAgentCommand.RequestBodySchema = zod_1.z.object({
|
|
11
9
|
templateId: zod_1.z.string().uuid(),
|
|
12
10
|
name: zod_1.z.string(),
|
|
13
|
-
icons: icon_variants_schema_1.IconVariantsSchema.optional(),
|
|
14
|
-
avatar: zod_1.z.string().nullable().optional(),
|
|
15
|
-
greetingPhrase: zod_1.z.string().nullable().optional(),
|
|
16
|
-
instructions: zod_1.z.string().nullable().optional(),
|
|
17
11
|
aiModelId: zod_1.z.string().uuid(),
|
|
18
|
-
interactionMode: zod_1.z.nativeEnum(agent_interaction_mode_enum_1.AGENT_INTERACTION_MODE).optional(),
|
|
19
|
-
isHumanHelp: zod_1.z.boolean().optional(),
|
|
20
|
-
useDocuments: zod_1.z.boolean().optional(),
|
|
21
12
|
});
|
|
22
13
|
CreateAgentCommand.ResponseSchema = zod_1.z.object({
|
|
23
14
|
data: agent_schema_1.AgentSchema,
|
|
@@ -20,4 +20,6 @@ __exportStar(require("./find-agents.command"), exports);
|
|
|
20
20
|
__exportStar(require("./get-agent-by-id.command"), exports);
|
|
21
21
|
__exportStar(require("./get-agent-public-info.command"), exports);
|
|
22
22
|
__exportStar(require("./get-agent-aggregate.command"), exports);
|
|
23
|
+
__exportStar(require("./activate-agent.command"), exports);
|
|
24
|
+
__exportStar(require("./stop-agent.command"), exports);
|
|
23
25
|
__exportStar(require("./update-agent.command"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StopAgentCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const agent_schema_1 = require("../../../models/agents/agent.schema");
|
|
6
|
+
var StopAgentCommand;
|
|
7
|
+
(function (StopAgentCommand) {
|
|
8
|
+
StopAgentCommand.RequestParamsSchema = zod_1.z.object({
|
|
9
|
+
id: zod_1.z.string().uuid(),
|
|
10
|
+
});
|
|
11
|
+
StopAgentCommand.ResponseSchema = zod_1.z.object({
|
|
12
|
+
data: agent_schema_1.AgentSchema,
|
|
13
|
+
});
|
|
14
|
+
})(StopAgentCommand || (exports.StopAgentCommand = StopAgentCommand = {}));
|
|
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./palette"), exports);
|
|
18
18
|
__exportStar(require("./text-gen"), exports);
|
|
19
|
+
__exportStar(require("./var-gen"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GenerateVariablesCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../../models");
|
|
6
|
+
var GenerateVariablesCommand;
|
|
7
|
+
(function (GenerateVariablesCommand) {
|
|
8
|
+
GenerateVariablesCommand.OutputSchema = models_1.VarGenOutputSchema;
|
|
9
|
+
GenerateVariablesCommand.RequestSchema = zod_1.z.object({
|
|
10
|
+
nodeUuid: zod_1.z.string().uuid(),
|
|
11
|
+
canvasId: zod_1.z.string().uuid(),
|
|
12
|
+
modelId: zod_1.z.string().uuid(),
|
|
13
|
+
prompt: zod_1.z.string().min(1),
|
|
14
|
+
});
|
|
15
|
+
GenerateVariablesCommand.ResponseSchema = zod_1.z.object({
|
|
16
|
+
data: GenerateVariablesCommand.OutputSchema,
|
|
17
|
+
});
|
|
18
|
+
})(GenerateVariablesCommand || (exports.GenerateVariablesCommand = GenerateVariablesCommand = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetVarGenConfigCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../../models");
|
|
6
|
+
var GetVarGenConfigCommand;
|
|
7
|
+
(function (GetVarGenConfigCommand) {
|
|
8
|
+
GetVarGenConfigCommand.ResponseSchema = zod_1.z.object({
|
|
9
|
+
data: zod_1.z.array(models_1.AiModelSchema),
|
|
10
|
+
});
|
|
11
|
+
})(GetVarGenConfigCommand || (exports.GetVarGenConfigCommand = GetVarGenConfigCommand = {}));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetVarGenPriceCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var GetVarGenPriceCommand;
|
|
6
|
+
(function (GetVarGenPriceCommand) {
|
|
7
|
+
GetVarGenPriceCommand.RequestSchema = zod_1.z.object({
|
|
8
|
+
modelId: zod_1.z.string().uuid(),
|
|
9
|
+
promptLength: zod_1.z.coerce.number().int().positive(),
|
|
10
|
+
});
|
|
11
|
+
GetVarGenPriceCommand.ResponseSchema = zod_1.z.object({
|
|
12
|
+
data: zod_1.z.object({
|
|
13
|
+
price: zod_1.z.number(),
|
|
14
|
+
charsUntilNextPriceIncrease: zod_1.z.number().int().nonnegative().nullable().optional(),
|
|
15
|
+
charsUntilNextPriceDecrease: zod_1.z.number().int().nonnegative().nullable().optional(),
|
|
16
|
+
}),
|
|
17
|
+
});
|
|
18
|
+
})(GetVarGenPriceCommand || (exports.GetVarGenPriceCommand = GetVarGenPriceCommand = {}));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./generate-variables.command"), exports);
|
|
18
|
+
__exportStar(require("./get-var-gen-config.command"), exports);
|
|
19
|
+
__exportStar(require("./get-var-gen-price.command"), exports);
|
|
@@ -14,7 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./agent-channel-status.enum"), exports);
|
|
18
17
|
__exportStar(require("./agent-channel-type.enum"), exports);
|
|
19
18
|
__exportStar(require("./agent-interaction-mode.enum"), exports);
|
|
20
19
|
__exportStar(require("./agent-status.enum"), exports);
|
|
@@ -22,3 +21,4 @@ __exportStar(require("./agent-tool-type.enum"), exports);
|
|
|
22
21
|
__exportStar(require("./agent-tool-status.enum"), exports);
|
|
23
22
|
__exportStar(require("./agent-document-status.enum"), exports);
|
|
24
23
|
__exportStar(require("./dialog-status.enum"), exports);
|
|
24
|
+
__exportStar(require("./message-sender-type.enum"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MESSAGE_SENDER_TYPE = void 0;
|
|
4
|
+
var MESSAGE_SENDER_TYPE;
|
|
5
|
+
(function (MESSAGE_SENDER_TYPE) {
|
|
6
|
+
MESSAGE_SENDER_TYPE["USER"] = "user";
|
|
7
|
+
MESSAGE_SENDER_TYPE["AI"] = "ai";
|
|
8
|
+
MESSAGE_SENDER_TYPE["OPERATOR"] = "operator";
|
|
9
|
+
})(MESSAGE_SENDER_TYPE || (exports.MESSAGE_SENDER_TYPE = MESSAGE_SENDER_TYPE = {}));
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AgentAiModelSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const icon_variants_schema_1 = require("../icon-variants.schema");
|
|
5
6
|
exports.AgentAiModelSchema = zod_1.z.object({
|
|
6
7
|
id: zod_1.z.string().uuid(),
|
|
7
8
|
model: zod_1.z.string(),
|
|
8
9
|
name: zod_1.z.string(),
|
|
9
|
-
|
|
10
|
+
icons: icon_variants_schema_1.IconVariantsSchema,
|
|
10
11
|
isActive: zod_1.z.boolean(),
|
|
11
12
|
order: zod_1.z.number(),
|
|
12
13
|
createdAt: zod_1.z.date(),
|
|
@@ -15,6 +15,11 @@ exports.AvitoChannelCredentialsSchema = zod_1.z.object({
|
|
|
15
15
|
type: zod_1.z.literal(enums_1.AGENT_CHANNEL_TYPE.AVITO),
|
|
16
16
|
clientId: zod_1.z.string().min(1),
|
|
17
17
|
clientSecret: zod_1.z.string().min(1),
|
|
18
|
+
accessToken: zod_1.z.string().optional(),
|
|
19
|
+
tokenType: zod_1.z.string().nullable().optional(),
|
|
20
|
+
expiresIn: zod_1.z.number().optional(),
|
|
21
|
+
avitoId: zod_1.z.string().optional(),
|
|
22
|
+
obtainedAt: zod_1.z.string().nullable().optional(),
|
|
18
23
|
});
|
|
19
24
|
exports.AgentChannelCredentialsSchema = zod_1.z.discriminatedUnion('type', [
|
|
20
25
|
exports.TelegramChannelCredentialsSchema,
|
|
@@ -3,13 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AgentChannelSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const enums_1 = require("../../constants/agents/enums");
|
|
6
|
+
const agent_channel_credentials_schema_1 = require("./agent-channel-credentials.schema");
|
|
6
7
|
exports.AgentChannelSchema = zod_1.z.object({
|
|
7
8
|
id: zod_1.z.string().uuid(),
|
|
8
9
|
agentId: zod_1.z.string().uuid(),
|
|
9
10
|
channelType: zod_1.z.nativeEnum(enums_1.AGENT_CHANNEL_TYPE),
|
|
10
|
-
|
|
11
|
-
lastCheckedAt: zod_1.z.date().nullable(),
|
|
12
|
-
lastError: zod_1.z.string().nullable(),
|
|
11
|
+
credentials: agent_channel_credentials_schema_1.AgentChannelCredentialsSchema,
|
|
13
12
|
createdAt: zod_1.z.date(),
|
|
14
13
|
updatedAt: zod_1.z.date(),
|
|
15
14
|
});
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AgentDialogMessageSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const message_sender_type_enum_1 = require("../../constants/agents/enums/message-sender-type.enum");
|
|
5
6
|
exports.AgentDialogMessageSchema = zod_1.z.object({
|
|
6
7
|
id: zod_1.z.string().uuid(),
|
|
7
8
|
text: zod_1.z.string().optional(),
|
|
8
9
|
images: zod_1.z.array(zod_1.z.string()),
|
|
9
10
|
attachments: zod_1.z.array(zod_1.z.string()),
|
|
10
11
|
tokensUsed: zod_1.z.number().optional(),
|
|
11
|
-
|
|
12
|
+
senderType: zod_1.z.nativeEnum(message_sender_type_enum_1.MESSAGE_SENDER_TYPE),
|
|
12
13
|
createdAt: zod_1.z.date(),
|
|
13
14
|
});
|
|
@@ -11,7 +11,8 @@ exports.AgentTemplateSchema = zod_1.z.object({
|
|
|
11
11
|
description: zod_1.z.string(),
|
|
12
12
|
icons: icon_variants_schema_1.IconVariantsSchema,
|
|
13
13
|
altIcons: icon_variants_schema_1.IconVariantsSchema.optional(),
|
|
14
|
-
|
|
14
|
+
greetingPhrase: zod_1.z.string().nullable(),
|
|
15
|
+
defaultInstructions: zod_1.z.string().nullable(),
|
|
15
16
|
interactionMode: zod_1.z.nativeEnum(agent_interaction_mode_enum_1.AGENT_INTERACTION_MODE),
|
|
16
17
|
isHumanHelp: zod_1.z.boolean(),
|
|
17
18
|
useDocuments: zod_1.z.boolean(),
|
|
@@ -36,7 +36,6 @@ __exportStar(require("./agent-tool.schema"), exports);
|
|
|
36
36
|
__exportStar(require("./agent-document.schema"), exports);
|
|
37
37
|
__exportStar(require("./agent-document-find-result.schema"), exports);
|
|
38
38
|
__exportStar(require("./agent-document-chunk.schema"), exports);
|
|
39
|
-
__exportStar(require("./agent-document-search-result.schema"), exports);
|
|
40
39
|
__exportStar(require("./agent.schema"), exports);
|
|
41
40
|
__exportStar(require("./agent-aggregate.schema"), exports);
|
|
42
41
|
__exportStar(require("./channel.schema"), exports);
|
|
@@ -68,7 +68,7 @@ exports.MotionControlParamsSchema = strictObject({
|
|
|
68
68
|
mode: zod_1.z.union([zod_1.z.literal('720p'), zod_1.z.literal('1080p')]),
|
|
69
69
|
});
|
|
70
70
|
exports.VarGenParamsSchema = strictObject({
|
|
71
|
-
prompt: zod_1.z.string(),
|
|
71
|
+
prompt: zod_1.z.string().min(1).optional(),
|
|
72
72
|
modelId: zod_1.z.string(),
|
|
73
73
|
modelName: zod_1.z.string(),
|
|
74
74
|
});
|
|
@@ -101,7 +101,7 @@ exports.MotionControlOutputSchema = strictObject({
|
|
|
101
101
|
resultUrl: zod_1.z.string(),
|
|
102
102
|
});
|
|
103
103
|
exports.VarGenOutputSchema = strictObject({
|
|
104
|
-
variables: zod_1.z.record(zod_1.z.string()),
|
|
104
|
+
variables: zod_1.z.record(zod_1.z.string().min(1), zod_1.z.string()),
|
|
105
105
|
});
|
|
106
106
|
exports.HtmlGenOutputSchema = strictObject({
|
|
107
107
|
sessionId: zod_1.z.string(),
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { AGENT_CHANNEL_STATUS } from '../../../constants/agents/enums';
|
|
3
2
|
import { AgentChannelCredentialsSchema } from '../../../models/agents/agent-channel-credentials.schema';
|
|
4
3
|
import { AgentChannelSchema } from '../../../models/agents/agent-channel.schema';
|
|
5
4
|
|
|
@@ -12,7 +11,6 @@ export namespace UpdateAgentChannelCommand {
|
|
|
12
11
|
|
|
13
12
|
export const RequestBodySchema = z.object({
|
|
14
13
|
credentials: AgentChannelCredentialsSchema.optional(),
|
|
15
|
-
status: z.nativeEnum(AGENT_CHANNEL_STATUS).optional(),
|
|
16
14
|
});
|
|
17
15
|
export type RequestBody = z.infer<typeof RequestBodySchema>;
|
|
18
16
|
|
|
@@ -21,16 +19,3 @@ export namespace UpdateAgentChannelCommand {
|
|
|
21
19
|
});
|
|
22
20
|
export type Response = z.infer<typeof ResponseSchema>;
|
|
23
21
|
}
|
|
24
|
-
|
|
25
|
-
export namespace ValidateAgentChannelCommand {
|
|
26
|
-
export const RequestParamsSchema = z.object({
|
|
27
|
-
agentId: z.string().uuid(),
|
|
28
|
-
id: z.string().uuid(),
|
|
29
|
-
});
|
|
30
|
-
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
31
|
-
|
|
32
|
-
export const ResponseSchema = z.object({
|
|
33
|
-
data: AgentChannelSchema,
|
|
34
|
-
});
|
|
35
|
-
export type Response = z.infer<typeof ResponseSchema>;
|
|
36
|
-
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AgentDocumentSchema } from '../../../models/agents/agent-document.schema';
|
|
3
|
+
|
|
4
|
+
export namespace GetAgentDocumentByIdCommand {
|
|
5
|
+
export const RequestParamsSchema = z.object({
|
|
6
|
+
agentId: z.string().uuid(),
|
|
7
|
+
documentId: z.string().uuid(),
|
|
8
|
+
});
|
|
9
|
+
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
10
|
+
|
|
11
|
+
export const ResponseSchema = z.object({
|
|
12
|
+
data: AgentDocumentSchema,
|
|
13
|
+
});
|
|
14
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
15
|
+
}
|
|
@@ -10,7 +10,8 @@ export namespace CreateAgentTemplateCommand {
|
|
|
10
10
|
description: z.string(),
|
|
11
11
|
icons: IconVariantsSchema.optional(),
|
|
12
12
|
altIcons: IconVariantsSchema.optional(),
|
|
13
|
-
|
|
13
|
+
greetingPhrase: z.string().nullable().optional(),
|
|
14
|
+
defaultInstructions: z.string().nullable().optional(),
|
|
14
15
|
interactionMode: z.nativeEnum(AGENT_INTERACTION_MODE).optional(),
|
|
15
16
|
isHumanHelp: z.boolean().optional(),
|
|
16
17
|
useDocuments: z.boolean().optional(),
|
|
@@ -6,7 +6,6 @@ export namespace FindAgentTemplateCategoriesCommand {
|
|
|
6
6
|
id: z.string().uuid().optional(),
|
|
7
7
|
slug: z.string().optional(),
|
|
8
8
|
name: z.string().optional(),
|
|
9
|
-
isActive: z.coerce.boolean().optional(),
|
|
10
9
|
limit: z.coerce.number().optional(),
|
|
11
10
|
offset: z.coerce.number().optional(),
|
|
12
11
|
});
|
|
@@ -9,7 +9,6 @@ export namespace FindAgentTemplateInstructionsCommand {
|
|
|
9
9
|
|
|
10
10
|
export const RequestQuerySchema = z.object({
|
|
11
11
|
title: z.string().optional(),
|
|
12
|
-
isActive: z.coerce.boolean().optional(),
|
|
13
12
|
limit: z.coerce.number().optional(),
|
|
14
13
|
offset: z.coerce.number().optional(),
|
|
15
14
|
});
|
|
@@ -6,7 +6,6 @@ export namespace FindAgentTemplatesCommand {
|
|
|
6
6
|
id: z.string().uuid().optional(),
|
|
7
7
|
categoryId: z.string().uuid().optional(),
|
|
8
8
|
name: z.string().optional(),
|
|
9
|
-
isActive: z.coerce.boolean().optional(),
|
|
10
9
|
limit: z.coerce.number().optional(),
|
|
11
10
|
offset: z.coerce.number().optional(),
|
|
12
11
|
});
|
|
@@ -15,7 +15,8 @@ export namespace UpdateAgentTemplateCommand {
|
|
|
15
15
|
description: z.string().optional(),
|
|
16
16
|
icons: IconVariantsSchema.optional(),
|
|
17
17
|
altIcons: IconVariantsSchema.optional(),
|
|
18
|
-
|
|
18
|
+
greetingPhrase: z.string().nullable().optional(),
|
|
19
|
+
defaultInstructions: z.string().nullable().optional(),
|
|
19
20
|
interactionMode: z.nativeEnum(AGENT_INTERACTION_MODE).optional(),
|
|
20
21
|
isHumanHelp: z.boolean().optional(),
|
|
21
22
|
useDocuments: z.boolean().optional(),
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AgentSchema } from '../../../models/agents/agent.schema';
|
|
3
|
+
|
|
4
|
+
export namespace ActivateAgentCommand {
|
|
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
|
+
}
|
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { AGENT_INTERACTION_MODE } from '../../../constants/agents/enums/agent-interaction-mode.enum';
|
|
3
2
|
import { AgentSchema } from '../../../models/agents/agent.schema';
|
|
4
|
-
import { IconVariantsSchema } from '../../../models/icon-variants.schema';
|
|
5
3
|
|
|
6
4
|
export namespace CreateAgentCommand {
|
|
7
5
|
export const RequestBodySchema = z.object({
|
|
8
6
|
templateId: z.string().uuid(),
|
|
9
7
|
name: z.string(),
|
|
10
|
-
icons: IconVariantsSchema.optional(),
|
|
11
|
-
avatar: z.string().nullable().optional(),
|
|
12
|
-
greetingPhrase: z.string().nullable().optional(),
|
|
13
|
-
instructions: z.string().nullable().optional(),
|
|
14
8
|
aiModelId: z.string().uuid(),
|
|
15
|
-
interactionMode: z.nativeEnum(AGENT_INTERACTION_MODE).optional(),
|
|
16
|
-
isHumanHelp: z.boolean().optional(),
|
|
17
|
-
useDocuments: z.boolean().optional(),
|
|
18
9
|
});
|
|
19
10
|
export type RequestBody = z.infer<typeof RequestBodySchema>;
|
|
20
11
|
|
|
@@ -4,4 +4,6 @@ export * from './find-agents.command';
|
|
|
4
4
|
export * from './get-agent-by-id.command';
|
|
5
5
|
export * from './get-agent-public-info.command';
|
|
6
6
|
export * from './get-agent-aggregate.command';
|
|
7
|
+
export * from './activate-agent.command';
|
|
8
|
+
export * from './stop-agent.command';
|
|
7
9
|
export * from './update-agent.command';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AgentSchema } from '../../../models/agents/agent.schema';
|
|
3
|
+
|
|
4
|
+
export namespace StopAgentCommand {
|
|
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,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { VarGenOutputSchema } from '../../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace GenerateVariablesCommand {
|
|
5
|
+
export const OutputSchema = VarGenOutputSchema;
|
|
6
|
+
export type Output = z.infer<typeof OutputSchema>;
|
|
7
|
+
|
|
8
|
+
export const RequestSchema = z.object({
|
|
9
|
+
nodeUuid: z.string().uuid(),
|
|
10
|
+
canvasId: z.string().uuid(),
|
|
11
|
+
modelId: z.string().uuid(),
|
|
12
|
+
prompt: z.string().min(1),
|
|
13
|
+
});
|
|
14
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
15
|
+
|
|
16
|
+
export const ResponseSchema = z.object({
|
|
17
|
+
data: OutputSchema,
|
|
18
|
+
});
|
|
19
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AiModelSchema } from '../../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace GetVarGenConfigCommand {
|
|
5
|
+
export const ResponseSchema = z.object({
|
|
6
|
+
data: z.array(AiModelSchema),
|
|
7
|
+
});
|
|
8
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace GetVarGenPriceCommand {
|
|
4
|
+
export const RequestSchema = z.object({
|
|
5
|
+
modelId: z.string().uuid(),
|
|
6
|
+
promptLength: z.coerce.number().int().positive(),
|
|
7
|
+
});
|
|
8
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
9
|
+
|
|
10
|
+
export const ResponseSchema = z.object({
|
|
11
|
+
data: z.object({
|
|
12
|
+
price: z.number(),
|
|
13
|
+
charsUntilNextPriceIncrease: z.number().int().nonnegative().nullable().optional(),
|
|
14
|
+
charsUntilNextPriceDecrease: z.number().int().nonnegative().nullable().optional(),
|
|
15
|
+
}),
|
|
16
|
+
});
|
|
17
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
18
|
+
}
|
|
@@ -2,7 +2,9 @@ import { z } from 'zod';
|
|
|
2
2
|
import { API_KEY_EXPIRATION_OPTION } from '../../constants/api-key/enums/api-key-expiration-option.enum';
|
|
3
3
|
|
|
4
4
|
export namespace CreateApiKeyCommand {
|
|
5
|
-
const resolveExpiresAt = (
|
|
5
|
+
const resolveExpiresAt = (
|
|
6
|
+
expiresAt?: Date | API_KEY_EXPIRATION_OPTION | null,
|
|
7
|
+
): Date | null | undefined => {
|
|
6
8
|
if (expiresAt === undefined) return undefined;
|
|
7
9
|
if (expiresAt === null || expiresAt === API_KEY_EXPIRATION_OPTION.NONE) return null;
|
|
8
10
|
if (expiresAt instanceof Date) return expiresAt;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export * from './agent-channel-status.enum';
|
|
2
1
|
export * from './agent-channel-type.enum';
|
|
3
2
|
export * from './agent-interaction-mode.enum';
|
|
4
3
|
export * from './agent-status.enum';
|
|
@@ -6,3 +5,4 @@ export * from './agent-tool-type.enum';
|
|
|
6
5
|
export * from './agent-tool-status.enum';
|
|
7
6
|
export * from './agent-document-status.enum';
|
|
8
7
|
export * from './dialog-status.enum';
|
|
8
|
+
export * from './message-sender-type.enum';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { IconVariantsSchema } from '../icon-variants.schema';
|
|
2
3
|
|
|
3
4
|
export const AgentAiModelSchema = z.object({
|
|
4
5
|
id: z.string().uuid(),
|
|
5
6
|
model: z.string(),
|
|
6
7
|
name: z.string(),
|
|
7
|
-
|
|
8
|
+
icons: IconVariantsSchema,
|
|
8
9
|
isActive: z.boolean(),
|
|
9
10
|
order: z.number(),
|
|
10
11
|
createdAt: z.date(),
|
|
@@ -19,6 +19,11 @@ export const AvitoChannelCredentialsSchema = z.object({
|
|
|
19
19
|
type: z.literal(AGENT_CHANNEL_TYPE.AVITO),
|
|
20
20
|
clientId: z.string().min(1),
|
|
21
21
|
clientSecret: z.string().min(1),
|
|
22
|
+
accessToken: z.string().optional(),
|
|
23
|
+
tokenType: z.string().nullable().optional(),
|
|
24
|
+
expiresIn: z.number().optional(),
|
|
25
|
+
avitoId: z.string().optional(),
|
|
26
|
+
obtainedAt: z.string().nullable().optional(),
|
|
22
27
|
});
|
|
23
28
|
|
|
24
29
|
export type AvitoChannelCredentials = z.infer<typeof AvitoChannelCredentialsSchema>;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { AGENT_CHANNEL_TYPE } from '../../constants/agents/enums';
|
|
3
|
+
import { AgentChannelCredentialsSchema } from './agent-channel-credentials.schema';
|
|
3
4
|
|
|
4
5
|
export const AgentChannelSchema = z.object({
|
|
5
6
|
id: z.string().uuid(),
|
|
6
7
|
agentId: z.string().uuid(),
|
|
7
8
|
channelType: z.nativeEnum(AGENT_CHANNEL_TYPE),
|
|
8
|
-
|
|
9
|
-
lastCheckedAt: z.date().nullable(),
|
|
10
|
-
lastError: z.string().nullable(),
|
|
9
|
+
credentials: AgentChannelCredentialsSchema,
|
|
11
10
|
createdAt: z.date(),
|
|
12
11
|
updatedAt: z.date(),
|
|
13
12
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { MESSAGE_SENDER_TYPE } from '../../constants/agents/enums/message-sender-type.enum';
|
|
2
3
|
|
|
3
4
|
export const AgentDialogMessageSchema = z.object({
|
|
4
5
|
id: z.string().uuid(),
|
|
@@ -6,7 +7,7 @@ export const AgentDialogMessageSchema = z.object({
|
|
|
6
7
|
images: z.array(z.string()),
|
|
7
8
|
attachments: z.array(z.string()),
|
|
8
9
|
tokensUsed: z.number().optional(),
|
|
9
|
-
|
|
10
|
+
senderType: z.nativeEnum(MESSAGE_SENDER_TYPE),
|
|
10
11
|
createdAt: z.date(),
|
|
11
12
|
});
|
|
12
13
|
|
|
@@ -9,7 +9,8 @@ export const AgentTemplateSchema = z.object({
|
|
|
9
9
|
description: z.string(),
|
|
10
10
|
icons: IconVariantsSchema,
|
|
11
11
|
altIcons: IconVariantsSchema.optional(),
|
|
12
|
-
|
|
12
|
+
greetingPhrase: z.string().nullable(),
|
|
13
|
+
defaultInstructions: z.string().nullable(),
|
|
13
14
|
interactionMode: z.nativeEnum(AGENT_INTERACTION_MODE),
|
|
14
15
|
isHumanHelp: z.boolean(),
|
|
15
16
|
useDocuments: z.boolean(),
|
package/models/agents/index.ts
CHANGED
|
@@ -20,7 +20,6 @@ export * from './agent-tool.schema';
|
|
|
20
20
|
export * from './agent-document.schema';
|
|
21
21
|
export * from './agent-document-find-result.schema';
|
|
22
22
|
export * from './agent-document-chunk.schema';
|
|
23
|
-
export * from './agent-document-search-result.schema';
|
|
24
23
|
export * from './agent.schema';
|
|
25
24
|
export * from './agent-aggregate.schema';
|
|
26
25
|
export * from './channel.schema';
|
|
@@ -84,7 +84,7 @@ export const MotionControlParamsSchema = strictObject({
|
|
|
84
84
|
export type MotionControlParams = z.infer<typeof MotionControlParamsSchema>;
|
|
85
85
|
|
|
86
86
|
export const VarGenParamsSchema = strictObject({
|
|
87
|
-
prompt: z.string(),
|
|
87
|
+
prompt: z.string().min(1).optional(),
|
|
88
88
|
modelId: z.string(),
|
|
89
89
|
modelName: z.string(),
|
|
90
90
|
});
|
|
@@ -137,7 +137,7 @@ export const MotionControlOutputSchema = strictObject({
|
|
|
137
137
|
export type MotionControlOutput = z.infer<typeof MotionControlOutputSchema>;
|
|
138
138
|
|
|
139
139
|
export const VarGenOutputSchema = strictObject({
|
|
140
|
-
variables: z.record(z.string()),
|
|
140
|
+
variables: z.record(z.string().min(1), z.string()),
|
|
141
141
|
});
|
|
142
142
|
export type VarGenOutput = z.infer<typeof VarGenOutputSchema>;
|
|
143
143
|
|
package/package.json
CHANGED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SearchAgentDocumentsCommand = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const agent_document_search_result_schema_1 = require("../../../models/agents/agent-document-search-result.schema");
|
|
6
|
-
var SearchAgentDocumentsCommand;
|
|
7
|
-
(function (SearchAgentDocumentsCommand) {
|
|
8
|
-
SearchAgentDocumentsCommand.RequestParamsSchema = zod_1.z.object({
|
|
9
|
-
agentId: zod_1.z.string().uuid(),
|
|
10
|
-
});
|
|
11
|
-
SearchAgentDocumentsCommand.RequestBodySchema = zod_1.z.object({
|
|
12
|
-
query: zod_1.z.string().min(1),
|
|
13
|
-
limit: zod_1.z.coerce.number().optional(),
|
|
14
|
-
threshold: zod_1.z.coerce.number().optional(),
|
|
15
|
-
});
|
|
16
|
-
SearchAgentDocumentsCommand.ResponseSchema = zod_1.z.object({
|
|
17
|
-
data: agent_document_search_result_schema_1.AgentDocumentSearchResultSchema,
|
|
18
|
-
});
|
|
19
|
-
})(SearchAgentDocumentsCommand || (exports.SearchAgentDocumentsCommand = SearchAgentDocumentsCommand = {}));
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AGENT_CHANNEL_STATUS = void 0;
|
|
4
|
-
var AGENT_CHANNEL_STATUS;
|
|
5
|
-
(function (AGENT_CHANNEL_STATUS) {
|
|
6
|
-
AGENT_CHANNEL_STATUS["ACTIVE"] = "active";
|
|
7
|
-
AGENT_CHANNEL_STATUS["ERROR"] = "error";
|
|
8
|
-
AGENT_CHANNEL_STATUS["PENDING"] = "pending";
|
|
9
|
-
})(AGENT_CHANNEL_STATUS || (exports.AGENT_CHANNEL_STATUS = AGENT_CHANNEL_STATUS = {}));
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AgentDocumentSearchResultSchema = exports.AgentDocumentSearchResultItemSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const agent_document_chunk_schema_1 = require("./agent-document-chunk.schema");
|
|
6
|
-
exports.AgentDocumentSearchResultItemSchema = zod_1.z.object({
|
|
7
|
-
chunk: agent_document_chunk_schema_1.AgentDocumentChunkSchema,
|
|
8
|
-
similarity: zod_1.z.number(),
|
|
9
|
-
});
|
|
10
|
-
exports.AgentDocumentSearchResultSchema = zod_1.z.object({
|
|
11
|
-
results: zod_1.z.array(exports.AgentDocumentSearchResultItemSchema),
|
|
12
|
-
context: zod_1.z.string(),
|
|
13
|
-
});
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { AgentDocumentSearchResultSchema } from '../../../models/agents/agent-document-search-result.schema';
|
|
3
|
-
|
|
4
|
-
export namespace SearchAgentDocumentsCommand {
|
|
5
|
-
export const RequestParamsSchema = z.object({
|
|
6
|
-
agentId: z.string().uuid(),
|
|
7
|
-
});
|
|
8
|
-
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
9
|
-
|
|
10
|
-
export const RequestBodySchema = z.object({
|
|
11
|
-
query: z.string().min(1),
|
|
12
|
-
limit: z.coerce.number().optional(),
|
|
13
|
-
threshold: z.coerce.number().optional(),
|
|
14
|
-
});
|
|
15
|
-
export type RequestBody = z.infer<typeof RequestBodySchema>;
|
|
16
|
-
|
|
17
|
-
export const ResponseSchema = z.object({
|
|
18
|
-
data: AgentDocumentSearchResultSchema,
|
|
19
|
-
});
|
|
20
|
-
export type Response = z.infer<typeof ResponseSchema>;
|
|
21
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { AgentDocumentChunkSchema } from './agent-document-chunk.schema';
|
|
3
|
-
|
|
4
|
-
export const AgentDocumentSearchResultItemSchema = z.object({
|
|
5
|
-
chunk: AgentDocumentChunkSchema,
|
|
6
|
-
similarity: z.number(),
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
export type AgentDocumentSearchResultItem = z.infer<typeof AgentDocumentSearchResultItemSchema>;
|
|
10
|
-
|
|
11
|
-
export const AgentDocumentSearchResultSchema = z.object({
|
|
12
|
-
results: z.array(AgentDocumentSearchResultItemSchema),
|
|
13
|
-
context: z.string(),
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
export type AgentDocumentSearchResult = z.infer<typeof AgentDocumentSearchResultSchema>;
|