/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { agentRunsCreateAgentRun } from "../funcs/agentRunsCreateAgentRun.js"; import { agentRunsDecideAgentRunMcpApproval } from "../funcs/agentRunsDecideAgentRunMcpApproval.js"; import { agentRunsGetAgentRun } from "../funcs/agentRunsGetAgentRun.js"; import { agentRunsListAgentRuns } from "../funcs/agentRunsListAgentRuns.js"; import { agentRunsStreamAgentRunEvents } from "../funcs/agentRunsStreamAgentRunEvents.js"; import { agentRunsWakeAgentRun } from "../funcs/agentRunsWakeAgentRun.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; export class AgentRuns extends ClientSDK { /** * List runs for an agent */ async listAgentRuns( request: operations.ListAgentRunsRequest, options?: RequestOptions, ): Promise { return unwrapAsync(agentRunsListAgentRuns( this, request, options, )); } /** * Start a saved agent run * * @remarks * Starts an asynchronous background run for a saved agent and returns the queued run record. Use the run retrieval endpoint to poll status or the events endpoint to stream progress. */ async createAgentRun( request: operations.CreateAgentRunRequest, options?: RequestOptions, ): Promise { return unwrapAsync(agentRunsCreateAgentRun( this, request, options, )); } /** * Stream agent run events * * @remarks * Streams Server-Sent Events for the gateway response linked to this agent run. Terminal runs emit a single terminal event and close. */ async streamAgentRunEvents( request: operations.StreamAgentRunEventsRequest, options?: RequestOptions, ): Promise { return unwrapAsync(agentRunsStreamAgentRunEvents( this, request, options, )); } /** * Wake a sleeping agent run * * @remarks * Interrupts a short sleep tool call on a background run by forwarding follow-up input to the gateway response. */ async wakeAgentRun( request: operations.WakeAgentRunRequest, options?: RequestOptions, ): Promise { return unwrapAsync(agentRunsWakeAgentRun( this, request, options, )); } /** * Approve or deny a pending MCP tool call * * @remarks * Creates a continuation run for an mcp_approval_request emitted by the source run. The gateway binds the single-use decision to the original server, tool, and arguments; denying never invokes the remote MCP tool. */ async decideAgentRunMcpApproval( request: operations.DecideAgentRunMcpApprovalRequest, options?: RequestOptions, ): Promise { return unwrapAsync(agentRunsDecideAgentRunMcpApproval( this, request, options, )); } /** * Retrieve an agent run */ async getAgentRun( request: operations.GetAgentRunRequest, options?: RequestOptions, ): Promise { return unwrapAsync(agentRunsGetAgentRun( this, request, options, )); } }