"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    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;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CoreProfileMcpTools = void 0;
const common_1 = require("@nestjs/common");
const profile_service_1 = require("../../profile/profile.service");
const mcp_tool_decorator_1 = require("../decorators/mcp-tool.decorator");
let CoreProfileMcpTools = class CoreProfileMcpTools {
    constructor(profileService) {
        this.profileService = profileService;
    }
    async getProfile(_args, context) {
        return this.profileService.getProfile(context.userId);
    }
    async updateProfile(args, context) {
        return this.profileService.update(context.userId, { name: args.name });
    }
    async updatePreferences(args, context) {
        return this.profileService.updatePreferences(context.locale, context.userId, args);
    }
    async getMfaMethods(_args, context) {
        return this.profileService.getMFAMethods(context.userId);
    }
    async changePassword(args, context) {
        return this.profileService.changePassword(context.locale, context.userId, args);
    }
};
exports.CoreProfileMcpTools = CoreProfileMcpTools;
__decorate([
    (0, mcp_tool_decorator_1.McpTool)({
        name: 'core.profile.get',
        description: 'Returns the authenticated user profile.',
        inputSchema: { type: 'object', properties: {} },
        readOnly: true,
    }),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object, Object]),
    __metadata("design:returntype", Promise)
], CoreProfileMcpTools.prototype, "getProfile", null);
__decorate([
    (0, mcp_tool_decorator_1.McpTool)({
        name: 'core.profile.update',
        description: 'Updates the authenticated user profile name.',
        inputSchema: {
            type: 'object',
            properties: {
                name: { type: 'string', description: 'New display name' },
            },
        },
    }),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object, Object]),
    __metadata("design:returntype", Promise)
], CoreProfileMcpTools.prototype, "updateProfile", null);
__decorate([
    (0, mcp_tool_decorator_1.McpTool)({
        name: 'core.profile.update-preferences',
        description: 'Updates authenticated user preferences such as theme and language.',
        inputSchema: {
            type: 'object',
            properties: {
                theme: { type: 'string', description: 'UI theme (e.g. dark, light)' },
                language: { type: 'string', description: 'Locale code (e.g. en, pt-BR)' },
            },
        },
    }),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object, Object]),
    __metadata("design:returntype", Promise)
], CoreProfileMcpTools.prototype, "updatePreferences", null);
__decorate([
    (0, mcp_tool_decorator_1.McpTool)({
        name: 'core.profile.mfa.list',
        description: 'Returns the MFA methods configured for the authenticated user.',
        inputSchema: { type: 'object', properties: {} },
        readOnly: true,
    }),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object, Object]),
    __metadata("design:returntype", Promise)
], CoreProfileMcpTools.prototype, "getMfaMethods", null);
__decorate([
    (0, mcp_tool_decorator_1.McpTool)({
        name: 'core.profile.change-password',
        description: 'Changes the password of the authenticated user.',
        inputSchema: {
            type: 'object',
            properties: {
                currentPassword: { type: 'string', description: 'Current password' },
                newPassword: { type: 'string', description: 'New password (must meet strength requirements)' },
            },
            required: ['currentPassword', 'newPassword'],
        },
    }),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object, Object]),
    __metadata("design:returntype", Promise)
], CoreProfileMcpTools.prototype, "changePassword", null);
exports.CoreProfileMcpTools = CoreProfileMcpTools = __decorate([
    (0, common_1.Injectable)(),
    __metadata("design:paramtypes", [profile_service_1.ProfileService])
], CoreProfileMcpTools);
//# sourceMappingURL=core-profile.mcp-tools.js.map