mirror of
https://dev.azure.com/globalhealthx/EMR/_git/helix-engage-server
synced 2026-05-18 20:08:19 +00:00
- Team module: POST /api/team/members (in-place employee creation with temp password + Redis cache), PUT /api/team/members/:id, GET temp password endpoint. Uses signUpInWorkspace — no email invites. - Dockerfile: rewritten as multi-stage build (builder + runtime) so native modules compile for target arch. Fixes darwin→linux crash. - .dockerignore: exclude dist, node_modules, .env, .git, data/ - package-lock.json: regenerated against public npmjs.org (was pointing at localhost:4873 Verdaccio — broke docker builds) - Doctor utils: shared DOCTOR_VISIT_SLOTS_FRAGMENT + normalizeDoctors helper for visit-slot-aware queries across 6 consumers - AI config: full admin CRUD (GET/PUT/POST reset), workspace-scoped setup-state with workspace ID isolation, AI prompt defaults overhaul - Agent config: camelCase field fix for SDK-synced workspaces - Session service: workspace-scoped Redis key prefixing for setup state - Recordings/supervisor/widget services: updated to use doctor-utils shared fragments instead of inline visitingHours queries Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
50 lines
1.8 KiB
TypeScript
50 lines
1.8 KiB
TypeScript
import { Body, Controller, Get, Logger, Param, Post, Put } from '@nestjs/common';
|
|
import { AiConfigService } from './ai-config.service';
|
|
import type { AiActorKey, AiConfig } from './ai.defaults';
|
|
|
|
// Mounted under /api/config alongside theme/widget/telephony/setup-state.
|
|
//
|
|
// GET /api/config/ai — full config (no secrets here, all safe to return)
|
|
// PUT /api/config/ai — admin update (provider/model/temperature)
|
|
// POST /api/config/ai/reset — reset entire config to defaults
|
|
// PUT /api/config/ai/prompts/:actor — update one persona's system prompt template
|
|
// POST /api/config/ai/prompts/:actor/reset — restore one persona to its default
|
|
@Controller('api/config')
|
|
export class AiConfigController {
|
|
private readonly logger = new Logger(AiConfigController.name);
|
|
|
|
constructor(private readonly ai: AiConfigService) {}
|
|
|
|
@Get('ai')
|
|
getAi() {
|
|
return this.ai.getConfig();
|
|
}
|
|
|
|
@Put('ai')
|
|
updateAi(@Body() body: Partial<AiConfig>) {
|
|
this.logger.log('AI config update request');
|
|
return this.ai.updateConfig(body);
|
|
}
|
|
|
|
@Post('ai/reset')
|
|
resetAi() {
|
|
this.logger.log('AI config reset request');
|
|
return this.ai.resetConfig();
|
|
}
|
|
|
|
@Put('ai/prompts/:actor')
|
|
updatePrompt(
|
|
@Param('actor') actor: AiActorKey,
|
|
@Body() body: { template: string; editedBy?: string },
|
|
) {
|
|
this.logger.log(`AI prompt update for actor '${actor}'`);
|
|
return this.ai.updatePrompt(actor, body.template, body.editedBy ?? null);
|
|
}
|
|
|
|
@Post('ai/prompts/:actor/reset')
|
|
resetPrompt(@Param('actor') actor: AiActorKey) {
|
|
this.logger.log(`AI prompt reset for actor '${actor}'`);
|
|
return this.ai.resetPrompt(actor);
|
|
}
|
|
}
|