@bpinhosilva/agent-orchestrator 1.0.0-alpha.35 → 1.0.0-alpha.37
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/CHANGELOG.md +14 -0
- package/dist/agents/agents.service.js +5 -11
- package/dist/agents/dto/create-agent.dto.js +1 -7
- package/dist/agents/entities/agent.entity.js +3 -14
- package/dist/auth/auth.service.js +2 -2
- package/dist/auth/dto/register.dto.js +3 -3
- package/dist/auth/dto/update-profile.dto.js +3 -3
- package/dist/auth/entities/refresh-token.entity.js +2 -1
- package/dist/cli/setup/admin.js +1 -1
- package/dist/config/typeorm.js +6 -1
- package/dist/migrations/1775935855172-MigrateSimpleJsonToJsonb.js +22 -0
- package/dist/migrations/1775936433494-RenameSnakeCaseColumnsToCamelCase.js +17 -0
- package/dist/migrations/1775938708731-ConvertIdsToUuid.js +77 -0
- package/dist/migrations/1775939208983-RemoveProviderIdFromAgents.js +30 -0
- package/dist/migrations/1775940000000-DropArtifactsTable.js +13 -0
- package/dist/models/models.module.js +2 -1
- package/dist/models/models.service.js +13 -2
- package/dist/projects/entities/project-member.entity.js +0 -1
- package/dist/system-settings/entities/system-settings.entity.js +2 -1
- package/dist/tasks/entities/comment.entity.js +2 -1
- package/dist/tasks/entities/recurrent-task-exec.entity.js +4 -2
- package/dist/tasks/entities/recurrent-task.entity.js +1 -0
- package/dist/tasks/entities/task.entity.js +6 -5
- package/dist/tasks/task-scheduler.service.js +2 -2
- package/dist/ui/assets/AgentFleet-CJZli5uA.js +1 -0
- package/dist/ui/assets/{AttachmentItem-QhT0YOmu.js → AttachmentItem-BtWBbVb3.js} +1 -1
- package/dist/ui/assets/ConfirmDialog-0ML5KiMx.js +1 -0
- package/dist/ui/assets/CreateRecurrentTaskModal-CBDVBNo3.js +1 -0
- package/dist/ui/assets/{MarkdownField-DJ12Ejut.js → MarkdownField-NTZbIxf_.js} +1 -1
- package/dist/ui/assets/Profile-CqypVkz4.js +1 -0
- package/dist/ui/assets/{ProjectDetail-D9GECicH.js → ProjectDetail-qhJ1BW1O.js} +1 -1
- package/dist/ui/assets/Providers-DCwmZwIR.js +1 -0
- package/dist/ui/assets/Scheduler-p4EMmdyC.js +1 -0
- package/dist/ui/assets/{Settings-CPWN7Z5a.js → Settings-D9CpYRIX.js} +1 -1
- package/dist/ui/assets/{TaskDetail-DmbJFnj7.js → TaskDetail-BEeV-tnd.js} +1 -1
- package/dist/ui/assets/TaskExecutions-vewMhs1F.js +2 -0
- package/dist/ui/assets/TaskManager-BbH2Ryxd.js +8 -0
- package/dist/ui/assets/UserDetail-obJE0ziY.js +1 -0
- package/dist/ui/assets/Users-Byt4xdom.js +1 -0
- package/dist/ui/assets/index-UgPpBNRb.js +3 -0
- package/dist/ui/assets/index-gxaIk1id.css +2 -0
- package/dist/ui/assets/providers-W8KP5fBt.js +1 -0
- package/dist/ui/assets/x-CM5VLsbZ.js +1 -0
- package/dist/ui/index.html +3 -2
- package/dist/users/dto/create-user.dto.js +3 -3
- package/dist/users/entities/user.entity.js +1 -1
- package/dist/users/users.service.js +2 -2
- package/package.json +1 -1
- package/dist/ui/assets/AgentFleet-eDOzJ1ln.js +0 -1
- package/dist/ui/assets/ConfirmDialog-BC4kXR-v.js +0 -1
- package/dist/ui/assets/CreateRecurrentTaskModal-3i2kvJ7D.js +0 -1
- package/dist/ui/assets/Profile-CIVwII8X.js +0 -1
- package/dist/ui/assets/Providers-e_57YNh2.js +0 -1
- package/dist/ui/assets/Scheduler-D8kBg7x3.js +0 -1
- package/dist/ui/assets/TaskExecutions-DSqVbwe_.js +0 -2
- package/dist/ui/assets/TaskManager-A75O4y6b.js +0 -8
- package/dist/ui/assets/UserDetail-DQxuKynZ.js +0 -1
- package/dist/ui/assets/Users-BLJjzn5Z.js +0 -1
- package/dist/ui/assets/index-B-2XAA2C.js +0 -3
- package/dist/ui/assets/index-BUrAFVNL.css +0 -2
- package/dist/ui/assets/providers-BLAJFnS4.js +0 -1
- package/dist/ui/assets/trending-up-D2Iapk5q.js +0 -1
- /package/dist/ui/assets/{clock-BTNXfvPT.js → clock-B13B5_wP.js} +0 -0
- /package/dist/ui/assets/{eye-CSLoB6-a.js → eye-C7PLqIzx.js} +0 -0
- /package/dist/ui/assets/{file-text-CRyDRJx0.js → file-text-D92QURK8.js} +0 -0
- /package/dist/ui/assets/{layers-CpiP5U5p.js → layers-CNTE6Cl4.js} +0 -0
- /package/dist/ui/assets/{loader-circle-DbVXtlbV.js → loader-circle-BJWGdyUC.js} +0 -0
- /package/dist/ui/assets/{paperclip-6x5JJ7A7.js → paperclip-b4O2LqQ-.js} +0 -0
- /package/dist/ui/assets/{refresh-cw-BGkg-lCf.js → refresh-cw-Bx28oH-b.js} +0 -0
- /package/dist/ui/assets/{rocket-DzN1Mizs.js → rocket-D75KmVDG.js} +0 -0
- /package/dist/ui/assets/{save-zLR2Bpx5.js → save-BJqQo16R.js} +0 -0
- /package/dist/ui/assets/{send-Bwuzypop.js → send-DHRDZ09J.js} +0 -0
- /package/dist/ui/assets/{shield-alert-BRwAB12k.js → shield-alert-DwOWpTph.js} +0 -0
- /package/dist/ui/assets/{shield-check-CdGbbgI2.js → shield-check-5104WjFF.js} +0 -0
- /package/dist/ui/assets/{terminal-DXcWSHx9.js → terminal-FItpYHvw.js} +0 -0
- /package/dist/ui/assets/{trash-2-BWnYC9Ad.js → trash-2-BlARVDmE.js} +0 -0
- /package/dist/ui/assets/{user-plus-CiJgTJ8j.js → user-plus-5rm15Rqq.js} +0 -0
- /package/dist/ui/assets/{users-BVNMRlU5.js → users-KvCcsozL.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [1.0.0-alpha.37](https://github.com/bpinhosilva/agent-orchestrator/compare/v1.0.0-alpha.36...v1.0.0-alpha.37) (2026-04-13)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **models:** implement model deletion with agent association check and enhance UI for model mgn ([e4cc599](https://github.com/bpinhosilva/agent-orchestrator/commit/e4cc599263f910e80e00116218e9408ec2ac2bf3))
|
|
7
|
+
|
|
8
|
+
# [1.0.0-alpha.36](https://github.com/bpinhosilva/agent-orchestrator/compare/v1.0.0-alpha.35...v1.0.0-alpha.36) (2026-04-13)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Performance Improvements
|
|
12
|
+
|
|
13
|
+
* **db:** optimize schema with composite and missing indexes ([091d7c4](https://github.com/bpinhosilva/agent-orchestrator/commit/091d7c417d9b3291d704754f8cd0b22924aec871))
|
|
14
|
+
|
|
1
15
|
# [1.0.0-alpha.35](https://github.com/bpinhosilva/agent-orchestrator/compare/v1.0.0-alpha.34...v1.0.0-alpha.35) (2026-04-11)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -20,7 +20,7 @@ const typeorm_2 = require("typeorm");
|
|
|
20
20
|
const agent_entity_1 = require("./entities/agent.entity");
|
|
21
21
|
const agent_registry_1 = require("./registry/agent.registry");
|
|
22
22
|
const core_1 = require("@nestjs/core");
|
|
23
|
-
const AGENT_RELATIONS = ['model'
|
|
23
|
+
const AGENT_RELATIONS = ['model'];
|
|
24
24
|
let AgentsService = AgentsService_1 = class AgentsService {
|
|
25
25
|
agentRepository;
|
|
26
26
|
moduleRef;
|
|
@@ -53,9 +53,9 @@ let AgentsService = AgentsService_1 = class AgentsService {
|
|
|
53
53
|
this.agentInstances.delete(agentEntity.id);
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
|
-
const providerName = agentEntity.provider?.name?.toLowerCase();
|
|
56
|
+
const providerName = agentEntity.model?.provider?.name?.toLowerCase();
|
|
57
57
|
if (!providerName) {
|
|
58
|
-
this.logger.warn(`No provider found for agent #${agentEntity.id}. Skipping instance creation.`);
|
|
58
|
+
this.logger.warn(`No provider found for agent #${agentEntity.id} (via model). Skipping instance creation.`);
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
61
|
const AgentClass = (0, agent_registry_1.getAgentImplementation)(providerName);
|
|
@@ -84,14 +84,11 @@ let AgentsService = AgentsService_1 = class AgentsService {
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
async create(createAgentDto) {
|
|
87
|
-
const { modelId,
|
|
87
|
+
const { modelId, ...rest } = createAgentDto;
|
|
88
88
|
const agentData = { ...rest };
|
|
89
89
|
if (modelId) {
|
|
90
90
|
agentData.model = { id: modelId };
|
|
91
91
|
}
|
|
92
|
-
if (providerId) {
|
|
93
|
-
agentData.provider = { id: providerId };
|
|
94
|
-
}
|
|
95
92
|
return await this.agentRepository.manager.transaction(async (manager) => {
|
|
96
93
|
const agent = manager.create(agent_entity_1.AgentEntity, agentData);
|
|
97
94
|
const savedAgent = await manager.save(agent);
|
|
@@ -120,14 +117,11 @@ let AgentsService = AgentsService_1 = class AgentsService {
|
|
|
120
117
|
return agent;
|
|
121
118
|
}
|
|
122
119
|
async update(id, updateAgentDto) {
|
|
123
|
-
const { modelId,
|
|
120
|
+
const { modelId, ...rest } = updateAgentDto;
|
|
124
121
|
const updateData = { ...rest };
|
|
125
122
|
if (modelId) {
|
|
126
123
|
updateData.model = { id: modelId };
|
|
127
124
|
}
|
|
128
|
-
if (providerId) {
|
|
129
|
-
updateData.provider = { id: providerId };
|
|
130
|
-
}
|
|
131
125
|
return await this.agentRepository.manager.transaction(async (manager) => {
|
|
132
126
|
await manager.update(agent_entity_1.AgentEntity, id, updateData);
|
|
133
127
|
const updatedAgent = await manager.findOne(agent_entity_1.AgentEntity, {
|
|
@@ -23,10 +23,9 @@ class CreateAgentDto {
|
|
|
23
23
|
modelId;
|
|
24
24
|
status;
|
|
25
25
|
emoji;
|
|
26
|
-
providerId;
|
|
27
26
|
attributes;
|
|
28
27
|
static _OPENAPI_METADATA_FACTORY() {
|
|
29
|
-
return { name: { required: true, type: () => String, maxLength: 200 }, description: { required: false, type: () => String, maxLength: 2000 }, role: { required: false, type: () => String, maxLength: 200 }, systemInstructions: { required: false, type: () => String, maxLength: 10000 }, modelId: { required: true, type: () => String }, status: { required: false, type: () => String, enum: ['active', 'inactive'] }, emoji: { required: false, type: () => Object, enum: agent_emoji_constants_1.AGENT_EMOJI_VALUES },
|
|
28
|
+
return { name: { required: true, type: () => String, maxLength: 200 }, description: { required: false, type: () => String, maxLength: 2000 }, role: { required: false, type: () => String, maxLength: 200 }, systemInstructions: { required: false, type: () => String, maxLength: 10000 }, modelId: { required: true, type: () => String }, status: { required: false, type: () => String, enum: ['active', 'inactive'] }, emoji: { required: false, type: () => Object, enum: agent_emoji_constants_1.AGENT_EMOJI_VALUES }, attributes: { required: false, type: () => require("./agent-attributes.dto").AgentAttributesDto } };
|
|
30
29
|
}
|
|
31
30
|
}
|
|
32
31
|
exports.CreateAgentDto = CreateAgentDto;
|
|
@@ -71,11 +70,6 @@ __decorate([
|
|
|
71
70
|
(0, class_validator_1.IsIn)(agent_emoji_constants_1.AGENT_EMOJI_VALUES),
|
|
72
71
|
__metadata("design:type", String)
|
|
73
72
|
], CreateAgentDto.prototype, "emoji", void 0);
|
|
74
|
-
__decorate([
|
|
75
|
-
(0, class_validator_1.IsUUID)(),
|
|
76
|
-
(0, class_validator_1.IsNotEmpty)(),
|
|
77
|
-
__metadata("design:type", String)
|
|
78
|
-
], CreateAgentDto.prototype, "providerId", void 0);
|
|
79
73
|
__decorate([
|
|
80
74
|
(0, class_validator_1.IsOptional)(),
|
|
81
75
|
(0, class_validator_1.ValidateNested)(),
|
|
@@ -13,8 +13,8 @@ exports.AgentEntity = void 0;
|
|
|
13
13
|
const openapi = require("@nestjs/swagger");
|
|
14
14
|
const typeorm_1 = require("typeorm");
|
|
15
15
|
const model_entity_1 = require("../../models/entities/model.entity");
|
|
16
|
-
const provider_entity_1 = require("../../providers/entities/provider.entity");
|
|
17
16
|
const agent_emoji_constants_1 = require("../agent-emoji.constants");
|
|
17
|
+
const typeorm_2 = require("../../config/typeorm");
|
|
18
18
|
let AgentEntity = class AgentEntity {
|
|
19
19
|
id;
|
|
20
20
|
name;
|
|
@@ -24,12 +24,11 @@ let AgentEntity = class AgentEntity {
|
|
|
24
24
|
status;
|
|
25
25
|
emoji;
|
|
26
26
|
attributes;
|
|
27
|
-
provider;
|
|
28
27
|
model;
|
|
29
28
|
createdAt;
|
|
30
29
|
updatedAt;
|
|
31
30
|
static _OPENAPI_METADATA_FACTORY() {
|
|
32
|
-
return { id: { required: true, type: () => String }, name: { required: true, type: () => String }, description: { required: true, type: () => String }, systemInstructions: { required: true, type: () => String }, role: { required: true, type: () => String, nullable: true }, status: { required: true, type: () => String, nullable: true }, emoji: { required: true, type: () => Object }, attributes: { required: true, type: () => Object, nullable: true },
|
|
31
|
+
return { id: { required: true, type: () => String }, name: { required: true, type: () => String }, description: { required: true, type: () => String }, systemInstructions: { required: true, type: () => String }, role: { required: true, type: () => String, nullable: true }, status: { required: true, type: () => String, nullable: true }, emoji: { required: true, type: () => Object }, attributes: { required: true, type: () => Object, nullable: true }, model: { required: true, type: () => require("../../models/entities/model.entity").Model, nullable: true }, createdAt: { required: true, type: () => Date }, updatedAt: { required: true, type: () => Date } };
|
|
33
32
|
}
|
|
34
33
|
};
|
|
35
34
|
exports.AgentEntity = AgentEntity;
|
|
@@ -62,19 +61,9 @@ __decorate([
|
|
|
62
61
|
__metadata("design:type", String)
|
|
63
62
|
], AgentEntity.prototype, "emoji", void 0);
|
|
64
63
|
__decorate([
|
|
65
|
-
(0, typeorm_1.Column)({ type:
|
|
64
|
+
(0, typeorm_1.Column)({ type: typeorm_2.JSON_COLUMN_TYPE, nullable: true }),
|
|
66
65
|
__metadata("design:type", Object)
|
|
67
66
|
], AgentEntity.prototype, "attributes", void 0);
|
|
68
|
-
__decorate([
|
|
69
|
-
(0, typeorm_1.Index)(),
|
|
70
|
-
(0, typeorm_1.ManyToOne)(() => provider_entity_1.Provider, {
|
|
71
|
-
nullable: true,
|
|
72
|
-
eager: true,
|
|
73
|
-
onDelete: 'SET NULL',
|
|
74
|
-
}),
|
|
75
|
-
(0, typeorm_1.JoinColumn)({ name: 'providerId' }),
|
|
76
|
-
__metadata("design:type", Object)
|
|
77
|
-
], AgentEntity.prototype, "provider", void 0);
|
|
78
67
|
__decorate([
|
|
79
68
|
(0, typeorm_1.Index)(),
|
|
80
69
|
(0, typeorm_1.ManyToOne)(() => model_entity_1.Model, (model) => model.agents, {
|
|
@@ -229,8 +229,8 @@ let AuthService = class AuthService {
|
|
|
229
229
|
const updateData = {};
|
|
230
230
|
if (dto.name !== undefined)
|
|
231
231
|
updateData.name = dto.name;
|
|
232
|
-
if (dto.
|
|
233
|
-
updateData.
|
|
232
|
+
if (dto.lastName !== undefined)
|
|
233
|
+
updateData.lastName = dto.lastName;
|
|
234
234
|
if (dto.email !== undefined)
|
|
235
235
|
updateData.email = dto.email;
|
|
236
236
|
if (dto.avatar !== undefined)
|
|
@@ -15,12 +15,12 @@ const class_validator_1 = require("class-validator");
|
|
|
15
15
|
const avatar_constants_1 = require("../../users/avatar.constants");
|
|
16
16
|
class RegisterDto {
|
|
17
17
|
name;
|
|
18
|
-
|
|
18
|
+
lastName;
|
|
19
19
|
email;
|
|
20
20
|
password;
|
|
21
21
|
avatar;
|
|
22
22
|
static _OPENAPI_METADATA_FACTORY() {
|
|
23
|
-
return { name: { required: true, type: () => String, maxLength: 100 },
|
|
23
|
+
return { name: { required: true, type: () => String, maxLength: 100 }, lastName: { required: true, type: () => String, maxLength: 100 }, email: { required: true, type: () => String, maxLength: 255, format: "email" }, password: { required: true, type: () => String, minLength: 8, maxLength: 72 }, avatar: { required: false, type: () => Object, enum: avatar_constants_1.USER_AVATAR_KEYS } };
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
exports.RegisterDto = RegisterDto;
|
|
@@ -35,7 +35,7 @@ __decorate([
|
|
|
35
35
|
(0, class_validator_1.IsNotEmpty)(),
|
|
36
36
|
(0, class_validator_1.MaxLength)(100),
|
|
37
37
|
__metadata("design:type", String)
|
|
38
|
-
], RegisterDto.prototype, "
|
|
38
|
+
], RegisterDto.prototype, "lastName", void 0);
|
|
39
39
|
__decorate([
|
|
40
40
|
(0, class_validator_1.IsEmail)(),
|
|
41
41
|
(0, class_validator_1.MaxLength)(255),
|
|
@@ -15,13 +15,13 @@ const class_validator_1 = require("class-validator");
|
|
|
15
15
|
const avatar_constants_1 = require("../../users/avatar.constants");
|
|
16
16
|
class UpdateProfileDto {
|
|
17
17
|
name;
|
|
18
|
-
|
|
18
|
+
lastName;
|
|
19
19
|
email;
|
|
20
20
|
currentPassword;
|
|
21
21
|
newPassword;
|
|
22
22
|
avatar;
|
|
23
23
|
static _OPENAPI_METADATA_FACTORY() {
|
|
24
|
-
return { name: { required: false, type: () => String, maxLength: 100 },
|
|
24
|
+
return { name: { required: false, type: () => String, maxLength: 100 }, lastName: { required: false, type: () => String, maxLength: 100 }, email: { required: false, type: () => String, maxLength: 255, format: "email" }, currentPassword: { required: false, type: () => String, minLength: 8, maxLength: 72 }, newPassword: { required: false, type: () => String, minLength: 8, maxLength: 72 }, avatar: { required: false, type: () => Object, enum: avatar_constants_1.USER_AVATAR_KEYS } };
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
exports.UpdateProfileDto = UpdateProfileDto;
|
|
@@ -36,7 +36,7 @@ __decorate([
|
|
|
36
36
|
(0, class_validator_1.IsString)(),
|
|
37
37
|
(0, class_validator_1.MaxLength)(100),
|
|
38
38
|
__metadata("design:type", String)
|
|
39
|
-
], UpdateProfileDto.prototype, "
|
|
39
|
+
], UpdateProfileDto.prototype, "lastName", void 0);
|
|
40
40
|
__decorate([
|
|
41
41
|
(0, class_validator_1.IsOptional)(),
|
|
42
42
|
(0, class_validator_1.IsEmail)(),
|
|
@@ -13,6 +13,7 @@ exports.RefreshToken = void 0;
|
|
|
13
13
|
const openapi = require("@nestjs/swagger");
|
|
14
14
|
const typeorm_1 = require("typeorm");
|
|
15
15
|
const user_entity_1 = require("../../users/entities/user.entity");
|
|
16
|
+
const typeorm_2 = require("../../config/typeorm");
|
|
16
17
|
let RefreshToken = class RefreshToken {
|
|
17
18
|
id;
|
|
18
19
|
userId;
|
|
@@ -33,7 +34,7 @@ __decorate([
|
|
|
33
34
|
__metadata("design:type", String)
|
|
34
35
|
], RefreshToken.prototype, "id", void 0);
|
|
35
36
|
__decorate([
|
|
36
|
-
(0, typeorm_1.Column)(),
|
|
37
|
+
(0, typeorm_1.Column)({ type: typeorm_2.UUID_COLUMN_TYPE }),
|
|
37
38
|
__metadata("design:type", String)
|
|
38
39
|
], RefreshToken.prototype, "userId", void 0);
|
|
39
40
|
__decorate([
|
package/dist/cli/setup/admin.js
CHANGED
|
@@ -103,7 +103,7 @@ bcryptDep = require('bcrypt')) {
|
|
|
103
103
|
const hashedPassword = await bcryptDep.hash(response.password, 10);
|
|
104
104
|
const user = userRepository.create({
|
|
105
105
|
name: response.name,
|
|
106
|
-
|
|
106
|
+
lastName: 'User',
|
|
107
107
|
email: response.email,
|
|
108
108
|
password: hashedPassword,
|
|
109
109
|
avatar: avatar_constants_1.DEFAULT_USER_AVATAR,
|
package/dist/config/typeorm.js
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createDataSource = exports.getTypeOrmConfig = void 0;
|
|
3
|
+
exports.createDataSource = exports.getTypeOrmConfig = exports.UUID_COLUMN_TYPE = exports.JSON_COLUMN_TYPE = void 0;
|
|
4
4
|
exports.resolveDataSourceType = resolveDataSourceType;
|
|
5
5
|
exports.isSqliteDriver = isSqliteDriver;
|
|
6
6
|
const typeorm_1 = require("typeorm");
|
|
7
7
|
const config_1 = require("@nestjs/config");
|
|
8
8
|
const path_1 = require("path");
|
|
9
9
|
const runtime_paths_1 = require("./runtime-paths");
|
|
10
|
+
(0, runtime_paths_1.loadRuntimeEnv)();
|
|
11
|
+
const dbType = process.env.DB_TYPE;
|
|
12
|
+
const databaseUrl = process.env.DATABASE_URL;
|
|
13
|
+
exports.JSON_COLUMN_TYPE = dbType === 'sqlite' || (!dbType && !databaseUrl) ? 'simple-json' : 'jsonb';
|
|
14
|
+
exports.UUID_COLUMN_TYPE = dbType === 'sqlite' || (!dbType && !databaseUrl) ? 'varchar' : 'uuid';
|
|
10
15
|
function resolveDataSourceType(dbType) {
|
|
11
16
|
return dbType === 'sqlite' ? 'better-sqlite3' : 'postgres';
|
|
12
17
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MigrateSimpleJsonToJsonb1775935855172 = void 0;
|
|
4
|
+
const typeorm_1 = require("../config/typeorm");
|
|
5
|
+
class MigrateSimpleJsonToJsonb1775935855172 {
|
|
6
|
+
name = 'MigrateSimpleJsonToJsonb1775935855172';
|
|
7
|
+
async up(queryRunner) {
|
|
8
|
+
const isSqlite = (0, typeorm_1.isSqliteDriver)(queryRunner.connection.options.type);
|
|
9
|
+
if (!isSqlite) {
|
|
10
|
+
await queryRunner.query(`ALTER TABLE "task_comments" ALTER COLUMN "artifacts" TYPE jsonb USING "artifacts"::jsonb`);
|
|
11
|
+
await queryRunner.query(`ALTER TABLE "recurrent_task_execs" ALTER COLUMN "artifacts" TYPE jsonb USING "artifacts"::jsonb`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
async down(queryRunner) {
|
|
15
|
+
const isSqlite = (0, typeorm_1.isSqliteDriver)(queryRunner.connection.options.type);
|
|
16
|
+
if (!isSqlite) {
|
|
17
|
+
await queryRunner.query(`ALTER TABLE "task_comments" ALTER COLUMN "artifacts" TYPE text USING "artifacts"::text`);
|
|
18
|
+
await queryRunner.query(`ALTER TABLE "recurrent_task_execs" ALTER COLUMN "artifacts" TYPE text USING "artifacts"::text`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.MigrateSimpleJsonToJsonb1775935855172 = MigrateSimpleJsonToJsonb1775935855172;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RenameSnakeCaseColumnsToCamelCase1775936433494 = void 0;
|
|
4
|
+
class RenameSnakeCaseColumnsToCamelCase1775936433494 {
|
|
5
|
+
name = 'RenameSnakeCaseColumnsToCamelCase1775936433494';
|
|
6
|
+
async up(queryRunner) {
|
|
7
|
+
await queryRunner.query(`ALTER TABLE "users" RENAME COLUMN "last_name" TO "lastName"`);
|
|
8
|
+
await queryRunner.query(`ALTER TABLE "tasks" RENAME COLUMN "cost_estimate" TO "costEstimate"`);
|
|
9
|
+
await queryRunner.query(`ALTER TABLE "tasks" RENAME COLUMN "llm_latency" TO "llmLatency"`);
|
|
10
|
+
}
|
|
11
|
+
async down(queryRunner) {
|
|
12
|
+
await queryRunner.query(`ALTER TABLE "users" RENAME COLUMN "lastName" TO "last_name"`);
|
|
13
|
+
await queryRunner.query(`ALTER TABLE "tasks" RENAME COLUMN "costEstimate" TO "cost_estimate"`);
|
|
14
|
+
await queryRunner.query(`ALTER TABLE "tasks" RENAME COLUMN "llmLatency" TO "llm_latency"`);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.RenameSnakeCaseColumnsToCamelCase1775936433494 = RenameSnakeCaseColumnsToCamelCase1775936433494;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConvertIdsToUuid1775938708731 = void 0;
|
|
4
|
+
const typeorm_1 = require("../config/typeorm");
|
|
5
|
+
class ConvertIdsToUuid1775938708731 {
|
|
6
|
+
name = 'ConvertIdsToUuid1775938708731';
|
|
7
|
+
async up(queryRunner) {
|
|
8
|
+
const isSqlite = (0, typeorm_1.isSqliteDriver)(queryRunner.connection.options.type);
|
|
9
|
+
if (isSqlite) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
await queryRunner.query(`ALTER TABLE "models" DROP CONSTRAINT "FK_2ce64b8d909a4385f26bcd363b3"`);
|
|
13
|
+
await queryRunner.query(`ALTER TABLE "agents" DROP CONSTRAINT "FK_e927e225423f493fb58dc146cf0"`);
|
|
14
|
+
await queryRunner.query(`ALTER TABLE "agents" DROP CONSTRAINT "FK_ef998451a458221d3c409b37923"`);
|
|
15
|
+
await queryRunner.query(`ALTER TABLE "projects" DROP CONSTRAINT "FK_6cb68059ab1223de4f03f9a7268"`);
|
|
16
|
+
await queryRunner.query(`ALTER TABLE "project_members" DROP CONSTRAINT "FK_d19892d8f03928e5bfc7313780c"`);
|
|
17
|
+
await queryRunner.query(`ALTER TABLE "project_members" DROP CONSTRAINT "FK_08d1346ff91abba68e5a637cfdb"`);
|
|
18
|
+
await queryRunner.query(`ALTER TABLE "tasks" DROP CONSTRAINT "FK_9a16d2c86252529f622fa53f1e3"`);
|
|
19
|
+
await queryRunner.query(`ALTER TABLE "tasks" DROP CONSTRAINT "FK_e08fca67ca8966e6b9914bf2956"`);
|
|
20
|
+
await queryRunner.query(`ALTER TABLE "task_comments" DROP CONSTRAINT "FK_ba265816ca1d93f51083e06c520"`);
|
|
21
|
+
await queryRunner.query(`ALTER TABLE "task_comments" DROP CONSTRAINT "FK_70a6d3ec52a15e0ff43d4ad3532"`);
|
|
22
|
+
await queryRunner.query(`ALTER TABLE "task_comments" DROP CONSTRAINT "FK_c2d5d4e5e1e33278318fa6b2b05"`);
|
|
23
|
+
await queryRunner.query(`ALTER TABLE "recurrent_tasks" DROP CONSTRAINT "FK_9ec101b70a5f9612b0757d87c83"`);
|
|
24
|
+
await queryRunner.query(`ALTER TABLE "recurrent_tasks" DROP CONSTRAINT "FK_0f9f543bd40419122e69aeff006"`);
|
|
25
|
+
await queryRunner.query(`ALTER TABLE "recurrent_task_execs" DROP CONSTRAINT "FK_f5bb7be33ddb87ac0f04807b4ab"`);
|
|
26
|
+
await queryRunner.query(`ALTER TABLE "refresh_tokens" DROP CONSTRAINT "FK_610102b60fea1455310ccd299de"`);
|
|
27
|
+
const tables = [
|
|
28
|
+
{ name: 'users', ids: ['id'] },
|
|
29
|
+
{ name: 'providers', ids: ['id'] },
|
|
30
|
+
{ name: 'models', ids: ['id', 'providerId'] },
|
|
31
|
+
{ name: 'agents', ids: ['id', 'providerId', 'modelId'] },
|
|
32
|
+
{ name: 'projects', ids: ['id', 'ownerAgentId'] },
|
|
33
|
+
{ name: 'project_members', ids: ['id', 'projectId', 'userId'] },
|
|
34
|
+
{ name: 'tasks', ids: ['id', 'assigneeId', 'projectId'] },
|
|
35
|
+
{
|
|
36
|
+
name: 'task_comments',
|
|
37
|
+
ids: ['id', 'taskId', 'authorUserId', 'authorAgentId'],
|
|
38
|
+
},
|
|
39
|
+
{ name: 'recurrent_tasks', ids: ['id', 'assigneeId', 'projectId'] },
|
|
40
|
+
{ name: 'recurrent_task_execs', ids: ['id', 'recurrentTaskId'] },
|
|
41
|
+
{ name: 'artifacts', ids: ['id'] },
|
|
42
|
+
{ name: 'refresh_tokens', ids: ['id', 'userId'] },
|
|
43
|
+
{ name: 'system_settings', ids: ['id'] },
|
|
44
|
+
];
|
|
45
|
+
for (const table of tables) {
|
|
46
|
+
for (const col of table.ids) {
|
|
47
|
+
await queryRunner.query(`ALTER TABLE "${table.name}" ALTER COLUMN "${col}" TYPE uuid USING "${col}"::uuid`);
|
|
48
|
+
if (col === 'id') {
|
|
49
|
+
await queryRunner.query(`ALTER TABLE "${table.name}" ALTER COLUMN "${col}" SET DEFAULT gen_random_uuid()`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
await queryRunner.query(`ALTER TABLE "models" ADD CONSTRAINT "FK_2ce64b8d909a4385f26bcd363b3" FOREIGN KEY ("providerId") REFERENCES "providers"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
54
|
+
await queryRunner.query(`ALTER TABLE "agents" ADD CONSTRAINT "FK_e927e225423f493fb58dc146cf0" FOREIGN KEY ("providerId") REFERENCES "providers"("id") ON DELETE SET NULL ON UPDATE NO ACTION`);
|
|
55
|
+
await queryRunner.query(`ALTER TABLE "agents" ADD CONSTRAINT "FK_ef998451a458221d3c409b37923" FOREIGN KEY ("modelId") REFERENCES "models"("id") ON DELETE SET NULL ON UPDATE NO ACTION`);
|
|
56
|
+
await queryRunner.query(`ALTER TABLE "projects" ADD CONSTRAINT "FK_6cb68059ab1223de4f03f9a7268" FOREIGN KEY ("ownerAgentId") REFERENCES "agents"("id") ON DELETE SET NULL ON UPDATE NO ACTION`);
|
|
57
|
+
await queryRunner.query(`ALTER TABLE "project_members" ADD CONSTRAINT "FK_d19892d8f03928e5bfc7313780c" FOREIGN KEY ("projectId") REFERENCES "projects"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
58
|
+
await queryRunner.query(`ALTER TABLE "project_members" ADD CONSTRAINT "FK_08d1346ff91abba68e5a637cfdb" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
59
|
+
await queryRunner.query(`ALTER TABLE "tasks" ADD CONSTRAINT "FK_9a16d2c86252529f622fa53f1e3" FOREIGN KEY ("assigneeId") REFERENCES "agents"("id") ON DELETE SET NULL ON UPDATE NO ACTION`);
|
|
60
|
+
await queryRunner.query(`ALTER TABLE "tasks" ADD CONSTRAINT "FK_e08fca67ca8966e6b9914bf2956" FOREIGN KEY ("projectId") REFERENCES "projects"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
61
|
+
await queryRunner.query(`ALTER TABLE "task_comments" ADD CONSTRAINT "FK_ba265816ca1d93f51083e06c520" FOREIGN KEY ("taskId") REFERENCES "tasks"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
62
|
+
await queryRunner.query(`ALTER TABLE "task_comments" ADD CONSTRAINT "FK_70a6d3ec52a15e0ff43d4ad3532" FOREIGN KEY ("authorUserId") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE NO ACTION`);
|
|
63
|
+
await queryRunner.query(`ALTER TABLE "task_comments" ADD CONSTRAINT "FK_c2d5d4e5e1e33278318fa6b2b05" FOREIGN KEY ("authorAgentId") REFERENCES "agents"("id") ON DELETE SET NULL ON UPDATE NO ACTION`);
|
|
64
|
+
await queryRunner.query(`ALTER TABLE "recurrent_tasks" ADD CONSTRAINT "FK_9ec101b70a5f9612b0757d87c83" FOREIGN KEY ("assigneeId") REFERENCES "agents"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
65
|
+
await queryRunner.query(`ALTER TABLE "recurrent_tasks" ADD CONSTRAINT "FK_0f9f543bd40419122e69aeff006" FOREIGN KEY ("projectId") REFERENCES "projects"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
66
|
+
await queryRunner.query(`ALTER TABLE "recurrent_task_execs" ADD CONSTRAINT "FK_f5bb7be33ddb87ac0f04807b4ab" FOREIGN KEY ("recurrentTaskId") REFERENCES "recurrent_tasks"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
67
|
+
await queryRunner.query(`ALTER TABLE "refresh_tokens" ADD CONSTRAINT "FK_610102b60fea1455310ccd299de" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
68
|
+
}
|
|
69
|
+
down(queryRunner) {
|
|
70
|
+
const isSqlite = (0, typeorm_1.isSqliteDriver)(queryRunner.connection.options.type);
|
|
71
|
+
if (isSqlite) {
|
|
72
|
+
return Promise.resolve();
|
|
73
|
+
}
|
|
74
|
+
return Promise.resolve();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
exports.ConvertIdsToUuid1775938708731 = ConvertIdsToUuid1775938708731;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RemoveProviderIdFromAgents1775939208983 = void 0;
|
|
4
|
+
const typeorm_1 = require("../config/typeorm");
|
|
5
|
+
class RemoveProviderIdFromAgents1775939208983 {
|
|
6
|
+
name = 'RemoveProviderIdFromAgents1775939208983';
|
|
7
|
+
async up(queryRunner) {
|
|
8
|
+
const isSqlite = (0, typeorm_1.isSqliteDriver)(queryRunner.connection.options.type);
|
|
9
|
+
if (isSqlite) {
|
|
10
|
+
await queryRunner.dropColumn('agents', 'providerId');
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
await queryRunner.query(`ALTER TABLE "agents" DROP CONSTRAINT "FK_e927e225423f493fb58dc146cf0"`);
|
|
14
|
+
await queryRunner.query(`DROP INDEX "IDX_e927e225423f493fb58dc146cf"`);
|
|
15
|
+
await queryRunner.query(`ALTER TABLE "agents" DROP COLUMN "providerId"`);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
async down(queryRunner) {
|
|
19
|
+
const isSqlite = (0, typeorm_1.isSqliteDriver)(queryRunner.connection.options.type);
|
|
20
|
+
if (isSqlite) {
|
|
21
|
+
await queryRunner.query(`ALTER TABLE "agents" ADD COLUMN "providerId" varchar`);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
await queryRunner.query(`ALTER TABLE "agents" ADD COLUMN "providerId" uuid`);
|
|
25
|
+
await queryRunner.query(`CREATE INDEX "IDX_e927e225423f493fb58dc146cf" ON "agents" ("providerId")`);
|
|
26
|
+
await queryRunner.query(`ALTER TABLE "agents" ADD CONSTRAINT "FK_e927e225423f493fb58dc146cf0" FOREIGN KEY ("providerId") REFERENCES "providers"("id") ON DELETE SET NULL ON UPDATE NO ACTION`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.RemoveProviderIdFromAgents1775939208983 = RemoveProviderIdFromAgents1775939208983;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DropArtifactsTable1775940000000 = void 0;
|
|
4
|
+
class DropArtifactsTable1775940000000 {
|
|
5
|
+
name = 'DropArtifactsTable1775940000000';
|
|
6
|
+
async up(queryRunner) {
|
|
7
|
+
await queryRunner.query(`DROP TABLE "artifacts"`);
|
|
8
|
+
}
|
|
9
|
+
async down(queryRunner) {
|
|
10
|
+
await queryRunner.query(`CREATE TABLE "artifacts" ("id" uuid PRIMARY KEY NOT NULL DEFAULT gen_random_uuid(), "originalName" varchar NOT NULL, "mimeType" varchar NOT NULL, "filePath" varchar NOT NULL, "metadata" text)`);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.DropArtifactsTable1775940000000 = DropArtifactsTable1775940000000;
|
|
@@ -12,12 +12,13 @@ const typeorm_1 = require("@nestjs/typeorm");
|
|
|
12
12
|
const models_service_1 = require("./models.service");
|
|
13
13
|
const models_controller_1 = require("./models.controller");
|
|
14
14
|
const model_entity_1 = require("./entities/model.entity");
|
|
15
|
+
const agent_entity_1 = require("../agents/entities/agent.entity");
|
|
15
16
|
let ModelsModule = class ModelsModule {
|
|
16
17
|
};
|
|
17
18
|
exports.ModelsModule = ModelsModule;
|
|
18
19
|
exports.ModelsModule = ModelsModule = __decorate([
|
|
19
20
|
(0, common_1.Module)({
|
|
20
|
-
imports: [typeorm_1.TypeOrmModule.forFeature([model_entity_1.Model])],
|
|
21
|
+
imports: [typeorm_1.TypeOrmModule.forFeature([model_entity_1.Model, agent_entity_1.AgentEntity])],
|
|
21
22
|
controllers: [models_controller_1.ModelsController],
|
|
22
23
|
providers: [models_service_1.ModelsService],
|
|
23
24
|
exports: [typeorm_1.TypeOrmModule],
|
|
@@ -17,10 +17,13 @@ const common_1 = require("@nestjs/common");
|
|
|
17
17
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
18
18
|
const typeorm_2 = require("typeorm");
|
|
19
19
|
const model_entity_1 = require("./entities/model.entity");
|
|
20
|
+
const agent_entity_1 = require("../agents/entities/agent.entity");
|
|
20
21
|
let ModelsService = class ModelsService {
|
|
21
22
|
modelRepository;
|
|
22
|
-
|
|
23
|
+
agentRepository;
|
|
24
|
+
constructor(modelRepository, agentRepository) {
|
|
23
25
|
this.modelRepository = modelRepository;
|
|
26
|
+
this.agentRepository = agentRepository;
|
|
24
27
|
}
|
|
25
28
|
async create(createModelDto) {
|
|
26
29
|
const { providerId, ...rest } = createModelDto;
|
|
@@ -66,6 +69,12 @@ let ModelsService = class ModelsService {
|
|
|
66
69
|
}
|
|
67
70
|
async remove(id) {
|
|
68
71
|
const model = await this.findOne(id);
|
|
72
|
+
const agentCount = await this.agentRepository.count({
|
|
73
|
+
where: { model: { id } },
|
|
74
|
+
});
|
|
75
|
+
if (agentCount > 0) {
|
|
76
|
+
throw new common_1.ConflictException(`Cannot delete model "${model.name}": ${agentCount} agent(s) are currently using it.`);
|
|
77
|
+
}
|
|
69
78
|
await this.modelRepository.remove(model);
|
|
70
79
|
}
|
|
71
80
|
};
|
|
@@ -73,5 +82,7 @@ exports.ModelsService = ModelsService;
|
|
|
73
82
|
exports.ModelsService = ModelsService = __decorate([
|
|
74
83
|
(0, common_1.Injectable)(),
|
|
75
84
|
__param(0, (0, typeorm_1.InjectRepository)(model_entity_1.Model)),
|
|
76
|
-
|
|
85
|
+
__param(1, (0, typeorm_1.InjectRepository)(agent_entity_1.AgentEntity)),
|
|
86
|
+
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
87
|
+
typeorm_2.Repository])
|
|
77
88
|
], ModelsService);
|
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.SystemSettings = void 0;
|
|
13
13
|
const openapi = require("@nestjs/swagger");
|
|
14
14
|
const typeorm_1 = require("typeorm");
|
|
15
|
+
const typeorm_2 = require("../../config/typeorm");
|
|
15
16
|
let SystemSettings = class SystemSettings {
|
|
16
17
|
id;
|
|
17
18
|
data;
|
|
@@ -27,7 +28,7 @@ __decorate([
|
|
|
27
28
|
__metadata("design:type", String)
|
|
28
29
|
], SystemSettings.prototype, "id", void 0);
|
|
29
30
|
__decorate([
|
|
30
|
-
(0, typeorm_1.Column)({ type:
|
|
31
|
+
(0, typeorm_1.Column)({ type: typeorm_2.JSON_COLUMN_TYPE }),
|
|
31
32
|
__metadata("design:type", Object)
|
|
32
33
|
], SystemSettings.prototype, "data", void 0);
|
|
33
34
|
__decorate([
|
|
@@ -15,6 +15,7 @@ const typeorm_1 = require("typeorm");
|
|
|
15
15
|
const task_entity_1 = require("./task.entity");
|
|
16
16
|
const agent_entity_1 = require("../../agents/entities/agent.entity");
|
|
17
17
|
const user_entity_1 = require("../../users/entities/user.entity");
|
|
18
|
+
const typeorm_2 = require("../../config/typeorm");
|
|
18
19
|
var CommentAuthorType;
|
|
19
20
|
(function (CommentAuthorType) {
|
|
20
21
|
CommentAuthorType["USER"] = "user";
|
|
@@ -76,7 +77,7 @@ __decorate([
|
|
|
76
77
|
__metadata("design:type", Object)
|
|
77
78
|
], TaskComment.prototype, "authorAgent", void 0);
|
|
78
79
|
__decorate([
|
|
79
|
-
(0, typeorm_1.Column)({ type:
|
|
80
|
+
(0, typeorm_1.Column)({ type: typeorm_2.JSON_COLUMN_TYPE, nullable: true }),
|
|
80
81
|
__metadata("design:type", Object)
|
|
81
82
|
], TaskComment.prototype, "artifacts", void 0);
|
|
82
83
|
__decorate([
|
|
@@ -13,6 +13,7 @@ exports.RecurrentTaskExec = exports.ExecStatus = void 0;
|
|
|
13
13
|
const openapi = require("@nestjs/swagger");
|
|
14
14
|
const typeorm_1 = require("typeorm");
|
|
15
15
|
const recurrent_task_entity_1 = require("./recurrent-task.entity");
|
|
16
|
+
const typeorm_2 = require("../../config/typeorm");
|
|
16
17
|
var ExecStatus;
|
|
17
18
|
(function (ExecStatus) {
|
|
18
19
|
ExecStatus["RUNNING"] = "running";
|
|
@@ -63,7 +64,7 @@ __decorate([
|
|
|
63
64
|
__metadata("design:type", Number)
|
|
64
65
|
], RecurrentTaskExec.prototype, "latencyMs", void 0);
|
|
65
66
|
__decorate([
|
|
66
|
-
(0, typeorm_1.Column)({ type:
|
|
67
|
+
(0, typeorm_1.Column)({ type: typeorm_2.JSON_COLUMN_TYPE, nullable: true }),
|
|
67
68
|
__metadata("design:type", Object)
|
|
68
69
|
], RecurrentTaskExec.prototype, "artifacts", void 0);
|
|
69
70
|
__decorate([
|
|
@@ -75,5 +76,6 @@ __decorate([
|
|
|
75
76
|
__metadata("design:type", Date)
|
|
76
77
|
], RecurrentTaskExec.prototype, "updatedAt", void 0);
|
|
77
78
|
exports.RecurrentTaskExec = RecurrentTaskExec = __decorate([
|
|
78
|
-
(0, typeorm_1.Entity)('recurrent_task_execs')
|
|
79
|
+
(0, typeorm_1.Entity)('recurrent_task_execs'),
|
|
80
|
+
(0, typeorm_1.Index)(['recurrentTask', 'createdAt'])
|
|
79
81
|
], RecurrentTaskExec);
|
|
@@ -36,8 +36,8 @@ let Task = class Task {
|
|
|
36
36
|
description;
|
|
37
37
|
status;
|
|
38
38
|
priority;
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
costEstimate;
|
|
40
|
+
llmLatency;
|
|
41
41
|
assignee;
|
|
42
42
|
project;
|
|
43
43
|
projectId;
|
|
@@ -45,7 +45,7 @@ let Task = class Task {
|
|
|
45
45
|
createdAt;
|
|
46
46
|
updatedAt;
|
|
47
47
|
static _OPENAPI_METADATA_FACTORY() {
|
|
48
|
-
return { id: { required: true, type: () => String }, title: { required: true, type: () => String }, description: { required: true, type: () => String }, status: { required: true, enum: require("./task.entity").TaskStatus }, priority: { required: true, enum: require("./task.entity").TaskPriority },
|
|
48
|
+
return { id: { required: true, type: () => String }, title: { required: true, type: () => String }, description: { required: true, type: () => String }, status: { required: true, enum: require("./task.entity").TaskStatus }, priority: { required: true, enum: require("./task.entity").TaskPriority }, costEstimate: { required: true, type: () => Number }, llmLatency: { required: true, type: () => Number }, assignee: { required: true, type: () => require("../../agents/entities/agent.entity").AgentEntity, nullable: true }, project: { required: true, type: () => require("../../projects/entities/project.entity").Project }, projectId: { required: true, type: () => String }, comments: { required: true, type: () => [require("./comment.entity").TaskComment] }, createdAt: { required: true, type: () => Date }, updatedAt: { required: true, type: () => Date } };
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
51
|
exports.Task = Task;
|
|
@@ -80,11 +80,11 @@ __decorate([
|
|
|
80
80
|
__decorate([
|
|
81
81
|
(0, typeorm_1.Column)('float', { default: 0 }),
|
|
82
82
|
__metadata("design:type", Number)
|
|
83
|
-
], Task.prototype, "
|
|
83
|
+
], Task.prototype, "costEstimate", void 0);
|
|
84
84
|
__decorate([
|
|
85
85
|
(0, typeorm_1.Column)('int', { default: 0 }),
|
|
86
86
|
__metadata("design:type", Number)
|
|
87
|
-
], Task.prototype, "
|
|
87
|
+
], Task.prototype, "llmLatency", void 0);
|
|
88
88
|
__decorate([
|
|
89
89
|
(0, typeorm_1.Index)(),
|
|
90
90
|
(0, typeorm_1.ManyToOne)(() => agent_entity_1.AgentEntity, {
|
|
@@ -120,6 +120,7 @@ __decorate([
|
|
|
120
120
|
], Task.prototype, "updatedAt", void 0);
|
|
121
121
|
exports.Task = Task = __decorate([
|
|
122
122
|
(0, typeorm_1.Entity)('tasks'),
|
|
123
|
+
(0, typeorm_1.Index)(['project', 'status', 'priority']),
|
|
123
124
|
(0, typeorm_1.Index)(['project', 'status', 'updatedAt']),
|
|
124
125
|
(0, typeorm_1.Index)(['project', 'updatedAt'])
|
|
125
126
|
], Task);
|
|
@@ -268,8 +268,8 @@ If no agent is suitable, return your own ID: "${ownerAgent.id}".
|
|
|
268
268
|
if (!t)
|
|
269
269
|
throw new Error(`Task ${task.id} not found for final update`);
|
|
270
270
|
t.status = task_entity_1.TaskStatus.REVIEW;
|
|
271
|
-
t.
|
|
272
|
-
t.
|
|
271
|
+
t.llmLatency = latency;
|
|
272
|
+
t.costEstimate = (t.costEstimate || 0) + iterationCost;
|
|
273
273
|
const savedTask = await manager.save(t);
|
|
274
274
|
const comment = manager.create(comment_entity_1.TaskComment, {
|
|
275
275
|
content: response.content,
|