"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const mablApiClientFactory_1 = require("@mablhq-internal/runtime/api/mablApiClientFactory");
const cliUtil_1 = require("@mablhq-internal/runtime/core/cliUtil");
const constants_1 = require("@mablhq-internal/runtime/core/constants");
const loggingProvider_1 = require("@mablhq-internal/runtime/providers/logging/loggingProvider");
exports.command = `delete <${constants_1.CommandArgId}>`;
exports.describe = 'Delete an agent instruction';
exports.builder = (yargs) => {
    yargs.positional(constants_1.CommandArgId, {
        describe: 'The instruction ID',
        type: 'string',
    });
};
exports.handler = (0, cliUtil_1.failWrapper)(deleteInstruction);
async function deleteInstruction(parsed) {
    const { id } = parsed;
    const apiClient = await mablApiClientFactory_1.MablApiClientFactory.createApiClient();
    await apiClient.deleteAgentInstruction(id);
    loggingProvider_1.logger.info(`Deleted agent instruction ${id}`);
    return id;
}
