Skip to content

Commit b467e93

Browse files
feat(api): add schedules to runs
1 parent 16356a2 commit b467e93

4 files changed

Lines changed: 38 additions & 32 deletions

File tree

.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-d3907596f0e1b561fd86deb46529fca2a4802a992a35e2a9c51440451f4e9811.yml
3-
openapi_spec_hash: 5636d38917d7664a237f4096c1338304
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta%2Fwarp-api-71da0fb8e959241d9767c5a4879871711b501bd0d6cef087fbb7047a0b86791e.yml
3+
openapi_spec_hash: 8b0828210e5b33f36fc88093dbf066f1
44
config_hash: 07820b17df23cbea39cb77fa05292538

src/resources/agent/agent.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,6 @@ export interface AgentRunResponse {
298298
* - INPROGRESS: Run is actively being executed
299299
* - SUCCEEDED: Run completed successfully
300300
* - FAILED: Run failed
301-
* - CANCELLED: Run was cancelled by user
302301
*/
303302
state: RunsAPI.RunState;
304303
}

src/resources/agent/runs.ts

Lines changed: 35 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,18 @@ export namespace ArtifactItem {
5454
/**
5555
* Type of the artifact
5656
*/
57-
artifact_type: 'PLAN';
57+
artifact_type: 'plan';
5858

5959
/**
6060
* Timestamp when the artifact was created (RFC3339)
6161
*/
6262
created_at: string;
6363

64-
data: PlanArtifact.Data;
64+
plan: PlanArtifact.Plan;
6565
}
6666

6767
export namespace PlanArtifact {
68-
export interface Data {
68+
export interface Plan {
6969
/**
7070
* Unique identifier for the plan document
7171
*/
@@ -87,18 +87,18 @@ export namespace ArtifactItem {
8787
/**
8888
* Type of the artifact
8989
*/
90-
artifact_type: 'PULL_REQUEST';
90+
artifact_type: 'pull_request';
9191

9292
/**
9393
* Timestamp when the artifact was created (RFC3339)
9494
*/
9595
created_at: string;
9696

97-
data: PullRequestArtifact.Data;
97+
pull_request: PullRequestArtifact.PullRequest;
9898
}
9999

100100
export namespace PullRequestArtifact {
101-
export interface Data {
101+
export interface PullRequest {
102102
/**
103103
* Branch name for the pull request
104104
*/
@@ -137,7 +137,6 @@ export interface RunItem {
137137
* - INPROGRESS: Run is actively being executed
138138
* - SUCCEEDED: Run completed successfully
139139
* - FAILED: Run failed
140-
* - CANCELLED: Run was cancelled by user
141140
*/
142141
state: RunState;
143142

@@ -183,6 +182,12 @@ export interface RunItem {
183182
*/
184183
request_usage?: RunItem.RequestUsage;
185184

185+
/**
186+
* Information about the schedule that triggered this run (only present for
187+
* scheduled runs)
188+
*/
189+
schedule?: RunItem.Schedule;
190+
186191
/**
187192
* UUID of the shared session (if available)
188193
*/
@@ -230,6 +235,27 @@ export namespace RunItem {
230235
inference_cost?: number;
231236
}
232237

238+
/**
239+
* Information about the schedule that triggered this run (only present for
240+
* scheduled runs)
241+
*/
242+
export interface Schedule {
243+
/**
244+
* Cron expression at the time the run was created
245+
*/
246+
cron_schedule: string;
247+
248+
/**
249+
* Unique identifier for the schedule
250+
*/
251+
schedule_id: string;
252+
253+
/**
254+
* Name of the schedule at the time the run was created
255+
*/
256+
schedule_name: string;
257+
}
258+
233259
export interface StatusMessage {
234260
/**
235261
* Human-readable status message
@@ -267,9 +293,8 @@ export type RunSourceType =
267293
* - INPROGRESS: Run is actively being executed
268294
* - SUCCEEDED: Run completed successfully
269295
* - FAILED: Run failed
270-
* - CANCELLED: Run was cancelled by user
271296
*/
272-
export type RunState = 'QUEUED' | 'PENDING' | 'CLAIMED' | 'INPROGRESS' | 'SUCCEEDED' | 'FAILED' | 'CANCELLED';
297+
export type RunState = 'QUEUED' | 'PENDING' | 'CLAIMED' | 'INPROGRESS' | 'SUCCEEDED' | 'FAILED';
273298

274299
export interface RunListResponse {
275300
page_info: RunListResponse.PageInfo;
@@ -325,7 +350,7 @@ export interface RunListParams {
325350
/**
326351
* Filter runs by environment ID
327352
*/
328-
environment_id?: string;
353+
environmentId?: string;
329354

330355
/**
331356
* Maximum number of runs to return
@@ -337,16 +362,6 @@ export interface RunListParams {
337362
*/
338363
model_id?: string;
339364

340-
/**
341-
* Filter runs by the scheduled agent ID that created them
342-
*/
343-
schedule_id?: string;
344-
345-
/**
346-
* Filter runs by skill spec (e.g., "owner/repo:path/to/SKILL.md")
347-
*/
348-
skill_spec?: string;
349-
350365
/**
351366
* Filter by run source type
352367
*/
@@ -357,11 +372,6 @@ export interface RunListParams {
357372
* states.
358373
*/
359374
state?: Array<RunState>;
360-
361-
/**
362-
* Filter runs updated after this timestamp (RFC3339 format)
363-
*/
364-
updated_after?: string;
365375
}
366376

367377
export declare namespace Runs {

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,11 @@ describe('resource runs', () => {
4343
created_before: '2019-12-27T18:11:19.117Z',
4444
creator: 'creator',
4545
cursor: 'cursor',
46-
environment_id: 'environment_id',
46+
environmentId: 'environmentId',
4747
limit: 1,
4848
model_id: 'model_id',
49-
schedule_id: 'schedule_id',
50-
skill_spec: 'skill_spec',
5149
source: 'LINEAR',
5250
state: ['QUEUED'],
53-
updated_after: '2019-12-27T18:11:19.117Z',
5451
},
5552
{ path: '/_stainless_unknown_path' },
5653
),

0 commit comments

Comments
 (0)