"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 describe_1 = require("../../commandUtil/describe");
const constants_1 = require("@mablhq-internal/runtime/core/constants");
exports.command = `describe <${constants_1.CommandArgId}>`;
exports.describe = 'Describe an agent instruction';
exports.builder = {
    ...(0, describe_1.getDescribeBuilderOptions)(),
};
exports.handler = (0, cliUtil_1.failWrapper)(describeInstruction);
async function describeInstruction(parsed) {
    const { id } = parsed;
    const apiClient = await mablApiClientFactory_1.MablApiClientFactory.createApiClient();
    const instruction = await apiClient.getAgentInstruction(id);
    (0, describe_1.outputEntity)(instruction, parsed.output);
    return instruction.instruction_id ?? id;
}
