Skip to content

Commit 0c471b5

Browse files
feat(api): manual updates
1 parent c992843 commit 0c471b5

File tree

5 files changed

+107
-39
lines changed

5 files changed

+107
-39
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 12
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta%2Fwarp-api-c99d72d8d845f1eeabf7a716949a12408df952a2a0ca2b97df570da3a7c8bb49.yml
3-
openapi_spec_hash: 8a503cbccc8a5741554282327a557114
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta%2Fwarp-api-91a7db62ba0752b9bdccd4bac4c6d09c1d59b7b69788159fe13598b7a5def7ee.yml
3+
openapi_spec_hash: f03a889deaf6df14d678643be1e4dbe3
44
config_hash: 433e7a5579323a048aa173a0ace06bfc

src/resources/agent/agent.ts

Lines changed: 36 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export class Agent extends APIResource {
4545
}
4646

4747
/**
48-
* Spawn an cloud agent with a prompt and optional configuration. The agent will be
48+
* Spawn a cloud agent with a prompt and optional configuration. The agent will be
4949
* queued for execution and assigned a unique run ID.
5050
*
5151
* @example
@@ -136,7 +136,7 @@ export namespace AgentSkill {
136136
}
137137

138138
/**
139-
* Configuration for an cloud agent run
139+
* Configuration for a cloud agent run
140140
*/
141141
export interface AmbientAgentConfig {
142142
/**
@@ -166,7 +166,10 @@ export interface AmbientAgentConfig {
166166
model_id?: string;
167167

168168
/**
169-
* Config name for searchability and traceability
169+
* Human-readable label for grouping, filtering, and traceability. Automatically
170+
* set to the skill name when running a skill-based agent. Set this explicitly to
171+
* categorize runs by intent (e.g., "nightly-dependency-check") so you can filter
172+
* and track them via the name query parameter on GET /agent/runs.
170173
*/
171174
name?: string;
172175

@@ -271,6 +274,11 @@ export interface UserProfile {
271274
*/
272275
display_name?: string;
273276

277+
/**
278+
* Email address of the creator
279+
*/
280+
email?: string;
281+
274282
/**
275283
* URL to the creator's photo
276284
*/
@@ -309,6 +317,8 @@ export interface AgentRunResponse {
309317
* - INPROGRESS: Run is actively being executed
310318
* - SUCCEEDED: Run completed successfully
311319
* - FAILED: Run failed
320+
* - BLOCKED: Run is blocked (e.g., awaiting user input or approval)
321+
* - ERROR: Run encountered an error
312322
* - CANCELLED: Run was cancelled by user
313323
*/
314324
state: RunsAPI.RunState;
@@ -317,6 +327,11 @@ export interface AgentRunResponse {
317327
* @deprecated Use run_id instead.
318328
*/
319329
task_id: string;
330+
331+
/**
332+
* Whether the system is at capacity when the run was created
333+
*/
334+
at_capacity?: boolean;
320335
}
321336

322337
export interface AgentListParams {
@@ -343,7 +358,13 @@ export interface AgentListParams {
343358

344359
export interface AgentRunParams {
345360
/**
346-
* Configuration for an cloud agent run
361+
* Optional file attachments to include with the prompt (max 5). Attachments are
362+
* uploaded to cloud storage and made available to the agent.
363+
*/
364+
attachments?: Array<AgentRunParams.Attachment>;
365+
366+
/**
367+
* Configuration for a cloud agent run
347368
*/
348369
config?: AmbientAgentConfig;
349370

@@ -353,12 +374,6 @@ export interface AgentRunParams {
353374
*/
354375
conversation_id?: string;
355376

356-
/**
357-
* Optional images to include with the prompt (max 5). Images are uploaded to cloud
358-
* storage and made available to the agent.
359-
*/
360-
images?: Array<AgentRunParams.Image>;
361-
362377
/**
363378
* The prompt/instruction for the agent to execute. Required unless a skill is
364379
* specified via the skill field or config.skill_spec.
@@ -389,19 +404,24 @@ export interface AgentRunParams {
389404

390405
export namespace AgentRunParams {
391406
/**
392-
* A base64-encoded image to include with the prompt
407+
* A base64-encoded file attachment to include with the prompt
393408
*/
394-
export interface Image {
409+
export interface Attachment {
395410
/**
396-
* Base64-encoded image data
411+
* Base64-encoded attachment data
397412
*/
398413
data: string;
399414

400415
/**
401-
* MIME type of the image. Supported types: image/jpeg, image/png, image/gif,
402-
* image/webp
416+
* Name of the attached file
417+
*/
418+
file_name: string;
419+
420+
/**
421+
* MIME type of the attachment. Supported image types: image/jpeg, image/png,
422+
* image/gif, image/webp
403423
*/
404-
mime_type: 'image/jpeg' | 'image/png' | 'image/gif' | 'image/webp';
424+
mime_type: string;
405425
}
406426
}
407427

src/resources/agent/runs.ts

Lines changed: 53 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ export class Runs extends APIResource {
4747
}
4848
}
4949

50-
export type ArtifactItem = ArtifactItem.PlanArtifact | ArtifactItem.PullRequestArtifact;
50+
export type ArtifactItem =
51+
| ArtifactItem.PlanArtifact
52+
| ArtifactItem.PullRequestArtifact
53+
| ArtifactItem.ScreenshotArtifact;
5154

5255
export namespace ArtifactItem {
5356
export interface PlanArtifact {
@@ -110,6 +113,39 @@ export namespace ArtifactItem {
110113
url: string;
111114
}
112115
}
116+
117+
export interface ScreenshotArtifact {
118+
/**
119+
* Type of the artifact
120+
*/
121+
artifact_type: 'SCREENSHOT';
122+
123+
/**
124+
* Timestamp when the artifact was created (RFC3339)
125+
*/
126+
created_at: string;
127+
128+
data: ScreenshotArtifact.Data;
129+
}
130+
131+
export namespace ScreenshotArtifact {
132+
export interface Data {
133+
/**
134+
* Unique identifier for the screenshot artifact
135+
*/
136+
artifact_uid: string;
137+
138+
/**
139+
* MIME type of the screenshot image
140+
*/
141+
mime_type: string;
142+
143+
/**
144+
* Optional description of the screenshot
145+
*/
146+
description?: string;
147+
}
148+
}
113149
}
114150

115151
export interface RunItem {
@@ -137,6 +173,8 @@ export interface RunItem {
137173
* - INPROGRESS: Run is actively being executed
138174
* - SUCCEEDED: Run completed successfully
139175
* - FAILED: Run failed
176+
* - BLOCKED: Run is blocked (e.g., awaiting user input or approval)
177+
* - ERROR: Run encountered an error
140178
* - CANCELLED: Run was cancelled by user
141179
*/
142180
state: RunState;
@@ -157,7 +195,7 @@ export interface RunItem {
157195
updated_at: string;
158196

159197
/**
160-
* Configuration for an cloud agent run
198+
* Configuration for a cloud agent run
161199
*/
162200
agent_config?: AgentAPI.AmbientAgentConfig;
163201

@@ -352,9 +390,20 @@ export type RunSourceType =
352390
* - INPROGRESS: Run is actively being executed
353391
* - SUCCEEDED: Run completed successfully
354392
* - FAILED: Run failed
393+
* - BLOCKED: Run is blocked (e.g., awaiting user input or approval)
394+
* - ERROR: Run encountered an error
355395
* - CANCELLED: Run was cancelled by user
356396
*/
357-
export type RunState = 'QUEUED' | 'PENDING' | 'CLAIMED' | 'INPROGRESS' | 'SUCCEEDED' | 'FAILED' | 'CANCELLED';
397+
export type RunState =
398+
| 'QUEUED'
399+
| 'PENDING'
400+
| 'CLAIMED'
401+
| 'INPROGRESS'
402+
| 'SUCCEEDED'
403+
| 'FAILED'
404+
| 'BLOCKED'
405+
| 'ERROR'
406+
| 'CANCELLED';
358407

359408
export interface RunListResponse {
360409
page_info: RunListResponse.PageInfo;
@@ -385,7 +434,7 @@ export interface RunListParams {
385434
/**
386435
* Filter runs by artifact type (PLAN or PULL_REQUEST)
387436
*/
388-
artifact_type?: 'PLAN' | 'PULL_REQUEST';
437+
artifact_type?: 'PLAN' | 'PULL_REQUEST' | 'SCREENSHOT';
389438

390439
/**
391440
* Filter runs created after this timestamp (RFC3339 format)

src/resources/agent/schedules.ts

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ export class Schedules extends APIResource {
1717
* await client.agent.schedules.create({
1818
* cron_schedule: '0 9 * * *',
1919
* name: 'Daily Code Review',
20+
* enabled: true,
2021
* prompt:
2122
* 'Review open pull requests and provide feedback',
22-
* enabled: true,
2323
* });
2424
* ```
2525
*/
@@ -52,7 +52,6 @@ export class Schedules extends APIResource {
5252
* cron_schedule: 'cron_schedule',
5353
* enabled: true,
5454
* name: 'name',
55-
* prompt: 'prompt',
5655
* });
5756
* ```
5857
*/
@@ -158,7 +157,7 @@ export interface ScheduledAgentItem {
158157
updated_at: string;
159158

160159
/**
161-
* Configuration for an cloud agent run
160+
* Configuration for a cloud agent run
162161
*/
163162
agent_config?: AgentAPI.AmbientAgentConfig;
164163

@@ -246,12 +245,7 @@ export interface ScheduleCreateParams {
246245
name: string;
247246

248247
/**
249-
* The prompt/instruction for the agent to execute
250-
*/
251-
prompt: string;
252-
253-
/**
254-
* Configuration for an cloud agent run
248+
* Configuration for a cloud agent run
255249
*/
256250
agent_config?: AgentAPI.AmbientAgentConfig;
257251

@@ -260,6 +254,12 @@ export interface ScheduleCreateParams {
260254
*/
261255
enabled?: boolean;
262256

257+
/**
258+
* The prompt/instruction for the agent to execute. Required unless
259+
* agent_config.skill_spec is provided.
260+
*/
261+
prompt?: string;
262+
263263
/**
264264
* Whether to create a team-owned schedule. Defaults to true for users on a single
265265
* team.
@@ -284,14 +284,15 @@ export interface ScheduleUpdateParams {
284284
name: string;
285285

286286
/**
287-
* The prompt/instruction for the agent to execute
287+
* Configuration for a cloud agent run
288288
*/
289-
prompt: string;
289+
agent_config?: AgentAPI.AmbientAgentConfig;
290290

291291
/**
292-
* Configuration for an cloud agent run
292+
* The prompt/instruction for the agent to execute. Required unless
293+
* agent_config.skill_spec is provided.
293294
*/
294-
agent_config?: AgentAPI.AmbientAgentConfig;
295+
prompt?: string;
295296
}
296297

297298
export declare namespace Schedules {

tests/api-resources/agent/schedules.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ describe('resource schedules', () => {
1313
const responsePromise = client.agent.schedules.create({
1414
cron_schedule: '0 9 * * *',
1515
name: 'Daily Code Review',
16-
prompt: 'Review open pull requests and provide feedback',
1716
});
1817
const rawResponse = await responsePromise.asResponse();
1918
expect(rawResponse).toBeInstanceOf(Response);
@@ -29,7 +28,6 @@ describe('resource schedules', () => {
2928
const response = await client.agent.schedules.create({
3029
cron_schedule: '0 9 * * *',
3130
name: 'Daily Code Review',
32-
prompt: 'Review open pull requests and provide feedback',
3331
agent_config: {
3432
base_prompt: 'base_prompt',
3533
computer_use_enabled: true,
@@ -50,6 +48,7 @@ describe('resource schedules', () => {
5048
worker_host: 'worker_host',
5149
},
5250
enabled: true,
51+
prompt: 'Review open pull requests and provide feedback',
5352
team: true,
5453
});
5554
});
@@ -72,7 +71,6 @@ describe('resource schedules', () => {
7271
cron_schedule: 'cron_schedule',
7372
enabled: true,
7473
name: 'name',
75-
prompt: 'prompt',
7674
});
7775
const rawResponse = await responsePromise.asResponse();
7876
expect(rawResponse).toBeInstanceOf(Response);
@@ -89,7 +87,6 @@ describe('resource schedules', () => {
8987
cron_schedule: 'cron_schedule',
9088
enabled: true,
9189
name: 'name',
92-
prompt: 'prompt',
9390
agent_config: {
9491
base_prompt: 'base_prompt',
9592
computer_use_enabled: true,
@@ -109,6 +106,7 @@ describe('resource schedules', () => {
109106
skill_spec: 'skill_spec',
110107
worker_host: 'worker_host',
111108
},
109+
prompt: 'prompt',
112110
});
113111
});
114112

0 commit comments

Comments
 (0)