"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.d = (exports1, definition)=>{
        for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
            enumerable: true,
            get: definition[key]
        });
    };
})();
(()=>{
    __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
})();
(()=>{
    __webpack_require__.r = (exports1)=>{
        if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
            value: 'Module'
        });
        Object.defineProperty(exports1, '__esModule', {
            value: true
        });
    };
})();
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
    exportSessionReport: ()=>exportSessionReport,
    createExportSessionReportTool: ()=>createExportSessionReportTool
});
const external_node_path_namespaceObject = require("node:path");
const external_zod_namespaceObject = require("zod");
const external_session_store_js_namespaceObject = require("./session-store.js");
const external_utils_js_namespaceObject = require("./utils.js");
function exportSessionReport(sessionId) {
    const dump = external_session_store_js_namespaceObject.SessionStore.buildSessionDump(sessionId);
    const reportPath = (0, external_node_path_namespaceObject.join)(external_session_store_js_namespaceObject.SessionStore.reportDir(sessionId), 'index.html');
    (0, external_utils_js_namespaceObject.reportHTMLContent)(JSON.stringify(dump), reportPath, false);
    external_session_store_js_namespaceObject.SessionStore.markReportGenerated(sessionId, reportPath);
    return reportPath;
}
function createExportSessionReportTool() {
    return {
        name: 'export_session_report',
        description: 'Generate a merged HTML report from a persisted session',
        schema: {
            sessionId: external_zod_namespaceObject.z.string().describe('Persistent session ID to export')
        },
        handler: async (args)=>{
            const { sessionId } = args;
            if ('string' != typeof sessionId || !sessionId) return {
                content: [
                    {
                        type: 'text',
                        text: 'sessionId is required to export a session report'
                    }
                ],
                isError: true
            };
            const reportPath = exportSessionReport(sessionId);
            return {
                content: [
                    {
                        type: 'text',
                        text: `Session report generated: ${reportPath}`
                    }
                ]
            };
        }
    };
}
exports.createExportSessionReportTool = __webpack_exports__.createExportSessionReportTool;
exports.exportSessionReport = __webpack_exports__.exportSessionReport;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "createExportSessionReportTool",
    "exportSessionReport"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});

//# sourceMappingURL=session-report.js.map