"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.CoreMcpChatMcpTools = void 0;
const common_1 = require("@nestjs/common");
const mcp_chat_service_1 = require("../../mcp-chat/mcp-chat.service");
const mcp_tool_decorator_1 = require("../decorators/mcp-tool.decorator");
let CoreMcpChatMcpTools = class CoreMcpChatMcpTools {
    constructor(mcpChatService) {
        this.mcpChatService = mcpChatService;
    }
    async listConversations(_args, context) {
        return this.mcpChatService.listConversations(context.userId);
    }
    async createConversation(args, context) {
        return this.mcpChatService.createConversation(context.userId, { title: args.title });
    }
    async deleteConversations(args, context) {
        return this.mcpChatService.deleteConversations(context.userId, args.ids);
    }
    async getMessages(args, context) {
        return this.mcpChatService.getMessages(args.conversationId, context.userId);
    }
    async sendMessage(args, context) {
        return this.mcpChatService.sendMessage(args.conversationId, context.userId, context.locale, args.message);
    }
};
exports.CoreMcpChatMcpTools = CoreMcpChatMcpTools;
__decorate([
    (0, mcp_tool_decorator_1.McpTool)({
        name: 'core.mcp-chat.conversations.list',
        description: 'Lists MCP chat conversations for the authenticated user.',
        inputSchema: { type: 'object', properties: {} },
        readOnly: true,
    }),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object, Object]),
    __metadata("design:returntype", Promise)
], CoreMcpChatMcpTools.prototype, "listConversations", null);
__decorate([
    (0, mcp_tool_decorator_1.McpTool)({
        name: 'core.mcp-chat.conversations.create',
        description: 'Creates a new MCP chat conversation.',
        inputSchema: {
            type: 'object',
            properties: {
                title: { type: 'string', description: 'Conversation title' },
            },
            required: ['title'],
        },
    }),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object, Object]),
    __metadata("design:returntype", Promise)
], CoreMcpChatMcpTools.prototype, "createConversation", null);
__decorate([
    (0, mcp_tool_decorator_1.McpTool)({
        name: 'core.mcp-chat.conversations.delete',
        description: 'Deletes one or more MCP chat conversations.',
        inputSchema: {
            type: 'object',
            properties: {
                ids: { type: 'array', items: { type: 'number' }, description: 'Conversation IDs to delete' },
            },
            required: ['ids'],
        },
    }),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object, Object]),
    __metadata("design:returntype", Promise)
], CoreMcpChatMcpTools.prototype, "deleteConversations", null);
__decorate([
    (0, mcp_tool_decorator_1.McpTool)({
        name: 'core.mcp-chat.messages.list',
        description: 'Returns messages in a conversation.',
        inputSchema: {
            type: 'object',
            properties: {
                conversationId: { type: 'number', description: 'Conversation ID' },
            },
            required: ['conversationId'],
        },
        readOnly: true,
    }),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object, Object]),
    __metadata("design:returntype", Promise)
], CoreMcpChatMcpTools.prototype, "getMessages", null);
__decorate([
    (0, mcp_tool_decorator_1.McpTool)({
        name: 'core.mcp-chat.messages.send',
        description: 'Sends a message in a conversation and returns the AI response.',
        inputSchema: {
            type: 'object',
            properties: {
                conversationId: { type: 'number', description: 'Conversation ID' },
                message: { type: 'string', description: 'Message to send' },
            },
            required: ['conversationId', 'message'],
        },
    }),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object, Object]),
    __metadata("design:returntype", Promise)
], CoreMcpChatMcpTools.prototype, "sendMessage", null);
exports.CoreMcpChatMcpTools = CoreMcpChatMcpTools = __decorate([
    (0, common_1.Injectable)(),
    __metadata("design:paramtypes", [mcp_chat_service_1.McpChatService])
], CoreMcpChatMcpTools);
//# sourceMappingURL=core-mcp-chat.mcp-tools.js.map