"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.tdfRuntimeMiddleWareManager = void 0;
const enum_tdf_mapping_1 = require("tdf-devtools-protocol/dist/types/enum-tdf-mapping");
const log_1 = require("@/utils/log");
const debug_target_1 = require("@/utils/debug-target");
const log = new log_1.Logger('tdf-runtime-middleware');
exports.tdfRuntimeMiddleWareManager = {
    downwardMiddleWareListMap: {
        [enum_tdf_mapping_1.TdfEvent.TDFRuntimeUpdateContextInfo]: async ({ clientId, msg }) => {
            const eventRes = msg;
            const { contextName } = eventRes.params;
            try {
                await debug_target_1.updateDebugTarget(clientId, { title: contextName });
            }
            catch (e) {
                log.error('update DebugTarget contextName fail', e.stack);
            }
            return msg;
        },
    },
    upwardMiddleWareListMap: {},
};
