"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.ProcessHandler = void 0;
const ipc_1 = require("../ipc");
const ProcessManager_1 = require("./ProcessManager");
let ProcessHandler = class ProcessHandler {
    processManager;
    constructor(processManager) {
        this.processManager = processManager;
    }
    /**
     * Launch an application instance.
     */
    async handleLaunchApp(args) {
        const { appId, bounds } = args;
        return await this.processManager.launchApp(appId, bounds);
    }
    /**
     * Stop a running application instance.
     */
    async handleStopApp(args) {
        const { appId } = args;
        await this.processManager.stopApp(appId);
        return { success: true };
    }
    /**
     * List all running application processes.
     * @param showHidden - If true, includes overlay apps (hidden by default)
     */
    async handleListApps(args) {
        return this.processManager.getRunningApps(args.showHidden);
    }
};
exports.ProcessHandler = ProcessHandler;
__decorate([
    (0, ipc_1.EdenHandler)("launch"),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Promise)
], ProcessHandler.prototype, "handleLaunchApp", null);
__decorate([
    (0, ipc_1.EdenHandler)("stop"),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Promise)
], ProcessHandler.prototype, "handleStopApp", null);
__decorate([
    (0, ipc_1.EdenHandler)("list"),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Promise)
], ProcessHandler.prototype, "handleListApps", null);
exports.ProcessHandler = ProcessHandler = __decorate([
    (0, ipc_1.EdenNamespace)("process"),
    __metadata("design:paramtypes", [ProcessManager_1.ProcessManager])
], ProcessHandler);
//# sourceMappingURL=ProcessHandler.js.map