"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.shiftAgent = void 0;
const agent_utils_1 = require("@graphai/agent_utils");
const shiftAgent = async ({ namedInputs }) => {
    (0, agent_utils_1.arrayValidate)("shiftAgent", namedInputs);
    const array = namedInputs.array.map((item) => item); // shallow copy
    const item = array.shift();
    return { array, item };
};
exports.shiftAgent = shiftAgent;
const shiftAgentInfo = {
    name: "shiftAgent",
    agent: exports.shiftAgent,
    mock: exports.shiftAgent,
    inputs: {
        type: "object",
        properties: {
            array: {
                type: "array",
                description: "the array to shift an item from",
            },
        },
        required: ["array"],
    },
    output: {
        type: "object",
        properties: {
            item: {
                anyOf: [{ type: "string" }, { type: "integer" }, { type: "object" }, { type: "array" }],
                description: "the item shifted from the array",
            },
            array: {
                type: "array",
                description: "the remaining array",
            },
        },
    },
    samples: [
        {
            inputs: { array: [1, 2, 3] },
            params: {},
            result: {
                array: [2, 3],
                item: 1,
            },
        },
        {
            inputs: { array: ["a", "b", "c"] },
            params: {},
            result: {
                array: ["b", "c"],
                item: "a",
            },
        },
    ],
    description: "shift Agent",
    category: ["array"],
    cacheType: "pureAgent",
    author: "Receptron team",
    repository: "https://github.com/receptron/graphai",
    source: "https://github.com/receptron/graphai/blob/main/agents/vanilla_agents/src/array_agents/shift_agent.ts",
    package: "@graphai/vanilla",
    license: "MIT",
};
exports.default = shiftAgentInfo;
