@@ -54,8 +54,9 @@ export class Agent extends APIResource {
5454 }
5555
5656 /**
57- * Retrieve an artifact by its UUID. For supported downloadable artifacts, returns
58- * a time-limited signed download URL.
57+ * Retrieve an artifact by its UUID. For downloadable file-like artifacts, returns
58+ * a time-limited signed download URL. For plan artifacts, returns the current plan
59+ * content inline.
5960 *
6061 * @example
6162 * ```ts
@@ -68,6 +69,23 @@ export class Agent extends APIResource {
6869 return this . _client . get ( path `/agent/artifacts/${ artifactUid } ` , options ) ;
6970 }
7071
72+ /**
73+ * Retrieve cloud environments accessible to the authenticated principal. Returns
74+ * environments the caller owns, has been granted guest access to, or has accessed
75+ * via link sharing.
76+ *
77+ * @example
78+ * ```ts
79+ * const response = await client.agent.listEnvironments();
80+ * ```
81+ */
82+ listEnvironments (
83+ query : AgentListEnvironmentsParams | null | undefined = { } ,
84+ options ?: RequestOptions ,
85+ ) : APIPromise < AgentListEnvironmentsResponse > {
86+ return this . _client . get ( '/agent/environments' , { query, ...options } ) ;
87+ }
88+
7189 /**
7290 * Alias for POST /agent/run. This is the preferred endpoint for creating new agent
7391 * runs. Behavior is identical to POST /agent/run.
@@ -190,6 +208,12 @@ export interface AmbientAgentConfig {
190208 */
191209 harness ?: AmbientAgentConfig . Harness ;
192210
211+ /**
212+ * Authentication secrets for third-party harnesses. Only the secret for the
213+ * harness specified gets injected into the environment.
214+ */
215+ harness_auth_secrets ?: AmbientAgentConfig . HarnessAuthSecrets ;
216+
193217 /**
194218 * Number of minutes to keep the agent environment alive after task completion. If
195219 * not set, defaults to 10 minutes. Maximum allowed value is min(60,
@@ -236,14 +260,6 @@ export namespace AmbientAgentConfig {
236260 * uses Warp's built-in harness.
237261 */
238262 export interface Harness {
239- /**
240- * Name of a managed secret to use as the authentication credential for the
241- * harness. The secret must exist within the caller's personal or team scope. The
242- * environment variable injected into the agent is determined by the secret type
243- * (e.g. ANTHROPIC_API_KEY for anthropic_api_key secrets).
244- */
245- auth_secret_name ?: string ;
246-
247263 /**
248264 * The harness type identifier.
249265 *
@@ -252,6 +268,19 @@ export namespace AmbientAgentConfig {
252268 */
253269 type ?: 'oz' | 'claude' ;
254270 }
271+
272+ /**
273+ * Authentication secrets for third-party harnesses. Only the secret for the
274+ * harness specified gets injected into the environment.
275+ */
276+ export interface HarnessAuthSecrets {
277+ /**
278+ * Name of a managed secret for Claude Code harness authentication. The secret must
279+ * exist within the caller's personal or team scope. Only applicable when harness
280+ * type is "claude".
281+ */
282+ claude_auth_secret_name ?: string ;
283+ }
255284}
256285
257286/**
@@ -264,6 +293,97 @@ export interface AwsProviderConfig {
264293 role_arn : string ;
265294}
266295
296+ /**
297+ * A cloud environment for running agents
298+ */
299+ export interface CloudEnvironment {
300+ /**
301+ * Configuration for a cloud environment used by scheduled agents
302+ */
303+ config : CloudEnvironmentConfig ;
304+
305+ /**
306+ * Timestamp when the environment was last updated (RFC3339)
307+ */
308+ last_updated : string ;
309+
310+ /**
311+ * True when the most recent task failed during setup before it started running
312+ */
313+ setup_failed : boolean ;
314+
315+ /**
316+ * Unique identifier for the environment
317+ */
318+ uid : string ;
319+
320+ creator ?: UserProfile ;
321+
322+ last_editor ?: UserProfile ;
323+
324+ /**
325+ * Summary of the most recently created task for an environment
326+ */
327+ last_task_created ?: CloudEnvironment . LastTaskCreated ;
328+
329+ /**
330+ * Timestamp of the most recent task run in this environment (RFC3339)
331+ */
332+ last_task_run_timestamp ?: string | null ;
333+
334+ /**
335+ * Ownership scope for a resource (team or personal)
336+ */
337+ scope ?: Scope ;
338+ }
339+
340+ export namespace CloudEnvironment {
341+ /**
342+ * Summary of the most recently created task for an environment
343+ */
344+ export interface LastTaskCreated {
345+ /**
346+ * Unique identifier of the task
347+ */
348+ id : string ;
349+
350+ /**
351+ * When the task was created (RFC3339)
352+ */
353+ created_at : string ;
354+
355+ /**
356+ * Current state of the run:
357+ *
358+ * - QUEUED: Run is waiting to be picked up
359+ * - PENDING: Run is being prepared
360+ * - CLAIMED: Run has been claimed by a worker
361+ * - INPROGRESS: Run is actively being executed
362+ * - SUCCEEDED: Run completed successfully
363+ * - FAILED: Run failed
364+ * - BLOCKED: Run is blocked (e.g., awaiting user input or approval)
365+ * - ERROR: Run encountered an error
366+ * - CANCELLED: Run was cancelled by user
367+ */
368+ state : RunsAPI . RunState ;
369+
370+ /**
371+ * Title of the task
372+ */
373+ title : string ;
374+
375+ /**
376+ * When the task was last updated (RFC3339)
377+ */
378+ updated_at : string ;
379+
380+ /**
381+ * When the task started running (RFC3339), null if not yet started
382+ */
383+ started_at ?: string | null ;
384+ }
385+ }
386+
267387/**
268388 * Configuration for a cloud environment used by scheduled agents
269389 */
@@ -536,13 +656,76 @@ export interface AgentListResponse {
536656}
537657
538658/**
539- * Response for retrieving a screenshot artifact.
659+ * Response for retrieving a plan artifact.
540660 */
541661export type AgentGetArtifactResponse =
662+ | AgentGetArtifactResponse . PlanArtifactResponse
542663 | AgentGetArtifactResponse . ScreenshotArtifactResponse
543664 | AgentGetArtifactResponse . FileArtifactResponse ;
544665
545666export namespace AgentGetArtifactResponse {
667+ /**
668+ * Response for retrieving a plan artifact.
669+ */
670+ export interface PlanArtifactResponse {
671+ /**
672+ * Type of the artifact
673+ */
674+ artifact_type : 'PLAN' ;
675+
676+ /**
677+ * Unique identifier (UUID) for the artifact
678+ */
679+ artifact_uid : string ;
680+
681+ /**
682+ * Timestamp when the artifact was created (RFC3339)
683+ */
684+ created_at : string ;
685+
686+ /**
687+ * Response data for a plan artifact, including current markdown content.
688+ */
689+ data : PlanArtifactResponse . Data ;
690+ }
691+
692+ export namespace PlanArtifactResponse {
693+ /**
694+ * Response data for a plan artifact, including current markdown content.
695+ */
696+ export interface Data {
697+ /**
698+ * Current markdown content of the plan
699+ */
700+ content : string ;
701+
702+ /**
703+ * MIME type of the returned plan content
704+ */
705+ content_type : string ;
706+
707+ /**
708+ * Unique identifier for the plan document
709+ */
710+ document_uid : string ;
711+
712+ /**
713+ * Unique identifier for the associated notebook
714+ */
715+ notebook_uid : string ;
716+
717+ /**
718+ * Current title of the plan
719+ */
720+ title ?: string ;
721+
722+ /**
723+ * URL to open the plan in Warp Drive
724+ */
725+ url ?: string ;
726+ }
727+ }
728+
546729 /**
547730 * Response for retrieving a screenshot artifact.
548731 */
@@ -663,6 +846,13 @@ export namespace AgentGetArtifactResponse {
663846 }
664847}
665848
849+ export interface AgentListEnvironmentsResponse {
850+ /**
851+ * List of accessible cloud environments
852+ */
853+ environments : Array < CloudEnvironment > ;
854+ }
855+
666856export interface AgentRunResponse {
667857 /**
668858 * Unique identifier for the created run
@@ -724,6 +914,16 @@ export interface AgentListParams {
724914 sort_by ?: 'name' | 'last_run' ;
725915}
726916
917+ export interface AgentListEnvironmentsParams {
918+ /**
919+ * Sort order for the returned environments.
920+ *
921+ * - `name`: alphabetical by environment name
922+ * - `last_updated`: most recently updated first (default)
923+ */
924+ sort_by ?: 'name' | 'last_updated' ;
925+ }
926+
727927export interface AgentRunParams {
728928 /**
729929 * Optional agent identity UID to use as the execution principal for the run. This
@@ -819,6 +1019,7 @@ export declare namespace Agent {
8191019 type AgentSkill as AgentSkill ,
8201020 type AmbientAgentConfig as AmbientAgentConfig ,
8211021 type AwsProviderConfig as AwsProviderConfig ,
1022+ type CloudEnvironment as CloudEnvironment ,
8221023 type CloudEnvironmentConfig as CloudEnvironmentConfig ,
8231024 type Error as Error ,
8241025 type ErrorCode as ErrorCode ,
@@ -828,8 +1029,10 @@ export declare namespace Agent {
8281029 type UserProfile as UserProfile ,
8291030 type AgentListResponse as AgentListResponse ,
8301031 type AgentGetArtifactResponse as AgentGetArtifactResponse ,
1032+ type AgentListEnvironmentsResponse as AgentListEnvironmentsResponse ,
8311033 type AgentRunResponse as AgentRunResponse ,
8321034 type AgentListParams as AgentListParams ,
1035+ type AgentListEnvironmentsParams as AgentListEnvironmentsParams ,
8331036 type AgentRunParams as AgentRunParams ,
8341037 } ;
8351038
0 commit comments