/**
* Copyright (c) 2025 Bytedance, Inc. and its affiliates.
* SPDX-License-Identifier: Apache-2.0
*/
"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__, {
    run: ()=>run
});
const external_commander_namespaceObject = require("commander");
const external_package_json_namespaceObject = require("../../package.json");
const external_start_js_namespaceObject = require("./start.js");
const run = ()=>{
    external_commander_namespaceObject.program.name('gui-agent').description('CLI for GUI Agent automation').usage('<command> [options]').version(`GUI Agent CLI v${external_package_json_namespaceObject.version} \u{1F680}`, '-v, --version', 'Display the version number');
    external_commander_namespaceObject.program.command('run').description('Run GUI Agent automation').option('-p, --presets <url>', 'Load model configuration from preset URL').option('-t, --target <target>', 'Target automation type (computer, browser, android)').option('-q, --query <query>', 'Instruction to execute (optional, will prompt if not provided)').option('-c, --config <path>', 'Path to configuration file').option('-o, --output <dir>', 'Directory to store execution results').option('--tasks <file>', "Path to tasks JSON file containing a list of {taskId, query}. Use 'demo' to run built-in sample tasks").action(async (options)=>{
        try {
            await (0, external_start_js_namespaceObject.start)(options);
        } catch (err) {
            console.error('Failed to run');
            console.error(err);
            process.exit(1);
        }
    });
    external_commander_namespaceObject.program.command('reset').description('Reset stored configuration (API keys, model settings, etc.)').option('-c, --config <path>', 'Reset specific configuration file (default: ~/.gui-agent-cli.json)').action(async (options)=>{
        try {
            await (0, external_start_js_namespaceObject.resetConfig)(options.config);
        } catch (err) {
            console.error('Failed to reset configuration');
            console.error(err);
            process.exit(1);
        }
    });
    if (process.argv.length <= 2) {
        external_commander_namespaceObject.program.outputHelp();
        console.log('\nExamples:');
        console.log('  gui-agent run                     # Run with interactive prompts');
        console.log('  gui-agent run -t android          # Run with Android automation');
        console.log('  gui-agent run -q "open calculator"  # Run with specific instruction');
        console.log('  gui-agent reset                    # Reset all configuration');
        console.log('  gui-agent reset -c custom.json     # Reset specific config file');
    }
    external_commander_namespaceObject.program.parse();
};
exports.run = __webpack_exports__.run;
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
    "run"
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
Object.defineProperty(exports, '__esModule', {
    value: true
});

//# sourceMappingURL=commands.js.map