/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: a6414d61dbf7 */ import { agentSessionsApprove } from "../funcs/agentSessionsApprove.js"; import { agentSessionsEvents } from "../funcs/agentSessionsEvents.js"; import { agentSessionsGet } from "../funcs/agentSessionsGet.js"; import { agentSessionsList } from "../funcs/agentSessionsList.js"; import { agentSessionsStop } from "../funcs/agentSessionsStop.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as models from "../models/index.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; export class AgentSessions extends ClientSDK { /** * List ai-agent monitor sessions for this workspace. Newest first, capped at 50. */ async list( request?: operations.ListAgentSessionsRequest | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(agentSessionsList( this, request, options, )); } /** * Retrieve one ai-agent monitor session by id. */ async get( request: operations.GetAgentSessionRequest, options?: RequestOptions, ): Promise { return unwrapAsync(agentSessionsGet( this, request, options, )); } /** * Incrementally read a session's event log (steps, tool calls, report deltas, approvals, status transitions). Pass the previous response's `latestSeq` as `after` to fetch only new events. */ async events( request: operations.ListAgentSessionEventsRequest, options?: RequestOptions, ): Promise { return unwrapAsync(agentSessionsEvents( this, request, options, )); } /** * Approve a halted ai-agent monitor session. Proxies to the ai-agent service, minting a fresh CLI session for the caller so the ai-agent's own auth applies. */ async approve( request: operations.ApproveAgentSessionRequest, options?: RequestOptions, ): Promise { return unwrapAsync(agentSessionsApprove( this, request, options, )); } /** * Stop (cancel) a running, queued, or halted ai-agent monitor session. Proxies to the ai-agent service, minting a fresh CLI session for the caller so the ai-agent's own auth applies. Idempotent — stopping an already-terminal session is a 200 no-op. */ async stop( request: operations.StopAgentSessionRequest, options?: RequestOptions, ): Promise { return unwrapAsync(agentSessionsStop( this, request, options, )); } }