@bpinhosilva/agent-orchestrator 1.0.0-alpha.8 → 1.0.0-alpha.9
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 +7 -0
- package/dist/agents/agents.controller.js +1 -1
- package/dist/agents/agents.module.js +2 -3
- package/dist/agents/agents.service.js +76 -16
- package/dist/agents/dto/agent-request.dto.js +5 -0
- package/dist/agents/dto/create-agent.dto.js +18 -3
- package/dist/agents/entities/agent.entity.js +35 -15
- package/dist/agents/registry/agent.registry.js +22 -0
- package/dist/app.module.js +1 -1
- package/dist/models/entities/model.entity.js +3 -1
- package/dist/models/models.controller.js +10 -0
- package/dist/models/models.service.js +11 -2
- package/dist/projects/entities/project.entity.js +6 -2
- package/dist/projects/projects.module.js +2 -1
- package/dist/projects/projects.service.js +3 -1
- package/dist/providers/providers.service.js +1 -1
- package/dist/scripts/generate-postman.js +1 -0
- package/dist/scripts/generate-postman.js.map +1 -1
- package/dist/src/agents/agents.controller.d.ts +4 -4
- package/dist/src/agents/agents.controller.js +8 -1
- package/dist/src/agents/agents.controller.js.map +1 -1
- package/dist/src/agents/agents.module.js +2 -3
- package/dist/src/agents/agents.module.js.map +1 -1
- package/dist/src/agents/agents.service.d.ts +10 -7
- package/dist/src/agents/agents.service.js +71 -17
- package/dist/src/agents/agents.service.js.map +1 -1
- package/dist/src/agents/dto/agent-request.dto.d.ts +1 -0
- package/dist/src/agents/dto/agent-request.dto.js +10 -0
- package/dist/src/agents/dto/agent-request.dto.js.map +1 -1
- package/dist/src/agents/dto/create-agent.dto.d.ts +4 -1
- package/dist/src/agents/dto/create-agent.dto.js +26 -4
- package/dist/src/agents/dto/create-agent.dto.js.map +1 -1
- package/dist/src/agents/dto/update-agent.dto.js +4 -0
- package/dist/src/agents/dto/update-agent.dto.js.map +1 -1
- package/dist/src/agents/entities/agent.entity.d.ts +8 -3
- package/dist/src/agents/entities/agent.entity.js +45 -17
- package/dist/src/agents/entities/agent.entity.js.map +1 -1
- package/dist/src/agents/implementations/gemini.agent.d.ts +13 -1
- package/dist/src/agents/implementations/gemini.agent.js +63 -6
- package/dist/src/agents/implementations/gemini.agent.js.map +1 -1
- package/dist/src/agents/interfaces/agent.interface.d.ts +6 -0
- package/dist/src/agents/registry/agent.registry.d.ts +5 -0
- package/dist/src/agents/registry/agent.registry.js +15 -0
- package/dist/src/agents/registry/agent.registry.js.map +1 -0
- package/dist/src/app.controller.js +2 -0
- package/dist/src/app.controller.js.map +1 -1
- package/dist/src/app.module.js +1 -1
- package/dist/src/app.module.js.map +1 -1
- package/dist/src/models/dto/create-model.dto.js +4 -0
- package/dist/src/models/dto/create-model.dto.js.map +1 -1
- package/dist/src/models/dto/update-model.dto.js +4 -0
- package/dist/src/models/dto/update-model.dto.js.map +1 -1
- package/dist/src/models/entities/model.entity.d.ts +2 -2
- package/dist/src/models/entities/model.entity.js +7 -1
- package/dist/src/models/entities/model.entity.js.map +1 -1
- package/dist/src/models/models.controller.d.ts +1 -0
- package/dist/src/models/models.controller.js +17 -0
- package/dist/src/models/models.controller.js.map +1 -1
- package/dist/src/models/models.service.d.ts +1 -0
- package/dist/src/models/models.service.js +11 -2
- package/dist/src/models/models.service.js.map +1 -1
- package/dist/src/projects/dto/create-project.dto.js +4 -0
- package/dist/src/projects/dto/create-project.dto.js.map +1 -1
- package/dist/src/projects/dto/update-project.dto.js +4 -0
- package/dist/src/projects/dto/update-project.dto.js.map +1 -1
- package/dist/src/projects/entities/project.entity.d.ts +3 -2
- package/dist/src/projects/entities/project.entity.js +11 -2
- package/dist/src/projects/entities/project.entity.js.map +1 -1
- package/dist/src/projects/projects.controller.js +6 -0
- package/dist/src/projects/projects.controller.js.map +1 -1
- package/dist/src/projects/projects.module.js +2 -1
- package/dist/src/projects/projects.module.js.map +1 -1
- package/dist/src/projects/projects.service.js +3 -1
- package/dist/src/projects/projects.service.js.map +1 -1
- package/dist/src/providers/dto/create-provider.dto.js +4 -0
- package/dist/src/providers/dto/create-provider.dto.js.map +1 -1
- package/dist/src/providers/dto/update-provider.dto.js +4 -0
- package/dist/src/providers/dto/update-provider.dto.js.map +1 -1
- package/dist/src/providers/entities/provider.entity.js +4 -0
- package/dist/src/providers/entities/provider.entity.js.map +1 -1
- package/dist/src/providers/providers.controller.js +6 -0
- package/dist/src/providers/providers.controller.js.map +1 -1
- package/dist/src/providers/providers.service.js +1 -1
- package/dist/src/providers/providers.service.js.map +1 -1
- package/dist/src/tasks/dto/create-task.dto.js +4 -0
- package/dist/src/tasks/dto/create-task.dto.js.map +1 -1
- package/dist/src/tasks/dto/update-task.dto.js +4 -0
- package/dist/src/tasks/dto/update-task.dto.js.map +1 -1
- package/dist/src/tasks/entities/task.entity.d.ts +2 -2
- package/dist/src/tasks/entities/task.entity.js +10 -2
- package/dist/src/tasks/entities/task.entity.js.map +1 -1
- package/dist/src/tasks/tasks.controller.js +6 -0
- package/dist/src/tasks/tasks.controller.js.map +1 -1
- package/dist/src/tasks/tasks.module.js +2 -1
- package/dist/src/tasks/tasks.module.js.map +1 -1
- package/dist/src/tasks/tasks.service.d.ts +3 -1
- package/dist/src/tasks/tasks.service.js +11 -8
- package/dist/src/tasks/tasks.service.js.map +1 -1
- package/dist/src/users/dto/create-user.dto.js +4 -0
- package/dist/src/users/dto/create-user.dto.js.map +1 -1
- package/dist/src/users/dto/update-user.dto.js +4 -0
- package/dist/src/users/dto/update-user.dto.js.map +1 -1
- package/dist/src/users/entities/user.entity.js +4 -0
- package/dist/src/users/entities/user.entity.js.map +1 -1
- package/dist/src/users/users.controller.js +6 -0
- package/dist/src/users/users.controller.js.map +1 -1
- package/dist/tasks/entities/task.entity.js +6 -2
- package/dist/tasks/tasks.module.js +2 -1
- package/dist/tasks/tasks.service.js +10 -8
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/agents/implementations/gemini.agent.js +0 -58
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [1.0.0-alpha.9](https://github.com/bpinhosilva/agent-orchestrator/compare/v1.0.0-alpha.8...v1.0.0-alpha.9) (2026-03-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* implement provider and model management UI and API, and enhance agent configuration ([01dbe34](https://github.com/bpinhosilva/agent-orchestrator/commit/01dbe345b8763da433682d7bc185c017e5b5d5d9))
|
|
7
|
+
|
|
1
8
|
# [1.0.0-alpha.8](https://github.com/bpinhosilva/agent-orchestrator/compare/v1.0.0-alpha.7...v1.0.0-alpha.8) (2026-03-22)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -38,7 +38,7 @@ let AgentsController = class AgentsController {
|
|
|
38
38
|
return this.agentsService.remove(id);
|
|
39
39
|
}
|
|
40
40
|
async processText(requestDto) {
|
|
41
|
-
return this.agentsService.processRequest(requestDto);
|
|
41
|
+
return this.agentsService.processRequest(requestDto.agentId, requestDto.input);
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
exports.AgentsController = AgentsController;
|
|
@@ -11,16 +11,15 @@ const common_1 = require("@nestjs/common");
|
|
|
11
11
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
12
12
|
const agents_controller_1 = require("./agents.controller");
|
|
13
13
|
const agents_service_1 = require("./agents.service");
|
|
14
|
-
const gemini_agent_1 = require("./implementations/gemini.agent");
|
|
15
14
|
const agent_entity_1 = require("./entities/agent.entity");
|
|
16
15
|
let AgentsModule = class AgentsModule {
|
|
17
16
|
};
|
|
18
17
|
exports.AgentsModule = AgentsModule;
|
|
19
18
|
exports.AgentsModule = AgentsModule = __decorate([
|
|
20
19
|
(0, common_1.Module)({
|
|
21
|
-
imports: [typeorm_1.TypeOrmModule.forFeature([agent_entity_1.
|
|
20
|
+
imports: [typeorm_1.TypeOrmModule.forFeature([agent_entity_1.AgentEntity])],
|
|
22
21
|
controllers: [agents_controller_1.AgentsController],
|
|
23
|
-
providers: [agents_service_1.AgentsService
|
|
22
|
+
providers: [agents_service_1.AgentsService],
|
|
24
23
|
exports: [agents_service_1.AgentsService],
|
|
25
24
|
})
|
|
26
25
|
], AgentsModule);
|
|
@@ -15,29 +15,85 @@ var AgentsService_1;
|
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.AgentsService = void 0;
|
|
17
17
|
const common_1 = require("@nestjs/common");
|
|
18
|
+
const core_1 = require("@nestjs/core");
|
|
18
19
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
19
20
|
const typeorm_2 = require("typeorm");
|
|
20
|
-
const
|
|
21
|
+
const agent_registry_1 = require("./registry/agent.registry");
|
|
21
22
|
const agent_entity_1 = require("./entities/agent.entity");
|
|
22
23
|
let AgentsService = AgentsService_1 = class AgentsService {
|
|
23
|
-
constructor(
|
|
24
|
-
this.
|
|
24
|
+
constructor(moduleRef, agentRepository) {
|
|
25
|
+
this.moduleRef = moduleRef;
|
|
25
26
|
this.agentRepository = agentRepository;
|
|
26
27
|
this.logger = new common_1.Logger(AgentsService_1.name);
|
|
27
|
-
this.
|
|
28
|
-
this.logger.log(
|
|
28
|
+
this.agentInstances = new Map();
|
|
29
|
+
this.logger.log('Initialized AgentsService with dynamic agent resolution enabled.');
|
|
29
30
|
}
|
|
30
|
-
async
|
|
31
|
-
this.logger.
|
|
32
|
-
|
|
31
|
+
async onModuleInit() {
|
|
32
|
+
this.logger.log('Synchronizing agents with database...');
|
|
33
|
+
const dbAgents = await this.agentRepository.find();
|
|
34
|
+
for (const agentEntity of dbAgents) {
|
|
35
|
+
await this.syncAgentInstance(agentEntity);
|
|
36
|
+
}
|
|
37
|
+
this.logger.log(`Synchronized ${this.agentInstances.size} agent instances from persistence.`);
|
|
38
|
+
}
|
|
39
|
+
async syncAgentInstance(agentEntity) {
|
|
40
|
+
const provider = agentEntity.provider;
|
|
41
|
+
const implementation = provider
|
|
42
|
+
? (0, agent_registry_1.getAgentImplementation)(provider)
|
|
43
|
+
: undefined;
|
|
44
|
+
if (!implementation) {
|
|
45
|
+
this.logger.warn(`No implementation found for provider: ${provider}. Skipping instance creation.`);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
try {
|
|
49
|
+
// Create a fresh instance for this specific agent to avoid shared state (e.g. system instructions)
|
|
50
|
+
const instance = await this.moduleRef.create(implementation);
|
|
51
|
+
// Configure the instance with agent-specific data
|
|
52
|
+
if (instance.updateConfig) {
|
|
53
|
+
instance.updateConfig({
|
|
54
|
+
name: agentEntity.name,
|
|
55
|
+
description: agentEntity.description,
|
|
56
|
+
systemInstructions: agentEntity.systemInstructions,
|
|
57
|
+
role: agentEntity.role,
|
|
58
|
+
provider: provider,
|
|
59
|
+
model: agentEntity.model?.name || 'Unknown',
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
this.agentInstances.set(agentEntity.id, instance);
|
|
63
|
+
this.logger.debug(`Synced unique instance for agent ${agentEntity.name} (Provider: ${provider})`);
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
this.logger.error(`Failed to instantiate agent for ${agentEntity.name}: ${error instanceof Error ? error.message : String(error)}`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
getInstances() {
|
|
70
|
+
return this.agentInstances;
|
|
71
|
+
}
|
|
72
|
+
async processRequest(agentId, input) {
|
|
73
|
+
const agent = this.agentInstances.get(agentId);
|
|
74
|
+
if (!agent) {
|
|
75
|
+
throw new common_1.NotFoundException(`Active instance for Agent #${agentId} not found`);
|
|
76
|
+
}
|
|
77
|
+
this.logger.debug(`Processing input using agent instance: ${agent.getName()}`);
|
|
78
|
+
return agent.processText(input);
|
|
33
79
|
}
|
|
34
80
|
async create(createAgentDto) {
|
|
35
81
|
const { modelId, ...rest } = createAgentDto;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
82
|
+
// Check if modelId is a valid UUID before trying to link
|
|
83
|
+
const isUuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(modelId);
|
|
84
|
+
const agentData = { ...rest };
|
|
85
|
+
if (isUuid) {
|
|
86
|
+
agentData.model = { id: modelId };
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
// If not a UUID, we might want to store it as a generic model name string if we had a column for it
|
|
90
|
+
// For now, let's just use it as part of the description or something, or assume it's a named model
|
|
91
|
+
// But status/provider are already being passed in 'rest' now
|
|
92
|
+
}
|
|
93
|
+
const agent = this.agentRepository.create(agentData);
|
|
94
|
+
const savedAgent = await this.agentRepository.save(agent);
|
|
95
|
+
await this.syncAgentInstance(savedAgent);
|
|
96
|
+
return savedAgent;
|
|
41
97
|
}
|
|
42
98
|
async findAll() {
|
|
43
99
|
return this.agentRepository.find();
|
|
@@ -62,17 +118,21 @@ let AgentsService = AgentsService_1 = class AgentsService {
|
|
|
62
118
|
if (!agent) {
|
|
63
119
|
throw new common_1.NotFoundException(`Agent #${id} not found`);
|
|
64
120
|
}
|
|
65
|
-
|
|
121
|
+
const updatedAgent = await this.agentRepository.save(agent);
|
|
122
|
+
await this.syncAgentInstance(updatedAgent);
|
|
123
|
+
return updatedAgent;
|
|
66
124
|
}
|
|
67
125
|
async remove(id) {
|
|
68
126
|
const agent = await this.findOne(id);
|
|
69
127
|
await this.agentRepository.remove(agent);
|
|
128
|
+
this.agentInstances.delete(id);
|
|
129
|
+
this.logger.debug(`Removed instance for agent ID ${id} from global map.`);
|
|
70
130
|
}
|
|
71
131
|
};
|
|
72
132
|
exports.AgentsService = AgentsService;
|
|
73
133
|
exports.AgentsService = AgentsService = AgentsService_1 = __decorate([
|
|
74
134
|
(0, common_1.Injectable)(),
|
|
75
|
-
__param(1, (0, typeorm_1.InjectRepository)(agent_entity_1.
|
|
76
|
-
__metadata("design:paramtypes", [
|
|
135
|
+
__param(1, (0, typeorm_1.InjectRepository)(agent_entity_1.AgentEntity)),
|
|
136
|
+
__metadata("design:paramtypes", [core_1.ModuleRef,
|
|
77
137
|
typeorm_2.Repository])
|
|
78
138
|
], AgentsService);
|
|
@@ -14,6 +14,11 @@ const class_validator_1 = require("class-validator");
|
|
|
14
14
|
class AgentRequestDto {
|
|
15
15
|
}
|
|
16
16
|
exports.AgentRequestDto = AgentRequestDto;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_validator_1.IsString)(),
|
|
19
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], AgentRequestDto.prototype, "agentId", void 0);
|
|
17
22
|
__decorate([
|
|
18
23
|
(0, class_validator_1.IsString)(),
|
|
19
24
|
(0, class_validator_1.IsNotEmpty)(),
|
|
@@ -21,16 +21,31 @@ __decorate([
|
|
|
21
21
|
], CreateAgentDto.prototype, "name", void 0);
|
|
22
22
|
__decorate([
|
|
23
23
|
(0, class_validator_1.IsString)(),
|
|
24
|
-
(0, class_validator_1.
|
|
24
|
+
(0, class_validator_1.IsOptional)(),
|
|
25
25
|
__metadata("design:type", String)
|
|
26
|
-
], CreateAgentDto.prototype, "
|
|
26
|
+
], CreateAgentDto.prototype, "description", void 0);
|
|
27
27
|
__decorate([
|
|
28
28
|
(0, class_validator_1.IsString)(),
|
|
29
29
|
(0, class_validator_1.IsOptional)(),
|
|
30
30
|
__metadata("design:type", String)
|
|
31
31
|
], CreateAgentDto.prototype, "role", void 0);
|
|
32
32
|
__decorate([
|
|
33
|
-
(0, class_validator_1.
|
|
33
|
+
(0, class_validator_1.IsString)(),
|
|
34
|
+
(0, class_validator_1.IsOptional)(),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], CreateAgentDto.prototype, "systemInstructions", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, class_validator_1.IsString)(),
|
|
34
39
|
(0, class_validator_1.IsNotEmpty)(),
|
|
35
40
|
__metadata("design:type", String)
|
|
36
41
|
], CreateAgentDto.prototype, "modelId", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, class_validator_1.IsString)(),
|
|
44
|
+
(0, class_validator_1.IsOptional)(),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], CreateAgentDto.prototype, "status", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, class_validator_1.IsString)(),
|
|
49
|
+
(0, class_validator_1.IsOptional)(),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], CreateAgentDto.prototype, "provider", void 0);
|
|
@@ -9,44 +9,64 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.AgentEntity = void 0;
|
|
13
13
|
const typeorm_1 = require("typeorm");
|
|
14
14
|
const model_entity_1 = require("../../models/entities/model.entity");
|
|
15
|
-
|
|
15
|
+
const project_entity_1 = require("../../projects/entities/project.entity");
|
|
16
|
+
let AgentEntity = class AgentEntity {
|
|
16
17
|
};
|
|
17
|
-
exports.
|
|
18
|
+
exports.AgentEntity = AgentEntity;
|
|
18
19
|
__decorate([
|
|
19
20
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
20
21
|
__metadata("design:type", String)
|
|
21
|
-
],
|
|
22
|
+
], AgentEntity.prototype, "id", void 0);
|
|
22
23
|
__decorate([
|
|
23
24
|
(0, typeorm_1.Column)({ unique: true }),
|
|
24
25
|
__metadata("design:type", String)
|
|
25
|
-
],
|
|
26
|
+
], AgentEntity.prototype, "name", void 0);
|
|
26
27
|
__decorate([
|
|
27
|
-
(0, typeorm_1.Column)('text'),
|
|
28
|
+
(0, typeorm_1.Column)('text', { nullable: true }),
|
|
28
29
|
__metadata("design:type", String)
|
|
29
|
-
],
|
|
30
|
+
], AgentEntity.prototype, "description", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.Column)('text', { nullable: true }),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], AgentEntity.prototype, "systemInstructions", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], AgentEntity.prototype, "role", void 0);
|
|
30
39
|
__decorate([
|
|
31
40
|
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
32
41
|
__metadata("design:type", String)
|
|
33
|
-
],
|
|
42
|
+
], AgentEntity.prototype, "status", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], AgentEntity.prototype, "provider", void 0);
|
|
34
47
|
__decorate([
|
|
35
48
|
(0, typeorm_1.ManyToOne)(() => model_entity_1.Model, (model) => model.agents, {
|
|
36
|
-
nullable:
|
|
49
|
+
nullable: true,
|
|
37
50
|
eager: true,
|
|
38
|
-
onDelete: '
|
|
51
|
+
onDelete: 'SET NULL',
|
|
39
52
|
}),
|
|
40
53
|
__metadata("design:type", model_entity_1.Model)
|
|
41
|
-
],
|
|
54
|
+
], AgentEntity.prototype, "model", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, typeorm_1.ManyToOne)(() => project_entity_1.Project, (project) => project.agents, {
|
|
57
|
+
nullable: true,
|
|
58
|
+
onDelete: 'SET NULL',
|
|
59
|
+
}),
|
|
60
|
+
__metadata("design:type", project_entity_1.Project)
|
|
61
|
+
], AgentEntity.prototype, "project", void 0);
|
|
42
62
|
__decorate([
|
|
43
63
|
(0, typeorm_1.CreateDateColumn)(),
|
|
44
64
|
__metadata("design:type", Date)
|
|
45
|
-
],
|
|
65
|
+
], AgentEntity.prototype, "createdAt", void 0);
|
|
46
66
|
__decorate([
|
|
47
67
|
(0, typeorm_1.UpdateDateColumn)(),
|
|
48
68
|
__metadata("design:type", Date)
|
|
49
|
-
],
|
|
50
|
-
exports.
|
|
69
|
+
], AgentEntity.prototype, "updatedAt", void 0);
|
|
70
|
+
exports.AgentEntity = AgentEntity = __decorate([
|
|
51
71
|
(0, typeorm_1.Entity)('agents')
|
|
52
|
-
],
|
|
72
|
+
], AgentEntity);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AGENT_REGISTRY = void 0;
|
|
4
|
+
exports.RegisterAgent = RegisterAgent;
|
|
5
|
+
exports.getAgentImplementation = getAgentImplementation;
|
|
6
|
+
exports.AGENT_REGISTRY = new Map();
|
|
7
|
+
/**
|
|
8
|
+
* Decorator to register an agent implementation for a specific provider.
|
|
9
|
+
* @param provider The name of the AI provider (e.g., 'Google', 'OpenAI').
|
|
10
|
+
*/
|
|
11
|
+
function RegisterAgent(provider) {
|
|
12
|
+
return (target) => {
|
|
13
|
+
exports.AGENT_REGISTRY.set(provider, target);
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Helper to get the implementation class for a provider.
|
|
18
|
+
* @param provider The provider name.
|
|
19
|
+
*/
|
|
20
|
+
function getAgentImplementation(provider) {
|
|
21
|
+
return exports.AGENT_REGISTRY.get(provider);
|
|
22
|
+
}
|
package/dist/app.module.js
CHANGED
|
@@ -29,7 +29,7 @@ exports.AppModule = AppModule = __decorate([
|
|
|
29
29
|
type: process.env.DATABASE_URL ? 'postgres' : 'sqlite',
|
|
30
30
|
database: process.env.DATABASE_URL
|
|
31
31
|
? undefined
|
|
32
|
-
: (0, path_1.join)(
|
|
32
|
+
: (0, path_1.join)(process.cwd(), 'local.sqlite'),
|
|
33
33
|
url: process.env.DATABASE_URL,
|
|
34
34
|
autoLoadEntities: true,
|
|
35
35
|
synchronize: true, // Use only in development
|
|
@@ -27,11 +27,13 @@ __decorate([
|
|
|
27
27
|
__decorate([
|
|
28
28
|
(0, typeorm_1.ManyToOne)(() => provider_entity_1.Provider, (provider) => provider.models, {
|
|
29
29
|
onDelete: 'CASCADE',
|
|
30
|
+
eager: true,
|
|
30
31
|
}),
|
|
32
|
+
(0, typeorm_1.JoinColumn)({ name: 'providerId' }),
|
|
31
33
|
__metadata("design:type", provider_entity_1.Provider)
|
|
32
34
|
], Model.prototype, "provider", void 0);
|
|
33
35
|
__decorate([
|
|
34
|
-
(0, typeorm_1.OneToMany)(() => agent_entity_1.
|
|
36
|
+
(0, typeorm_1.OneToMany)(() => agent_entity_1.AgentEntity, (agent) => agent.model),
|
|
35
37
|
__metadata("design:type", Array)
|
|
36
38
|
], Model.prototype, "agents", void 0);
|
|
37
39
|
__decorate([
|
|
@@ -27,6 +27,9 @@ let ModelsController = class ModelsController {
|
|
|
27
27
|
findAll() {
|
|
28
28
|
return this.modelsService.findAll();
|
|
29
29
|
}
|
|
30
|
+
findByProvider(providerId) {
|
|
31
|
+
return this.modelsService.findByProviderId(providerId);
|
|
32
|
+
}
|
|
30
33
|
findOne(id) {
|
|
31
34
|
return this.modelsService.findOne(id);
|
|
32
35
|
}
|
|
@@ -51,6 +54,13 @@ __decorate([
|
|
|
51
54
|
__metadata("design:paramtypes", []),
|
|
52
55
|
__metadata("design:returntype", void 0)
|
|
53
56
|
], ModelsController.prototype, "findAll", null);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, common_1.Get)('provider/:providerId'),
|
|
59
|
+
__param(0, (0, common_1.Param)('providerId')),
|
|
60
|
+
__metadata("design:type", Function),
|
|
61
|
+
__metadata("design:paramtypes", [String]),
|
|
62
|
+
__metadata("design:returntype", void 0)
|
|
63
|
+
], ModelsController.prototype, "findByProvider", null);
|
|
54
64
|
__decorate([
|
|
55
65
|
(0, common_1.Get)(':id'),
|
|
56
66
|
__param(0, (0, common_1.Param)('id')),
|
|
@@ -30,10 +30,19 @@ let ModelsService = class ModelsService {
|
|
|
30
30
|
return this.modelRepository.save(model);
|
|
31
31
|
}
|
|
32
32
|
async findAll() {
|
|
33
|
-
return this.modelRepository.find();
|
|
33
|
+
return this.modelRepository.find({ relations: ['provider'] });
|
|
34
|
+
}
|
|
35
|
+
async findByProviderId(providerId) {
|
|
36
|
+
return this.modelRepository.find({
|
|
37
|
+
where: { provider: { id: providerId } },
|
|
38
|
+
relations: ['provider'],
|
|
39
|
+
});
|
|
34
40
|
}
|
|
35
41
|
async findOne(id) {
|
|
36
|
-
const model = await this.modelRepository.findOne({
|
|
42
|
+
const model = await this.modelRepository.findOne({
|
|
43
|
+
where: { id },
|
|
44
|
+
relations: ['provider'],
|
|
45
|
+
});
|
|
37
46
|
if (!model) {
|
|
38
47
|
throw new common_1.NotFoundException(`Model #${id} not found`);
|
|
39
48
|
}
|
|
@@ -44,12 +44,16 @@ __decorate([
|
|
|
44
44
|
__metadata("design:type", String)
|
|
45
45
|
], Project.prototype, "status", void 0);
|
|
46
46
|
__decorate([
|
|
47
|
-
(0, typeorm_1.
|
|
47
|
+
(0, typeorm_1.OneToMany)(() => agent_entity_1.AgentEntity, (agent) => agent.project),
|
|
48
|
+
__metadata("design:type", Array)
|
|
49
|
+
], Project.prototype, "agents", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, typeorm_1.ManyToOne)(() => agent_entity_1.AgentEntity, {
|
|
48
52
|
nullable: false,
|
|
49
53
|
eager: true,
|
|
50
54
|
onDelete: 'RESTRICT',
|
|
51
55
|
}),
|
|
52
|
-
__metadata("design:type", agent_entity_1.
|
|
56
|
+
__metadata("design:type", agent_entity_1.AgentEntity)
|
|
53
57
|
], Project.prototype, "defaultAgent", void 0);
|
|
54
58
|
__decorate([
|
|
55
59
|
(0, typeorm_1.CreateDateColumn)(),
|
|
@@ -12,12 +12,13 @@ const typeorm_1 = require("@nestjs/typeorm");
|
|
|
12
12
|
const projects_service_1 = require("./projects.service");
|
|
13
13
|
const projects_controller_1 = require("./projects.controller");
|
|
14
14
|
const project_entity_1 = require("./entities/project.entity");
|
|
15
|
+
const agent_entity_1 = require("../agents/entities/agent.entity");
|
|
15
16
|
let ProjectsModule = class ProjectsModule {
|
|
16
17
|
};
|
|
17
18
|
exports.ProjectsModule = ProjectsModule;
|
|
18
19
|
exports.ProjectsModule = ProjectsModule = __decorate([
|
|
19
20
|
(0, common_1.Module)({
|
|
20
|
-
imports: [typeorm_1.TypeOrmModule.forFeature([project_entity_1.Project])],
|
|
21
|
+
imports: [typeorm_1.TypeOrmModule.forFeature([project_entity_1.Project, agent_entity_1.AgentEntity])],
|
|
21
22
|
controllers: [projects_controller_1.ProjectsController],
|
|
22
23
|
providers: [projects_service_1.ProjectsService],
|
|
23
24
|
})
|
|
@@ -49,7 +49,9 @@ let ProjectsService = class ProjectsService {
|
|
|
49
49
|
if (updateProjectDto.status !== undefined)
|
|
50
50
|
project.status = updateProjectDto.status;
|
|
51
51
|
if (updateProjectDto.defaultAgentId !== undefined)
|
|
52
|
-
project.defaultAgent = {
|
|
52
|
+
project.defaultAgent = {
|
|
53
|
+
id: updateProjectDto.defaultAgentId,
|
|
54
|
+
};
|
|
53
55
|
return this.projectsRepository.save(project);
|
|
54
56
|
}
|
|
55
57
|
async remove(id) {
|
|
@@ -26,7 +26,7 @@ let ProvidersService = class ProvidersService {
|
|
|
26
26
|
return this.providerRepository.save(provider);
|
|
27
27
|
}
|
|
28
28
|
async findAll() {
|
|
29
|
-
return this.providerRepository.find();
|
|
29
|
+
return this.providerRepository.find({ relations: ['models'] });
|
|
30
30
|
}
|
|
31
31
|
async findOne(id) {
|
|
32
32
|
const provider = await this.providerRepository.findOne({ where: { id } });
|
|
@@ -41,6 +41,7 @@ const path = __importStar(require("path"));
|
|
|
41
41
|
const Converter = require('openapi-to-postmanv2');
|
|
42
42
|
async function bootstrap() {
|
|
43
43
|
const app = await core_1.NestFactory.create(app_module_1.AppModule, { logger: false });
|
|
44
|
+
app.setGlobalPrefix('api/v1');
|
|
44
45
|
const config = new swagger_1.DocumentBuilder()
|
|
45
46
|
.setTitle('Agent Orchestrator API')
|
|
46
47
|
.setDescription('The core API for the Agent Orchestrator platform')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-postman.js","sourceRoot":"","sources":["../../scripts/generate-postman.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA2C;AAC3C,6CAAiE;AACjE,kDAA8C;AAC9C,uCAAyB;AACzB,2CAA6B;AAG7B,MAAM,SAAS,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAElD,KAAK,UAAU,SAAS;IACtB,MAAM,GAAG,GAAG,MAAM,kBAAW,CAAC,MAAM,CAAC,sBAAS,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"generate-postman.js","sourceRoot":"","sources":["../../scripts/generate-postman.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA2C;AAC3C,6CAAiE;AACjE,kDAA8C;AAC9C,uCAAyB;AACzB,2CAA6B;AAG7B,MAAM,SAAS,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAElD,KAAK,UAAU,SAAS;IACtB,MAAM,GAAG,GAAG,MAAM,kBAAW,CAAC,MAAM,CAAC,sBAAS,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IACnE,GAAG,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;IAE9B,MAAM,MAAM,GAAG,IAAI,yBAAe,EAAE;SACjC,QAAQ,CAAC,wBAAwB,CAAC;SAClC,cAAc,CAAC,kDAAkD,CAAC;SAClE,UAAU,CAAC,KAAK,CAAC;SACjB,KAAK,EAAE,CAAC;IAEX,MAAM,QAAQ,GAAG,uBAAa,CAAC,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAC3D,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IAEhD,SAAS,CAAC,OAAO,CACf,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,cAAc,EAAE,EACxC,EAAE,WAAW,EAAE,IAAI,EAAE,EACrB,CAAC,GAAQ,EAAE,gBAAqB,EAAE,EAAE;QAClC,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC;YAC7B,OAAO,CAAC,KAAK,CAAC,mBAAmB,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;YAC5D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;aAAM,CAAC;YACN,MAAM,UAAU,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;YACnD,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,4CAA4C,CAAC,CAAC;YAE5F,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YAClE,OAAO,CAAC,GAAG,CAAC,qDAAqD,UAAU,IAAI,CAAC,CAAC;YACjF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC;AAED,SAAS,EAAE,CAAC"}
|
|
@@ -6,10 +6,10 @@ import { UpdateAgentDto } from './dto/update-agent.dto';
|
|
|
6
6
|
export declare class AgentsController {
|
|
7
7
|
private readonly agentsService;
|
|
8
8
|
constructor(agentsService: AgentsService);
|
|
9
|
-
create(createAgentDto: CreateAgentDto): Promise<import("./entities/agent.entity").
|
|
10
|
-
findAll(): Promise<import("./entities/agent.entity").
|
|
11
|
-
findOne(id: string): Promise<import("./entities/agent.entity").
|
|
12
|
-
update(id: string, updateAgentDto: UpdateAgentDto): Promise<import("./entities/agent.entity").
|
|
9
|
+
create(createAgentDto: CreateAgentDto): Promise<import("./entities/agent.entity").AgentEntity>;
|
|
10
|
+
findAll(): Promise<import("./entities/agent.entity").AgentEntity[]>;
|
|
11
|
+
findOne(id: string): Promise<import("./entities/agent.entity").AgentEntity>;
|
|
12
|
+
update(id: string, updateAgentDto: UpdateAgentDto): Promise<import("./entities/agent.entity").AgentEntity>;
|
|
13
13
|
remove(id: string): Promise<void>;
|
|
14
14
|
processText(requestDto: AgentRequestDto): Promise<AgentResponse>;
|
|
15
15
|
}
|
|
@@ -13,6 +13,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.AgentsController = void 0;
|
|
16
|
+
const openapi = require("@nestjs/swagger");
|
|
16
17
|
const common_1 = require("@nestjs/common");
|
|
17
18
|
const agents_service_1 = require("./agents.service");
|
|
18
19
|
const agent_request_dto_1 = require("./dto/agent-request.dto");
|
|
@@ -39,12 +40,13 @@ let AgentsController = class AgentsController {
|
|
|
39
40
|
return this.agentsService.remove(id);
|
|
40
41
|
}
|
|
41
42
|
async processText(requestDto) {
|
|
42
|
-
return this.agentsService.processRequest(requestDto);
|
|
43
|
+
return this.agentsService.processRequest(requestDto.agentId, requestDto.input);
|
|
43
44
|
}
|
|
44
45
|
};
|
|
45
46
|
exports.AgentsController = AgentsController;
|
|
46
47
|
__decorate([
|
|
47
48
|
(0, common_1.Post)(),
|
|
49
|
+
openapi.ApiResponse({ status: 201, type: require("./entities/agent.entity").AgentEntity }),
|
|
48
50
|
__param(0, (0, common_1.Body)()),
|
|
49
51
|
__metadata("design:type", Function),
|
|
50
52
|
__metadata("design:paramtypes", [create_agent_dto_1.CreateAgentDto]),
|
|
@@ -52,12 +54,14 @@ __decorate([
|
|
|
52
54
|
], AgentsController.prototype, "create", null);
|
|
53
55
|
__decorate([
|
|
54
56
|
(0, common_1.Get)(),
|
|
57
|
+
openapi.ApiResponse({ status: 200, type: [require("./entities/agent.entity").AgentEntity] }),
|
|
55
58
|
__metadata("design:type", Function),
|
|
56
59
|
__metadata("design:paramtypes", []),
|
|
57
60
|
__metadata("design:returntype", void 0)
|
|
58
61
|
], AgentsController.prototype, "findAll", null);
|
|
59
62
|
__decorate([
|
|
60
63
|
(0, common_1.Get)(':id'),
|
|
64
|
+
openapi.ApiResponse({ status: 200, type: require("./entities/agent.entity").AgentEntity }),
|
|
61
65
|
__param(0, (0, common_1.Param)('id')),
|
|
62
66
|
__metadata("design:type", Function),
|
|
63
67
|
__metadata("design:paramtypes", [String]),
|
|
@@ -65,6 +69,7 @@ __decorate([
|
|
|
65
69
|
], AgentsController.prototype, "findOne", null);
|
|
66
70
|
__decorate([
|
|
67
71
|
(0, common_1.Patch)(':id'),
|
|
72
|
+
openapi.ApiResponse({ status: 200, type: require("./entities/agent.entity").AgentEntity }),
|
|
68
73
|
__param(0, (0, common_1.Param)('id')),
|
|
69
74
|
__param(1, (0, common_1.Body)()),
|
|
70
75
|
__metadata("design:type", Function),
|
|
@@ -73,6 +78,7 @@ __decorate([
|
|
|
73
78
|
], AgentsController.prototype, "update", null);
|
|
74
79
|
__decorate([
|
|
75
80
|
(0, common_1.Delete)(':id'),
|
|
81
|
+
openapi.ApiResponse({ status: 200 }),
|
|
76
82
|
__param(0, (0, common_1.Param)('id')),
|
|
77
83
|
__metadata("design:type", Function),
|
|
78
84
|
__metadata("design:paramtypes", [String]),
|
|
@@ -81,6 +87,7 @@ __decorate([
|
|
|
81
87
|
__decorate([
|
|
82
88
|
(0, common_1.Post)('process'),
|
|
83
89
|
(0, common_1.HttpCode)(common_1.HttpStatus.OK),
|
|
90
|
+
openapi.ApiResponse({ status: common_1.HttpStatus.OK, type: Object }),
|
|
84
91
|
__param(0, (0, common_1.Body)()),
|
|
85
92
|
__metadata("design:type", Function),
|
|
86
93
|
__metadata("design:paramtypes", [agent_request_dto_1.AgentRequestDto]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.controller.js","sourceRoot":"","sources":["../../../src/agents/agents.controller.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agents.controller.js","sourceRoot":"","sources":["../../../src/agents/agents.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAUwB;AACxB,qDAAiD;AACjD,+DAA0D;AAE1D,6DAAwD;AACxD,6DAAwD;AAGjD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IACE;IAA7B,YAA6B,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAAG,CAAC;IAG7D,MAAM,CAAS,cAA8B;QAC3C,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;IACnD,CAAC;IAGD,OAAO;QACL,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC;IACtC,CAAC;IAGD,OAAO,CAAc,EAAU;QAC7B,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACxC,CAAC;IAGD,MAAM,CAAc,EAAU,EAAU,cAA8B;QACpE,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,EAAE,cAAc,CAAC,CAAC;IACvD,CAAC;IAGD,MAAM,CAAc,EAAU;QAC5B,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACvC,CAAC;IAIK,AAAN,KAAK,CAAC,WAAW,CACP,UAA2B;QAEnC,OAAO,IAAI,CAAC,aAAa,CAAC,cAAc,CACtC,UAAU,CAAC,OAAO,EAClB,UAAU,CAAC,KAAK,CACjB,CAAC;IACJ,CAAC;CACF,CAAA;AAtCY,4CAAgB;AAI3B;IADC,IAAA,aAAI,GAAE;;IACC,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAiB,iCAAc;;8CAE5C;AAGD;IADC,IAAA,YAAG,GAAE;;;;;+CAGL;AAGD;IADC,IAAA,YAAG,EAAC,KAAK,CAAC;;IACF,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;+CAEnB;AAGD;IADC,IAAA,cAAK,EAAC,KAAK,CAAC;;IACL,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;IAAc,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAiB,iCAAc;;8CAErE;AAGD;IADC,IAAA,eAAM,EAAC,KAAK,CAAC;;IACN,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;8CAElB;AAIK;IAFL,IAAA,aAAI,EAAC,SAAS,CAAC;IACf,IAAA,iBAAQ,EAAC,mBAAU,CAAC,EAAE,CAAC;kCAAd,mBAAU,CAAC,EAAE;IAEpB,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAa,mCAAe;;mDAMpC;2BArCU,gBAAgB;IAD5B,IAAA,mBAAU,EAAC,QAAQ,CAAC;qCAEyB,8BAAa;GAD9C,gBAAgB,CAsC5B"}
|
|
@@ -11,16 +11,15 @@ const common_1 = require("@nestjs/common");
|
|
|
11
11
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
12
12
|
const agents_controller_1 = require("./agents.controller");
|
|
13
13
|
const agents_service_1 = require("./agents.service");
|
|
14
|
-
const gemini_agent_1 = require("./implementations/gemini.agent");
|
|
15
14
|
const agent_entity_1 = require("./entities/agent.entity");
|
|
16
15
|
let AgentsModule = class AgentsModule {
|
|
17
16
|
};
|
|
18
17
|
exports.AgentsModule = AgentsModule;
|
|
19
18
|
exports.AgentsModule = AgentsModule = __decorate([
|
|
20
19
|
(0, common_1.Module)({
|
|
21
|
-
imports: [typeorm_1.TypeOrmModule.forFeature([agent_entity_1.
|
|
20
|
+
imports: [typeorm_1.TypeOrmModule.forFeature([agent_entity_1.AgentEntity])],
|
|
22
21
|
controllers: [agents_controller_1.AgentsController],
|
|
23
|
-
providers: [agents_service_1.AgentsService
|
|
22
|
+
providers: [agents_service_1.AgentsService],
|
|
24
23
|
exports: [agents_service_1.AgentsService],
|
|
25
24
|
})
|
|
26
25
|
], AgentsModule);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.module.js","sourceRoot":"","sources":["../../../src/agents/agents.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,2DAAuD;AACvD,qDAAiD;AACjD,
|
|
1
|
+
{"version":3,"file":"agents.module.js","sourceRoot":"","sources":["../../../src/agents/agents.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,2DAAuD;AACvD,qDAAiD;AACjD,0DAAsD;AAQ/C,IAAM,YAAY,GAAlB,MAAM,YAAY;CAAG,CAAA;AAAf,oCAAY;uBAAZ,YAAY;IANxB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,uBAAa,CAAC,UAAU,CAAC,CAAC,0BAAW,CAAC,CAAC,CAAC;QAClD,WAAW,EAAE,CAAC,oCAAgB,CAAC;QAC/B,SAAS,EAAE,CAAC,8BAAa,CAAC;QAC1B,OAAO,EAAE,CAAC,8BAAa,CAAC;KACzB,CAAC;GACW,YAAY,CAAG"}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
+
import { ModuleRef } from '@nestjs/core';
|
|
1
2
|
import { Repository } from 'typeorm';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { AgentRequestDto } from './dto/agent-request.dto';
|
|
5
|
-
import { Agent as AgentEntity } from './entities/agent.entity';
|
|
3
|
+
import { AgentResponse, Agent as IAgent } from './interfaces/agent.interface';
|
|
4
|
+
import { AgentEntity } from './entities/agent.entity';
|
|
6
5
|
import { CreateAgentDto } from './dto/create-agent.dto';
|
|
7
6
|
import { UpdateAgentDto } from './dto/update-agent.dto';
|
|
8
7
|
export declare class AgentsService {
|
|
9
|
-
private readonly
|
|
8
|
+
private readonly moduleRef;
|
|
10
9
|
private readonly agentRepository;
|
|
11
10
|
private readonly logger;
|
|
12
11
|
private defaultAgent;
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
private readonly agentInstances;
|
|
13
|
+
constructor(moduleRef: ModuleRef, agentRepository: Repository<AgentEntity>);
|
|
14
|
+
onModuleInit(): Promise<void>;
|
|
15
|
+
private syncAgentInstance;
|
|
16
|
+
getInstances(): Map<string, IAgent>;
|
|
17
|
+
processRequest(agentId: string, input: string): Promise<AgentResponse>;
|
|
15
18
|
create(createAgentDto: CreateAgentDto): Promise<AgentEntity>;
|
|
16
19
|
findAll(): Promise<AgentEntity[]>;
|
|
17
20
|
findOne(id: string): Promise<AgentEntity>;
|