"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createSumiAPIFactory = createSumiAPIFactory;
const ide_core_common_1 = require("@opensumi/ide-core-common");
const sumi_1 = require("../../common/sumi");
const main_thread_chat_agents_1 = require("./main.thread.chat-agents");
const main_thread_common_1 = require("./main.thread.common");
const main_thread_layout_1 = require("./main.thread.layout");
const main_thread_lifecycle_1 = require("./main.thread.lifecycle");
const main_thread_theme_1 = require("./main.thread.theme");
const main_thread_toolbar_1 = require("./main.thread.toolbar");
const main_thread_window_1 = require("./main.thread.window");
function createSumiAPIFactory(rpcProtocol, injector) {
    const disposer = new ide_core_common_1.Disposable();
    const lifeCycle = injector.get(main_thread_lifecycle_1.MainThreadLifeCycle, [injector]);
    const mainThreadTheme = injector.get(main_thread_theme_1.MainThreadTheme, [rpcProtocol, injector]);
    disposer.addDispose(mainThreadTheme);
    const layout = injector.get(main_thread_layout_1.MainThreadLayout, [rpcProtocol]);
    disposer.addDispose(layout);
    const common = injector.get(main_thread_common_1.MainThreadCommon, [rpcProtocol, injector]);
    disposer.addDispose(common);
    const toolbar = injector.get(main_thread_toolbar_1.MainThreadToolbar);
    disposer.addDispose(toolbar);
    const window = injector.get(main_thread_window_1.MainThreadIDEWindow, [rpcProtocol]);
    disposer.addDispose(window);
    const chatAgents = injector.get(main_thread_chat_agents_1.MainThreadChatAgents, [rpcProtocol, injector]);
    disposer.addDispose(chatAgents);
    rpcProtocol.set(sumi_1.MainThreadSumiAPIIdentifier.MainThreadLifecycle, lifeCycle);
    rpcProtocol.set(sumi_1.MainThreadSumiAPIIdentifier.MainThreadTheme, mainThreadTheme);
    rpcProtocol.set(sumi_1.MainThreadSumiAPIIdentifier.MainThreadLayout, layout);
    rpcProtocol.set(sumi_1.MainThreadSumiAPIIdentifier.MainThreadCommon, common);
    rpcProtocol.set(sumi_1.MainThreadSumiAPIIdentifier.MainThreadToolbar, toolbar);
    rpcProtocol.set(sumi_1.MainThreadSumiAPIIdentifier.MainThreadIDEWindow, window);
    rpcProtocol.set(sumi_1.MainThreadSumiAPIIdentifier.MainThreadChatAgents, chatAgents);
    return () => {
        disposer.dispose();
    };
}
//# sourceMappingURL=main.thread.api.impl.js.map