"use strict";
/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.Agents = void 0;
const agentsCreate_js_1 = require("../funcs/agentsCreate.js");
const agentsDelete_js_1 = require("../funcs/agentsDelete.js");
const agentsInvoke_js_1 = require("../funcs/agentsInvoke.js");
const agentsList_js_1 = require("../funcs/agentsList.js");
const agentsPostV2AgentsA2a_js_1 = require("../funcs/agentsPostV2AgentsA2a.js");
const agentsPostV2AgentsKeyCardRefresh_js_1 = require("../funcs/agentsPostV2AgentsKeyCardRefresh.js");
const agentsRetrieve_js_1 = require("../funcs/agentsRetrieve.js");
const agentsRun_js_1 = require("../funcs/agentsRun.js");
const agentsStream_js_1 = require("../funcs/agentsStream.js");
const agentsStreamRun_js_1 = require("../funcs/agentsStreamRun.js");
const agentsUpdate_js_1 = require("../funcs/agentsUpdate.js");
const sdks_js_1 = require("../lib/sdks.js");
const fp_js_1 = require("../types/fp.js");
const orqresponses_js_1 = require("./orqresponses.js");
class Agents extends sdks_js_1.ClientSDK {
    get responses() {
        return (this._responses ?? (this._responses = new orqresponses_js_1.OrqResponses(this._options)));
    }
    /**
     * Register external A2A agent
     *
     * @remarks
     * Register an external A2A-compliant agent into Orquesta. The agent card will be fetched during registration to validate the agent and cache its capabilities.
     */
    async postV2AgentsA2a(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, agentsPostV2AgentsA2a_js_1.agentsPostV2AgentsA2a)(this, request, options));
    }
    /**
     * Refresh A2A agent card
     *
     * @remarks
     * Fetches the latest agent card from the external A2A agent and updates the cached card in the database. Similar to MCP server refresh functionality.
     */
    async postV2AgentsKeyCardRefresh(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, agentsPostV2AgentsKeyCardRefresh_js_1.agentsPostV2AgentsKeyCardRefresh)(this, request, options));
    }
    /**
     * Create agent
     *
     * @remarks
     * Creates a new agent with the specified configuration, including model selection, instructions, tools, and knowledge bases. Agents are intelligent assistants that can execute tasks, interact with tools, and maintain context through memory stores. The agent can be configured with a primary model and optional fallback models for automatic failover, custom instructions for behavior control, and various settings to control execution limits and tool usage.
     */
    async create(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, agentsCreate_js_1.agentsCreate)(this, request, options));
    }
    /**
     * List agents
     *
     * @remarks
     * Retrieves a comprehensive list of agents configured in your workspace. Supports pagination for large datasets and returns agents sorted by creation date (newest first). Each agent in the response includes its complete configuration: model settings with fallback options, instructions, tools, knowledge bases, memory stores, and execution parameters. Use pagination parameters to efficiently navigate through large collections of agents.
     */
    async list(limit, startingAfter, endingBefore, type, options) {
        return (0, fp_js_1.unwrapAsync)((0, agentsList_js_1.agentsList)(this, limit, startingAfter, endingBefore, type, options));
    }
    /**
     * Delete agent
     *
     * @remarks
     * Permanently removes an agent from the workspace. This operation is irreversible and will delete all associated configuration including model assignments, tools, knowledge bases, memory stores, and cached data. Active agent sessions will be terminated, and the agent key will become available for reuse.
     */
    async delete(agentKey, options) {
        return (0, fp_js_1.unwrapAsync)((0, agentsDelete_js_1.agentsDelete)(this, agentKey, options));
    }
    /**
     * Retrieve agent
     *
     * @remarks
     * Retrieves detailed information about a specific agent identified by its unique key or identifier. Returns the complete agent manifest including configuration settings, model assignments (primary and fallback), tools, knowledge bases, memory stores, instructions, and execution parameters. Use this endpoint to fetch the current state and configuration of an individual agent.
     */
    async retrieve(agentKey, options) {
        return (0, fp_js_1.unwrapAsync)((0, agentsRetrieve_js_1.agentsRetrieve)(this, agentKey, options));
    }
    /**
     * Update agent
     *
     * @remarks
     * Modifies an existing agent's configuration with partial updates. Supports updating any aspect of the agent including model assignments (primary and fallback), instructions, tools, knowledge bases, memory stores, and execution parameters. Only the fields provided in the request body will be updated; all other fields remain unchanged. Changes take effect immediately for new agent invocations.
     */
    async update(requestBody, agentKey, options) {
        return (0, fp_js_1.unwrapAsync)((0, agentsUpdate_js_1.agentsUpdate)(this, requestBody, agentKey, options));
    }
    /**
     * Execute an agent task
     *
     * @remarks
     * Invokes an agent to perform a task with the provided input message. The agent will process the request using its configured model and tools, maintaining context through memory stores if configured. Supports automatic model fallback on primary model failure, tool execution, knowledge base retrieval, and continuation of previous conversations. Returns a task response that can be used to track execution status and retrieve results.
     *
     * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
     */
    async invoke(key, requestBody, options) {
        return (0, fp_js_1.unwrapAsync)((0, agentsInvoke_js_1.agentsInvoke)(this, key, requestBody, options));
    }
    /**
     * Run an agent with configuration
     *
     * @remarks
     * Executes an agent using inline configuration or references an existing agent. Supports dynamic agent creation where the system automatically manages agent versioning - reusing existing agents with matching configurations or creating new versions when configurations differ. Ideal for programmatic agent execution with flexible configuration management. The agent processes messages in A2A format with support for memory context, tool execution, and automatic model fallback on failure.
     *
     * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
     */
    async run(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, agentsRun_js_1.agentsRun)(this, request, options));
    }
    /**
     * Run agent with streaming response
     *
     * @remarks
     * Dynamically configures and executes an agent while streaming the interaction in real-time via Server-Sent Events (SSE). Intelligently manages agent versioning by reusing existing agents with matching configurations or creating new versions when configurations differ. Combines the flexibility of inline configuration with real-time streaming, making it ideal for dynamic agent interactions with live feedback. The stream provides continuous updates including message chunks, tool executions, and status changes until completion or timeout.
     *
     * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
     */
    async streamRun(request, options) {
        return (0, fp_js_1.unwrapAsync)((0, agentsStreamRun_js_1.agentsStreamRun)(this, request, options));
    }
    /**
     * Stream agent execution in real-time
     *
     * @remarks
     * Executes an agent and streams the interaction in real-time using Server-Sent Events (SSE). Provides live updates as the agent processes the request, including message chunks, tool calls, and execution status. Perfect for building responsive chat interfaces and monitoring agent progress. The stream continues until the agent completes its task, encounters an error, or reaches the configured timeout (default 30 minutes, configurable 1-3600 seconds).
     *
     * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
     */
    async stream(requestBody, key, options) {
        return (0, fp_js_1.unwrapAsync)((0, agentsStream_js_1.agentsStream)(this, requestBody, key, options));
    }
}
exports.Agents = Agents;
//# sourceMappingURL=agents.js.map