warp-agent-sdk 0.2.0 → 1.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/LICENSE +1 -1
- package/README.md +2 -2
- package/client.js +1 -1
- package/client.js.map +1 -1
- package/client.mjs +1 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/agent/agent.d.mts +25 -21
- package/resources/agent/agent.d.mts.map +1 -1
- package/resources/agent/agent.d.ts +25 -21
- package/resources/agent/agent.d.ts.map +1 -1
- package/resources/agent/agent.js +5 -5
- package/resources/agent/agent.js.map +1 -1
- package/resources/agent/agent.mjs +5 -5
- package/resources/agent/agent.mjs.map +1 -1
- package/resources/agent/index.d.mts +1 -1
- package/resources/agent/index.d.mts.map +1 -1
- package/resources/agent/index.d.ts +1 -1
- package/resources/agent/index.d.ts.map +1 -1
- package/resources/agent/index.js +3 -3
- package/resources/agent/index.js.map +1 -1
- package/resources/agent/index.mjs +1 -1
- package/resources/agent/index.mjs.map +1 -1
- package/resources/agent/runs.d.mts +222 -0
- package/resources/agent/runs.d.mts.map +1 -0
- package/resources/agent/runs.d.ts +222 -0
- package/resources/agent/runs.d.ts.map +1 -0
- package/resources/agent/runs.js +34 -0
- package/resources/agent/runs.js.map +1 -0
- package/resources/agent/runs.mjs +30 -0
- package/resources/agent/runs.mjs.map +1 -0
- package/src/client.ts +1 -1
- package/src/resources/agent/agent.ts +32 -27
- package/src/resources/agent/index.ts +7 -7
- package/src/resources/agent/runs.ts +276 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
- package/resources/agent/tasks.d.mts +0 -183
- package/resources/agent/tasks.d.mts.map +0 -1
- package/resources/agent/tasks.d.ts +0 -183
- package/resources/agent/tasks.d.ts.map +0 -1
- package/resources/agent/tasks.js +0 -36
- package/resources/agent/tasks.js.map +0 -1
- package/resources/agent/tasks.mjs +0 -32
- package/resources/agent/tasks.mjs.map +0 -1
- package/src/resources/agent/tasks.ts +0 -231
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
2
|
+
import * as AgentAPI from "./agent.mjs";
|
|
3
|
+
import { APIPromise } from "../../core/api-promise.mjs";
|
|
4
|
+
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
5
|
+
export declare class Runs extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Retrieve detailed information about a specific agent run, including the full
|
|
8
|
+
* prompt, session link, and resolved configuration.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const runItem = await client.agent.runs.retrieve('runId');
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
retrieve(runID: string, options?: RequestOptions): APIPromise<RunItem>;
|
|
16
|
+
/**
|
|
17
|
+
* Retrieve a paginated list of agent runs with optional filtering. Results are
|
|
18
|
+
* ordered by creation time (newest first).
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* const runs = await client.agent.runs.list();
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
list(query?: RunListParams | null | undefined, options?: RequestOptions): APIPromise<RunListResponse>;
|
|
26
|
+
}
|
|
27
|
+
export interface RunItem {
|
|
28
|
+
/**
|
|
29
|
+
* Timestamp when the run was created (RFC3339)
|
|
30
|
+
*/
|
|
31
|
+
created_at: string;
|
|
32
|
+
/**
|
|
33
|
+
* The prompt/instruction for the agent
|
|
34
|
+
*/
|
|
35
|
+
prompt: string;
|
|
36
|
+
/**
|
|
37
|
+
* Unique identifier for the run
|
|
38
|
+
*/
|
|
39
|
+
run_id: string;
|
|
40
|
+
/**
|
|
41
|
+
* Current state of the run:
|
|
42
|
+
*
|
|
43
|
+
* - QUEUED: Run is waiting to be picked up
|
|
44
|
+
* - PENDING: Run is being prepared
|
|
45
|
+
* - CLAIMED: Run has been claimed by a worker
|
|
46
|
+
* - INPROGRESS: Run is actively being executed
|
|
47
|
+
* - SUCCEEDED: Run completed successfully
|
|
48
|
+
* - FAILED: Run failed
|
|
49
|
+
*/
|
|
50
|
+
state: RunState;
|
|
51
|
+
/**
|
|
52
|
+
* @deprecated Use run_id instead.
|
|
53
|
+
*/
|
|
54
|
+
task_id: string;
|
|
55
|
+
/**
|
|
56
|
+
* Human-readable title for the run
|
|
57
|
+
*/
|
|
58
|
+
title: string;
|
|
59
|
+
/**
|
|
60
|
+
* Timestamp when the run was last updated (RFC3339)
|
|
61
|
+
*/
|
|
62
|
+
updated_at: string;
|
|
63
|
+
/**
|
|
64
|
+
* Configuration for an ambient agent run
|
|
65
|
+
*/
|
|
66
|
+
agent_config?: AgentAPI.AmbientAgentConfig;
|
|
67
|
+
/**
|
|
68
|
+
* UUID of the conversation associated with the run
|
|
69
|
+
*/
|
|
70
|
+
conversation_id?: string;
|
|
71
|
+
creator?: RunItem.Creator;
|
|
72
|
+
/**
|
|
73
|
+
* Whether the sandbox environment is currently running
|
|
74
|
+
*/
|
|
75
|
+
is_sandbox_running?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Resource usage information for the run
|
|
78
|
+
*/
|
|
79
|
+
request_usage?: RunItem.RequestUsage;
|
|
80
|
+
/**
|
|
81
|
+
* UUID of the shared session (if available)
|
|
82
|
+
*/
|
|
83
|
+
session_id?: string;
|
|
84
|
+
/**
|
|
85
|
+
* URL to view the agent session
|
|
86
|
+
*/
|
|
87
|
+
session_link?: string;
|
|
88
|
+
/**
|
|
89
|
+
* Source that created the run:
|
|
90
|
+
*
|
|
91
|
+
* - LINEAR: Created from Linear integration
|
|
92
|
+
* - API: Created via the Warp API
|
|
93
|
+
* - SLACK: Created from Slack integration
|
|
94
|
+
* - LOCAL: Created from local CLI/app
|
|
95
|
+
* - SCHEDULED_AGENT: Created by a scheduled agent
|
|
96
|
+
*/
|
|
97
|
+
source?: RunSourceType;
|
|
98
|
+
/**
|
|
99
|
+
* Timestamp when the agent started working on the run (RFC3339)
|
|
100
|
+
*/
|
|
101
|
+
started_at?: string | null;
|
|
102
|
+
status_message?: RunItem.StatusMessage;
|
|
103
|
+
}
|
|
104
|
+
export declare namespace RunItem {
|
|
105
|
+
interface Creator {
|
|
106
|
+
/**
|
|
107
|
+
* Display name of the creator
|
|
108
|
+
*/
|
|
109
|
+
display_name?: string;
|
|
110
|
+
/**
|
|
111
|
+
* URL to the creator's photo
|
|
112
|
+
*/
|
|
113
|
+
photo_url?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Type of the creator principal
|
|
116
|
+
*/
|
|
117
|
+
type?: 'user' | 'service_account';
|
|
118
|
+
/**
|
|
119
|
+
* Unique identifier of the creator
|
|
120
|
+
*/
|
|
121
|
+
uid?: string;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Resource usage information for the run
|
|
125
|
+
*/
|
|
126
|
+
interface RequestUsage {
|
|
127
|
+
/**
|
|
128
|
+
* Cost of compute resources for the run
|
|
129
|
+
*/
|
|
130
|
+
compute_cost?: number;
|
|
131
|
+
/**
|
|
132
|
+
* Cost of LLM inference for the run
|
|
133
|
+
*/
|
|
134
|
+
inference_cost?: number;
|
|
135
|
+
}
|
|
136
|
+
interface StatusMessage {
|
|
137
|
+
/**
|
|
138
|
+
* Human-readable status message
|
|
139
|
+
*/
|
|
140
|
+
message?: string;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Source that created the run:
|
|
145
|
+
*
|
|
146
|
+
* - LINEAR: Created from Linear integration
|
|
147
|
+
* - API: Created via the Warp API
|
|
148
|
+
* - SLACK: Created from Slack integration
|
|
149
|
+
* - LOCAL: Created from local CLI/app
|
|
150
|
+
* - SCHEDULED_AGENT: Created by a scheduled agent
|
|
151
|
+
*/
|
|
152
|
+
export type RunSourceType = 'LINEAR' | 'API' | 'SLACK' | 'LOCAL' | 'SCHEDULED_AGENT';
|
|
153
|
+
/**
|
|
154
|
+
* Current state of the run:
|
|
155
|
+
*
|
|
156
|
+
* - QUEUED: Run is waiting to be picked up
|
|
157
|
+
* - PENDING: Run is being prepared
|
|
158
|
+
* - CLAIMED: Run has been claimed by a worker
|
|
159
|
+
* - INPROGRESS: Run is actively being executed
|
|
160
|
+
* - SUCCEEDED: Run completed successfully
|
|
161
|
+
* - FAILED: Run failed
|
|
162
|
+
*/
|
|
163
|
+
export type RunState = 'QUEUED' | 'PENDING' | 'CLAIMED' | 'INPROGRESS' | 'SUCCEEDED' | 'FAILED';
|
|
164
|
+
export interface RunListResponse {
|
|
165
|
+
page_info: RunListResponse.PageInfo;
|
|
166
|
+
runs: Array<RunItem>;
|
|
167
|
+
}
|
|
168
|
+
export declare namespace RunListResponse {
|
|
169
|
+
interface PageInfo {
|
|
170
|
+
/**
|
|
171
|
+
* Whether there are more results available
|
|
172
|
+
*/
|
|
173
|
+
has_next_page: boolean;
|
|
174
|
+
/**
|
|
175
|
+
* Opaque cursor for fetching the next page
|
|
176
|
+
*/
|
|
177
|
+
next_cursor?: string;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
export interface RunListParams {
|
|
181
|
+
/**
|
|
182
|
+
* Filter by agent config name
|
|
183
|
+
*/
|
|
184
|
+
config_name?: string;
|
|
185
|
+
/**
|
|
186
|
+
* Filter runs created after this timestamp (RFC3339 format)
|
|
187
|
+
*/
|
|
188
|
+
created_after?: string;
|
|
189
|
+
/**
|
|
190
|
+
* Filter runs created before this timestamp (RFC3339 format)
|
|
191
|
+
*/
|
|
192
|
+
created_before?: string;
|
|
193
|
+
/**
|
|
194
|
+
* Filter by creator UID (user or service account)
|
|
195
|
+
*/
|
|
196
|
+
creator?: string;
|
|
197
|
+
/**
|
|
198
|
+
* Pagination cursor from previous response
|
|
199
|
+
*/
|
|
200
|
+
cursor?: string;
|
|
201
|
+
/**
|
|
202
|
+
* Maximum number of runs to return
|
|
203
|
+
*/
|
|
204
|
+
limit?: number;
|
|
205
|
+
/**
|
|
206
|
+
* Filter by model ID
|
|
207
|
+
*/
|
|
208
|
+
model_id?: string;
|
|
209
|
+
/**
|
|
210
|
+
* Filter by run source type
|
|
211
|
+
*/
|
|
212
|
+
source?: RunSourceType;
|
|
213
|
+
/**
|
|
214
|
+
* Filter by run state. Can be specified multiple times to match any of the given
|
|
215
|
+
* states.
|
|
216
|
+
*/
|
|
217
|
+
state?: Array<RunState>;
|
|
218
|
+
}
|
|
219
|
+
export declare namespace Runs {
|
|
220
|
+
export { type RunItem as RunItem, type RunSourceType as RunSourceType, type RunState as RunState, type RunListResponse as RunListResponse, type RunListParams as RunListParams, };
|
|
221
|
+
}
|
|
222
|
+
//# sourceMappingURL=runs.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs.d.mts","sourceRoot":"","sources":["../../src/resources/agent/runs.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,QAAQ;OACb,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,IAAK,SAAQ,WAAW;IACnC;;;;;;;;OAQG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;IAItE;;;;;;;;OAQG;IACH,IAAI,CAAC,KAAK,GAAE,aAAa,GAAG,IAAI,GAAG,SAAc,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,eAAe,CAAC;CAG1G;AAED,MAAM,WAAW,OAAO;IACtB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;;;;;;;OASG;IACH,KAAK,EAAE,QAAQ,CAAC;IAEhB;;OAEG;I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
import { APIPromise } from "../../core/api-promise.js";
|
|
4
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
5
|
+
export declare class Runs extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Retrieve detailed information about a specific agent run, including the full
|
|
8
|
+
* prompt, session link, and resolved configuration.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const runItem = await client.agent.runs.retrieve('runId');
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
retrieve(runID: string, options?: RequestOptions): APIPromise<RunItem>;
|
|
16
|
+
/**
|
|
17
|
+
* Retrieve a paginated list of agent runs with optional filtering. Results are
|
|
18
|
+
* ordered by creation time (newest first).
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* const runs = await client.agent.runs.list();
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
list(query?: RunListParams | null | undefined, options?: RequestOptions): APIPromise<RunListResponse>;
|
|
26
|
+
}
|
|
27
|
+
export interface RunItem {
|
|
28
|
+
/**
|
|
29
|
+
* Timestamp when the run was created (RFC3339)
|
|
30
|
+
*/
|
|
31
|
+
created_at: string;
|
|
32
|
+
/**
|
|
33
|
+
* The prompt/instruction for the agent
|
|
34
|
+
*/
|
|
35
|
+
prompt: string;
|
|
36
|
+
/**
|
|
37
|
+
* Unique identifier for the run
|
|
38
|
+
*/
|
|
39
|
+
run_id: string;
|
|
40
|
+
/**
|
|
41
|
+
* Current state of the run:
|
|
42
|
+
*
|
|
43
|
+
* - QUEUED: Run is waiting to be picked up
|
|
44
|
+
* - PENDING: Run is being prepared
|
|
45
|
+
* - CLAIMED: Run has been claimed by a worker
|
|
46
|
+
* - INPROGRESS: Run is actively being executed
|
|
47
|
+
* - SUCCEEDED: Run completed successfully
|
|
48
|
+
* - FAILED: Run failed
|
|
49
|
+
*/
|
|
50
|
+
state: RunState;
|
|
51
|
+
/**
|
|
52
|
+
* @deprecated Use run_id instead.
|
|
53
|
+
*/
|
|
54
|
+
task_id: string;
|
|
55
|
+
/**
|
|
56
|
+
* Human-readable title for the run
|
|
57
|
+
*/
|
|
58
|
+
title: string;
|
|
59
|
+
/**
|
|
60
|
+
* Timestamp when the run was last updated (RFC3339)
|
|
61
|
+
*/
|
|
62
|
+
updated_at: string;
|
|
63
|
+
/**
|
|
64
|
+
* Configuration for an ambient agent run
|
|
65
|
+
*/
|
|
66
|
+
agent_config?: AgentAPI.AmbientAgentConfig;
|
|
67
|
+
/**
|
|
68
|
+
* UUID of the conversation associated with the run
|
|
69
|
+
*/
|
|
70
|
+
conversation_id?: string;
|
|
71
|
+
creator?: RunItem.Creator;
|
|
72
|
+
/**
|
|
73
|
+
* Whether the sandbox environment is currently running
|
|
74
|
+
*/
|
|
75
|
+
is_sandbox_running?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Resource usage information for the run
|
|
78
|
+
*/
|
|
79
|
+
request_usage?: RunItem.RequestUsage;
|
|
80
|
+
/**
|
|
81
|
+
* UUID of the shared session (if available)
|
|
82
|
+
*/
|
|
83
|
+
session_id?: string;
|
|
84
|
+
/**
|
|
85
|
+
* URL to view the agent session
|
|
86
|
+
*/
|
|
87
|
+
session_link?: string;
|
|
88
|
+
/**
|
|
89
|
+
* Source that created the run:
|
|
90
|
+
*
|
|
91
|
+
* - LINEAR: Created from Linear integration
|
|
92
|
+
* - API: Created via the Warp API
|
|
93
|
+
* - SLACK: Created from Slack integration
|
|
94
|
+
* - LOCAL: Created from local CLI/app
|
|
95
|
+
* - SCHEDULED_AGENT: Created by a scheduled agent
|
|
96
|
+
*/
|
|
97
|
+
source?: RunSourceType;
|
|
98
|
+
/**
|
|
99
|
+
* Timestamp when the agent started working on the run (RFC3339)
|
|
100
|
+
*/
|
|
101
|
+
started_at?: string | null;
|
|
102
|
+
status_message?: RunItem.StatusMessage;
|
|
103
|
+
}
|
|
104
|
+
export declare namespace RunItem {
|
|
105
|
+
interface Creator {
|
|
106
|
+
/**
|
|
107
|
+
* Display name of the creator
|
|
108
|
+
*/
|
|
109
|
+
display_name?: string;
|
|
110
|
+
/**
|
|
111
|
+
* URL to the creator's photo
|
|
112
|
+
*/
|
|
113
|
+
photo_url?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Type of the creator principal
|
|
116
|
+
*/
|
|
117
|
+
type?: 'user' | 'service_account';
|
|
118
|
+
/**
|
|
119
|
+
* Unique identifier of the creator
|
|
120
|
+
*/
|
|
121
|
+
uid?: string;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Resource usage information for the run
|
|
125
|
+
*/
|
|
126
|
+
interface RequestUsage {
|
|
127
|
+
/**
|
|
128
|
+
* Cost of compute resources for the run
|
|
129
|
+
*/
|
|
130
|
+
compute_cost?: number;
|
|
131
|
+
/**
|
|
132
|
+
* Cost of LLM inference for the run
|
|
133
|
+
*/
|
|
134
|
+
inference_cost?: number;
|
|
135
|
+
}
|
|
136
|
+
interface StatusMessage {
|
|
137
|
+
/**
|
|
138
|
+
* Human-readable status message
|
|
139
|
+
*/
|
|
140
|
+
message?: string;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Source that created the run:
|
|
145
|
+
*
|
|
146
|
+
* - LINEAR: Created from Linear integration
|
|
147
|
+
* - API: Created via the Warp API
|
|
148
|
+
* - SLACK: Created from Slack integration
|
|
149
|
+
* - LOCAL: Created from local CLI/app
|
|
150
|
+
* - SCHEDULED_AGENT: Created by a scheduled agent
|
|
151
|
+
*/
|
|
152
|
+
export type RunSourceType = 'LINEAR' | 'API' | 'SLACK' | 'LOCAL' | 'SCHEDULED_AGENT';
|
|
153
|
+
/**
|
|
154
|
+
* Current state of the run:
|
|
155
|
+
*
|
|
156
|
+
* - QUEUED: Run is waiting to be picked up
|
|
157
|
+
* - PENDING: Run is being prepared
|
|
158
|
+
* - CLAIMED: Run has been claimed by a worker
|
|
159
|
+
* - INPROGRESS: Run is actively being executed
|
|
160
|
+
* - SUCCEEDED: Run completed successfully
|
|
161
|
+
* - FAILED: Run failed
|
|
162
|
+
*/
|
|
163
|
+
export type RunState = 'QUEUED' | 'PENDING' | 'CLAIMED' | 'INPROGRESS' | 'SUCCEEDED' | 'FAILED';
|
|
164
|
+
export interface RunListResponse {
|
|
165
|
+
page_info: RunListResponse.PageInfo;
|
|
166
|
+
runs: Array<RunItem>;
|
|
167
|
+
}
|
|
168
|
+
export declare namespace RunListResponse {
|
|
169
|
+
interface PageInfo {
|
|
170
|
+
/**
|
|
171
|
+
* Whether there are more results available
|
|
172
|
+
*/
|
|
173
|
+
has_next_page: boolean;
|
|
174
|
+
/**
|
|
175
|
+
* Opaque cursor for fetching the next page
|
|
176
|
+
*/
|
|
177
|
+
next_cursor?: string;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
export interface RunListParams {
|
|
181
|
+
/**
|
|
182
|
+
* Filter by agent config name
|
|
183
|
+
*/
|
|
184
|
+
config_name?: string;
|
|
185
|
+
/**
|
|
186
|
+
* Filter runs created after this timestamp (RFC3339 format)
|
|
187
|
+
*/
|
|
188
|
+
created_after?: string;
|
|
189
|
+
/**
|
|
190
|
+
* Filter runs created before this timestamp (RFC3339 format)
|
|
191
|
+
*/
|
|
192
|
+
created_before?: string;
|
|
193
|
+
/**
|
|
194
|
+
* Filter by creator UID (user or service account)
|
|
195
|
+
*/
|
|
196
|
+
creator?: string;
|
|
197
|
+
/**
|
|
198
|
+
* Pagination cursor from previous response
|
|
199
|
+
*/
|
|
200
|
+
cursor?: string;
|
|
201
|
+
/**
|
|
202
|
+
* Maximum number of runs to return
|
|
203
|
+
*/
|
|
204
|
+
limit?: number;
|
|
205
|
+
/**
|
|
206
|
+
* Filter by model ID
|
|
207
|
+
*/
|
|
208
|
+
model_id?: string;
|
|
209
|
+
/**
|
|
210
|
+
* Filter by run source type
|
|
211
|
+
*/
|
|
212
|
+
source?: RunSourceType;
|
|
213
|
+
/**
|
|
214
|
+
* Filter by run state. Can be specified multiple times to match any of the given
|
|
215
|
+
* states.
|
|
216
|
+
*/
|
|
217
|
+
state?: Array<RunState>;
|
|
218
|
+
}
|
|
219
|
+
export declare namespace Runs {
|
|
220
|
+
export { type RunItem as RunItem, type RunSourceType as RunSourceType, type RunState as RunState, type RunListResponse as RunListResponse, type RunListParams as RunListParams, };
|
|
221
|
+
}
|
|
222
|
+
//# sourceMappingURL=runs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../../src/resources/agent/runs.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,QAAQ;OACb,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,IAAK,SAAQ,WAAW;IACnC;;;;;;;;OAQG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;IAItE;;;;;;;;OAQG;IACH,IAAI,CAAC,KAAK,GAAE,aAAa,GAAG,IAAI,GAAG,SAAc,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,eAAe,CAAC;CAG1G;AAED,MAAM,WAAW,OAAO;IACtB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;;;;;;;OASG;IACH,KAAK,EAAE,QAAQ,CAAC;IAEhB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,YAAY,CAAC,EAAE,QAAQ,CAAC,kBAAkB,CAAC;IAE3C;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,OAAO,CAAC,EAAE,OAAO,CAAC,OAA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BAAiB,eAAe,CAAC;IAC/B,UAAiB,QAAQ;QACvB;;WAEG;QACH,aAAa,EAAE,OAAO,CAAC;QAEvB;;WAEG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB;CACF;AAED,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,MAAM,CAAC,EAAE,aAAa,CAAC;IAEvB;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;CACzB;AAED,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,OAAO,EACL,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,QAAQ,IAAI,QAAQ,EACzB,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,aAAa,IAAI,aAAa,GACpC,CAAC;CACH"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Runs = void 0;
|
|
5
|
+
const resource_1 = require("../../core/resource.js");
|
|
6
|
+
const path_1 = require("../../internal/utils/path.js");
|
|
7
|
+
class Runs extends resource_1.APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Retrieve detailed information about a specific agent run, including the full
|
|
10
|
+
* prompt, session link, and resolved configuration.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const runItem = await client.agent.runs.retrieve('runId');
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
retrieve(runID, options) {
|
|
18
|
+
return this._client.get((0, path_1.path) `/agent/runs/${runID}`, options);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Retrieve a paginated list of agent runs with optional filtering. Results are
|
|
22
|
+
* ordered by creation time (newest first).
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const runs = await client.agent.runs.list();
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
list(query = {}, options) {
|
|
30
|
+
return this._client.get('/agent/runs', { query, ...options });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.Runs = Runs;
|
|
34
|
+
//# sourceMappingURL=runs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs.js","sourceRoot":"","sources":["../../src/resources/agent/runs.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAIlD,uDAAiD;AAEjD,MAAa,IAAK,SAAQ,sBAAW;IACnC;;;;;;;;OAQG;IACH,QAAQ,CAAC,KAAa,EAAE,OAAwB;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,eAAe,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/D,CAAC;IAED;;;;;;;;OAQG;IACH,IAAI,CAAC,QAA0C,EAAE,EAAE,OAAwB;QACzE,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChE,CAAC;CACF;AA1BD,oBA0BC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
+
import { path } from "../../internal/utils/path.mjs";
|
|
4
|
+
export class Runs extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Retrieve detailed information about a specific agent run, including the full
|
|
7
|
+
* prompt, session link, and resolved configuration.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const runItem = await client.agent.runs.retrieve('runId');
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
retrieve(runID, options) {
|
|
15
|
+
return this._client.get(path `/agent/runs/${runID}`, options);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Retrieve a paginated list of agent runs with optional filtering. Results are
|
|
19
|
+
* ordered by creation time (newest first).
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* const runs = await client.agent.runs.list();
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
list(query = {}, options) {
|
|
27
|
+
return this._client.get('/agent/runs', { query, ...options });
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=runs.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs.mjs","sourceRoot":"","sources":["../../src/resources/agent/runs.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAIf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,IAAK,SAAQ,WAAW;IACnC;;;;;;;;OAQG;IACH,QAAQ,CAAC,KAAa,EAAE,OAAwB;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,eAAe,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/D,CAAC;IAED;;;;;;;;OAQG;IACH,IAAI,CAAC,QAA0C,EAAE,EAAE,OAAwB;QACzE,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChE,CAAC;CACF"}
|
package/src/client.ts
CHANGED
|
@@ -213,7 +213,7 @@ export class WarpAPI {
|
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
protected stringifyQuery(query: Record<string, unknown>): string {
|
|
216
|
-
return qs.stringify(query, { arrayFormat: '
|
|
216
|
+
return qs.stringify(query, { arrayFormat: 'repeat' });
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
private getUserAgent(): string {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../core/resource';
|
|
4
|
-
import * as
|
|
5
|
-
import {
|
|
4
|
+
import * as RunsAPI from './runs';
|
|
5
|
+
import { RunItem, RunListParams, RunListResponse, RunSourceType, RunState, Runs } from './runs';
|
|
6
6
|
import { APIPromise } from '../../core/api-promise';
|
|
7
7
|
import { RequestOptions } from '../../internal/request-options';
|
|
8
8
|
|
|
9
9
|
export class Agent extends APIResource {
|
|
10
|
-
|
|
10
|
+
runs: RunsAPI.Runs = new RunsAPI.Runs(this._client);
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Spawn an ambient agent with a prompt and optional configuration. The agent will
|
|
14
|
-
* be queued for execution and assigned a unique
|
|
14
|
+
* be queued for execution and assigned a unique run ID.
|
|
15
15
|
*
|
|
16
16
|
* @example
|
|
17
17
|
* ```ts
|
|
@@ -26,7 +26,7 @@ export class Agent extends APIResource {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
|
-
* Configuration for an ambient agent
|
|
29
|
+
* Configuration for an ambient agent run
|
|
30
30
|
*/
|
|
31
31
|
export interface AmbientAgentConfig {
|
|
32
32
|
/**
|
|
@@ -35,7 +35,7 @@ export interface AmbientAgentConfig {
|
|
|
35
35
|
base_prompt?: string;
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
|
-
* UID of
|
|
38
|
+
* UID of the environment to run the agent in
|
|
39
39
|
*/
|
|
40
40
|
environment_id?: string;
|
|
41
41
|
|
|
@@ -45,7 +45,7 @@ export interface AmbientAgentConfig {
|
|
|
45
45
|
mcp_servers?: { [key: string]: AmbientAgentConfig.McpServers };
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
|
-
* LLM model to use (uses
|
|
48
|
+
* LLM model to use (uses team default if not specified)
|
|
49
49
|
*/
|
|
50
50
|
model_id?: string;
|
|
51
51
|
|
|
@@ -95,21 +95,21 @@ export namespace AmbientAgentConfig {
|
|
|
95
95
|
|
|
96
96
|
export interface AgentRunResponse {
|
|
97
97
|
/**
|
|
98
|
-
*
|
|
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
|
|
106
99
|
*/
|
|
107
|
-
|
|
100
|
+
run_id: string;
|
|
108
101
|
|
|
109
102
|
/**
|
|
110
|
-
*
|
|
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
|
|
111
111
|
*/
|
|
112
|
-
|
|
112
|
+
state: RunsAPI.RunState;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
export interface AgentRunParams {
|
|
@@ -119,17 +119,22 @@ export interface AgentRunParams {
|
|
|
119
119
|
prompt: string;
|
|
120
120
|
|
|
121
121
|
/**
|
|
122
|
-
* Configuration for an ambient agent
|
|
122
|
+
* Configuration for an ambient agent run
|
|
123
123
|
*/
|
|
124
124
|
config?: AmbientAgentConfig;
|
|
125
125
|
|
|
126
126
|
/**
|
|
127
|
-
*
|
|
127
|
+
* Make the run visible to all team members, not only the calling user
|
|
128
|
+
*/
|
|
129
|
+
team?: boolean;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Custom title for the run (auto-generated if not provided)
|
|
128
133
|
*/
|
|
129
134
|
title?: string;
|
|
130
135
|
}
|
|
131
136
|
|
|
132
|
-
Agent.
|
|
137
|
+
Agent.Runs = Runs;
|
|
133
138
|
|
|
134
139
|
export declare namespace Agent {
|
|
135
140
|
export {
|
|
@@ -139,11 +144,11 @@ export declare namespace Agent {
|
|
|
139
144
|
};
|
|
140
145
|
|
|
141
146
|
export {
|
|
142
|
-
|
|
143
|
-
type
|
|
144
|
-
type
|
|
145
|
-
type
|
|
146
|
-
type
|
|
147
|
-
type
|
|
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,
|
|
148
153
|
};
|
|
149
154
|
}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
export { Agent, type AmbientAgentConfig, type AgentRunResponse, type AgentRunParams } from './agent';
|
|
4
4
|
export {
|
|
5
|
-
|
|
6
|
-
type
|
|
7
|
-
type
|
|
8
|
-
type
|
|
9
|
-
type
|
|
10
|
-
type
|
|
11
|
-
} from './
|
|
5
|
+
Runs,
|
|
6
|
+
type RunItem,
|
|
7
|
+
type RunSourceType,
|
|
8
|
+
type RunState,
|
|
9
|
+
type RunListResponse,
|
|
10
|
+
type RunListParams,
|
|
11
|
+
} from './runs';
|