@purpleschool/gptbot 0.13.15-stage2 → 0.13.17
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-statistics.ts +5 -0
- package/api/controllers/http/agents/agent-template.ts +1 -0
- package/api/controllers/http/agents/agent-tool.ts +2 -1
- package/api/controllers/http/agents/agent.ts +6 -0
- package/api/controllers/http/agents/index.ts +1 -0
- package/api/controllers/http/canvas-var-generation.ts +7 -0
- package/api/controllers/http/index.ts +1 -0
- package/api/routes.ts +8 -2
- package/build/api/controllers/http/agents/agent-statistics.js +7 -0
- package/build/api/controllers/http/agents/agent-template.js +1 -0
- package/build/api/controllers/http/agents/agent-tool.js +2 -1
- package/build/api/controllers/http/agents/agent.js +3 -0
- package/build/api/controllers/http/agents/index.js +1 -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 +5 -1
- package/build/commands/agents/agent-dialog/get-cabinet-price-preview.command.js +26 -0
- package/build/commands/agents/agent-dialog/get-dialog-context-length.command.js +30 -0
- package/build/commands/agents/agent-dialog/index.js +3 -0
- package/build/commands/agents/agent-dialog/send-cabinet-message.command.js +4 -4
- package/build/commands/agents/agent-dialog/stop-cabinet-stream.command.js +15 -0
- package/build/commands/agents/agent-lead/find-agent-leads.command.js +2 -4
- package/build/commands/agents/agent-template/get-agent-template-instructions-by-template.command.js +14 -0
- package/build/commands/agents/agent-template/index.js +1 -0
- package/build/commands/agents/agent-tool/find-agent-tools-catalog.command.js +2 -0
- package/build/commands/agents/agent-tool/find-agent-tools.command.js +2 -0
- package/build/commands/agents/agents/get-agent-statistics.command.js +20 -0
- package/build/commands/agents/agents/index.js +1 -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/models/agents/agent-statistics.schema.js +33 -0
- package/build/models/agents/index.js +2 -0
- package/build/models/agents/message-attachment.schema.js +21 -0
- package/build/models/canvas-node.schema.js +2 -2
- package/commands/agents/agent-dialog/get-cabinet-price-preview.command.ts +28 -0
- package/commands/agents/agent-dialog/get-dialog-context-length.command.ts +33 -0
- package/commands/agents/agent-dialog/index.ts +3 -0
- package/commands/agents/agent-dialog/send-cabinet-message.command.ts +18 -10
- package/commands/agents/agent-dialog/stop-cabinet-stream.command.ts +15 -0
- package/commands/agents/agent-lead/find-agent-leads.command.ts +2 -4
- package/commands/agents/agent-template/get-agent-template-instructions-by-template.command.ts +14 -0
- package/commands/agents/agent-template/index.ts +1 -0
- package/commands/agents/agent-tool/find-agent-tools-catalog.command.ts +2 -0
- package/commands/agents/agent-tool/find-agent-tools.command.ts +2 -0
- package/commands/agents/agents/get-agent-statistics.command.ts +28 -0
- package/commands/agents/agents/index.ts +1 -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/models/agents/agent-statistics.schema.ts +38 -0
- package/models/agents/index.ts +2 -0
- package/models/agents/message-attachment.schema.ts +22 -0
- package/models/canvas-node.schema.ts +2 -2
- package/package.json +1 -1
|
@@ -7,5 +7,6 @@ export const AGENT_TEMPLATE_ROUTES = {
|
|
|
7
7
|
TEMPLATES: 'templates',
|
|
8
8
|
TEMPLATE: (id: string) => `templates/${id}`,
|
|
9
9
|
INSTRUCTIONS: (templateId: string) => `${templateId}/instructions`,
|
|
10
|
+
INSTRUCTIONS_BY_TEMPLATE: (templateId: string) => `${templateId}/instructions/by-template`,
|
|
10
11
|
INSTRUCTION: (templateId: string, id: string) => `${templateId}/instructions/${id}`,
|
|
11
12
|
} as const;
|
|
@@ -2,7 +2,8 @@ export const AGENT_TOOL_CONTROLLER_PRIVATE = 'private/agents-tools' as const;
|
|
|
2
2
|
|
|
3
3
|
export const AGENT_TOOL_ROUTES = {
|
|
4
4
|
CATALOG: 'catalog',
|
|
5
|
-
|
|
5
|
+
LIST_AGENT_TOOLS: (agentId: string) => `${agentId}`,
|
|
6
|
+
CONNECT_AGENT_TOOL: (agentId: string) => `${agentId}`,
|
|
6
7
|
UPDATE: (agentId: string, id: string) => `${agentId}/${id}`,
|
|
7
8
|
DISCONNECT: (agentId: string, id: string) => `${agentId}/${id}`,
|
|
8
9
|
} as const;
|
|
@@ -13,6 +13,12 @@ export const AGENT_ROUTES = {
|
|
|
13
13
|
CABINET_START_DIALOG: (agentId: string) => `${agentId}/dialogs/cabinet/start`,
|
|
14
14
|
CABINET_SEND_MESSAGE: (agentId: string, dialogId: string) =>
|
|
15
15
|
`${agentId}/dialogs/${dialogId}/cabinet/messages`,
|
|
16
|
+
CABINET_SEND_MESSAGE_STREAM: (agentId: string, dialogId: string) =>
|
|
17
|
+
`${agentId}/dialogs/${dialogId}/cabinet/messages/stream`,
|
|
18
|
+
STOP_CABINET_STREAM: (agentId: string, dialogId: string, messageId: string) =>
|
|
19
|
+
`${agentId}/dialogs/${dialogId}/cabinet/messages/${messageId}/stop`,
|
|
20
|
+
CABINET_PRICE_PREVIEW: (agentId: string, dialogId: string) =>
|
|
21
|
+
`${agentId}/dialogs/${dialogId}/cabinet/price-preview`,
|
|
16
22
|
} as const;
|
|
17
23
|
|
|
18
24
|
export const AGENT_PUBLIC_ROUTES = {
|
package/api/routes.ts
CHANGED
|
@@ -171,10 +171,16 @@ export const REST_API = {
|
|
|
171
171
|
GET_BY_ID: (id: string): string =>
|
|
172
172
|
`${ROOT}/${CONTROLLERS.AGENT_LEAD_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_LEAD_ROUTES.GET_BY_ID(id)}`,
|
|
173
173
|
},
|
|
174
|
+
AGENT_STATISTICS_PRIVATE: {
|
|
175
|
+
GET: (agentId: string): string =>
|
|
176
|
+
`${ROOT}/${CONTROLLERS.AGENT_STATISTICS_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_STATISTICS_ROUTES.GET(agentId)}`,
|
|
177
|
+
},
|
|
174
178
|
AGENT_TOOL_PRIVATE: {
|
|
175
179
|
CATALOG: `${ROOT}/${CONTROLLERS.AGENT_TOOL_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_TOOL_ROUTES.CATALOG}`,
|
|
176
|
-
|
|
177
|
-
`${ROOT}/${CONTROLLERS.AGENT_TOOL_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_TOOL_ROUTES.
|
|
180
|
+
LIST_AGENT_TOOLS: (agentId: string): string =>
|
|
181
|
+
`${ROOT}/${CONTROLLERS.AGENT_TOOL_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_TOOL_ROUTES.LIST_AGENT_TOOLS(agentId)}`,
|
|
182
|
+
CONNECT_AGENT_TOOL: (agentId: string): string =>
|
|
183
|
+
`${ROOT}/${CONTROLLERS.AGENT_TOOL_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_TOOL_ROUTES.CONNECT_AGENT_TOOL(agentId)}`,
|
|
178
184
|
UPDATE: (agentId: string, id: string): string =>
|
|
179
185
|
`${ROOT}/${CONTROLLERS.AGENT_TOOL_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_TOOL_ROUTES.UPDATE(agentId, id)}`,
|
|
180
186
|
DISCONNECT: (agentId: string, id: string): string =>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AGENT_STATISTICS_ROUTES = exports.AGENT_STATISTICS_CONTROLLER_PRIVATE = void 0;
|
|
4
|
+
exports.AGENT_STATISTICS_CONTROLLER_PRIVATE = 'private/agents-statistics';
|
|
5
|
+
exports.AGENT_STATISTICS_ROUTES = {
|
|
6
|
+
GET: (agentId) => `${agentId}`,
|
|
7
|
+
};
|
|
@@ -9,5 +9,6 @@ exports.AGENT_TEMPLATE_ROUTES = {
|
|
|
9
9
|
TEMPLATES: 'templates',
|
|
10
10
|
TEMPLATE: (id) => `templates/${id}`,
|
|
11
11
|
INSTRUCTIONS: (templateId) => `${templateId}/instructions`,
|
|
12
|
+
INSTRUCTIONS_BY_TEMPLATE: (templateId) => `${templateId}/instructions/by-template`,
|
|
12
13
|
INSTRUCTION: (templateId, id) => `${templateId}/instructions/${id}`,
|
|
13
14
|
};
|
|
@@ -4,7 +4,8 @@ exports.AGENT_TOOL_ROUTES = exports.AGENT_TOOL_CONTROLLER_PRIVATE = void 0;
|
|
|
4
4
|
exports.AGENT_TOOL_CONTROLLER_PRIVATE = 'private/agents-tools';
|
|
5
5
|
exports.AGENT_TOOL_ROUTES = {
|
|
6
6
|
CATALOG: 'catalog',
|
|
7
|
-
|
|
7
|
+
LIST_AGENT_TOOLS: (agentId) => `${agentId}`,
|
|
8
|
+
CONNECT_AGENT_TOOL: (agentId) => `${agentId}`,
|
|
8
9
|
UPDATE: (agentId, id) => `${agentId}/${id}`,
|
|
9
10
|
DISCONNECT: (agentId, id) => `${agentId}/${id}`,
|
|
10
11
|
};
|
|
@@ -14,6 +14,9 @@ exports.AGENT_ROUTES = {
|
|
|
14
14
|
DELETE: (id) => `${id}`,
|
|
15
15
|
CABINET_START_DIALOG: (agentId) => `${agentId}/dialogs/cabinet/start`,
|
|
16
16
|
CABINET_SEND_MESSAGE: (agentId, dialogId) => `${agentId}/dialogs/${dialogId}/cabinet/messages`,
|
|
17
|
+
CABINET_SEND_MESSAGE_STREAM: (agentId, dialogId) => `${agentId}/dialogs/${dialogId}/cabinet/messages/stream`,
|
|
18
|
+
STOP_CABINET_STREAM: (agentId, dialogId, messageId) => `${agentId}/dialogs/${dialogId}/cabinet/messages/${messageId}/stop`,
|
|
19
|
+
CABINET_PRICE_PREVIEW: (agentId, dialogId) => `${agentId}/dialogs/${dialogId}/cabinet/price-preview`,
|
|
17
20
|
};
|
|
18
21
|
exports.AGENT_PUBLIC_ROUTES = {
|
|
19
22
|
PUBLIC_INFO: (id) => `${id}/public-info`,
|
|
@@ -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
|
@@ -166,9 +166,13 @@ exports.REST_API = {
|
|
|
166
166
|
LIST: `${exports.ROOT}/${CONTROLLERS.AGENT_LEAD_CONTROLLER_PRIVATE}`,
|
|
167
167
|
GET_BY_ID: (id) => `${exports.ROOT}/${CONTROLLERS.AGENT_LEAD_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_LEAD_ROUTES.GET_BY_ID(id)}`,
|
|
168
168
|
},
|
|
169
|
+
AGENT_STATISTICS_PRIVATE: {
|
|
170
|
+
GET: (agentId) => `${exports.ROOT}/${CONTROLLERS.AGENT_STATISTICS_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_STATISTICS_ROUTES.GET(agentId)}`,
|
|
171
|
+
},
|
|
169
172
|
AGENT_TOOL_PRIVATE: {
|
|
170
173
|
CATALOG: `${exports.ROOT}/${CONTROLLERS.AGENT_TOOL_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_TOOL_ROUTES.CATALOG}`,
|
|
171
|
-
|
|
174
|
+
LIST_AGENT_TOOLS: (agentId) => `${exports.ROOT}/${CONTROLLERS.AGENT_TOOL_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_TOOL_ROUTES.LIST_AGENT_TOOLS(agentId)}`,
|
|
175
|
+
CONNECT_AGENT_TOOL: (agentId) => `${exports.ROOT}/${CONTROLLERS.AGENT_TOOL_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_TOOL_ROUTES.CONNECT_AGENT_TOOL(agentId)}`,
|
|
172
176
|
UPDATE: (agentId, id) => `${exports.ROOT}/${CONTROLLERS.AGENT_TOOL_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_TOOL_ROUTES.UPDATE(agentId, id)}`,
|
|
173
177
|
DISCONNECT: (agentId, id) => `${exports.ROOT}/${CONTROLLERS.AGENT_TOOL_CONTROLLER_PRIVATE}/${CONTROLLERS.AGENT_TOOL_ROUTES.DISCONNECT(agentId, id)}`,
|
|
174
178
|
},
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetCabinetPricePreviewCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var GetCabinetPricePreviewCommand;
|
|
6
|
+
(function (GetCabinetPricePreviewCommand) {
|
|
7
|
+
GetCabinetPricePreviewCommand.RequestParamsSchema = zod_1.z.object({
|
|
8
|
+
agentId: zod_1.z.string().uuid(),
|
|
9
|
+
dialogId: zod_1.z.string().uuid(),
|
|
10
|
+
});
|
|
11
|
+
GetCabinetPricePreviewCommand.RequestBodySchema = zod_1.z.object({
|
|
12
|
+
inputLength: zod_1.z.number().int().min(0),
|
|
13
|
+
fileIds: zod_1.z.array(zod_1.z.string().uuid()).optional(),
|
|
14
|
+
useWebSearch: zod_1.z.boolean().optional(),
|
|
15
|
+
});
|
|
16
|
+
GetCabinetPricePreviewCommand.ResponseSchema = zod_1.z.object({
|
|
17
|
+
data: zod_1.z.object({
|
|
18
|
+
price: zod_1.z.number().int().min(0),
|
|
19
|
+
breakdown: zod_1.z.object({
|
|
20
|
+
textCost: zod_1.z.number().int().min(0),
|
|
21
|
+
attachmentsCost: zod_1.z.number().int().min(0),
|
|
22
|
+
webSearchCost: zod_1.z.number().int().min(0),
|
|
23
|
+
}),
|
|
24
|
+
}),
|
|
25
|
+
});
|
|
26
|
+
})(GetCabinetPricePreviewCommand || (exports.GetCabinetPricePreviewCommand = GetCabinetPricePreviewCommand = {}));
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetDialogContextLengthCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const message_attachment_schema_1 = require("../../../models/agents/message-attachment.schema");
|
|
6
|
+
var GetDialogContextLengthCommand;
|
|
7
|
+
(function (GetDialogContextLengthCommand) {
|
|
8
|
+
GetDialogContextLengthCommand.RequestSchema = zod_1.z.object({
|
|
9
|
+
teamAccountId: zod_1.z.string().uuid(),
|
|
10
|
+
dialogId: zod_1.z.string().uuid(),
|
|
11
|
+
inputLength: zod_1.z.number().int().min(0),
|
|
12
|
+
attachments: zod_1.z
|
|
13
|
+
.array(zod_1.z.object({
|
|
14
|
+
type: message_attachment_schema_1.MessageAttachmentTypeEnum,
|
|
15
|
+
contentLength: zod_1.z.number().int().optional(),
|
|
16
|
+
}))
|
|
17
|
+
.default([]),
|
|
18
|
+
});
|
|
19
|
+
GetDialogContextLengthCommand.ResponseSchema = zod_1.z.object({
|
|
20
|
+
isSuccess: zod_1.z.literal(true),
|
|
21
|
+
data: zod_1.z.object({
|
|
22
|
+
historyChars: zod_1.z.number().int().min(0),
|
|
23
|
+
totalInputChars: zod_1.z.number().int().min(0),
|
|
24
|
+
modelPricing: zod_1.z.object({
|
|
25
|
+
inputPrice: zod_1.z.number(),
|
|
26
|
+
outputPrice: zod_1.z.number(),
|
|
27
|
+
}),
|
|
28
|
+
}),
|
|
29
|
+
});
|
|
30
|
+
})(GetDialogContextLengthCommand || (exports.GetDialogContextLengthCommand = GetDialogContextLengthCommand = {}));
|
|
@@ -21,3 +21,6 @@ __exportStar(require("./clear-agent-dialog-history.command"), exports);
|
|
|
21
21
|
__exportStar(require("./send-agent-dialog-admin-reply.command"), exports);
|
|
22
22
|
__exportStar(require("./start-cabinet-dialog.command"), exports);
|
|
23
23
|
__exportStar(require("./send-cabinet-message.command"), exports);
|
|
24
|
+
__exportStar(require("./get-dialog-context-length.command"), exports);
|
|
25
|
+
__exportStar(require("./get-cabinet-price-preview.command"), exports);
|
|
26
|
+
__exportStar(require("./stop-cabinet-stream.command"), exports);
|
|
@@ -11,11 +11,11 @@ var SendCabinetMessageCommand;
|
|
|
11
11
|
SendCabinetMessageCommand.RequestBodySchema = zod_1.z
|
|
12
12
|
.object({
|
|
13
13
|
text: zod_1.z.string().optional(),
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
fileIds: zod_1.z.array(zod_1.z.string().uuid()).optional(),
|
|
15
|
+
useWebSearch: zod_1.z.boolean().optional(),
|
|
16
16
|
})
|
|
17
|
-
.refine((data) => { var _a, _b
|
|
18
|
-
message: 'Message must contain text
|
|
17
|
+
.refine((data) => { var _a, _b; return data.text || ((_b = (_a = data.fileIds) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0; }, {
|
|
18
|
+
message: 'Message must contain text or file attachments',
|
|
19
19
|
path: ['text'],
|
|
20
20
|
});
|
|
21
21
|
SendCabinetMessageCommand.ResponseSchema = zod_1.z.object({
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StopCabinetStreamCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var StopCabinetStreamCommand;
|
|
6
|
+
(function (StopCabinetStreamCommand) {
|
|
7
|
+
StopCabinetStreamCommand.RequestParamsSchema = zod_1.z.object({
|
|
8
|
+
agentId: zod_1.z.string().uuid(),
|
|
9
|
+
dialogId: zod_1.z.string().uuid(),
|
|
10
|
+
messageId: zod_1.z.string().uuid(),
|
|
11
|
+
});
|
|
12
|
+
StopCabinetStreamCommand.ResponseSchema = zod_1.z.object({
|
|
13
|
+
stopped: zod_1.z.boolean(),
|
|
14
|
+
});
|
|
15
|
+
})(StopCabinetStreamCommand || (exports.StopCabinetStreamCommand = StopCabinetStreamCommand = {}));
|
|
@@ -2,15 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FindAgentLeadsCommand = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
5
|
+
const agent_lead_schema_1 = require("../../../models/agents/agent-lead.schema");
|
|
6
6
|
var FindAgentLeadsCommand;
|
|
7
7
|
(function (FindAgentLeadsCommand) {
|
|
8
8
|
FindAgentLeadsCommand.RequestQuerySchema = zod_1.z.object({
|
|
9
9
|
dialogId: zod_1.z.string().uuid().optional(),
|
|
10
|
-
limit: zod_1.z.coerce.number().optional(),
|
|
11
|
-
offset: zod_1.z.coerce.number().optional(),
|
|
12
10
|
});
|
|
13
11
|
FindAgentLeadsCommand.ResponseSchema = zod_1.z.object({
|
|
14
|
-
data:
|
|
12
|
+
data: zod_1.z.array(agent_lead_schema_1.AgentLeadSchema),
|
|
15
13
|
});
|
|
16
14
|
})(FindAgentLeadsCommand || (exports.FindAgentLeadsCommand = FindAgentLeadsCommand = {}));
|
package/build/commands/agents/agent-template/get-agent-template-instructions-by-template.command.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetAgentTemplateInstructionsByTemplateCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const agent_template_instruction_schema_1 = require("../../../models/agents/agent-template-instruction.schema");
|
|
6
|
+
var GetAgentTemplateInstructionsByTemplateCommand;
|
|
7
|
+
(function (GetAgentTemplateInstructionsByTemplateCommand) {
|
|
8
|
+
GetAgentTemplateInstructionsByTemplateCommand.RequestParamsSchema = zod_1.z.object({
|
|
9
|
+
templateId: zod_1.z.string().uuid(),
|
|
10
|
+
});
|
|
11
|
+
GetAgentTemplateInstructionsByTemplateCommand.ResponseSchema = zod_1.z.object({
|
|
12
|
+
data: zod_1.z.array(agent_template_instruction_schema_1.AgentTemplateInstructionSchema),
|
|
13
|
+
});
|
|
14
|
+
})(GetAgentTemplateInstructionsByTemplateCommand || (exports.GetAgentTemplateInstructionsByTemplateCommand = GetAgentTemplateInstructionsByTemplateCommand = {}));
|
|
@@ -24,6 +24,7 @@ __exportStar(require("./find-agent-template-catalog.command"), exports);
|
|
|
24
24
|
__exportStar(require("./find-agent-template-categories.command"), exports);
|
|
25
25
|
__exportStar(require("./find-agent-template-instructions.command"), exports);
|
|
26
26
|
__exportStar(require("./find-agent-templates.command"), exports);
|
|
27
|
+
__exportStar(require("./get-agent-template-instructions-by-template.command"), exports);
|
|
27
28
|
__exportStar(require("./update-agent-template-category.command"), exports);
|
|
28
29
|
__exportStar(require("./update-agent-template-instruction.command"), exports);
|
|
29
30
|
__exportStar(require("./update-agent-template.command"), exports);
|
|
@@ -11,5 +11,7 @@ var FindAgentToolsCatalogCommand;
|
|
|
11
11
|
});
|
|
12
12
|
FindAgentToolsCatalogCommand.ResponseSchema = zod_1.z.object({
|
|
13
13
|
data: zod_1.z.array(agent_tool_catalog_schema_1.AgentToolCatalogSchema),
|
|
14
|
+
totalPages: zod_1.z.number(),
|
|
15
|
+
page: zod_1.z.number(),
|
|
14
16
|
});
|
|
15
17
|
})(FindAgentToolsCatalogCommand || (exports.FindAgentToolsCatalogCommand = FindAgentToolsCatalogCommand = {}));
|
|
@@ -10,5 +10,7 @@ var FindAgentToolsCommand;
|
|
|
10
10
|
});
|
|
11
11
|
FindAgentToolsCommand.ResponseSchema = zod_1.z.object({
|
|
12
12
|
data: zod_1.z.array(agent_tool_schema_1.AgentToolSchema),
|
|
13
|
+
totalPages: zod_1.z.number(),
|
|
14
|
+
page: zod_1.z.number(),
|
|
13
15
|
});
|
|
14
16
|
})(FindAgentToolsCommand || (exports.FindAgentToolsCommand = FindAgentToolsCommand = {}));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetAgentStatisticsCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const agent_statistics_schema_1 = require("../../../models/agents/agent-statistics.schema");
|
|
6
|
+
var GetAgentStatisticsCommand;
|
|
7
|
+
(function (GetAgentStatisticsCommand) {
|
|
8
|
+
GetAgentStatisticsCommand.RequestQuerySchema = zod_1.z.object({
|
|
9
|
+
from: zod_1.z.string().datetime().optional(),
|
|
10
|
+
to: zod_1.z.string().datetime().optional(),
|
|
11
|
+
granularity: zod_1.z.enum(['day', 'week', 'month']).optional().default('day'),
|
|
12
|
+
source: zod_1.z.string().optional(),
|
|
13
|
+
});
|
|
14
|
+
GetAgentStatisticsCommand.RequestParamsSchema = zod_1.z.object({
|
|
15
|
+
agentId: zod_1.z.string().uuid(),
|
|
16
|
+
});
|
|
17
|
+
GetAgentStatisticsCommand.ResponseSchema = zod_1.z.object({
|
|
18
|
+
data: agent_statistics_schema_1.AgentStatisticsDataSchema,
|
|
19
|
+
});
|
|
20
|
+
})(GetAgentStatisticsCommand || (exports.GetAgentStatisticsCommand = GetAgentStatisticsCommand = {}));
|
|
@@ -23,3 +23,4 @@ __exportStar(require("./get-agent-aggregate.command"), exports);
|
|
|
23
23
|
__exportStar(require("./activate-agent.command"), exports);
|
|
24
24
|
__exportStar(require("./stop-agent.command"), exports);
|
|
25
25
|
__exportStar(require("./update-agent.command"), exports);
|
|
26
|
+
__exportStar(require("./get-agent-statistics.command"), exports);
|
|
@@ -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);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AgentStatisticsDataSchema = exports.AgentStatisticsBucketSchema = exports.AgentStatisticsTotalsSchema = exports.AgentStatisticsRangeSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.AgentStatisticsRangeSchema = zod_1.z.object({
|
|
6
|
+
from: zod_1.z.string().datetime(),
|
|
7
|
+
to: zod_1.z.string().datetime(),
|
|
8
|
+
granularity: zod_1.z.enum(['day', 'week', 'month']),
|
|
9
|
+
});
|
|
10
|
+
exports.AgentStatisticsTotalsSchema = zod_1.z.object({
|
|
11
|
+
dialogs: zod_1.z.number().int().min(0),
|
|
12
|
+
leads: zod_1.z.number().int().min(0),
|
|
13
|
+
messagesIncoming: zod_1.z.number().int().min(0),
|
|
14
|
+
messagesOutgoing: zod_1.z.number().int().min(0),
|
|
15
|
+
starsSpent: zod_1.z.number().int().min(0),
|
|
16
|
+
conversionToLeadPercent: zod_1.z.number().min(0),
|
|
17
|
+
conversionToDialogPercent: zod_1.z.number().min(0),
|
|
18
|
+
agentActivations: zod_1.z.number().int().min(0),
|
|
19
|
+
});
|
|
20
|
+
exports.AgentStatisticsBucketSchema = zod_1.z.object({
|
|
21
|
+
start: zod_1.z.string().datetime(),
|
|
22
|
+
dialogs: zod_1.z.number().int().min(0),
|
|
23
|
+
leads: zod_1.z.number().int().min(0),
|
|
24
|
+
launches: zod_1.z.number().int().min(0),
|
|
25
|
+
starsSpent: zod_1.z.number().int().min(0),
|
|
26
|
+
});
|
|
27
|
+
exports.AgentStatisticsDataSchema = zod_1.z.object({
|
|
28
|
+
range: exports.AgentStatisticsRangeSchema,
|
|
29
|
+
totals: exports.AgentStatisticsTotalsSchema,
|
|
30
|
+
chart: zod_1.z.object({
|
|
31
|
+
buckets: zod_1.z.array(exports.AgentStatisticsBucketSchema),
|
|
32
|
+
}),
|
|
33
|
+
});
|
|
@@ -38,4 +38,6 @@ __exportStar(require("./agent-document-find-result.schema"), exports);
|
|
|
38
38
|
__exportStar(require("./agent-document-chunk.schema"), exports);
|
|
39
39
|
__exportStar(require("./agent.schema"), exports);
|
|
40
40
|
__exportStar(require("./agent-aggregate.schema"), exports);
|
|
41
|
+
__exportStar(require("./agent-statistics.schema"), exports);
|
|
41
42
|
__exportStar(require("./channel.schema"), exports);
|
|
43
|
+
__exportStar(require("./message-attachment.schema"), exports);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MessageAttachmentInputSchema = exports.MessageAttachmentTypeEnum = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.MessageAttachmentTypeEnum = zod_1.z.enum([
|
|
6
|
+
'image',
|
|
7
|
+
'document',
|
|
8
|
+
'text',
|
|
9
|
+
'audio',
|
|
10
|
+
'video',
|
|
11
|
+
'other',
|
|
12
|
+
]);
|
|
13
|
+
exports.MessageAttachmentInputSchema = zod_1.z.object({
|
|
14
|
+
fileId: zod_1.z.string().uuid().optional(),
|
|
15
|
+
url: zod_1.z.string(),
|
|
16
|
+
mimeType: zod_1.z.string(),
|
|
17
|
+
type: exports.MessageAttachmentTypeEnum,
|
|
18
|
+
originalName: zod_1.z.string().optional(),
|
|
19
|
+
content: zod_1.z.string().optional(),
|
|
20
|
+
contentLength: zod_1.z.number().int().optional(),
|
|
21
|
+
});
|
|
@@ -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(),
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace GetCabinetPricePreviewCommand {
|
|
4
|
+
export const RequestParamsSchema = z.object({
|
|
5
|
+
agentId: z.string().uuid(),
|
|
6
|
+
dialogId: z.string().uuid(),
|
|
7
|
+
});
|
|
8
|
+
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
9
|
+
|
|
10
|
+
export const RequestBodySchema = z.object({
|
|
11
|
+
inputLength: z.number().int().min(0),
|
|
12
|
+
fileIds: z.array(z.string().uuid()).optional(),
|
|
13
|
+
useWebSearch: z.boolean().optional(),
|
|
14
|
+
});
|
|
15
|
+
export type RequestBody = z.infer<typeof RequestBodySchema>;
|
|
16
|
+
|
|
17
|
+
export const ResponseSchema = z.object({
|
|
18
|
+
data: z.object({
|
|
19
|
+
price: z.number().int().min(0),
|
|
20
|
+
breakdown: z.object({
|
|
21
|
+
textCost: z.number().int().min(0),
|
|
22
|
+
attachmentsCost: z.number().int().min(0),
|
|
23
|
+
webSearchCost: z.number().int().min(0),
|
|
24
|
+
}),
|
|
25
|
+
}),
|
|
26
|
+
});
|
|
27
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { MessageAttachmentTypeEnum } from '../../../models/agents/message-attachment.schema';
|
|
3
|
+
|
|
4
|
+
export namespace GetDialogContextLengthCommand {
|
|
5
|
+
export const RequestSchema = z.object({
|
|
6
|
+
teamAccountId: z.string().uuid(),
|
|
7
|
+
dialogId: z.string().uuid(),
|
|
8
|
+
inputLength: z.number().int().min(0),
|
|
9
|
+
attachments: z
|
|
10
|
+
.array(
|
|
11
|
+
z.object({
|
|
12
|
+
type: MessageAttachmentTypeEnum,
|
|
13
|
+
contentLength: z.number().int().optional(),
|
|
14
|
+
}),
|
|
15
|
+
)
|
|
16
|
+
.default([]),
|
|
17
|
+
});
|
|
18
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
19
|
+
|
|
20
|
+
export const ResponseSchema = z.object({
|
|
21
|
+
isSuccess: z.literal(true),
|
|
22
|
+
data: z.object({
|
|
23
|
+
historyChars: z.number().int().min(0),
|
|
24
|
+
totalInputChars: z.number().int().min(0),
|
|
25
|
+
modelPricing: z.object({
|
|
26
|
+
inputPrice: z.number(),
|
|
27
|
+
outputPrice: z.number(),
|
|
28
|
+
}),
|
|
29
|
+
}),
|
|
30
|
+
});
|
|
31
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
32
|
+
export type ResponseData = z.infer<typeof ResponseSchema>['data'];
|
|
33
|
+
}
|
|
@@ -5,3 +5,6 @@ export * from './clear-agent-dialog-history.command';
|
|
|
5
5
|
export * from './send-agent-dialog-admin-reply.command';
|
|
6
6
|
export * from './start-cabinet-dialog.command';
|
|
7
7
|
export * from './send-cabinet-message.command';
|
|
8
|
+
export * from './get-dialog-context-length.command';
|
|
9
|
+
export * from './get-cabinet-price-preview.command';
|
|
10
|
+
export * from './stop-cabinet-stream.command';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { MessageAttachmentInputSchema } from '../../../models/agents/message-attachment.schema';
|
|
2
3
|
|
|
3
4
|
export namespace SendCabinetMessageCommand {
|
|
4
5
|
export const RequestParamsSchema = z.object({
|
|
@@ -10,17 +11,13 @@ export namespace SendCabinetMessageCommand {
|
|
|
10
11
|
export const RequestBodySchema = z
|
|
11
12
|
.object({
|
|
12
13
|
text: z.string().optional(),
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
fileIds: z.array(z.string().uuid()).optional(),
|
|
15
|
+
useWebSearch: z.boolean().optional(),
|
|
15
16
|
})
|
|
16
|
-
.refine(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
message: 'Message must contain text, images, or attachments',
|
|
21
|
-
path: ['text'],
|
|
22
|
-
},
|
|
23
|
-
);
|
|
17
|
+
.refine((data) => data.text || (data.fileIds?.length ?? 0) > 0, {
|
|
18
|
+
message: 'Message must contain text or file attachments',
|
|
19
|
+
path: ['text'],
|
|
20
|
+
});
|
|
24
21
|
export type RequestBody = z.infer<typeof RequestBodySchema>;
|
|
25
22
|
|
|
26
23
|
export const ResponseSchema = z.object({
|
|
@@ -31,4 +28,15 @@ export namespace SendCabinetMessageCommand {
|
|
|
31
28
|
}),
|
|
32
29
|
});
|
|
33
30
|
export type Response = z.infer<typeof ResponseSchema>;
|
|
31
|
+
|
|
32
|
+
// RMQ payload sent to rugpt-agents (new format with resolved attachments)
|
|
33
|
+
export type RmqRequest = {
|
|
34
|
+
teamAccountId: string;
|
|
35
|
+
userId: string;
|
|
36
|
+
teamMemberRole?: string;
|
|
37
|
+
dialogId: string;
|
|
38
|
+
text?: string;
|
|
39
|
+
attachments: z.infer<typeof MessageAttachmentInputSchema>[];
|
|
40
|
+
useWebSearch?: boolean;
|
|
41
|
+
};
|
|
34
42
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace StopCabinetStreamCommand {
|
|
4
|
+
export const RequestParamsSchema = z.object({
|
|
5
|
+
agentId: z.string().uuid(),
|
|
6
|
+
dialogId: z.string().uuid(),
|
|
7
|
+
messageId: z.string().uuid(),
|
|
8
|
+
});
|
|
9
|
+
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
10
|
+
|
|
11
|
+
export const ResponseSchema = z.object({
|
|
12
|
+
stopped: z.boolean(),
|
|
13
|
+
});
|
|
14
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
15
|
+
}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { AgentLeadSchema } from '../../../models/agents/agent-lead.schema';
|
|
3
3
|
|
|
4
4
|
export namespace FindAgentLeadsCommand {
|
|
5
5
|
export const RequestQuerySchema = z.object({
|
|
6
6
|
dialogId: z.string().uuid().optional(),
|
|
7
|
-
limit: z.coerce.number().optional(),
|
|
8
|
-
offset: z.coerce.number().optional(),
|
|
9
7
|
});
|
|
10
8
|
export type RequestQuery = z.infer<typeof RequestQuerySchema>;
|
|
11
9
|
|
|
12
10
|
export const ResponseSchema = z.object({
|
|
13
|
-
data:
|
|
11
|
+
data: z.array(AgentLeadSchema),
|
|
14
12
|
});
|
|
15
13
|
export type Response = z.infer<typeof ResponseSchema>;
|
|
16
14
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AgentTemplateInstructionSchema } from '../../../models/agents/agent-template-instruction.schema';
|
|
3
|
+
|
|
4
|
+
export namespace GetAgentTemplateInstructionsByTemplateCommand {
|
|
5
|
+
export const RequestParamsSchema = z.object({
|
|
6
|
+
templateId: z.string().uuid(),
|
|
7
|
+
});
|
|
8
|
+
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
9
|
+
|
|
10
|
+
export const ResponseSchema = z.object({
|
|
11
|
+
data: z.array(AgentTemplateInstructionSchema),
|
|
12
|
+
});
|
|
13
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
14
|
+
}
|
|
@@ -8,6 +8,7 @@ export * from './find-agent-template-catalog.command';
|
|
|
8
8
|
export * from './find-agent-template-categories.command';
|
|
9
9
|
export * from './find-agent-template-instructions.command';
|
|
10
10
|
export * from './find-agent-templates.command';
|
|
11
|
+
export * from './get-agent-template-instructions-by-template.command';
|
|
11
12
|
export * from './update-agent-template-category.command';
|
|
12
13
|
export * from './update-agent-template-instruction.command';
|
|
13
14
|
export * from './update-agent-template.command';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AgentStatisticsDataSchema } from '../../../models/agents/agent-statistics.schema';
|
|
3
|
+
|
|
4
|
+
export namespace GetAgentStatisticsCommand {
|
|
5
|
+
export const RequestQuerySchema = z.object({
|
|
6
|
+
from: z.string().datetime().optional(),
|
|
7
|
+
to: z.string().datetime().optional(),
|
|
8
|
+
granularity: z.enum(['day', 'week', 'month']).optional().default('day'),
|
|
9
|
+
source: z.string().optional(),
|
|
10
|
+
});
|
|
11
|
+
export type RequestQuery = z.infer<typeof RequestQuerySchema>;
|
|
12
|
+
|
|
13
|
+
export const RequestParamsSchema = z.object({
|
|
14
|
+
agentId: z.string().uuid(),
|
|
15
|
+
});
|
|
16
|
+
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
17
|
+
|
|
18
|
+
export const ResponseSchema = z.object({
|
|
19
|
+
data: AgentStatisticsDataSchema,
|
|
20
|
+
});
|
|
21
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
22
|
+
|
|
23
|
+
// Internal RMQ envelope — not part of the HTTP contract
|
|
24
|
+
export type RmqResponse = {
|
|
25
|
+
isSuccess: true;
|
|
26
|
+
data: z.infer<typeof AgentStatisticsDataSchema>;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export const AgentStatisticsRangeSchema = z.object({
|
|
4
|
+
from: z.string().datetime(),
|
|
5
|
+
to: z.string().datetime(),
|
|
6
|
+
granularity: z.enum(['day', 'week', 'month']),
|
|
7
|
+
});
|
|
8
|
+
export type AgentStatisticsRange = z.infer<typeof AgentStatisticsRangeSchema>;
|
|
9
|
+
|
|
10
|
+
export const AgentStatisticsTotalsSchema = z.object({
|
|
11
|
+
dialogs: z.number().int().min(0),
|
|
12
|
+
leads: z.number().int().min(0),
|
|
13
|
+
messagesIncoming: z.number().int().min(0),
|
|
14
|
+
messagesOutgoing: z.number().int().min(0),
|
|
15
|
+
starsSpent: z.number().int().min(0),
|
|
16
|
+
conversionToLeadPercent: z.number().min(0),
|
|
17
|
+
conversionToDialogPercent: z.number().min(0),
|
|
18
|
+
agentActivations: z.number().int().min(0),
|
|
19
|
+
});
|
|
20
|
+
export type AgentStatisticsTotals = z.infer<typeof AgentStatisticsTotalsSchema>;
|
|
21
|
+
|
|
22
|
+
export const AgentStatisticsBucketSchema = z.object({
|
|
23
|
+
start: z.string().datetime(),
|
|
24
|
+
dialogs: z.number().int().min(0),
|
|
25
|
+
leads: z.number().int().min(0),
|
|
26
|
+
launches: z.number().int().min(0),
|
|
27
|
+
starsSpent: z.number().int().min(0),
|
|
28
|
+
});
|
|
29
|
+
export type AgentStatisticsBucket = z.infer<typeof AgentStatisticsBucketSchema>;
|
|
30
|
+
|
|
31
|
+
export const AgentStatisticsDataSchema = z.object({
|
|
32
|
+
range: AgentStatisticsRangeSchema,
|
|
33
|
+
totals: AgentStatisticsTotalsSchema,
|
|
34
|
+
chart: z.object({
|
|
35
|
+
buckets: z.array(AgentStatisticsBucketSchema),
|
|
36
|
+
}),
|
|
37
|
+
});
|
|
38
|
+
export type AgentStatisticsData = z.infer<typeof AgentStatisticsDataSchema>;
|
package/models/agents/index.ts
CHANGED
|
@@ -22,4 +22,6 @@ export * from './agent-document-find-result.schema';
|
|
|
22
22
|
export * from './agent-document-chunk.schema';
|
|
23
23
|
export * from './agent.schema';
|
|
24
24
|
export * from './agent-aggregate.schema';
|
|
25
|
+
export * from './agent-statistics.schema';
|
|
25
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>;
|
|
@@ -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
|
|