devchain-cli 0.7.2 → 0.8.0
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/dist/drizzle/0027_legal_malice.sql +17 -0
- package/dist/drizzle/0028_populate_provider_configs.sql +19 -0
- package/dist/drizzle/0029_merge_profiles_by_family_slug.sql +116 -0
- package/dist/drizzle/0030_set_agents_provider_config_id.sql +14 -0
- package/dist/drizzle/0031_remove_legacy_profile_columns.sql +68 -0
- package/dist/drizzle/0032_agents_provider_config_not_null.sql +52 -0
- package/dist/drizzle/0033_profile_provider_configs_name.sql +38 -0
- package/dist/drizzle/0034_sessions_agent_running_unique.sql +30 -0
- package/dist/drizzle/0035_provider_config_position.sql +26 -0
- package/dist/drizzle/PHASE2_MIGRATION_GUIDE.md +109 -0
- package/dist/drizzle/meta/0027_snapshot.json +3648 -0
- package/dist/drizzle/meta/0035_snapshot.json +3670 -0
- package/dist/drizzle/meta/_journal.json +64 -1
- package/dist/drizzle/migration-guard.sql +17 -0
- package/dist/drizzle/phase2-rollback.sql +44 -0
- package/dist/node_modules/@devchain/shared/schemas/export-schema.d.ts +101 -12
- package/dist/node_modules/@devchain/shared/schemas/export-schema.d.ts.map +1 -1
- package/dist/node_modules/@devchain/shared/schemas/export-schema.js +20 -0
- package/dist/node_modules/@devchain/shared/schemas/export-schema.js.map +1 -1
- package/dist/node_modules/@devchain/shared/tsconfig.tsbuildinfo +1 -1
- package/dist/server/modules/agents/controllers/agents.controller.d.ts +15 -0
- package/dist/server/modules/agents/controllers/agents.controller.js +120 -57
- package/dist/server/modules/agents/controllers/agents.controller.js.map +1 -1
- package/dist/server/modules/core/services/preflight.service.d.ts +6 -0
- package/dist/server/modules/core/services/preflight.service.js +143 -57
- package/dist/server/modules/core/services/preflight.service.js.map +1 -1
- package/dist/server/modules/epics/services/epics.service.d.ts +10 -4
- package/dist/server/modules/epics/services/epics.service.js +8 -5
- package/dist/server/modules/epics/services/epics.service.js.map +1 -1
- package/dist/server/modules/events/catalog/epic.created.d.ts +18 -0
- package/dist/server/modules/events/catalog/epic.created.js +8 -0
- package/dist/server/modules/events/catalog/epic.created.js.map +1 -1
- package/dist/server/modules/events/catalog/epic.updated.d.ts +18 -0
- package/dist/server/modules/events/catalog/epic.updated.js +8 -0
- package/dist/server/modules/events/catalog/epic.updated.js.map +1 -1
- package/dist/server/modules/events/catalog/index.d.ts +36 -0
- package/dist/server/modules/events/subscribers/epic-assignment-notifier.subscriber.d.ts +1 -0
- package/dist/server/modules/events/subscribers/epic-assignment-notifier.subscriber.js +33 -2
- package/dist/server/modules/events/subscribers/epic-assignment-notifier.subscriber.js.map +1 -1
- package/dist/server/modules/events/subscribers/review-comment-notifier.subscriber.js +12 -5
- package/dist/server/modules/events/subscribers/review-comment-notifier.subscriber.js.map +1 -1
- package/dist/server/modules/mcp/services/mcp.service.js +16 -2
- package/dist/server/modules/mcp/services/mcp.service.js.map +1 -1
- package/dist/server/modules/mcp/services/terminal-activity.service.d.ts +1 -1
- package/dist/server/modules/mcp/services/terminal-activity.service.js +22 -2
- package/dist/server/modules/mcp/services/terminal-activity.service.js.map +1 -1
- package/dist/server/modules/profiles/controllers/profiles.controller.d.ts +11 -8
- package/dist/server/modules/profiles/controllers/profiles.controller.js +88 -14
- package/dist/server/modules/profiles/controllers/profiles.controller.js.map +1 -1
- package/dist/server/modules/profiles/controllers/provider-configs.controller.d.ts +9 -0
- package/dist/server/modules/profiles/controllers/provider-configs.controller.js +94 -0
- package/dist/server/modules/profiles/controllers/provider-configs.controller.js.map +1 -0
- package/dist/server/modules/profiles/dto.d.ts +81 -6
- package/dist/server/modules/profiles/dto.js +45 -3
- package/dist/server/modules/profiles/dto.js.map +1 -1
- package/dist/server/modules/profiles/profiles.module.js +2 -1
- package/dist/server/modules/profiles/profiles.module.js.map +1 -1
- package/dist/server/modules/projects/controllers/projects.controller.d.ts +78 -19
- package/dist/server/modules/projects/controllers/projects.controller.js +243 -17
- package/dist/server/modules/projects/controllers/projects.controller.js.map +1 -1
- package/dist/server/modules/projects/dtos/export.dto.d.ts +44 -0
- package/dist/server/modules/projects/dtos/export.dto.js +10 -0
- package/dist/server/modules/projects/dtos/export.dto.js.map +1 -1
- package/dist/server/modules/projects/services/projects.service.d.ts +48 -11
- package/dist/server/modules/projects/services/projects.service.js +359 -27
- package/dist/server/modules/projects/services/projects.service.js.map +1 -1
- package/dist/server/modules/providers/controllers/providers.controller.js +12 -7
- package/dist/server/modules/providers/controllers/providers.controller.js.map +1 -1
- package/dist/server/modules/registry/controllers/templates.controller.d.ts +2 -2
- package/dist/server/modules/registry/services/registry-orchestration.service.js +11 -0
- package/dist/server/modules/registry/services/registry-orchestration.service.js.map +1 -1
- package/dist/server/modules/registry/services/template-upgrade.service.js +6 -0
- package/dist/server/modules/registry/services/template-upgrade.service.js.map +1 -1
- package/dist/server/modules/registry/services/unified-template.service.d.ts +2 -1
- package/dist/server/modules/registry/services/unified-template.service.js +61 -0
- package/dist/server/modules/registry/services/unified-template.service.js.map +1 -1
- package/dist/server/modules/reviews/services/reviews.service.js +8 -0
- package/dist/server/modules/reviews/services/reviews.service.js.map +1 -1
- package/dist/server/modules/sessions/services/activity-tracker.service.d.ts +2 -0
- package/dist/server/modules/sessions/services/activity-tracker.service.js +20 -0
- package/dist/server/modules/sessions/services/activity-tracker.service.js.map +1 -1
- package/dist/server/modules/sessions/services/sessions-message-pool.service.js +2 -2
- package/dist/server/modules/sessions/services/sessions-message-pool.service.js.map +1 -1
- package/dist/server/modules/sessions/services/sessions.service.d.ts +3 -1
- package/dist/server/modules/sessions/services/sessions.service.js +275 -144
- package/dist/server/modules/sessions/services/sessions.service.js.map +1 -1
- package/dist/server/modules/sessions/utils/env-builder.d.ts +8 -0
- package/dist/server/modules/sessions/utils/env-builder.js +62 -0
- package/dist/server/modules/sessions/utils/env-builder.js.map +1 -0
- package/dist/server/modules/settings/dtos/settings.dto.d.ts +84 -8
- package/dist/server/modules/settings/dtos/settings.dto.js +15 -2
- package/dist/server/modules/settings/dtos/settings.dto.js.map +1 -1
- package/dist/server/modules/settings/services/settings.service.d.ts +10 -1
- package/dist/server/modules/settings/services/settings.service.js +275 -0
- package/dist/server/modules/settings/services/settings.service.js.map +1 -1
- package/dist/server/modules/storage/db/db.provider.js +2 -0
- package/dist/server/modules/storage/db/db.provider.js.map +1 -1
- package/dist/server/modules/storage/db/schema.d.ts +185 -28
- package/dist/server/modules/storage/db/schema.js +32 -6
- package/dist/server/modules/storage/db/schema.js.map +1 -1
- package/dist/server/modules/storage/interfaces/storage.interface.d.ts +17 -1
- package/dist/server/modules/storage/interfaces/storage.interface.js.map +1 -1
- package/dist/server/modules/storage/local/local-storage.service.d.ts +15 -1
- package/dist/server/modules/storage/local/local-storage.service.js +352 -21
- package/dist/server/modules/storage/local/local-storage.service.js.map +1 -1
- package/dist/server/modules/storage/models/domain.models.d.ts +26 -7
- package/dist/server/modules/subscribers/actions/restart-agent.action.js +17 -19
- package/dist/server/modules/subscribers/actions/restart-agent.action.js.map +1 -1
- package/dist/server/modules/subscribers/events/event-fields-catalog.js +4 -0
- package/dist/server/modules/subscribers/events/event-fields-catalog.js.map +1 -1
- package/dist/server/modules/terminal/services/pty.service.js +6 -1
- package/dist/server/modules/terminal/services/pty.service.js.map +1 -1
- package/dist/server/modules/watchers/services/watcher-runner.service.js +27 -8
- package/dist/server/modules/watchers/services/watcher-runner.service.js.map +1 -1
- package/dist/{templates/claude-opus.json → server/templates/dev-loop.json} +365 -209
- package/dist/server/tsconfig.tsbuildinfo +1 -1
- package/dist/server/ui/assets/{ReviewDetailPage-I54h-2L-.js → ReviewDetailPage-YlFGGJv7.js} +2 -2
- package/dist/server/ui/assets/ReviewsPage-Diegg4jt.js +19 -0
- package/dist/server/ui/assets/index-DuMIsIyY.css +32 -0
- package/dist/server/ui/assets/index-sEtQpiB4.js +868 -0
- package/dist/server/ui/assets/{useReviewSubscription-C0GEsiRw.js → useReviewSubscription-CMhQ2m0h.js} +22 -22
- package/dist/server/ui/index.html +2 -2
- package/dist/{server/templates/claude-opus.json → templates/dev-loop.json} +365 -209
- package/package.json +9 -4
- package/dist/node_modules/@devchain/shared/schemas/export-schema.spec.d.ts +0 -2
- package/dist/node_modules/@devchain/shared/schemas/export-schema.spec.d.ts.map +0 -1
- package/dist/node_modules/@devchain/shared/schemas/export-schema.spec.js +0 -88
- package/dist/node_modules/@devchain/shared/schemas/export-schema.spec.js.map +0 -1
- package/dist/server/templates/claude-codex-advanced.json +0 -470
- package/dist/server/templates/simple-codex.json +0 -469
- package/dist/server/ui/assets/ReviewsPage-B4ua5hiX.js +0 -19
- package/dist/server/ui/assets/index-CqcmnFBh.css +0 -32
- package/dist/server/ui/assets/index-JbUMpbg7.js +0 -858
- package/dist/templates/claude-codex-advanced.json +0 -470
- package/dist/templates/simple-codex.json +0 -469
|
@@ -23,7 +23,6 @@ const logger = (0, logger_1.createLogger)('ProfilesController');
|
|
|
23
23
|
const CreateProfileSchema = zod_1.z.object({
|
|
24
24
|
projectId: zod_1.z.string().min(1),
|
|
25
25
|
name: zod_1.z.string().min(1),
|
|
26
|
-
providerId: zod_1.z.string().min(1),
|
|
27
26
|
familySlug: zod_1.z
|
|
28
27
|
.union([zod_1.z.string(), zod_1.z.null()])
|
|
29
28
|
.optional()
|
|
@@ -37,19 +36,6 @@ const CreateProfileSchema = zod_1.z.object({
|
|
|
37
36
|
const trimmed = value.trim().toLowerCase();
|
|
38
37
|
return trimmed.length > 0 ? trimmed : null;
|
|
39
38
|
}),
|
|
40
|
-
options: zod_1.z
|
|
41
|
-
.union([zod_1.z.string(), zod_1.z.null()])
|
|
42
|
-
.optional()
|
|
43
|
-
.transform((value) => {
|
|
44
|
-
if (value === undefined) {
|
|
45
|
-
return undefined;
|
|
46
|
-
}
|
|
47
|
-
if (value === null) {
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
const trimmed = value.trim();
|
|
51
|
-
return trimmed.length > 0 ? trimmed : null;
|
|
52
|
-
}),
|
|
53
39
|
systemPrompt: zod_1.z.string().nullable().optional(),
|
|
54
40
|
instructions: zod_1.z.string().nullable().optional(),
|
|
55
41
|
temperature: zod_1.z.number().min(0).max(2).nullable().optional(),
|
|
@@ -145,8 +131,73 @@ let ProfilesController = class ProfilesController {
|
|
|
145
131
|
}
|
|
146
132
|
async deleteProfile(id) {
|
|
147
133
|
logger.info({ id }, 'DELETE /api/profiles/:id');
|
|
134
|
+
const profile = await this.storage.getAgentProfile(id);
|
|
135
|
+
if (profile.projectId) {
|
|
136
|
+
const agents = await this.storage.listAgents(profile.projectId, {
|
|
137
|
+
limit: 10000,
|
|
138
|
+
offset: 0,
|
|
139
|
+
});
|
|
140
|
+
const agentsUsingProfile = agents.items.filter((a) => a.profileId === id);
|
|
141
|
+
if (agentsUsingProfile.length > 0) {
|
|
142
|
+
const agentNames = agentsUsingProfile.map((a) => a.name).join(', ');
|
|
143
|
+
throw new common_1.ConflictException({
|
|
144
|
+
message: `Cannot delete profile: ${agentsUsingProfile.length} agent(s) are still using it`,
|
|
145
|
+
details: `The following agents use this profile: ${agentNames}`,
|
|
146
|
+
agentCount: agentsUsingProfile.length,
|
|
147
|
+
agents: agentNames,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
}
|
|
148
151
|
await this.storage.deleteAgentProfile(id);
|
|
149
152
|
}
|
|
153
|
+
async listProviderConfigs(profileId) {
|
|
154
|
+
logger.info({ profileId }, 'GET /api/profiles/:id/provider-configs');
|
|
155
|
+
await this.storage.getAgentProfile(profileId);
|
|
156
|
+
const configs = await this.storage.listProfileProviderConfigsByProfile(profileId);
|
|
157
|
+
return configs.map((c) => dto_1.ProfileProviderConfigSchema.parse(c));
|
|
158
|
+
}
|
|
159
|
+
async createProviderConfig(profileId, body) {
|
|
160
|
+
logger.info({ profileId }, 'POST /api/profiles/:id/provider-configs');
|
|
161
|
+
await this.storage.getAgentProfile(profileId);
|
|
162
|
+
const data = dto_1.CreateProviderConfigSchema.parse(body);
|
|
163
|
+
const config = await this.storage.createProfileProviderConfig({
|
|
164
|
+
profileId,
|
|
165
|
+
providerId: data.providerId,
|
|
166
|
+
name: data.name,
|
|
167
|
+
options: data.options ?? null,
|
|
168
|
+
env: data.env ?? null,
|
|
169
|
+
});
|
|
170
|
+
return dto_1.ProfileProviderConfigSchema.parse(config);
|
|
171
|
+
}
|
|
172
|
+
async reorderProviderConfigs(profileId, body) {
|
|
173
|
+
logger.info({ profileId }, 'PUT /api/profiles/:id/provider-configs/order');
|
|
174
|
+
await this.storage.getAgentProfile(profileId);
|
|
175
|
+
const data = dto_1.ReorderProviderConfigsSchema.parse(body);
|
|
176
|
+
const { configIds } = data;
|
|
177
|
+
const configs = await this.storage.listProfileProviderConfigsByProfile(profileId);
|
|
178
|
+
const configMap = new Map(configs.map((c) => [c.id, c]));
|
|
179
|
+
for (const configId of configIds) {
|
|
180
|
+
const config = configMap.get(configId);
|
|
181
|
+
if (!config) {
|
|
182
|
+
throw new common_1.BadRequestException(`Config ${configId} not found or does not belong to profile ${profileId}`);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
if (new Set(configIds).size !== configIds.length) {
|
|
186
|
+
throw new common_1.BadRequestException('Duplicate configIds provided');
|
|
187
|
+
}
|
|
188
|
+
if (configIds.length !== configs.length) {
|
|
189
|
+
throw new common_1.BadRequestException(`All configs must be included in reorder. Expected ${configs.length} configs, got ${configIds.length}.`);
|
|
190
|
+
}
|
|
191
|
+
const allConfigIds = new Set(configs.map((c) => c.id));
|
|
192
|
+
const requestConfigIds = new Set(configIds);
|
|
193
|
+
for (const configId of allConfigIds) {
|
|
194
|
+
if (!requestConfigIds.has(configId)) {
|
|
195
|
+
throw new common_1.BadRequestException(`All configs must be included in reorder. Missing config: ${configId}`);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
await this.storage.reorderProfileProviderConfigs(profileId, configIds);
|
|
199
|
+
return { success: true };
|
|
200
|
+
}
|
|
150
201
|
};
|
|
151
202
|
exports.ProfilesController = ProfilesController;
|
|
152
203
|
__decorate([
|
|
@@ -193,6 +244,29 @@ __decorate([
|
|
|
193
244
|
__metadata("design:paramtypes", [String]),
|
|
194
245
|
__metadata("design:returntype", Promise)
|
|
195
246
|
], ProfilesController.prototype, "deleteProfile", null);
|
|
247
|
+
__decorate([
|
|
248
|
+
(0, common_1.Get)(':id/provider-configs'),
|
|
249
|
+
__param(0, (0, common_1.Param)('id')),
|
|
250
|
+
__metadata("design:type", Function),
|
|
251
|
+
__metadata("design:paramtypes", [String]),
|
|
252
|
+
__metadata("design:returntype", Promise)
|
|
253
|
+
], ProfilesController.prototype, "listProviderConfigs", null);
|
|
254
|
+
__decorate([
|
|
255
|
+
(0, common_1.Post)(':id/provider-configs'),
|
|
256
|
+
__param(0, (0, common_1.Param)('id')),
|
|
257
|
+
__param(1, (0, common_1.Body)()),
|
|
258
|
+
__metadata("design:type", Function),
|
|
259
|
+
__metadata("design:paramtypes", [String, Object]),
|
|
260
|
+
__metadata("design:returntype", Promise)
|
|
261
|
+
], ProfilesController.prototype, "createProviderConfig", null);
|
|
262
|
+
__decorate([
|
|
263
|
+
(0, common_1.Put)(':id/provider-configs/order'),
|
|
264
|
+
__param(0, (0, common_1.Param)('id')),
|
|
265
|
+
__param(1, (0, common_1.Body)()),
|
|
266
|
+
__metadata("design:type", Function),
|
|
267
|
+
__metadata("design:paramtypes", [String, Object]),
|
|
268
|
+
__metadata("design:returntype", Promise)
|
|
269
|
+
], ProfilesController.prototype, "reorderProviderConfigs", null);
|
|
196
270
|
exports.ProfilesController = ProfilesController = __decorate([
|
|
197
271
|
(0, common_1.Controller)('api/profiles'),
|
|
198
272
|
__param(0, (0, common_1.Inject)(storage_interface_1.STORAGE_SERVICE)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profiles.controller.js","sourceRoot":"","sources":["../../../../src/modules/profiles/controllers/profiles.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"profiles.controller.js","sour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AAA,cAAK,EAAC,IAAI,CAAC,CAAA;IACX,WAAA,IAAA,aAAI,GAAE,CAAA;;;;+DAmCR;AAGK;IADL,IAAA,eAAM,EAAC,KAAK,CAAC;IACO,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;uDAwB/B;AAOK;IADL,IAAA,YAAG,EAAC,sBAAsB,CAAC;IACD,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;6DAMrC;AAGK;IADL,IAAA,aAAI,EAAC,sBAAsB,CAAC;IAE1B,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;IACX,WAAA,IAAA,aAAI,GAAE,CAAA;;;;8DAkBR;AAGK;IADL,IAAA,YAAG,EAAC,4BAA4B,CAAC;IAE/B,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;IACX,WAAA,IAAA,aAAI,GAAE,CAAA;;;;gEAkDR;6BApOU,kBAAkB;IAD9B,IAAA,mBAAU,EAAC,cAAc,CAAC;IAEZ,WAAA,IAAA,eAAM,EAAC,mCAAe,CAAC,CAAA;;GADzB,kBAAkB,CAqO9B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { StorageService } from '../../storage/interfaces/storage.interface';
|
|
2
|
+
import { ProfileProviderConfig } from '../../storage/models/domain.models';
|
|
3
|
+
export declare class ProviderConfigsController {
|
|
4
|
+
private readonly storage;
|
|
5
|
+
constructor(storage: StorageService);
|
|
6
|
+
getProviderConfig(id: string): Promise<ProfileProviderConfig>;
|
|
7
|
+
updateProviderConfig(id: string, body: unknown): Promise<ProfileProviderConfig>;
|
|
8
|
+
deleteProviderConfig(id: string): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
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.ProviderConfigsController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const storage_interface_1 = require("../../storage/interfaces/storage.interface");
|
|
18
|
+
const logger_1 = require("../../../common/logging/logger");
|
|
19
|
+
const dto_1 = require("../dto");
|
|
20
|
+
const error_types_1 = require("../../../common/errors/error-types");
|
|
21
|
+
const logger = (0, logger_1.createLogger)('ProviderConfigsController');
|
|
22
|
+
let ProviderConfigsController = class ProviderConfigsController {
|
|
23
|
+
constructor(storage) {
|
|
24
|
+
this.storage = storage;
|
|
25
|
+
}
|
|
26
|
+
async getProviderConfig(id) {
|
|
27
|
+
logger.info({ id }, 'GET /api/provider-configs/:id');
|
|
28
|
+
const config = await this.storage.getProfileProviderConfig(id);
|
|
29
|
+
return dto_1.ProfileProviderConfigSchema.parse(config);
|
|
30
|
+
}
|
|
31
|
+
async updateProviderConfig(id, body) {
|
|
32
|
+
logger.info({ id }, 'PUT /api/provider-configs/:id');
|
|
33
|
+
const data = dto_1.UpdateProviderConfigSchema.parse(body);
|
|
34
|
+
const updateData = {};
|
|
35
|
+
if (data.providerId !== undefined) {
|
|
36
|
+
updateData.providerId = data.providerId;
|
|
37
|
+
}
|
|
38
|
+
if (data.name !== undefined) {
|
|
39
|
+
updateData.name = data.name;
|
|
40
|
+
}
|
|
41
|
+
if (data.options !== undefined) {
|
|
42
|
+
updateData.options = data.options;
|
|
43
|
+
}
|
|
44
|
+
if (data.env !== undefined) {
|
|
45
|
+
updateData.env = data.env;
|
|
46
|
+
}
|
|
47
|
+
const config = await this.storage.updateProfileProviderConfig(id, updateData);
|
|
48
|
+
return dto_1.ProfileProviderConfigSchema.parse(config);
|
|
49
|
+
}
|
|
50
|
+
async deleteProviderConfig(id) {
|
|
51
|
+
logger.info({ id }, 'DELETE /api/provider-configs/:id');
|
|
52
|
+
try {
|
|
53
|
+
await this.storage.deleteProfileProviderConfig(id);
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
if (error instanceof error_types_1.ValidationError) {
|
|
57
|
+
throw new common_1.BadRequestException({
|
|
58
|
+
message: error.message,
|
|
59
|
+
code: 'CONFIG_IN_USE',
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
throw error;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
exports.ProviderConfigsController = ProviderConfigsController;
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, common_1.Get)(':id'),
|
|
69
|
+
__param(0, (0, common_1.Param)('id')),
|
|
70
|
+
__metadata("design:type", Function),
|
|
71
|
+
__metadata("design:paramtypes", [String]),
|
|
72
|
+
__metadata("design:returntype", Promise)
|
|
73
|
+
], ProviderConfigsController.prototype, "getProviderConfig", null);
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, common_1.Put)(':id'),
|
|
76
|
+
__param(0, (0, common_1.Param)('id')),
|
|
77
|
+
__param(1, (0, common_1.Body)()),
|
|
78
|
+
__metadata("design:type", Function),
|
|
79
|
+
__metadata("design:paramtypes", [String, Object]),
|
|
80
|
+
__metadata("design:returntype", Promise)
|
|
81
|
+
], ProviderConfigsController.prototype, "updateProviderConfig", null);
|
|
82
|
+
__decorate([
|
|
83
|
+
(0, common_1.Delete)(':id'),
|
|
84
|
+
__param(0, (0, common_1.Param)('id')),
|
|
85
|
+
__metadata("design:type", Function),
|
|
86
|
+
__metadata("design:paramtypes", [String]),
|
|
87
|
+
__metadata("design:returntype", Promise)
|
|
88
|
+
], ProviderConfigsController.prototype, "deleteProviderConfig", null);
|
|
89
|
+
exports.ProviderConfigsController = ProviderConfigsController = __decorate([
|
|
90
|
+
(0, common_1.Controller)('api/provider-configs'),
|
|
91
|
+
__param(0, (0, common_1.Inject)(storage_interface_1.STORAGE_SERVICE)),
|
|
92
|
+
__metadata("design:paramtypes", [Object])
|
|
93
|
+
], ProviderConfigsController);
|
|
94
|
+
//# sourceMappingURL=provider-configs.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider-configs.controller.js","sourceRoot":"","sources":["../../../../src/modules/profiles/controllers/provider-configs.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CASwB;AACxB,kFAA6F;AAE7F,2DAA8D;AAC9D,gCAAiF;AACjF,oEAAqE;AAErE,MAAM,MAAM,GAAG,IAAA,qBAAY,EAAC,2BAA2B,CAAC,CAAC;AAGlD,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;IACpC,YAAsD,OAAuB;QAAvB,YAAO,GAAP,OAAO,CAAgB;IAAG,CAAC;IAG3E,AAAN,KAAK,CAAC,iBAAiB,CAAc,EAAU;QAC7C,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,EAAE,+BAA+B,CAAC,CAAC;QACrD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC;QAC/D,OAAO,iCAA2B,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACnD,CAAC;IAGK,AAAN,KAAK,CAAC,oBAAoB,CACX,EAAU,EACf,IAAa;QAErB,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,EAA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IACH,CAAC;CACF,CAAA;AA3DY,8DAAyB;AAI9B;IADL,IAAA,YAAG,EAAC,KAAK,CAAC;IACc,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;kEAInC;AAGK;IADL,IAAA,YAAG,EAAC,KAAK,CAAC;IAER,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;IACX,WAAA,IAAA,aAAI,GAAE,CAAA;;;;qEA6BR;AAGK;IADL,IAAA,eAAM,EAAC,KAAK,CAAC;IACc,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;qEAatC;oCA1DU,yBAAyB;IADrC,IAAA,mBAAU,EAAC,sBAAsB,CAAC;IAEpB,WAAA,IAAA,eAAM,EAAC,mCAAe,CAAC,CAAA;;GADzB,yBAAyB,CA2DrC"}
|
|
@@ -16,9 +16,7 @@ export declare const AgentProfileWithPromptsSchema: z.ZodObject<{
|
|
|
16
16
|
id: z.ZodString;
|
|
17
17
|
projectId: z.ZodNullable<z.ZodString>;
|
|
18
18
|
name: z.ZodString;
|
|
19
|
-
providerId: z.ZodString;
|
|
20
19
|
familySlug: z.ZodNullable<z.ZodString>;
|
|
21
|
-
options: z.ZodNullable<z.ZodString>;
|
|
22
20
|
systemPrompt: z.ZodNullable<z.ZodString>;
|
|
23
21
|
instructions: z.ZodNullable<z.ZodString>;
|
|
24
22
|
temperature: z.ZodNullable<z.ZodNumber>;
|
|
@@ -39,7 +37,6 @@ export declare const AgentProfileWithPromptsSchema: z.ZodObject<{
|
|
|
39
37
|
order: number;
|
|
40
38
|
}>, "many">;
|
|
41
39
|
}, "strip", z.ZodTypeAny, {
|
|
42
|
-
options: string | null;
|
|
43
40
|
id: string;
|
|
44
41
|
createdAt: string;
|
|
45
42
|
updatedAt: string;
|
|
@@ -47,7 +44,6 @@ export declare const AgentProfileWithPromptsSchema: z.ZodObject<{
|
|
|
47
44
|
projectId: string | null;
|
|
48
45
|
instructions: string | null;
|
|
49
46
|
familySlug: string | null;
|
|
50
|
-
providerId: string;
|
|
51
47
|
systemPrompt: string | null;
|
|
52
48
|
temperature: number | null;
|
|
53
49
|
maxTokens: number | null;
|
|
@@ -57,7 +53,6 @@ export declare const AgentProfileWithPromptsSchema: z.ZodObject<{
|
|
|
57
53
|
order: number;
|
|
58
54
|
}[];
|
|
59
55
|
}, {
|
|
60
|
-
options: string | null;
|
|
61
56
|
id: string;
|
|
62
57
|
createdAt: string;
|
|
63
58
|
updatedAt: string;
|
|
@@ -65,7 +60,6 @@ export declare const AgentProfileWithPromptsSchema: z.ZodObject<{
|
|
|
65
60
|
projectId: string | null;
|
|
66
61
|
instructions: string | null;
|
|
67
62
|
familySlug: string | null;
|
|
68
|
-
providerId: string;
|
|
69
63
|
systemPrompt: string | null;
|
|
70
64
|
temperature: number | null;
|
|
71
65
|
maxTokens: number | null;
|
|
@@ -76,3 +70,84 @@ export declare const AgentProfileWithPromptsSchema: z.ZodObject<{
|
|
|
76
70
|
}[];
|
|
77
71
|
}>;
|
|
78
72
|
export type AgentProfileWithPrompts = z.infer<typeof AgentProfileWithPromptsSchema>;
|
|
73
|
+
export declare const EnvVarsSchema: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodString>, Record<string, string>, Record<string, string>>, Record<string, string>, Record<string, string>>>>;
|
|
74
|
+
export declare const ProfileProviderConfigSchema: z.ZodObject<{
|
|
75
|
+
id: z.ZodString;
|
|
76
|
+
profileId: z.ZodString;
|
|
77
|
+
providerId: z.ZodString;
|
|
78
|
+
name: z.ZodString;
|
|
79
|
+
options: z.ZodNullable<z.ZodString>;
|
|
80
|
+
env: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
81
|
+
position: z.ZodNumber;
|
|
82
|
+
createdAt: z.ZodString;
|
|
83
|
+
updatedAt: z.ZodString;
|
|
84
|
+
}, "strip", z.ZodTypeAny, {
|
|
85
|
+
options: string | null;
|
|
86
|
+
id: string;
|
|
87
|
+
createdAt: string;
|
|
88
|
+
updatedAt: string;
|
|
89
|
+
name: string;
|
|
90
|
+
position: number;
|
|
91
|
+
profileId: string;
|
|
92
|
+
providerId: string;
|
|
93
|
+
env: Record<string, string> | null;
|
|
94
|
+
}, {
|
|
95
|
+
options: string | null;
|
|
96
|
+
id: string;
|
|
97
|
+
createdAt: string;
|
|
98
|
+
updatedAt: string;
|
|
99
|
+
name: string;
|
|
100
|
+
position: number;
|
|
101
|
+
profileId: string;
|
|
102
|
+
providerId: string;
|
|
103
|
+
env: Record<string, string> | null;
|
|
104
|
+
}>;
|
|
105
|
+
export type ProfileProviderConfigDto = z.infer<typeof ProfileProviderConfigSchema>;
|
|
106
|
+
export declare const CreateProviderConfigSchema: z.ZodObject<{
|
|
107
|
+
providerId: z.ZodString;
|
|
108
|
+
name: z.ZodString;
|
|
109
|
+
options: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodString>>, string | null, string | null | undefined>;
|
|
110
|
+
env: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodString>, Record<string, string>, Record<string, string>>, Record<string, string>, Record<string, string>>>>, Record<string, string> | null, Record<string, string> | null | undefined>;
|
|
111
|
+
position: z.ZodOptional<z.ZodNumber>;
|
|
112
|
+
}, "strip", z.ZodTypeAny, {
|
|
113
|
+
options: string | null;
|
|
114
|
+
name: string;
|
|
115
|
+
providerId: string;
|
|
116
|
+
env: Record<string, string> | null;
|
|
117
|
+
position?: number | undefined;
|
|
118
|
+
}, {
|
|
119
|
+
name: string;
|
|
120
|
+
providerId: string;
|
|
121
|
+
options?: string | null | undefined;
|
|
122
|
+
position?: number | undefined;
|
|
123
|
+
env?: Record<string, string> | null | undefined;
|
|
124
|
+
}>;
|
|
125
|
+
export type CreateProviderConfigDto = z.infer<typeof CreateProviderConfigSchema>;
|
|
126
|
+
export declare const UpdateProviderConfigSchema: z.ZodObject<{
|
|
127
|
+
providerId: z.ZodOptional<z.ZodString>;
|
|
128
|
+
name: z.ZodOptional<z.ZodString>;
|
|
129
|
+
options: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
130
|
+
env: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodString>, Record<string, string>, Record<string, string>>, Record<string, string>, Record<string, string>>>>;
|
|
131
|
+
position: z.ZodOptional<z.ZodNumber>;
|
|
132
|
+
}, "strip", z.ZodTypeAny, {
|
|
133
|
+
options?: string | null | undefined;
|
|
134
|
+
name?: string | undefined;
|
|
135
|
+
position?: number | undefined;
|
|
136
|
+
providerId?: string | undefined;
|
|
137
|
+
env?: Record<string, string> | null | undefined;
|
|
138
|
+
}, {
|
|
139
|
+
options?: string | null | undefined;
|
|
140
|
+
name?: string | undefined;
|
|
141
|
+
position?: number | undefined;
|
|
142
|
+
providerId?: string | undefined;
|
|
143
|
+
env?: Record<string, string> | null | undefined;
|
|
144
|
+
}>;
|
|
145
|
+
export type UpdateProviderConfigDto = z.infer<typeof UpdateProviderConfigSchema>;
|
|
146
|
+
export declare const ReorderProviderConfigsSchema: z.ZodObject<{
|
|
147
|
+
configIds: z.ZodArray<z.ZodString, "many">;
|
|
148
|
+
}, "strip", z.ZodTypeAny, {
|
|
149
|
+
configIds: string[];
|
|
150
|
+
}, {
|
|
151
|
+
configIds: string[];
|
|
152
|
+
}>;
|
|
153
|
+
export type ReorderProviderConfigsDto = z.infer<typeof ReorderProviderConfigsSchema>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AgentProfileWithPromptsSchema = exports.PromptSummarySchema = void 0;
|
|
3
|
+
exports.ReorderProviderConfigsSchema = exports.UpdateProviderConfigSchema = exports.CreateProviderConfigSchema = exports.ProfileProviderConfigSchema = exports.EnvVarsSchema = exports.AgentProfileWithPromptsSchema = exports.PromptSummarySchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
exports.PromptSummarySchema = zod_1.z.object({
|
|
6
6
|
promptId: zod_1.z.string(),
|
|
@@ -11,9 +11,7 @@ exports.AgentProfileWithPromptsSchema = zod_1.z.object({
|
|
|
11
11
|
id: zod_1.z.string(),
|
|
12
12
|
projectId: zod_1.z.string().nullable(),
|
|
13
13
|
name: zod_1.z.string(),
|
|
14
|
-
providerId: zod_1.z.string(),
|
|
15
14
|
familySlug: zod_1.z.string().nullable(),
|
|
16
|
-
options: zod_1.z.string().nullable(),
|
|
17
15
|
systemPrompt: zod_1.z.string().nullable(),
|
|
18
16
|
instructions: zod_1.z.string().nullable(),
|
|
19
17
|
temperature: zod_1.z.number().nullable(),
|
|
@@ -22,4 +20,48 @@ exports.AgentProfileWithPromptsSchema = zod_1.z.object({
|
|
|
22
20
|
updatedAt: zod_1.z.string(),
|
|
23
21
|
prompts: zod_1.z.array(exports.PromptSummarySchema),
|
|
24
22
|
});
|
|
23
|
+
const EnvKeyRegex = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
24
|
+
const ControlCharRegex = /[\x00-\x1f]/;
|
|
25
|
+
exports.EnvVarsSchema = zod_1.z
|
|
26
|
+
.record(zod_1.z.string())
|
|
27
|
+
.refine((env) => Object.keys(env).every((key) => EnvKeyRegex.test(key)), {
|
|
28
|
+
message: 'Environment variable keys must contain only alphanumeric characters and underscores, starting with a letter or underscore',
|
|
29
|
+
})
|
|
30
|
+
.refine((env) => Object.values(env).every((value) => !ControlCharRegex.test(value)), {
|
|
31
|
+
message: 'Environment variable values must not contain control characters or newlines',
|
|
32
|
+
})
|
|
33
|
+
.nullable()
|
|
34
|
+
.optional();
|
|
35
|
+
exports.ProfileProviderConfigSchema = zod_1.z.object({
|
|
36
|
+
id: zod_1.z.string(),
|
|
37
|
+
profileId: zod_1.z.string(),
|
|
38
|
+
providerId: zod_1.z.string(),
|
|
39
|
+
name: zod_1.z.string(),
|
|
40
|
+
options: zod_1.z.string().nullable(),
|
|
41
|
+
env: zod_1.z.record(zod_1.z.string()).nullable(),
|
|
42
|
+
position: zod_1.z.number().int().nonnegative(),
|
|
43
|
+
createdAt: zod_1.z.string(),
|
|
44
|
+
updatedAt: zod_1.z.string(),
|
|
45
|
+
});
|
|
46
|
+
exports.CreateProviderConfigSchema = zod_1.z.object({
|
|
47
|
+
providerId: zod_1.z.string().min(1, 'providerId is required'),
|
|
48
|
+
name: zod_1.z.string().min(1, 'name is required'),
|
|
49
|
+
options: zod_1.z
|
|
50
|
+
.string()
|
|
51
|
+
.nullable()
|
|
52
|
+
.optional()
|
|
53
|
+
.transform((v) => (v === undefined ? null : v)),
|
|
54
|
+
env: exports.EnvVarsSchema.transform((v) => (v === undefined ? null : v)),
|
|
55
|
+
position: zod_1.z.number().int().nonnegative().optional(),
|
|
56
|
+
});
|
|
57
|
+
exports.UpdateProviderConfigSchema = zod_1.z.object({
|
|
58
|
+
providerId: zod_1.z.string().min(1).optional(),
|
|
59
|
+
name: zod_1.z.string().min(1).optional(),
|
|
60
|
+
options: zod_1.z.string().nullable().optional(),
|
|
61
|
+
env: exports.EnvVarsSchema,
|
|
62
|
+
position: zod_1.z.number().int().nonnegative().optional(),
|
|
63
|
+
});
|
|
64
|
+
exports.ReorderProviderConfigsSchema = zod_1.z.object({
|
|
65
|
+
configIds: zod_1.z.array(zod_1.z.string().uuid()).min(1, 'configIds must be a non-empty array'),
|
|
66
|
+
});
|
|
25
67
|
//# sourceMappingURL=dto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dto.js","sourceRoot":"","sources":["../../../src/modules/profiles/dto.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAEX,QAAA,mBAAmB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC1C,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;IACpB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;IACjB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,G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C;IACnD,SAAS,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,qCAAqC,CAAC;CACpF,CAAC,CAAC"}
|
|
@@ -9,6 +9,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.ProfilesModule = void 0;
|
|
10
10
|
const common_1 = require("@nestjs/common");
|
|
11
11
|
const profiles_controller_1 = require("./controllers/profiles.controller");
|
|
12
|
+
const provider_configs_controller_1 = require("./controllers/provider-configs.controller");
|
|
12
13
|
const storage_module_1 = require("../storage/storage.module");
|
|
13
14
|
let ProfilesModule = class ProfilesModule {
|
|
14
15
|
};
|
|
@@ -16,7 +17,7 @@ exports.ProfilesModule = ProfilesModule;
|
|
|
16
17
|
exports.ProfilesModule = ProfilesModule = __decorate([
|
|
17
18
|
(0, common_1.Module)({
|
|
18
19
|
imports: [storage_module_1.StorageModule],
|
|
19
|
-
controllers: [profiles_controller_1.ProfilesController],
|
|
20
|
+
controllers: [profiles_controller_1.ProfilesController, provider_configs_controller_1.ProviderConfigsController],
|
|
20
21
|
})
|
|
21
22
|
], ProfilesModule);
|
|
22
23
|
//# sourceMappingURL=profiles.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profiles.module.js","sourceRoot":"","sources":["../../../src/modules/profiles/profiles.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,2EAAuE;AACvE,8DAA0D;AAMnD,IAAM,cAAc,GAApB,MAAM,cAAc;CAAG,CAAA;AAAjB,wCAAc;yBAAd,cAAc;IAJ1B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,8BAAa,CAAC;QACxB,WAAW,EAAE,CAAC,wCAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"profiles.module.js","sourceRoot":"","sources":["../../../src/modules/profiles/profiles.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,2EAAuE;AACvE,2FAAsF;AACtF,8DAA0D;AAMnD,IAAM,cAAc,GAApB,MAAM,cAAc;CAAG,CAAA;AAAjB,wCAAc;yBAAd,cAAc;IAJ1B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,8BAAa,CAAC;QACxB,WAAW,EAAE,CAAC,wCAAkB,EAAE,uDAAyB,CAAC;KAC7D,CAAC;GACW,cAAc,CAAG"}
|
|
@@ -5,7 +5,7 @@ import { SettingsService } from '../../settings/services/settings.service';
|
|
|
5
5
|
interface ProjectTemplateMetadata {
|
|
6
6
|
slug: string;
|
|
7
7
|
version: string | null;
|
|
8
|
-
source: 'bundled' | 'registry';
|
|
8
|
+
source: 'bundled' | 'registry' | 'file';
|
|
9
9
|
}
|
|
10
10
|
interface ProjectWithMetadata extends Project {
|
|
11
11
|
templateMetadata: ProjectTemplateMetadata | null;
|
|
@@ -95,6 +95,14 @@ export declare class ProjectsController {
|
|
|
95
95
|
updateProject(id: string, body: unknown): Promise<Project>;
|
|
96
96
|
deleteProject(id: string): Promise<void>;
|
|
97
97
|
exportProject(id: string): Promise<{
|
|
98
|
+
presets?: {
|
|
99
|
+
name: string;
|
|
100
|
+
description?: string | null;
|
|
101
|
+
agentConfigs: Array<{
|
|
102
|
+
agentName: string;
|
|
103
|
+
providerConfigName: string;
|
|
104
|
+
}>;
|
|
105
|
+
}[] | undefined;
|
|
98
106
|
watchers: {
|
|
99
107
|
id: string;
|
|
100
108
|
name: string;
|
|
@@ -161,19 +169,23 @@ export declare class ProjectsController {
|
|
|
161
169
|
tags: string[];
|
|
162
170
|
}[];
|
|
163
171
|
profiles: {
|
|
172
|
+
providerConfigs?: {
|
|
173
|
+
name: string;
|
|
174
|
+
providerName: string;
|
|
175
|
+
options: string | null;
|
|
176
|
+
env: Record<string, string> | null;
|
|
177
|
+
position: number;
|
|
178
|
+
}[] | undefined;
|
|
164
179
|
id: string;
|
|
165
180
|
name: string;
|
|
166
|
-
provider:
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
options: string | null;
|
|
172
|
-
instructions: string | null;
|
|
173
|
-
temperature: number | null;
|
|
174
|
-
maxTokens: number | null;
|
|
181
|
+
provider: null;
|
|
182
|
+
familySlug: string | null | undefined;
|
|
183
|
+
instructions: string | null | undefined;
|
|
184
|
+
temperature: number | null | undefined;
|
|
185
|
+
maxTokens: number | null | undefined;
|
|
175
186
|
}[];
|
|
176
187
|
agents: {
|
|
188
|
+
providerConfigName?: string | undefined;
|
|
177
189
|
id: string;
|
|
178
190
|
name: string;
|
|
179
191
|
profileId: string;
|
|
@@ -192,6 +204,14 @@ export declare class ProjectsController {
|
|
|
192
204
|
} | null;
|
|
193
205
|
}>;
|
|
194
206
|
exportProjectWithOverrides(id: string, body?: unknown): Promise<{
|
|
207
|
+
presets?: {
|
|
208
|
+
name: string;
|
|
209
|
+
description?: string | null;
|
|
210
|
+
agentConfigs: Array<{
|
|
211
|
+
agentName: string;
|
|
212
|
+
providerConfigName: string;
|
|
213
|
+
}>;
|
|
214
|
+
}[] | undefined;
|
|
195
215
|
watchers: {
|
|
196
216
|
id: string;
|
|
197
217
|
name: string;
|
|
@@ -258,19 +278,23 @@ export declare class ProjectsController {
|
|
|
258
278
|
tags: string[];
|
|
259
279
|
}[];
|
|
260
280
|
profiles: {
|
|
281
|
+
providerConfigs?: {
|
|
282
|
+
name: string;
|
|
283
|
+
providerName: string;
|
|
284
|
+
options: string | null;
|
|
285
|
+
env: Record<string, string> | null;
|
|
286
|
+
position: number;
|
|
287
|
+
}[] | undefined;
|
|
261
288
|
id: string;
|
|
262
289
|
name: string;
|
|
263
|
-
provider:
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
options: string | null;
|
|
269
|
-
instructions: string | null;
|
|
270
|
-
temperature: number | null;
|
|
271
|
-
maxTokens: number | null;
|
|
290
|
+
provider: null;
|
|
291
|
+
familySlug: string | null | undefined;
|
|
292
|
+
instructions: string | null | undefined;
|
|
293
|
+
temperature: number | null | undefined;
|
|
294
|
+
maxTokens: number | null | undefined;
|
|
272
295
|
}[];
|
|
273
296
|
agents: {
|
|
297
|
+
providerConfigName?: string | undefined;
|
|
274
298
|
id: string;
|
|
275
299
|
name: string;
|
|
276
300
|
profileId: string;
|
|
@@ -382,5 +406,40 @@ export declare class ProjectsController {
|
|
|
382
406
|
message: string;
|
|
383
407
|
providerMappingRequired?: undefined;
|
|
384
408
|
}>;
|
|
409
|
+
getProjectPresets(id: string): Promise<{
|
|
410
|
+
presets: {
|
|
411
|
+
name: string;
|
|
412
|
+
agentConfigs: {
|
|
413
|
+
agentName: string;
|
|
414
|
+
providerConfigName: string;
|
|
415
|
+
}[];
|
|
416
|
+
description?: string | null | undefined;
|
|
417
|
+
}[];
|
|
418
|
+
activePreset: string | null;
|
|
419
|
+
}>;
|
|
420
|
+
applyPreset(id: string, body: unknown): Promise<{
|
|
421
|
+
applied: number;
|
|
422
|
+
warnings: string[];
|
|
423
|
+
agents: import("../../storage/models/domain.models").Agent[];
|
|
424
|
+
}>;
|
|
425
|
+
createPreset(id: string, body: unknown): Promise<{
|
|
426
|
+
name: string;
|
|
427
|
+
agentConfigs: {
|
|
428
|
+
agentName: string;
|
|
429
|
+
providerConfigName: string;
|
|
430
|
+
}[];
|
|
431
|
+
description?: string | null | undefined;
|
|
432
|
+
}>;
|
|
433
|
+
updatePreset(id: string, body: unknown): Promise<{
|
|
434
|
+
name: string;
|
|
435
|
+
agentConfigs: {
|
|
436
|
+
agentName: string;
|
|
437
|
+
providerConfigName: string;
|
|
438
|
+
}[];
|
|
439
|
+
description?: string | null | undefined;
|
|
440
|
+
}>;
|
|
441
|
+
deletePreset(id: string, body: unknown): Promise<{
|
|
442
|
+
deleted: boolean;
|
|
443
|
+
}>;
|
|
385
444
|
}
|
|
386
445
|
export {};
|