@@ -21,12 +21,16 @@ import {
2121 ScheduledAgentItem ,
2222 Schedules ,
2323} from './schedules' ;
24+ import * as SessionsAPI from './sessions' ;
25+ import { SessionCheckRedirectResponse , Sessions } from './sessions' ;
2426import { APIPromise } from '../../core/api-promise' ;
2527import { RequestOptions } from '../../internal/request-options' ;
28+ import { path } from '../../internal/utils/path' ;
2629
2730export class Agent extends APIResource {
2831 runs : RunsAPI . Runs = new RunsAPI . Runs ( this . _client ) ;
2932 schedules : SchedulesAPI . Schedules = new SchedulesAPI . Schedules ( this . _client ) ;
33+ sessions : SessionsAPI . Sessions = new SessionsAPI . Sessions ( this . _client ) ;
3034
3135 /**
3236 * Retrieve a list of available agents (skills) that can be used to run tasks.
@@ -44,6 +48,21 @@ export class Agent extends APIResource {
4448 return this . _client . get ( '/agent' , { query, ...options } ) ;
4549 }
4650
51+ /**
52+ * Retrieve an artifact by its UUID. For screenshot artifacts, returns a
53+ * time-limited signed download URL.
54+ *
55+ * @example
56+ * ```ts
57+ * const response = await client.agent.getArtifact(
58+ * 'artifactUid',
59+ * );
60+ * ```
61+ */
62+ getArtifact ( artifactUid : string , options ?: RequestOptions ) : APIPromise < AgentGetArtifactResponse > {
63+ return this . _client . get ( path `/agent/artifacts/${ artifactUid } ` , options ) ;
64+ }
65+
4766 /**
4867 * Spawn a cloud agent with a prompt and optional configuration. The agent will be
4968 * queued for execution and assigned a unique run ID.
@@ -302,6 +321,58 @@ export interface AgentListResponse {
302321 agents : Array < AgentSkill > ;
303322}
304323
324+ /**
325+ * Response for artifact retrieval. Currently supports screenshot artifacts.
326+ */
327+ export interface AgentGetArtifactResponse {
328+ /**
329+ * Type of the artifact (e.g., SCREENSHOT)
330+ */
331+ artifact_type : string ;
332+
333+ /**
334+ * Unique identifier (UUID) for the artifact
335+ */
336+ artifact_uid : string ;
337+
338+ /**
339+ * Timestamp when the artifact was created (RFC3339)
340+ */
341+ created_at : string ;
342+
343+ /**
344+ * Response data for a screenshot artifact, including a signed download URL.
345+ */
346+ data : AgentGetArtifactResponse . Data ;
347+ }
348+
349+ export namespace AgentGetArtifactResponse {
350+ /**
351+ * Response data for a screenshot artifact, including a signed download URL.
352+ */
353+ export interface Data {
354+ /**
355+ * MIME type of the screenshot (e.g., image/png)
356+ */
357+ content_type : string ;
358+
359+ /**
360+ * Time-limited signed URL to download the screenshot
361+ */
362+ download_url : string ;
363+
364+ /**
365+ * Timestamp when the download URL expires (RFC3339)
366+ */
367+ expires_at : string ;
368+
369+ /**
370+ * Optional description of the screenshot
371+ */
372+ description ?: string ;
373+ }
374+ }
375+
305376export interface AgentRunResponse {
306377 /**
307378 * Unique identifier for the created run
@@ -427,6 +498,7 @@ export namespace AgentRunParams {
427498
428499Agent . Runs = Runs ;
429500Agent . Schedules = Schedules ;
501+ Agent . Sessions = Sessions ;
430502
431503export declare namespace Agent {
432504 export {
@@ -436,6 +508,7 @@ export declare namespace Agent {
436508 type McpServerConfig as McpServerConfig ,
437509 type UserProfile as UserProfile ,
438510 type AgentListResponse as AgentListResponse ,
511+ type AgentGetArtifactResponse as AgentGetArtifactResponse ,
439512 type AgentRunResponse as AgentRunResponse ,
440513 type AgentListParams as AgentListParams ,
441514 type AgentRunParams as AgentRunParams ,
@@ -460,4 +533,6 @@ export declare namespace Agent {
460533 type ScheduleCreateParams as ScheduleCreateParams ,
461534 type ScheduleUpdateParams as ScheduleUpdateParams ,
462535 } ;
536+
537+ export { Sessions as Sessions , type SessionCheckRedirectResponse as SessionCheckRedirectResponse } ;
463538}
0 commit comments