repoburg 1.3.142 → 1.3.143
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/backend/dist/src/agents/agents.controller.d.ts +15 -0
- package/backend/dist/src/agents/agents.controller.js +154 -0
- package/backend/dist/src/agents/agents.controller.js.map +1 -0
- package/backend/dist/src/agents/agents.module.d.ts +2 -0
- package/backend/dist/src/agents/agents.module.js +26 -0
- package/backend/dist/src/agents/agents.module.js.map +1 -0
- package/backend/dist/src/agents/agents.service.d.ts +20 -0
- package/backend/dist/src/agents/agents.service.js +141 -0
- package/backend/dist/src/agents/agents.service.js.map +1 -0
- package/backend/dist/src/agents/dto/create-agent.dto.d.ts +14 -0
- package/backend/dist/src/agents/dto/create-agent.dto.js +110 -0
- package/backend/dist/src/agents/dto/create-agent.dto.js.map +1 -0
- package/backend/dist/src/agents/dto/update-agent.dto.d.ts +12 -0
- package/backend/dist/src/agents/dto/update-agent.dto.js +93 -0
- package/backend/dist/src/agents/dto/update-agent.dto.js.map +1 -0
- package/backend/dist/src/app.module.js +4 -0
- package/backend/dist/src/app.module.js.map +1 -1
- package/backend/dist/src/core-entities/agent.entity.d.ts +20 -0
- package/backend/dist/src/core-entities/agent.entity.js +153 -0
- package/backend/dist/src/core-entities/agent.entity.js.map +1 -0
- package/backend/dist/src/core-entities/index.d.ts +1 -0
- package/backend/dist/src/core-entities/index.js +1 -0
- package/backend/dist/src/core-entities/index.js.map +1 -1
- package/backend/dist/src/llm-orchestration/action-handlers/manage-agents.handler.d.ts +20 -0
- package/backend/dist/src/llm-orchestration/action-handlers/manage-agents.handler.js +321 -0
- package/backend/dist/src/llm-orchestration/action-handlers/manage-agents.handler.js.map +1 -0
- package/backend/dist/src/llm-orchestration/llm-orchestration.module.js +7 -1
- package/backend/dist/src/llm-orchestration/llm-orchestration.module.js.map +1 -1
- package/backend/dist/src/seeding/agent-seeding.service.d.ts +12 -0
- package/backend/dist/src/seeding/agent-seeding.service.js +147 -0
- package/backend/dist/src/seeding/agent-seeding.service.js.map +1 -0
- package/backend/dist/src/seeding/data/agents/config-manager.d.ts +8 -0
- package/backend/dist/src/seeding/data/agents/config-manager.js +12 -0
- package/backend/dist/src/seeding/data/agents/config-manager.js.map +1 -0
- package/backend/dist/src/seeding/data/agents/default-agent.d.ts +8 -0
- package/backend/dist/src/seeding/data/agents/default-agent.js +12 -0
- package/backend/dist/src/seeding/data/agents/default-agent.js.map +1 -0
- package/backend/dist/src/seeding/data/context-templates/config-manager-followup-context.d.ts +9 -0
- package/backend/dist/src/seeding/data/context-templates/config-manager-followup-context.js +28 -0
- package/backend/dist/src/seeding/data/context-templates/config-manager-followup-context.js.map +1 -0
- package/backend/dist/src/seeding/data/context-templates/config-manager-initial-context.d.ts +9 -0
- package/backend/dist/src/seeding/data/context-templates/config-manager-initial-context.js +22 -0
- package/backend/dist/src/seeding/data/context-templates/config-manager-initial-context.js.map +1 -0
- package/backend/dist/src/seeding/data/system-prompts/config-manager-agent.d.ts +1 -1
- package/backend/dist/src/seeding/data/system-prompts/config-manager-agent.js +10 -2
- package/backend/dist/src/seeding/data/system-prompts/config-manager-agent.js.map +1 -1
- package/backend/dist/src/seeding/seeding.module.js +6 -1
- package/backend/dist/src/seeding/seeding.module.js.map +1 -1
- package/backend/dist/src/seeding/seeding.service.d.ts +3 -1
- package/backend/dist/src/seeding/seeding.service.js +6 -2
- package/backend/dist/src/seeding/seeding.service.js.map +1 -1
- package/backend/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AgentsService } from './agents.service';
|
|
2
|
+
import { CreateAgentDto } from './dto/create-agent.dto';
|
|
3
|
+
import { UpdateAgentDto } from './dto/update-agent.dto';
|
|
4
|
+
export declare class AgentsController {
|
|
5
|
+
private readonly agentsService;
|
|
6
|
+
constructor(agentsService: AgentsService);
|
|
7
|
+
create(createAgentDto: CreateAgentDto): Promise<import("../core-entities").Agent>;
|
|
8
|
+
findAll(activeOnly?: boolean): Promise<import("../core-entities").Agent[]>;
|
|
9
|
+
findDefault(): Promise<import("../core-entities").Agent>;
|
|
10
|
+
findOne(id: string): Promise<import("../core-entities").Agent>;
|
|
11
|
+
update(id: string, updateAgentDto: UpdateAgentDto): Promise<import("../core-entities").Agent>;
|
|
12
|
+
remove(id: string): Promise<void>;
|
|
13
|
+
setDefault(id: string): Promise<import("../core-entities").Agent>;
|
|
14
|
+
duplicate(id: string): Promise<import("../core-entities").Agent>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.AgentsController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
18
|
+
const agents_service_1 = require("./agents.service");
|
|
19
|
+
const create_agent_dto_1 = require("./dto/create-agent.dto");
|
|
20
|
+
const update_agent_dto_1 = require("./dto/update-agent.dto");
|
|
21
|
+
let AgentsController = class AgentsController {
|
|
22
|
+
constructor(agentsService) {
|
|
23
|
+
this.agentsService = agentsService;
|
|
24
|
+
}
|
|
25
|
+
create(createAgentDto) {
|
|
26
|
+
return this.agentsService.create(createAgentDto);
|
|
27
|
+
}
|
|
28
|
+
findAll(activeOnly) {
|
|
29
|
+
return this.agentsService.findAll(activeOnly);
|
|
30
|
+
}
|
|
31
|
+
findDefault() {
|
|
32
|
+
return this.agentsService.findDefault();
|
|
33
|
+
}
|
|
34
|
+
findOne(id) {
|
|
35
|
+
return this.agentsService.findOne(id);
|
|
36
|
+
}
|
|
37
|
+
update(id, updateAgentDto) {
|
|
38
|
+
return this.agentsService.update(id, updateAgentDto);
|
|
39
|
+
}
|
|
40
|
+
remove(id) {
|
|
41
|
+
return this.agentsService.remove(id);
|
|
42
|
+
}
|
|
43
|
+
setDefault(id) {
|
|
44
|
+
return this.agentsService.setDefault(id);
|
|
45
|
+
}
|
|
46
|
+
async duplicate(id) {
|
|
47
|
+
return this.agentsService.duplicate(id);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
exports.AgentsController = AgentsController;
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, common_1.Post)(),
|
|
53
|
+
(0, common_1.HttpCode)(common_1.HttpStatus.CREATED),
|
|
54
|
+
(0, swagger_1.ApiOperation)({ summary: 'Create an agent' }),
|
|
55
|
+
(0, swagger_1.ApiResponse)({ status: 201, description: 'Agent created' }),
|
|
56
|
+
__param(0, (0, common_1.Body)()),
|
|
57
|
+
__metadata("design:type", Function),
|
|
58
|
+
__metadata("design:paramtypes", [create_agent_dto_1.CreateAgentDto]),
|
|
59
|
+
__metadata("design:returntype", void 0)
|
|
60
|
+
], AgentsController.prototype, "create", null);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, common_1.Get)(),
|
|
63
|
+
(0, swagger_1.ApiOperation)({ summary: 'List agents (optional filter by active)' }),
|
|
64
|
+
(0, swagger_1.ApiQuery)({
|
|
65
|
+
name: 'activeOnly',
|
|
66
|
+
required: false,
|
|
67
|
+
description: 'Filter to only active agents',
|
|
68
|
+
type: Boolean,
|
|
69
|
+
}),
|
|
70
|
+
(0, swagger_1.ApiResponse)({ status: 200, description: 'List of agents' }),
|
|
71
|
+
__param(0, (0, common_1.Query)('activeOnly')),
|
|
72
|
+
__metadata("design:type", Function),
|
|
73
|
+
__metadata("design:paramtypes", [Boolean]),
|
|
74
|
+
__metadata("design:returntype", void 0)
|
|
75
|
+
], AgentsController.prototype, "findAll", null);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, common_1.Get)('default'),
|
|
78
|
+
(0, swagger_1.ApiOperation)({ summary: 'Get the default agent' }),
|
|
79
|
+
(0, swagger_1.ApiResponse)({ status: 200, description: 'Default agent' }),
|
|
80
|
+
(0, swagger_1.ApiResponse)({ status: 404, description: 'No default agent found' }),
|
|
81
|
+
__metadata("design:type", Function),
|
|
82
|
+
__metadata("design:paramtypes", []),
|
|
83
|
+
__metadata("design:returntype", void 0)
|
|
84
|
+
], AgentsController.prototype, "findDefault", null);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, common_1.Get)(':id'),
|
|
87
|
+
(0, swagger_1.ApiOperation)({ summary: 'Get an agent by ID' }),
|
|
88
|
+
(0, swagger_1.ApiParam)({ name: 'id', description: 'Agent UUID', format: 'uuid' }),
|
|
89
|
+
(0, swagger_1.ApiResponse)({ status: 200, description: 'Agent found' }),
|
|
90
|
+
(0, swagger_1.ApiResponse)({ status: 404, description: 'Agent not found' }),
|
|
91
|
+
__param(0, (0, common_1.Param)('id')),
|
|
92
|
+
__metadata("design:type", Function),
|
|
93
|
+
__metadata("design:paramtypes", [String]),
|
|
94
|
+
__metadata("design:returntype", void 0)
|
|
95
|
+
], AgentsController.prototype, "findOne", null);
|
|
96
|
+
__decorate([
|
|
97
|
+
(0, common_1.Patch)(':id'),
|
|
98
|
+
(0, swagger_1.ApiOperation)({ summary: 'Update an agent' }),
|
|
99
|
+
(0, swagger_1.ApiParam)({ name: 'id', description: 'Agent UUID', format: 'uuid' }),
|
|
100
|
+
(0, swagger_1.ApiResponse)({ status: 200, description: 'Agent updated' }),
|
|
101
|
+
(0, swagger_1.ApiResponse)({ status: 403, description: 'Cannot modify built-in agent' }),
|
|
102
|
+
(0, swagger_1.ApiResponse)({ status: 404, description: 'Agent not found' }),
|
|
103
|
+
__param(0, (0, common_1.Param)('id')),
|
|
104
|
+
__param(1, (0, common_1.Body)()),
|
|
105
|
+
__metadata("design:type", Function),
|
|
106
|
+
__metadata("design:paramtypes", [String, update_agent_dto_1.UpdateAgentDto]),
|
|
107
|
+
__metadata("design:returntype", void 0)
|
|
108
|
+
], AgentsController.prototype, "update", null);
|
|
109
|
+
__decorate([
|
|
110
|
+
(0, common_1.Delete)(':id'),
|
|
111
|
+
(0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
|
|
112
|
+
(0, swagger_1.ApiOperation)({ summary: 'Delete an agent' }),
|
|
113
|
+
(0, swagger_1.ApiParam)({ name: 'id', description: 'Agent UUID', format: 'uuid' }),
|
|
114
|
+
(0, swagger_1.ApiResponse)({ status: 204, description: 'Agent deleted' }),
|
|
115
|
+
(0, swagger_1.ApiResponse)({ status: 403, description: 'Cannot delete built-in agent' }),
|
|
116
|
+
(0, swagger_1.ApiResponse)({ status: 404, description: 'Agent not found' }),
|
|
117
|
+
__param(0, (0, common_1.Param)('id')),
|
|
118
|
+
__metadata("design:type", Function),
|
|
119
|
+
__metadata("design:paramtypes", [String]),
|
|
120
|
+
__metadata("design:returntype", void 0)
|
|
121
|
+
], AgentsController.prototype, "remove", null);
|
|
122
|
+
__decorate([
|
|
123
|
+
(0, common_1.Post)(':id/set-default'),
|
|
124
|
+
(0, swagger_1.ApiOperation)({ summary: 'Set an agent as the default' }),
|
|
125
|
+
(0, swagger_1.ApiParam)({ name: 'id', description: 'Agent UUID', format: 'uuid' }),
|
|
126
|
+
(0, swagger_1.ApiResponse)({ status: 200, description: 'Agent set as default' }),
|
|
127
|
+
(0, swagger_1.ApiResponse)({ status: 404, description: 'Agent not found' }),
|
|
128
|
+
__param(0, (0, common_1.Param)('id')),
|
|
129
|
+
__metadata("design:type", Function),
|
|
130
|
+
__metadata("design:paramtypes", [String]),
|
|
131
|
+
__metadata("design:returntype", void 0)
|
|
132
|
+
], AgentsController.prototype, "setDefault", null);
|
|
133
|
+
__decorate([
|
|
134
|
+
(0, common_1.Post)(':id/duplicate'),
|
|
135
|
+
(0, common_1.HttpCode)(common_1.HttpStatus.CREATED),
|
|
136
|
+
(0, swagger_1.ApiOperation)({ summary: 'Duplicate an agent' }),
|
|
137
|
+
(0, swagger_1.ApiParam)({
|
|
138
|
+
name: 'id',
|
|
139
|
+
description: 'Agent UUID to duplicate',
|
|
140
|
+
format: 'uuid',
|
|
141
|
+
}),
|
|
142
|
+
(0, swagger_1.ApiResponse)({ status: 201, description: 'Agent duplicated' }),
|
|
143
|
+
(0, swagger_1.ApiResponse)({ status: 404, description: 'Agent not found' }),
|
|
144
|
+
__param(0, (0, common_1.Param)('id')),
|
|
145
|
+
__metadata("design:type", Function),
|
|
146
|
+
__metadata("design:paramtypes", [String]),
|
|
147
|
+
__metadata("design:returntype", Promise)
|
|
148
|
+
], AgentsController.prototype, "duplicate", null);
|
|
149
|
+
exports.AgentsController = AgentsController = __decorate([
|
|
150
|
+
(0, swagger_1.ApiTags)('agents'),
|
|
151
|
+
(0, common_1.Controller)('agents'),
|
|
152
|
+
__metadata("design:paramtypes", [agents_service_1.AgentsService])
|
|
153
|
+
], AgentsController);
|
|
154
|
+
//# sourceMappingURL=agents.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.controller.js","sourceRoot":"","sources":["../../../src/agents/agents.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAWwB;AACxB,6CAMyB;AACzB,qDAAiD;AACjD,6DAAwD;AACxD,6DAAwD;AAIjD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IA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AAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IACnE,IAAA,qBAAW,EAAC,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;IACjE,IAAA,qBAAW,EAAC,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACjD,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;kDAEtB;AAYK;IAVL,IAAA,aAAI,EAAC,eAAe,CAAC;IACrB,IAAA,iBAAQ,EAAC,mBAAU,CAAC,OAAO,CAAC;IAC5B,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,oBAAoB,EAAE,CAAC;IAC/C,IAAA,kBAAQ,EAAC;QACR,IAAI,EAAE,IAAI;QACV,WAAW,EAAE,yBAAyB;QACtC,MAAM,EAAE,MAAM;KACf,CAAC;IACD,IAAA,qBAAW,EAAC,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;IAC7D,IAAA,qBAAW,EAAC,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;IAC5C,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;iDAE3B;2BAnFU,gBAAgB;IAF5B,IAAA,iBAAO,EAAC,QAAQ,CAAC;IACjB,IAAA,mBAAU,EAAC,QAAQ,CAAC;qCAEyB,8BAAa;GAD9C,gBAAgB,CAoF5B"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.AgentsModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
12
|
+
const core_entities_1 = require("../core-entities");
|
|
13
|
+
const agents_service_1 = require("./agents.service");
|
|
14
|
+
const agents_controller_1 = require("./agents.controller");
|
|
15
|
+
let AgentsModule = class AgentsModule {
|
|
16
|
+
};
|
|
17
|
+
exports.AgentsModule = AgentsModule;
|
|
18
|
+
exports.AgentsModule = AgentsModule = __decorate([
|
|
19
|
+
(0, common_1.Module)({
|
|
20
|
+
imports: [typeorm_1.TypeOrmModule.forFeature([core_entities_1.Agent])],
|
|
21
|
+
controllers: [agents_controller_1.AgentsController],
|
|
22
|
+
providers: [agents_service_1.AgentsService],
|
|
23
|
+
exports: [agents_service_1.AgentsService],
|
|
24
|
+
})
|
|
25
|
+
], AgentsModule);
|
|
26
|
+
//# sourceMappingURL=agents.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.module.js","sourceRoot":"","sources":["../../../src/agents/agents.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,oDAAyC;AACzC,qDAAiD;AACjD,2DAAuD;AAQhD,IAAM,YAAY,GAAlB,MAAM,YAAY;CAAG,CAAA;AAAf,oCAAY;uBAAZ,YAAY;IANxB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,uBAAa,CAAC,UAAU,CAAC,CAAC,qBAAK,CAAC,CAAC,CAAC;QAC5C,WAAW,EAAE,CAAC,oCAAgB,CAAC;QAC/B,SAAS,EAAE,CAAC,8BAAa,CAAC;QAC1B,OAAO,EAAE,CAAC,8BAAa,CAAC;KACzB,CAAC;GACW,YAAY,CAAG"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Repository, DataSource } from 'typeorm';
|
|
2
|
+
import { Agent } from '../core-entities';
|
|
3
|
+
import { CreateAgentDto } from './dto/create-agent.dto';
|
|
4
|
+
import { UpdateAgentDto } from './dto/update-agent.dto';
|
|
5
|
+
export declare class AgentsService {
|
|
6
|
+
private readonly agentsRepository;
|
|
7
|
+
private readonly dataSource;
|
|
8
|
+
private readonly logger;
|
|
9
|
+
constructor(agentsRepository: Repository<Agent>, dataSource: DataSource);
|
|
10
|
+
create(createAgentDto: CreateAgentDto): Promise<Agent>;
|
|
11
|
+
findAll(activeOnly?: boolean): Promise<Agent[]>;
|
|
12
|
+
findOne(id: string): Promise<Agent>;
|
|
13
|
+
update(id: string, updateAgentDto: UpdateAgentDto): Promise<Agent>;
|
|
14
|
+
remove(id: string): Promise<void>;
|
|
15
|
+
setDefault(id: string): Promise<Agent>;
|
|
16
|
+
private clearDefault;
|
|
17
|
+
findDefault(): Promise<Agent | null>;
|
|
18
|
+
findByBuiltinKey(builtinKey: string): Promise<Agent | null>;
|
|
19
|
+
duplicate(id: string): Promise<Agent>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var AgentsService_1;
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.AgentsService = void 0;
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
19
|
+
const typeorm_2 = require("typeorm");
|
|
20
|
+
const core_entities_1 = require("../core-entities");
|
|
21
|
+
let AgentsService = AgentsService_1 = class AgentsService {
|
|
22
|
+
constructor(agentsRepository, dataSource) {
|
|
23
|
+
this.agentsRepository = agentsRepository;
|
|
24
|
+
this.dataSource = dataSource;
|
|
25
|
+
this.logger = new common_1.Logger(AgentsService_1.name);
|
|
26
|
+
}
|
|
27
|
+
async create(createAgentDto) {
|
|
28
|
+
const agent = this.agentsRepository.create(createAgentDto);
|
|
29
|
+
if (agent.is_default) {
|
|
30
|
+
await this.clearDefault();
|
|
31
|
+
}
|
|
32
|
+
return this.agentsRepository.save(agent);
|
|
33
|
+
}
|
|
34
|
+
async findAll(activeOnly = false) {
|
|
35
|
+
const query = this.agentsRepository
|
|
36
|
+
.createQueryBuilder('agent')
|
|
37
|
+
.leftJoinAndSelect('agent.systemPrompt', 'systemPrompt')
|
|
38
|
+
.leftJoinAndSelect('agent.contextTemplate', 'contextTemplate')
|
|
39
|
+
.leftJoinAndSelect('agent.followupContextTemplate', 'followupContextTemplate')
|
|
40
|
+
.orderBy('agent.name', 'ASC');
|
|
41
|
+
if (activeOnly) {
|
|
42
|
+
query.where('agent.is_active = :isActive', { isActive: true });
|
|
43
|
+
}
|
|
44
|
+
return query.getMany();
|
|
45
|
+
}
|
|
46
|
+
async findOne(id) {
|
|
47
|
+
const agent = await this.agentsRepository.findOne({
|
|
48
|
+
where: { id },
|
|
49
|
+
relations: ['systemPrompt', 'contextTemplate', 'followupContextTemplate'],
|
|
50
|
+
});
|
|
51
|
+
if (!agent) {
|
|
52
|
+
throw new common_1.NotFoundException(`Agent with ID "${id}" not found`);
|
|
53
|
+
}
|
|
54
|
+
return agent;
|
|
55
|
+
}
|
|
56
|
+
async update(id, updateAgentDto) {
|
|
57
|
+
const agent = await this.findOne(id);
|
|
58
|
+
if (agent.is_builtin) {
|
|
59
|
+
const allowedKeys = [
|
|
60
|
+
'is_active',
|
|
61
|
+
'model_id',
|
|
62
|
+
'reasoning_effort',
|
|
63
|
+
];
|
|
64
|
+
const modifiedFields = Object.keys(updateAgentDto).filter((key) => !allowedKeys.includes(key));
|
|
65
|
+
if (modifiedFields.length > 0) {
|
|
66
|
+
throw new common_1.ForbiddenException(`Cannot modify built-in agent "${agent.name}". Only active status, model, and reasoning effort can be changed. Duplicate it to create your own version.`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (updateAgentDto.is_default === true) {
|
|
70
|
+
await this.clearDefault();
|
|
71
|
+
}
|
|
72
|
+
const updateData = {};
|
|
73
|
+
for (const [key, value] of Object.entries(updateAgentDto)) {
|
|
74
|
+
if (value !== undefined) {
|
|
75
|
+
updateData[key] = value;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
await this.agentsRepository.update(id, updateData);
|
|
79
|
+
return this.findOne(id);
|
|
80
|
+
}
|
|
81
|
+
async remove(id) {
|
|
82
|
+
const agent = await this.findOne(id);
|
|
83
|
+
if (agent.is_builtin) {
|
|
84
|
+
throw new common_1.ForbiddenException(`Cannot delete built-in agent "${agent.name}".`);
|
|
85
|
+
}
|
|
86
|
+
await this.agentsRepository.remove(agent);
|
|
87
|
+
}
|
|
88
|
+
async setDefault(id) {
|
|
89
|
+
const agent = await this.findOne(id);
|
|
90
|
+
await this.clearDefault();
|
|
91
|
+
agent.is_default = true;
|
|
92
|
+
await this.agentsRepository.save(agent);
|
|
93
|
+
return this.findOne(id);
|
|
94
|
+
}
|
|
95
|
+
async clearDefault() {
|
|
96
|
+
await this.agentsRepository.update({ is_default: true }, { is_default: false });
|
|
97
|
+
}
|
|
98
|
+
async findDefault() {
|
|
99
|
+
return this.agentsRepository.findOne({
|
|
100
|
+
where: { is_default: true },
|
|
101
|
+
relations: ['systemPrompt', 'contextTemplate', 'followupContextTemplate'],
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
async findByBuiltinKey(builtinKey) {
|
|
105
|
+
return this.agentsRepository.findOne({
|
|
106
|
+
where: { builtin_key: builtinKey },
|
|
107
|
+
relations: ['systemPrompt', 'contextTemplate', 'followupContextTemplate'],
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
async duplicate(id) {
|
|
111
|
+
const original = await this.findOne(id);
|
|
112
|
+
let newName = `${original.name} (Copy)`;
|
|
113
|
+
let suffix = 2;
|
|
114
|
+
while (await this.agentsRepository.findOne({ where: { name: newName } })) {
|
|
115
|
+
newName = `${original.name} (Copy ${suffix})`;
|
|
116
|
+
suffix++;
|
|
117
|
+
}
|
|
118
|
+
const duplicate = this.agentsRepository.create({
|
|
119
|
+
name: newName,
|
|
120
|
+
description: original.description,
|
|
121
|
+
system_prompt_id: original.system_prompt_id,
|
|
122
|
+
context_template_id: original.context_template_id,
|
|
123
|
+
followup_context_template_id: original.followup_context_template_id,
|
|
124
|
+
model_id: original.model_id,
|
|
125
|
+
reasoning_effort: original.reasoning_effort,
|
|
126
|
+
is_default: false,
|
|
127
|
+
is_active: true,
|
|
128
|
+
is_builtin: false,
|
|
129
|
+
builtin_key: null,
|
|
130
|
+
});
|
|
131
|
+
return this.agentsRepository.save(duplicate);
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
exports.AgentsService = AgentsService;
|
|
135
|
+
exports.AgentsService = AgentsService = AgentsService_1 = __decorate([
|
|
136
|
+
(0, common_1.Injectable)(),
|
|
137
|
+
__param(0, (0, typeorm_1.InjectRepository)(core_entities_1.Agent)),
|
|
138
|
+
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
139
|
+
typeorm_2.DataSource])
|
|
140
|
+
], AgentsService);
|
|
141
|
+
//# sourceMappingURL=agents.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.service.js","sourceRoot":"","sources":["../../../src/agents/agents.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAKwB;AACxB,6CAAmD;AACnD,qCAAiD;AACjD,oDAAyC;AAKlC,IAAM,aAAa,qBAAnB,MAAM,aAAa;IAGxB,YAEE,gBAAoD,EACnC,UAAsB;QADtB,qBAAgB,GAAhB,gBAAgB,CAAmB;QACnC,eAAU,GAAV,UAAU,CAAY;QALxB,WAAM,GAAG,IAAI,eAAM,CAAC,eAAa,CAAC,IAAI,CAAC,CAAC;IAMtD,CAAC;IAEJ,KAAK,CAAC,MAAM,CAAC,cAA8B;QACzC,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;QAG3D,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC;YACrB,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;QAC5B,CAAC;QAED,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,UAAU,GAAG,KAAK;QAC9B,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB;aAChC,kBAAkB,CAAC,OAAO,CAAC;aAC3B,iBAAiB,CAAC,oBAAoB,EAAE,cAAc,CAAC;aACvD,iBAAiB,CAAC,uBAAuB,EAAE,iBAAiB,CAAC;aAC7D,iBAAiB,CAChB,+BAA+B,EAC/B,yBAAyB,CAC1B;aACA,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;QAEhC,IAAI,UAAU,EAAE,CAAC;YACf,KAAK,CAAC,KAAK,CAAC,6BAA6B,EAAE,EAAE,QAAQ,EAAE,IAAI,EAA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,CAAC,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC/C,CAAC;CACF,CAAA;AA5KY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;IAKR,WAAA,IAAA,0BAAgB,EAAC,qBAAK,CAAC,CAAA;qCACW,oBAAU;QAChB,oBAAU;GAN9B,aAAa,CA4KzB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReasoningEffort } from '../../core-entities/enums';
|
|
2
|
+
export declare class CreateAgentDto {
|
|
3
|
+
name: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
system_prompt_id?: string | null;
|
|
6
|
+
context_template_id?: string | null;
|
|
7
|
+
followup_context_template_id?: string | null;
|
|
8
|
+
model_id?: string | null;
|
|
9
|
+
reasoning_effort?: ReasoningEffort | null;
|
|
10
|
+
is_default?: boolean;
|
|
11
|
+
is_active?: boolean;
|
|
12
|
+
is_builtin?: boolean;
|
|
13
|
+
builtin_key?: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CreateAgentDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
15
|
+
const enums_1 = require("../../core-entities/enums");
|
|
16
|
+
class CreateAgentDto {
|
|
17
|
+
}
|
|
18
|
+
exports.CreateAgentDto = CreateAgentDto;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, swagger_1.ApiProperty)({ description: 'Name of the agent', example: 'Code Reviewer' }),
|
|
21
|
+
(0, class_validator_1.IsString)(),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], CreateAgentDto.prototype, "name", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
26
|
+
description: 'Description of what this agent does',
|
|
27
|
+
}),
|
|
28
|
+
(0, class_validator_1.IsOptional)(),
|
|
29
|
+
(0, class_validator_1.IsString)(),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], CreateAgentDto.prototype, "description", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
34
|
+
description: 'UUID of system prompt for this agent',
|
|
35
|
+
format: 'uuid',
|
|
36
|
+
}),
|
|
37
|
+
(0, class_validator_1.IsOptional)(),
|
|
38
|
+
(0, class_validator_1.IsUUID)(),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], CreateAgentDto.prototype, "system_prompt_id", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
43
|
+
description: 'UUID of context template for initial prompts',
|
|
44
|
+
format: 'uuid',
|
|
45
|
+
}),
|
|
46
|
+
(0, class_validator_1.IsOptional)(),
|
|
47
|
+
(0, class_validator_1.IsUUID)(),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], CreateAgentDto.prototype, "context_template_id", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
52
|
+
description: 'UUID of context template for follow-up prompts',
|
|
53
|
+
format: 'uuid',
|
|
54
|
+
}),
|
|
55
|
+
(0, class_validator_1.IsOptional)(),
|
|
56
|
+
(0, class_validator_1.IsUUID)(),
|
|
57
|
+
__metadata("design:type", String)
|
|
58
|
+
], CreateAgentDto.prototype, "followup_context_template_id", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
61
|
+
description: 'Model ID to use for this agent',
|
|
62
|
+
example: 'ollama/glm-5.1:cloud',
|
|
63
|
+
}),
|
|
64
|
+
(0, class_validator_1.IsOptional)(),
|
|
65
|
+
(0, class_validator_1.IsString)(),
|
|
66
|
+
__metadata("design:type", String)
|
|
67
|
+
], CreateAgentDto.prototype, "model_id", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
70
|
+
description: 'Reasoning effort level for this agent',
|
|
71
|
+
enum: enums_1.ReasoningEffort,
|
|
72
|
+
enumName: 'ReasoningEffort',
|
|
73
|
+
}),
|
|
74
|
+
(0, class_validator_1.IsOptional)(),
|
|
75
|
+
(0, class_validator_1.IsEnum)(enums_1.ReasoningEffort),
|
|
76
|
+
__metadata("design:type", String)
|
|
77
|
+
], CreateAgentDto.prototype, "reasoning_effort", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
80
|
+
description: 'Whether this agent is the default for new sessions',
|
|
81
|
+
}),
|
|
82
|
+
(0, class_validator_1.IsOptional)(),
|
|
83
|
+
(0, class_validator_1.IsBoolean)(),
|
|
84
|
+
__metadata("design:type", Boolean)
|
|
85
|
+
], CreateAgentDto.prototype, "is_default", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
(0, swagger_1.ApiPropertyOptional)({ description: 'Whether this agent is active' }),
|
|
88
|
+
(0, class_validator_1.IsOptional)(),
|
|
89
|
+
(0, class_validator_1.IsBoolean)(),
|
|
90
|
+
__metadata("design:type", Boolean)
|
|
91
|
+
], CreateAgentDto.prototype, "is_active", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
94
|
+
description: 'Whether this is a built-in agent (only used by seeding)',
|
|
95
|
+
example: false,
|
|
96
|
+
}),
|
|
97
|
+
(0, class_validator_1.IsOptional)(),
|
|
98
|
+
(0, class_validator_1.IsBoolean)(),
|
|
99
|
+
__metadata("design:type", Boolean)
|
|
100
|
+
], CreateAgentDto.prototype, "is_builtin", void 0);
|
|
101
|
+
__decorate([
|
|
102
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
103
|
+
description: 'Unique key for built-in agents (only used by seeding)',
|
|
104
|
+
example: 'default-agent',
|
|
105
|
+
}),
|
|
106
|
+
(0, class_validator_1.IsOptional)(),
|
|
107
|
+
(0, class_validator_1.IsString)(),
|
|
108
|
+
__metadata("design:type", String)
|
|
109
|
+
], CreateAgentDto.prototype, "builtin_key", void 0);
|
|
110
|
+
//# sourceMappingURL=create-agent.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-agent.dto.js","sourceRoot":"","sources":["../../../../src/agents/dto/create-agent.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAMyB;AACzB,6CAAmE;AACnE,qDAA4D;AAE5D,MAAa,cAAc;CAgF1B;AAhFD,wCAgFC;AA7EC;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,mBAAmB,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3E,IAAA,0BAAQ,GAAE;;4CACE;AAOb;IALC,IAAA,6BAAmB,EAAC;QACnB,WAAW,EAAE,qCAAqC;KACnD,CAAC;IACD,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;mDACU;AAQrB;IANC,IAAA,6BAAmB,EAAC;QACnB,WAAW,EAAE,sCAAsC;QACnD,MAAM,EAAE,MAAM;KACf,CAAC;IACD,IAAA,4BAAU,GAAE;IACZ,IAAA,wB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E;;mDACU"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReasoningEffort } from '../../core-entities/enums';
|
|
2
|
+
export declare class UpdateAgentDto {
|
|
3
|
+
name?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
system_prompt_id?: string | null;
|
|
6
|
+
context_template_id?: string | null;
|
|
7
|
+
followup_context_template_id?: string | null;
|
|
8
|
+
model_id?: string | null;
|
|
9
|
+
reasoning_effort?: ReasoningEffort | null;
|
|
10
|
+
is_active?: boolean;
|
|
11
|
+
is_default?: boolean;
|
|
12
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.UpdateAgentDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
15
|
+
const enums_1 = require("../../core-entities/enums");
|
|
16
|
+
class UpdateAgentDto {
|
|
17
|
+
}
|
|
18
|
+
exports.UpdateAgentDto = UpdateAgentDto;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, swagger_1.ApiPropertyOptional)({ description: 'Name of the agent' }),
|
|
21
|
+
(0, class_validator_1.IsOptional)(),
|
|
22
|
+
(0, class_validator_1.IsString)(),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], UpdateAgentDto.prototype, "name", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
27
|
+
description: 'Description of what this agent does',
|
|
28
|
+
}),
|
|
29
|
+
(0, class_validator_1.IsOptional)(),
|
|
30
|
+
(0, class_validator_1.IsString)(),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], UpdateAgentDto.prototype, "description", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
35
|
+
description: 'UUID of system prompt',
|
|
36
|
+
format: 'uuid',
|
|
37
|
+
}),
|
|
38
|
+
(0, class_validator_1.IsOptional)(),
|
|
39
|
+
(0, class_validator_1.IsUUID)(),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], UpdateAgentDto.prototype, "system_prompt_id", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
44
|
+
description: 'UUID of context template for initial prompts',
|
|
45
|
+
format: 'uuid',
|
|
46
|
+
}),
|
|
47
|
+
(0, class_validator_1.IsOptional)(),
|
|
48
|
+
(0, class_validator_1.IsUUID)(),
|
|
49
|
+
__metadata("design:type", String)
|
|
50
|
+
], UpdateAgentDto.prototype, "context_template_id", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
53
|
+
description: 'UUID of context template for follow-up prompts',
|
|
54
|
+
format: 'uuid',
|
|
55
|
+
}),
|
|
56
|
+
(0, class_validator_1.IsOptional)(),
|
|
57
|
+
(0, class_validator_1.IsUUID)(),
|
|
58
|
+
__metadata("design:type", String)
|
|
59
|
+
], UpdateAgentDto.prototype, "followup_context_template_id", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
62
|
+
description: 'Model ID to use',
|
|
63
|
+
example: 'ollama/glm-5.1:cloud',
|
|
64
|
+
}),
|
|
65
|
+
(0, class_validator_1.IsOptional)(),
|
|
66
|
+
(0, class_validator_1.IsString)(),
|
|
67
|
+
__metadata("design:type", String)
|
|
68
|
+
], UpdateAgentDto.prototype, "model_id", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
71
|
+
description: 'Reasoning effort level',
|
|
72
|
+
enum: enums_1.ReasoningEffort,
|
|
73
|
+
enumName: 'ReasoningEffort',
|
|
74
|
+
}),
|
|
75
|
+
(0, class_validator_1.IsOptional)(),
|
|
76
|
+
(0, class_validator_1.IsEnum)(enums_1.ReasoningEffort),
|
|
77
|
+
__metadata("design:type", String)
|
|
78
|
+
], UpdateAgentDto.prototype, "reasoning_effort", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, swagger_1.ApiPropertyOptional)({ description: 'Whether this agent is active' }),
|
|
81
|
+
(0, class_validator_1.IsOptional)(),
|
|
82
|
+
(0, class_validator_1.IsBoolean)(),
|
|
83
|
+
__metadata("design:type", Boolean)
|
|
84
|
+
], UpdateAgentDto.prototype, "is_active", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
87
|
+
description: 'Whether this agent is the default for new sessions',
|
|
88
|
+
}),
|
|
89
|
+
(0, class_validator_1.IsOptional)(),
|
|
90
|
+
(0, class_validator_1.IsBoolean)(),
|
|
91
|
+
__metadata("design:type", Boolean)
|
|
92
|
+
], UpdateAgentDto.prototype, "is_default", void 0);
|
|
93
|
+
//# sourceMappingURL=update-agent.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-agent.dto.js","sourceRoot":"","sources":["../../../../src/agents/dto/update-agent.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAMyB;AACzB,6CAAsD;AACtD,qDA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