import { APIResource } from "../../../core/resource.js"; import * as EventsAPI from "./events.js"; import { EventRetrieveParams, EventRetrieveResponse, Events } from "./events.js"; import * as MessagesAPI from "./messages.js"; import { MessageCreateParams, MessageCreateResponse, Messages } from "./messages.js"; import * as ResumeStateAPI from "./resume-state.js"; import { ResumeState, ResumeStateCreateResponse } from "./resume-state.js"; import { APIPromise } from "../../../core/api-promise.js"; import { PageCursorURL, PagePromise } from "../../../core/pagination.js"; import { RequestOptions } from "../../../internal/request-options.js"; /** * Agents defined by the company */ export declare class Sessions extends APIResource { messages: MessagesAPI.Messages; resumeState: ResumeStateAPI.ResumeState; events: EventsAPI.Events; /** * Start an agent session with a prompt. * * @example HTTP * Representative request and response shapes. * ``` * POST /agents/sessions/ HTTP/1.1 * Host: rest.ripplingapis.com * Content-Type: application/json * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * { * "agent_id": "agent_id", * "prompt": "prompt" * } * * HTTP/1.1 200 OK * Content-Type: application/json * * { * "id": "string", * "created_at": "string", * "updated_at": "string", * "agent_id": "string", * "prompt": "string", * "status": "string", * "langsmith_thread_id": "string", * "output": {}, * "error_message": "string", * "submission_id": "string", * "session_resume_receipt": { * "status": "string" * } * } * ``` */ create(body: SessionCreateParams, options?: RequestOptions): APIPromise; /** * A list of sessions for an agent. * * @example HTTP * Representative request and response shapes. * ``` * GET /agents/{agent_id}/sessions/?limit=1&cursor=cursor HTTP/1.1 * Host: rest.ripplingapis.com * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * HTTP/1.1 200 OK * Content-Type: application/json * * { * "results": [ * { * "id": "string", * "created_at": "string", * "updated_at": "string", * "agent_id": "string", * "prompt": "string", * "status": "string", * "langsmith_thread_id": "string", * "output": {}, * "error_message": "string", * "submission_id": "string", * "session_resume_receipt": { * "status": "string" * } * } * ], * "next_link": "string" * } * ``` */ list(agentID: string, query?: SessionListParams | null | undefined, options?: RequestOptions): PagePromise; /** * Retrieve an agent session, including its terminal output or error when * available. * * @example HTTP * Representative request and response shapes. * ``` * GET /agents/sessions/{session_id}/ HTTP/1.1 * Host: rest.ripplingapis.com * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * HTTP/1.1 200 OK * Content-Type: application/json * * { * "id": "string", * "created_at": "string", * "updated_at": "string", * "agent_id": "string", * "prompt": "string", * "status": "string", * "langsmith_thread_id": "string", * "output": {}, * "error_message": "string", * "submission_id": "string", * "session_resume_receipt": { * "status": "string" * } * } * ``` */ retrieve(sessionID: string, options?: RequestOptions): APIPromise; } export type SessionListResponsesPageCursorURL = PageCursorURL; export interface SessionCreateResponse { /** * Identifier field */ id: string; /** * The ID of the agent to run */ agent_id: string; /** * Record creation date */ created_at: string; /** * The prompt to send to the agent */ prompt: string; /** * Record update date */ updated_at: string; /** * The session error message */ error_message?: string; /** * The stable LangSmith thread identifier for this session */ langsmith_thread_id?: string; /** * The output of the session */ output?: unknown; /** * Receipt that ACP restored the requested session resume state */ session_resume_receipt?: SessionCreateResponse.SessionResumeReceipt; /** * The status of the session. Possible values: `awaiting_approval`: someone else * requested this session on your behalf, and it is waiting for your approval * before it starts; `active`: the agent is running; `idle`: the session is open * and waiting for more work; `waiting_on_user`: the agent is waiting for user * input; `suspended`: the session is paused; `completed`: the session finished * successfully; `ended`: the session was explicitly ended; `failed`: execution * failed or the approval request expired or became invalid before execution; * `cancelled`: execution was cancelled or the approval request was rejected or * cancelled. The Platform API does not support requesting delegated execution or * managing approvals. */ status?: string; /** * Receipt for correlating agent.submission.settled events after create or * append-message writes */ submission_id?: string; } export declare namespace SessionCreateResponse { /** * Receipt that ACP restored the requested session resume state */ interface SessionResumeReceipt { /** * The session resume state restore status */ status?: string; } } export interface SessionListResponse { /** * Identifier field */ id: string; /** * The ID of the agent to run */ agent_id: string; /** * Record creation date */ created_at: string; /** * The prompt to send to the agent */ prompt: string; /** * Record update date */ updated_at: string; /** * The session error message */ error_message?: string; /** * The stable LangSmith thread identifier for this session */ langsmith_thread_id?: string; /** * The output of the session */ output?: unknown; /** * Receipt that ACP restored the requested session resume state */ session_resume_receipt?: SessionListResponse.SessionResumeReceipt; /** * The status of the session. Possible values: `awaiting_approval`: someone else * requested this session on your behalf, and it is waiting for your approval * before it starts; `active`: the agent is running; `idle`: the session is open * and waiting for more work; `waiting_on_user`: the agent is waiting for user * input; `suspended`: the session is paused; `completed`: the session finished * successfully; `ended`: the session was explicitly ended; `failed`: execution * failed or the approval request expired or became invalid before execution; * `cancelled`: execution was cancelled or the approval request was rejected or * cancelled. The Platform API does not support requesting delegated execution or * managing approvals. */ status?: string; /** * Receipt for correlating agent.submission.settled events after create or * append-message writes */ submission_id?: string; } export declare namespace SessionListResponse { /** * Receipt that ACP restored the requested session resume state */ interface SessionResumeReceipt { /** * The session resume state restore status */ status?: string; } } export interface SessionRetrieveResponse { /** * Identifier field */ id: string; /** * The ID of the agent to run */ agent_id: string; /** * Record creation date */ created_at: string; /** * The prompt to send to the agent */ prompt: string; /** * Record update date */ updated_at: string; /** * The session error message */ error_message?: string; /** * The stable LangSmith thread identifier for this session */ langsmith_thread_id?: string; /** * The output of the session */ output?: unknown; /** * Receipt that ACP restored the requested session resume state */ session_resume_receipt?: SessionRetrieveResponse.SessionResumeReceipt; /** * The status of the session. Possible values: `awaiting_approval`: someone else * requested this session on your behalf, and it is waiting for your approval * before it starts; `active`: the agent is running; `idle`: the session is open * and waiting for more work; `waiting_on_user`: the agent is waiting for user * input; `suspended`: the session is paused; `completed`: the session finished * successfully; `ended`: the session was explicitly ended; `failed`: execution * failed or the approval request expired or became invalid before execution; * `cancelled`: execution was cancelled or the approval request was rejected or * cancelled. The Platform API does not support requesting delegated execution or * managing approvals. */ status?: string; /** * Receipt for correlating agent.submission.settled events after create or * append-message writes */ submission_id?: string; } export declare namespace SessionRetrieveResponse { /** * Receipt that ACP restored the requested session resume state */ interface SessionResumeReceipt { /** * The session resume state restore status */ status?: string; } } export interface SessionCreateParams { /** * The ID of the agent to run */ agent_id: string; /** * The prompt to send to the agent */ prompt: string; /** * Optional opaque state used to restore the new session */ session_resume_state?: SessionCreateParams.SessionResumeState; } export declare namespace SessionCreateParams { /** * Optional opaque state used to restore the new session */ interface SessionResumeState { /** * An opaque base64-encoded agent session resume state */ artifact: string; } } export interface SessionListParams { /** * The cursor from a previous next_link. */ cursor?: string; /** * The maximum number of results to return. */ limit?: number; } export declare namespace Sessions { export { type SessionCreateResponse as SessionCreateResponse, type SessionListResponse as SessionListResponse, type SessionRetrieveResponse as SessionRetrieveResponse, type SessionListResponsesPageCursorURL as SessionListResponsesPageCursorURL, type SessionCreateParams as SessionCreateParams, type SessionListParams as SessionListParams, }; export { Messages as Messages, type MessageCreateResponse as MessageCreateResponse, type MessageCreateParams as MessageCreateParams, }; export { ResumeState as ResumeState, type ResumeStateCreateResponse as ResumeStateCreateResponse }; export { Events as Events, type EventRetrieveResponse as EventRetrieveResponse, type EventRetrieveParams as EventRetrieveParams, }; } //# sourceMappingURL=sessions.d.ts.map