Skip to content

Commit ba37afd

Browse files
feat(api)!: catch up openapi, rename tasks -> runs
1 parent 7594f38 commit ba37afd

8 files changed

Lines changed: 326 additions & 286 deletions

File tree

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 3
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta%2Fwarp-api-678afb4efd7b655ded420e66621722701b018bcfce2423ec9beb4e575108c05c.yml
3-
openapi_spec_hash: 4f8537526fc20ec33facbc86e1abd571
4-
config_hash: 9c6b93a5f4b658b946f0ab7fcfedbaa3
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta%2Fwarp-api-24029c9a3bb61d8ed8807686035c52060f97505d57ad827ae4debdec426ea0a0.yml
3+
openapi_spec_hash: ffe58e3dd2d1c5c1552af6c0330e6fb1
4+
config_hash: 386210f0e52fc8dd00b78e25011b9980

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const client = new WarpAPI({
2828

2929
const response = await client.agent.run({ prompt: 'Fix the bug in auth.go' });
3030

31-
console.log(response.task_id);
31+
console.log(response.run_id);
3232
```
3333

3434
### Using environments and configuration
@@ -206,7 +206,7 @@ const { data: response, response: raw } = await client.agent
206206
.run({ prompt: 'Fix the bug in auth.go' })
207207
.withResponse();
208208
console.log(raw.headers.get('X-My-Header'));
209-
console.log(response.task_id);
209+
console.log(response.run_id);
210210
```
211211

212212
### Logging

api.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ Methods:
99

1010
- <code title="post /agent/run">client.agent.<a href="./src/resources/agent/agent.ts">run</a>({ ...params }) -> AgentRunResponse</code>
1111

12-
## Tasks
12+
## Runs
1313

1414
Types:
1515

16-
- <code><a href="./src/resources/agent/tasks.ts">TaskItem</a></code>
17-
- <code><a href="./src/resources/agent/tasks.ts">TaskSourceType</a></code>
18-
- <code><a href="./src/resources/agent/tasks.ts">TaskState</a></code>
19-
- <code><a href="./src/resources/agent/tasks.ts">TaskListResponse</a></code>
16+
- <code><a href="./src/resources/agent/runs.ts">RunItem</a></code>
17+
- <code><a href="./src/resources/agent/runs.ts">RunSourceType</a></code>
18+
- <code><a href="./src/resources/agent/runs.ts">RunState</a></code>
19+
- <code><a href="./src/resources/agent/runs.ts">RunListResponse</a></code>
2020

2121
Methods:
2222

23-
- <code title="get /agent/tasks/{taskId}">client.agent.tasks.<a href="./src/resources/agent/tasks.ts">retrieve</a>(taskID) -> TaskItem</code>
24-
- <code title="get /agent/tasks">client.agent.tasks.<a href="./src/resources/agent/tasks.ts">list</a>({ ...params }) -> TaskListResponse</code>
23+
- <code title="get /agent/runs/{runId}">client.agent.runs.<a href="./src/resources/agent/runs.ts">retrieve</a>(runID) -> RunItem</code>
24+
- <code title="get /agent/runs">client.agent.runs.<a href="./src/resources/agent/runs.ts">list</a>({ ...params }) -> RunListResponse</code>

src/resources/agent/agent.ts

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
import { APIResource } from '../../core/resource';
4-
import * as TasksAPI from './tasks';
5-
import { TaskItem, TaskListParams, TaskListResponse, TaskSourceType, TaskState, Tasks } from './tasks';
4+
import * as RunsAPI from './runs';
5+
import { RunItem, RunListParams, RunListResponse, RunSourceType, RunState, Runs } from './runs';
66
import { APIPromise } from '../../core/api-promise';
77
import { RequestOptions } from '../../internal/request-options';
88

99
export class Agent extends APIResource {
10-
tasks: TasksAPI.Tasks = new TasksAPI.Tasks(this._client);
10+
runs: RunsAPI.Runs = new RunsAPI.Runs(this._client);
1111

1212
/**
1313
* Spawn an ambient agent with a prompt and optional configuration. The agent will
14-
* be queued for execution and assigned a unique task ID.
14+
* be queued for execution and assigned a unique run ID.
1515
*
1616
* @example
1717
* ```ts
@@ -26,7 +26,7 @@ export class Agent extends APIResource {
2626
}
2727

2828
/**
29-
* Configuration for an ambient agent task
29+
* Configuration for an ambient agent run
3030
*/
3131
export interface AmbientAgentConfig {
3232
/**
@@ -35,7 +35,7 @@ export interface AmbientAgentConfig {
3535
base_prompt?: string;
3636

3737
/**
38-
* UID of the environment to run the task in
38+
* UID of the environment to run the agent in
3939
*/
4040
environment_id?: string;
4141

@@ -95,21 +95,21 @@ export namespace AmbientAgentConfig {
9595

9696
export interface AgentRunResponse {
9797
/**
98-
* Current state of the task:
99-
*
100-
* - QUEUED: Task is waiting to be picked up
101-
* - PENDING: Task is being prepared
102-
* - CLAIMED: Task has been claimed by a worker
103-
* - INPROGRESS: Task is actively being executed
104-
* - SUCCEEDED: Task completed successfully
105-
* - FAILED: Task failed
98+
* Unique identifier for the created run
10699
*/
107-
state: TasksAPI.TaskState;
100+
run_id: string;
108101

109102
/**
110-
* Unique identifier for the created task
103+
* Current state of the run:
104+
*
105+
* - QUEUED: Run is waiting to be picked up
106+
* - PENDING: Run is being prepared
107+
* - CLAIMED: Run has been claimed by a worker
108+
* - INPROGRESS: Run is actively being executed
109+
* - SUCCEEDED: Run completed successfully
110+
* - FAILED: Run failed
111111
*/
112-
task_id: string;
112+
state: RunsAPI.RunState;
113113
}
114114

115115
export interface AgentRunParams {
@@ -119,22 +119,22 @@ export interface AgentRunParams {
119119
prompt: string;
120120

121121
/**
122-
* Configuration for an ambient agent task
122+
* Configuration for an ambient agent run
123123
*/
124124
config?: AmbientAgentConfig;
125125

126126
/**
127-
* Make the task visible to all team members, not only the calling user
127+
* Make the run visible to all team members, not only the calling user
128128
*/
129129
team?: boolean;
130130

131131
/**
132-
* Custom title for the task (auto-generated if not provided)
132+
* Custom title for the run (auto-generated if not provided)
133133
*/
134134
title?: string;
135135
}
136136

137-
Agent.Tasks = Tasks;
137+
Agent.Runs = Runs;
138138

139139
export declare namespace Agent {
140140
export {
@@ -144,11 +144,11 @@ export declare namespace Agent {
144144
};
145145

146146
export {
147-
Tasks as Tasks,
148-
type TaskItem as TaskItem,
149-
type TaskSourceType as TaskSourceType,
150-
type TaskState as TaskState,
151-
type TaskListResponse as TaskListResponse,
152-
type TaskListParams as TaskListParams,
147+
Runs as Runs,
148+
type RunItem as RunItem,
149+
type RunSourceType as RunSourceType,
150+
type RunState as RunState,
151+
type RunListResponse as RunListResponse,
152+
type RunListParams as RunListParams,
153153
};
154154
}

src/resources/agent/index.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
export { Agent, type AmbientAgentConfig, type AgentRunResponse, type AgentRunParams } from './agent';
44
export {
5-
Tasks,
6-
type TaskItem,
7-
type TaskSourceType,
8-
type TaskState,
9-
type TaskListResponse,
10-
type TaskListParams,
11-
} from './tasks';
5+
Runs,
6+
type RunItem,
7+
type RunSourceType,
8+
type RunState,
9+
type RunListResponse,
10+
type RunListParams,
11+
} from './runs';

0 commit comments

Comments
 (0)