11// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22
33import { 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 ' ;
66import { APIPromise } from '../../core/api-promise' ;
77import { RequestOptions } from '../../internal/request-options' ;
88
99export 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 */
3131export 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
9696export 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
115115export 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
139139export 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}
0 commit comments