Skip to content

Commit c438610

Browse files
feat(api): api update
1 parent 52e41eb commit c438610

10 files changed

Lines changed: 275 additions & 17 deletions

File tree

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 14
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta%2Fwarp-api-8f9c749573846b07a55a3131b66456f0a592838c6bfc986ab30948df66cd6f11.yml
3-
openapi_spec_hash: 59f1ac98ad6cf13b12c59196bcecffd7
4-
config_hash: 60052b2c1c0862014416821aba875574
1+
configured_endpoints: 15
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta%2Fwarp-api-abde9a81e648a7bbddbb7c7af07eb9202e584f78dea9cc79ff075da2ad66efd5.yml
3+
openapi_spec_hash: db45809e85b0f85020a6b046c6eed90e
4+
config_hash: 253e4b5ca01236d448980a78491c17c5

api.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Types:
55
- <code><a href="./src/resources/agent/agent.ts">AgentSkill</a></code>
66
- <code><a href="./src/resources/agent/agent.ts">AmbientAgentConfig</a></code>
77
- <code><a href="./src/resources/agent/agent.ts">AwsProviderConfig</a></code>
8+
- <code><a href="./src/resources/agent/agent.ts">CloudEnvironment</a></code>
89
- <code><a href="./src/resources/agent/agent.ts">CloudEnvironmentConfig</a></code>
910
- <code><a href="./src/resources/agent/agent.ts">Error</a></code>
1011
- <code><a href="./src/resources/agent/agent.ts">ErrorCode</a></code>
@@ -14,12 +15,14 @@ Types:
1415
- <code><a href="./src/resources/agent/agent.ts">UserProfile</a></code>
1516
- <code><a href="./src/resources/agent/agent.ts">AgentListResponse</a></code>
1617
- <code><a href="./src/resources/agent/agent.ts">AgentGetArtifactResponse</a></code>
18+
- <code><a href="./src/resources/agent/agent.ts">AgentListEnvironmentsResponse</a></code>
1719
- <code><a href="./src/resources/agent/agent.ts">AgentRunResponse</a></code>
1820

1921
Methods:
2022

2123
- <code title="get /agent">client.agent.<a href="./src/resources/agent/agent.ts">list</a>({ ...params }) -> AgentListResponse</code>
2224
- <code title="get /agent/artifacts/{artifactUid}">client.agent.<a href="./src/resources/agent/agent.ts">getArtifact</a>(artifactUid) -> AgentGetArtifactResponse</code>
25+
- <code title="get /agent/environments">client.agent.<a href="./src/resources/agent/agent.ts">listEnvironments</a>({ ...params }) -> AgentListEnvironmentsResponse</code>
2326
- <code title="post /agent/runs">client.agent.<a href="./src/resources/agent/agent.ts">run</a>({ ...params }) -> AgentRunResponse</code>
2427

2528
## Runs

src/client.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,16 @@ import { APIPromise } from './core/api-promise';
2222
import {
2323
Agent,
2424
AgentGetArtifactResponse,
25+
AgentListEnvironmentsParams,
26+
AgentListEnvironmentsResponse,
2527
AgentListParams,
2628
AgentListResponse,
2729
AgentRunParams,
2830
AgentRunResponse,
2931
AgentSkill,
3032
AmbientAgentConfig,
3133
AwsProviderConfig,
34+
CloudEnvironment,
3235
CloudEnvironmentConfig,
3336
Error,
3437
ErrorCode,
@@ -781,6 +784,7 @@ export declare namespace OzAPI {
781784
type AgentSkill as AgentSkill,
782785
type AmbientAgentConfig as AmbientAgentConfig,
783786
type AwsProviderConfig as AwsProviderConfig,
787+
type CloudEnvironment as CloudEnvironment,
784788
type CloudEnvironmentConfig as CloudEnvironmentConfig,
785789
type Error as Error,
786790
type ErrorCode as ErrorCode,
@@ -790,8 +794,10 @@ export declare namespace OzAPI {
790794
type UserProfile as UserProfile,
791795
type AgentListResponse as AgentListResponse,
792796
type AgentGetArtifactResponse as AgentGetArtifactResponse,
797+
type AgentListEnvironmentsResponse as AgentListEnvironmentsResponse,
793798
type AgentRunResponse as AgentRunResponse,
794799
type AgentListParams as AgentListParams,
800+
type AgentListEnvironmentsParams as AgentListEnvironmentsParams,
795801
type AgentRunParams as AgentRunParams,
796802
};
797803
}

src/resources/agent/agent.ts

Lines changed: 214 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -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
*/
541661
export type AgentGetArtifactResponse =
662+
| AgentGetArtifactResponse.PlanArtifactResponse
542663
| AgentGetArtifactResponse.ScreenshotArtifactResponse
543664
| AgentGetArtifactResponse.FileArtifactResponse;
544665

545666
export 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+
666856
export 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+
727927
export 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

src/resources/agent/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export {
55
type AgentSkill,
66
type AmbientAgentConfig,
77
type AwsProviderConfig,
8+
type CloudEnvironment,
89
type CloudEnvironmentConfig,
910
type Error,
1011
type ErrorCode,
@@ -14,8 +15,10 @@ export {
1415
type UserProfile,
1516
type AgentListResponse,
1617
type AgentGetArtifactResponse,
18+
type AgentListEnvironmentsResponse,
1719
type AgentRunResponse,
1820
type AgentListParams,
21+
type AgentListEnvironmentsParams,
1922
type AgentRunParams,
2023
} from './agent';
2124
export {

0 commit comments

Comments
 (0)