casedev 0.31.3 → 0.32.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 +16 -0
- package/package.json +1 -1
- package/resources/agent/agent.d.mts +4 -0
- package/resources/agent/agent.d.mts.map +1 -1
- package/resources/agent/agent.d.ts +4 -0
- package/resources/agent/agent.d.ts.map +1 -1
- package/resources/agent/agent.js +4 -0
- package/resources/agent/agent.js.map +1 -1
- package/resources/agent/agent.mjs +4 -0
- package/resources/agent/agent.mjs.map +1 -1
- package/resources/agent/index.d.mts +1 -0
- package/resources/agent/index.d.mts.map +1 -1
- package/resources/agent/index.d.ts +1 -0
- package/resources/agent/index.d.ts.map +1 -1
- package/resources/agent/index.js +3 -1
- package/resources/agent/index.js.map +1 -1
- package/resources/agent/index.mjs +1 -0
- package/resources/agent/index.mjs.map +1 -1
- package/resources/agent/v2/chat/chat.d.mts +165 -0
- package/resources/agent/v2/chat/chat.d.mts.map +1 -0
- package/resources/agent/v2/chat/chat.d.ts +165 -0
- package/resources/agent/v2/chat/chat.d.ts.map +1 -0
- package/resources/agent/v2/chat/chat.js +109 -0
- package/resources/agent/v2/chat/chat.js.map +1 -0
- package/resources/agent/v2/chat/chat.mjs +104 -0
- package/resources/agent/v2/chat/chat.mjs.map +1 -0
- package/resources/agent/v2/chat/files.d.mts +42 -0
- package/resources/agent/v2/chat/files.d.mts.map +1 -0
- package/resources/agent/v2/chat/files.d.ts +42 -0
- package/resources/agent/v2/chat/files.d.ts.map +1 -0
- package/resources/agent/v2/chat/files.js +33 -0
- package/resources/agent/v2/chat/files.js.map +1 -0
- package/resources/agent/v2/chat/files.mjs +29 -0
- package/resources/agent/v2/chat/files.mjs.map +1 -0
- package/resources/agent/v2/chat/index.d.mts +3 -0
- package/resources/agent/v2/chat/index.d.mts.map +1 -0
- package/resources/agent/v2/chat/index.d.ts +3 -0
- package/resources/agent/v2/chat/index.d.ts.map +1 -0
- package/resources/agent/v2/chat/index.js +9 -0
- package/resources/agent/v2/chat/index.js.map +1 -0
- package/resources/agent/v2/chat/index.mjs +4 -0
- package/resources/agent/v2/chat/index.mjs.map +1 -0
- package/resources/agent/v2/chat.d.mts +2 -0
- package/resources/agent/v2/chat.d.mts.map +1 -0
- package/resources/agent/v2/chat.d.ts +2 -0
- package/resources/agent/v2/chat.d.ts.map +1 -0
- package/resources/agent/v2/chat.js +6 -0
- package/resources/agent/v2/chat.js.map +1 -0
- package/resources/agent/v2/chat.mjs +3 -0
- package/resources/agent/v2/chat.mjs.map +1 -0
- package/resources/agent/v2/execute.d.mts +42 -0
- package/resources/agent/v2/execute.d.mts.map +1 -0
- package/resources/agent/v2/execute.d.ts +42 -0
- package/resources/agent/v2/execute.d.ts.map +1 -0
- package/resources/agent/v2/execute.js +19 -0
- package/resources/agent/v2/execute.js.map +1 -0
- package/resources/agent/v2/execute.mjs +15 -0
- package/resources/agent/v2/execute.mjs.map +1 -0
- package/resources/agent/v2/index.d.mts +5 -0
- package/resources/agent/v2/index.d.mts.map +1 -0
- package/resources/agent/v2/index.d.ts +5 -0
- package/resources/agent/v2/index.d.ts.map +1 -0
- package/resources/agent/v2/index.js +13 -0
- package/resources/agent/v2/index.js.map +1 -0
- package/resources/agent/v2/index.mjs +6 -0
- package/resources/agent/v2/index.mjs.map +1 -0
- package/resources/agent/v2/run.d.mts +73 -0
- package/resources/agent/v2/run.d.mts.map +1 -0
- package/resources/agent/v2/run.d.ts +73 -0
- package/resources/agent/v2/run.d.ts.map +1 -0
- package/resources/agent/v2/run.js +51 -0
- package/resources/agent/v2/run.js.map +1 -0
- package/resources/agent/v2/run.mjs +47 -0
- package/resources/agent/v2/run.mjs.map +1 -0
- package/resources/agent/v2/v2.d.mts +18 -0
- package/resources/agent/v2/v2.d.mts.map +1 -0
- package/resources/agent/v2/v2.d.ts +18 -0
- package/resources/agent/v2/v2.d.ts.map +1 -0
- package/resources/agent/v2/v2.js +25 -0
- package/resources/agent/v2/v2.js.map +1 -0
- package/resources/agent/v2/v2.mjs +20 -0
- package/resources/agent/v2/v2.mjs.map +1 -0
- package/resources/agent/v2.d.mts +2 -0
- package/resources/agent/v2.d.mts.map +1 -0
- package/resources/agent/v2.d.ts +2 -0
- package/resources/agent/v2.d.ts.map +1 -0
- package/resources/agent/v2.js +6 -0
- package/resources/agent/v2.js.map +1 -0
- package/resources/agent/v2.mjs +3 -0
- package/resources/agent/v2.mjs.map +1 -0
- package/resources/vault/objects.d.mts +4 -0
- package/resources/vault/objects.d.mts.map +1 -1
- package/resources/vault/objects.d.ts +4 -0
- package/resources/vault/objects.d.ts.map +1 -1
- package/src/resources/agent/agent.ts +6 -0
- package/src/resources/agent/index.ts +1 -0
- package/src/resources/agent/v2/chat/chat.ts +272 -0
- package/src/resources/agent/v2/chat/files.ts +63 -0
- package/src/resources/agent/v2/chat/index.ts +16 -0
- package/src/resources/agent/v2/chat.ts +3 -0
- package/src/resources/agent/v2/execute.ts +67 -0
- package/src/resources/agent/v2/index.ts +27 -0
- package/src/resources/agent/v2/run.ts +137 -0
- package/src/resources/agent/v2/v2.ts +73 -0
- package/src/resources/agent/v2.ts +3 -0
- package/src/resources/vault/objects.ts +5 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../../core/resource';
|
|
4
|
+
import * as FilesAPI from './files';
|
|
5
|
+
import { FileDownloadParams, FileListResponse, Files } from './files';
|
|
6
|
+
import { APIPromise } from '../../../../core/api-promise';
|
|
7
|
+
import { Stream } from '../../../../core/streaming';
|
|
8
|
+
import { buildHeaders } from '../../../../internal/headers';
|
|
9
|
+
import { RequestOptions } from '../../../../internal/request-options';
|
|
10
|
+
import { path } from '../../../../internal/utils/path';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Create, manage, and execute AI agents with tool access, sandbox environments, and async run workflows
|
|
14
|
+
*/
|
|
15
|
+
export class Chat extends APIResource {
|
|
16
|
+
files: FilesAPI.Files = new FilesAPI.Files(this._client);
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Creates a persistent OpenCode chat session backed by a Daytona runtime. Session
|
|
20
|
+
* state is retained and can be resumed or recovered across requests.
|
|
21
|
+
*/
|
|
22
|
+
create(
|
|
23
|
+
body: ChatCreateParams | null | undefined = {},
|
|
24
|
+
options?: RequestOptions,
|
|
25
|
+
): APIPromise<ChatCreateResponse> {
|
|
26
|
+
return this._client.post('/agent/v2/chat', { body, ...options });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Terminates the active Daytona runtime (if any), then marks the chat as ended.
|
|
31
|
+
*/
|
|
32
|
+
delete(id: string, options?: RequestOptions): APIPromise<ChatDeleteResponse> {
|
|
33
|
+
return this._client.delete(path`/agent/v2/chat/${id}`, options);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Aborts the active OpenCode generation for this Daytona-backed chat session.
|
|
38
|
+
*/
|
|
39
|
+
cancel(id: string, options?: RequestOptions): APIPromise<ChatCancelResponse> {
|
|
40
|
+
return this._client.post(path`/agent/v2/chat/${id}/cancel`, options);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Answers a pending OpenCode question for the Daytona-backed chat session and
|
|
45
|
+
* resumes or recovers the runtime if needed.
|
|
46
|
+
*/
|
|
47
|
+
replyToQuestion(
|
|
48
|
+
requestID: string,
|
|
49
|
+
params: ChatReplyToQuestionParams,
|
|
50
|
+
options?: RequestOptions,
|
|
51
|
+
): APIPromise<void> {
|
|
52
|
+
const { id, ...body } = params;
|
|
53
|
+
return this._client.post(path`/agent/v2/chat/${id}/question/${requestID}/reply`, {
|
|
54
|
+
body,
|
|
55
|
+
...options,
|
|
56
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Streams a single assistant turn from a Daytona-backed chat runtime as normalized
|
|
62
|
+
* SSE events with stable turn, message, and part IDs. Emits events:
|
|
63
|
+
* `turn.started`, `turn.status`, `message.created`, `message.part.updated`,
|
|
64
|
+
* `message.completed`, `session.usage`, `turn.completed`.
|
|
65
|
+
*
|
|
66
|
+
* **When to use this endpoint:** Recommended for building custom chat UIs that
|
|
67
|
+
* need real-time streaming progress. This is the primary streaming endpoint for
|
|
68
|
+
* new integrations.
|
|
69
|
+
*
|
|
70
|
+
* **Alternatives:**
|
|
71
|
+
*
|
|
72
|
+
* - `POST /chat/:id/message` — synchronous, returns complete response as JSON
|
|
73
|
+
* (best for server-to-server)
|
|
74
|
+
*/
|
|
75
|
+
respond(
|
|
76
|
+
id: string,
|
|
77
|
+
body: ChatRespondParams,
|
|
78
|
+
options?: RequestOptions,
|
|
79
|
+
): APIPromise<Stream<ChatRespondResponse>> {
|
|
80
|
+
return this._client.post(path`/agent/v2/chat/${id}/respond`, {
|
|
81
|
+
body,
|
|
82
|
+
...options,
|
|
83
|
+
headers: buildHeaders([{ Accept: 'text/event-stream' }, options?.headers]),
|
|
84
|
+
stream: true,
|
|
85
|
+
}) as APIPromise<Stream<ChatRespondResponse>>;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Sends a message to a Daytona-backed chat runtime and returns the complete
|
|
90
|
+
* response as a single JSON body. Blocks until the assistant turn completes.
|
|
91
|
+
*
|
|
92
|
+
* **When to use this endpoint:** Best for server-to-server integrations,
|
|
93
|
+
* background processing, or any context where you want the full response in one
|
|
94
|
+
* call without managing an SSE stream.
|
|
95
|
+
*
|
|
96
|
+
* **Alternatives:**
|
|
97
|
+
*
|
|
98
|
+
* - `POST /chat/:id/respond` — streaming SSE with normalized events (recommended
|
|
99
|
+
* for custom chat UIs)
|
|
100
|
+
*/
|
|
101
|
+
sendMessage(id: string, body: ChatSendMessageParams, options?: RequestOptions): APIPromise<void> {
|
|
102
|
+
return this._client.post(path`/agent/v2/chat/${id}/message`, {
|
|
103
|
+
body,
|
|
104
|
+
...options,
|
|
105
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Relays OpenCode SSE events for this Daytona-backed chat runtime. Supports replay
|
|
111
|
+
* from buffered events using Last-Event-ID and transparently reconnects stopped or
|
|
112
|
+
* archived runtimes.
|
|
113
|
+
*/
|
|
114
|
+
stream(
|
|
115
|
+
id: string,
|
|
116
|
+
query: ChatStreamParams | undefined = {},
|
|
117
|
+
options?: RequestOptions,
|
|
118
|
+
): APIPromise<Stream<ChatStreamResponse>> {
|
|
119
|
+
return this._client.get(path`/agent/v2/chat/${id}/stream`, {
|
|
120
|
+
query,
|
|
121
|
+
...options,
|
|
122
|
+
headers: buildHeaders([{ Accept: 'text/event-stream' }, options?.headers]),
|
|
123
|
+
stream: true,
|
|
124
|
+
}) as APIPromise<Stream<ChatStreamResponse>>;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export interface ChatCreateResponse {
|
|
129
|
+
id?: string;
|
|
130
|
+
|
|
131
|
+
createdAt?: string;
|
|
132
|
+
|
|
133
|
+
idleTimeoutMs?: number;
|
|
134
|
+
|
|
135
|
+
provider?: 'daytona';
|
|
136
|
+
|
|
137
|
+
runtimeState?: string;
|
|
138
|
+
|
|
139
|
+
status?: string;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export interface ChatDeleteResponse {
|
|
143
|
+
id?: string;
|
|
144
|
+
|
|
145
|
+
cost?: number;
|
|
146
|
+
|
|
147
|
+
provider?: string | null;
|
|
148
|
+
|
|
149
|
+
runtimeId?: string | null;
|
|
150
|
+
|
|
151
|
+
runtimeMs?: number;
|
|
152
|
+
|
|
153
|
+
status?: string;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export interface ChatCancelResponse {
|
|
157
|
+
id?: string;
|
|
158
|
+
|
|
159
|
+
ok?: boolean;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export type ChatRespondResponse = string;
|
|
163
|
+
|
|
164
|
+
export type ChatStreamResponse = string;
|
|
165
|
+
|
|
166
|
+
export interface ChatCreateParams {
|
|
167
|
+
/**
|
|
168
|
+
* Idle timeout before the runtime is eligible to stop. Defaults to 15 minutes.
|
|
169
|
+
*/
|
|
170
|
+
idleTimeoutMs?: number | null;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Optional model override for the OpenCode session
|
|
174
|
+
*/
|
|
175
|
+
model?: string | null;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Optional human-readable session title
|
|
179
|
+
*/
|
|
180
|
+
title?: string;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Restrict the chat session to specific vault IDs
|
|
184
|
+
*/
|
|
185
|
+
vaultIds?: Array<string> | null;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export interface ChatReplyToQuestionParams {
|
|
189
|
+
/**
|
|
190
|
+
* Path param: Chat session ID
|
|
191
|
+
*/
|
|
192
|
+
id: string;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Body param: Answer selections for each prompt element in the pending question
|
|
196
|
+
*/
|
|
197
|
+
answers: Array<Array<string>>;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export interface ChatRespondParams {
|
|
201
|
+
/**
|
|
202
|
+
* Message content parts. Currently only "text" type is supported. Additional types
|
|
203
|
+
* (e.g. file, image) may be added in future versions.
|
|
204
|
+
*/
|
|
205
|
+
parts?: Array<ChatRespondParams.Part>;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export namespace ChatRespondParams {
|
|
209
|
+
export interface Part {
|
|
210
|
+
/**
|
|
211
|
+
* The message text content
|
|
212
|
+
*/
|
|
213
|
+
text: string;
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Part type. Currently only "text" is supported.
|
|
217
|
+
*/
|
|
218
|
+
type: 'text';
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export interface ChatSendMessageParams {
|
|
223
|
+
/**
|
|
224
|
+
* Message content parts. Currently only "text" type is supported. Additional types
|
|
225
|
+
* (e.g. file, image) may be added in future versions.
|
|
226
|
+
*/
|
|
227
|
+
parts?: Array<ChatSendMessageParams.Part>;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export namespace ChatSendMessageParams {
|
|
231
|
+
export interface Part {
|
|
232
|
+
/**
|
|
233
|
+
* The message text content
|
|
234
|
+
*/
|
|
235
|
+
text: string;
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Part type. Currently only "text" is supported.
|
|
239
|
+
*/
|
|
240
|
+
type: 'text';
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export interface ChatStreamParams {
|
|
245
|
+
/**
|
|
246
|
+
* Replay events after this sequence number
|
|
247
|
+
*/
|
|
248
|
+
lastEventId?: number;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
Chat.Files = Files;
|
|
252
|
+
|
|
253
|
+
export declare namespace Chat {
|
|
254
|
+
export {
|
|
255
|
+
type ChatCreateResponse as ChatCreateResponse,
|
|
256
|
+
type ChatDeleteResponse as ChatDeleteResponse,
|
|
257
|
+
type ChatCancelResponse as ChatCancelResponse,
|
|
258
|
+
type ChatRespondResponse as ChatRespondResponse,
|
|
259
|
+
type ChatStreamResponse as ChatStreamResponse,
|
|
260
|
+
type ChatCreateParams as ChatCreateParams,
|
|
261
|
+
type ChatReplyToQuestionParams as ChatReplyToQuestionParams,
|
|
262
|
+
type ChatRespondParams as ChatRespondParams,
|
|
263
|
+
type ChatSendMessageParams as ChatSendMessageParams,
|
|
264
|
+
type ChatStreamParams as ChatStreamParams,
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
export {
|
|
268
|
+
Files as Files,
|
|
269
|
+
type FileListResponse as FileListResponse,
|
|
270
|
+
type FileDownloadParams as FileDownloadParams,
|
|
271
|
+
};
|
|
272
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../../../core/api-promise';
|
|
5
|
+
import { buildHeaders } from '../../../../internal/headers';
|
|
6
|
+
import { RequestOptions } from '../../../../internal/request-options';
|
|
7
|
+
import { path } from '../../../../internal/utils/path';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Create, manage, and execute AI agents with tool access, sandbox environments, and async run workflows
|
|
11
|
+
*/
|
|
12
|
+
export class Files extends APIResource {
|
|
13
|
+
/**
|
|
14
|
+
* Lists files created by the agent in the Daytona runtime workspace. Stopped or
|
|
15
|
+
* archived runtimes are transparently resumed or recovered.
|
|
16
|
+
*/
|
|
17
|
+
list(id: string, options?: RequestOptions): APIPromise<FileListResponse> {
|
|
18
|
+
return this._client.get(path`/agent/v2/chat/${id}/files`, options);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Downloads a file from the Daytona runtime workspace by path. Stopped or archived
|
|
23
|
+
* runtimes are transparently resumed or recovered.
|
|
24
|
+
*/
|
|
25
|
+
download(filePath: string, params: FileDownloadParams, options?: RequestOptions): APIPromise<Response> {
|
|
26
|
+
const { id } = params;
|
|
27
|
+
return this._client.get(path`/agent/v2/chat/${id}/files/${filePath}`, {
|
|
28
|
+
...options,
|
|
29
|
+
headers: buildHeaders([{ Accept: 'application/octet-stream' }, options?.headers]),
|
|
30
|
+
__binaryResponse: true,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface FileListResponse {
|
|
36
|
+
chatId?: string;
|
|
37
|
+
|
|
38
|
+
files?: Array<FileListResponse.File>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export namespace FileListResponse {
|
|
42
|
+
export interface File {
|
|
43
|
+
name?: string;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Relative path from /workspace
|
|
47
|
+
*/
|
|
48
|
+
path?: string;
|
|
49
|
+
|
|
50
|
+
sizeBytes?: number;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface FileDownloadParams {
|
|
55
|
+
/**
|
|
56
|
+
* Chat session ID
|
|
57
|
+
*/
|
|
58
|
+
id: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export declare namespace Files {
|
|
62
|
+
export { type FileListResponse as FileListResponse, type FileDownloadParams as FileDownloadParams };
|
|
63
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
Chat,
|
|
5
|
+
type ChatCreateResponse,
|
|
6
|
+
type ChatDeleteResponse,
|
|
7
|
+
type ChatCancelResponse,
|
|
8
|
+
type ChatRespondResponse,
|
|
9
|
+
type ChatStreamResponse,
|
|
10
|
+
type ChatCreateParams,
|
|
11
|
+
type ChatReplyToQuestionParams,
|
|
12
|
+
type ChatRespondParams,
|
|
13
|
+
type ChatSendMessageParams,
|
|
14
|
+
type ChatStreamParams,
|
|
15
|
+
} from './chat';
|
|
16
|
+
export { Files, type FileListResponse, type FileDownloadParams } from './files';
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Create, manage, and execute AI agents with tool access, sandbox environments, and async run workflows
|
|
9
|
+
*/
|
|
10
|
+
export class Execute extends APIResource {
|
|
11
|
+
/**
|
|
12
|
+
* Creates an ephemeral agent and immediately executes a v2 run on the Daytona
|
|
13
|
+
* runtime.
|
|
14
|
+
*/
|
|
15
|
+
create(body: ExecuteCreateParams, options?: RequestOptions): APIPromise<ExecuteCreateResponse> {
|
|
16
|
+
return this._client.post('/agent/v2/execute', { body, ...options });
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface ExecuteCreateResponse {
|
|
21
|
+
agentId?: string;
|
|
22
|
+
|
|
23
|
+
message?: string;
|
|
24
|
+
|
|
25
|
+
provider?: 'daytona';
|
|
26
|
+
|
|
27
|
+
runId?: string;
|
|
28
|
+
|
|
29
|
+
runtimeState?: 'running';
|
|
30
|
+
|
|
31
|
+
status?: 'running';
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface ExecuteCreateParams {
|
|
35
|
+
prompt: string;
|
|
36
|
+
|
|
37
|
+
disabledTools?: Array<string> | null;
|
|
38
|
+
|
|
39
|
+
enabledTools?: Array<string> | null;
|
|
40
|
+
|
|
41
|
+
guidance?: string | null;
|
|
42
|
+
|
|
43
|
+
instructions?: string;
|
|
44
|
+
|
|
45
|
+
model?: string;
|
|
46
|
+
|
|
47
|
+
objectIds?: Array<string> | null;
|
|
48
|
+
|
|
49
|
+
sandbox?: ExecuteCreateParams.Sandbox | null;
|
|
50
|
+
|
|
51
|
+
vaultIds?: Array<string> | null;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export namespace ExecuteCreateParams {
|
|
55
|
+
export interface Sandbox {
|
|
56
|
+
cpu?: number;
|
|
57
|
+
|
|
58
|
+
memoryMiB?: number;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export declare namespace Execute {
|
|
63
|
+
export {
|
|
64
|
+
type ExecuteCreateResponse as ExecuteCreateResponse,
|
|
65
|
+
type ExecuteCreateParams as ExecuteCreateParams,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
Chat,
|
|
5
|
+
type ChatCreateResponse,
|
|
6
|
+
type ChatDeleteResponse,
|
|
7
|
+
type ChatCancelResponse,
|
|
8
|
+
type ChatRespondResponse,
|
|
9
|
+
type ChatStreamResponse,
|
|
10
|
+
type ChatCreateParams,
|
|
11
|
+
type ChatReplyToQuestionParams,
|
|
12
|
+
type ChatRespondParams,
|
|
13
|
+
type ChatSendMessageParams,
|
|
14
|
+
type ChatStreamParams,
|
|
15
|
+
} from './chat/index';
|
|
16
|
+
export { Execute, type ExecuteCreateResponse, type ExecuteCreateParams } from './execute';
|
|
17
|
+
export {
|
|
18
|
+
Run,
|
|
19
|
+
type RunCreateResponse,
|
|
20
|
+
type RunEventsResponse,
|
|
21
|
+
type RunExecResponse,
|
|
22
|
+
type RunGetDetailsResponse,
|
|
23
|
+
type RunGetStatusResponse,
|
|
24
|
+
type RunCreateParams,
|
|
25
|
+
type RunEventsParams,
|
|
26
|
+
} from './run';
|
|
27
|
+
export { V2 } from './v2';
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
5
|
+
import { Stream } from '../../../core/streaming';
|
|
6
|
+
import { buildHeaders } from '../../../internal/headers';
|
|
7
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
8
|
+
import { path } from '../../../internal/utils/path';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Create, manage, and execute AI agents with tool access, sandbox environments, and async run workflows
|
|
12
|
+
*/
|
|
13
|
+
export class Run extends APIResource {
|
|
14
|
+
/**
|
|
15
|
+
* Creates a v2 run in queued state. Call POST /agent/v2/run/:id/exec to start
|
|
16
|
+
* execution on the Daytona runtime.
|
|
17
|
+
*/
|
|
18
|
+
create(body: RunCreateParams, options?: RequestOptions): APIPromise<RunCreateResponse> {
|
|
19
|
+
return this._client.post('/agent/v2/run', { body, ...options });
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Streams real-time v2 run events over SSE with replay support.
|
|
24
|
+
*/
|
|
25
|
+
events(
|
|
26
|
+
id: string,
|
|
27
|
+
query: RunEventsParams | undefined = {},
|
|
28
|
+
options?: RequestOptions,
|
|
29
|
+
): APIPromise<Stream<RunEventsResponse>> {
|
|
30
|
+
return this._client.get(path`/agent/v2/run/${id}/events`, {
|
|
31
|
+
query,
|
|
32
|
+
...options,
|
|
33
|
+
headers: buildHeaders([{ Accept: 'text/event-stream' }, options?.headers]),
|
|
34
|
+
stream: true,
|
|
35
|
+
}) as APIPromise<Stream<RunEventsResponse>>;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Starts execution of a queued v2 run. The agent runs in a durable workflow on a
|
|
40
|
+
* Daytona runtime.
|
|
41
|
+
*/
|
|
42
|
+
exec(id: string, options?: RequestOptions): APIPromise<RunExecResponse> {
|
|
43
|
+
return this._client.post(path`/agent/v2/run/${id}/exec`, options);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Full audit trail for a v2 run, with provider-neutral runtime metadata.
|
|
48
|
+
*/
|
|
49
|
+
getDetails(id: string, options?: RequestOptions): APIPromise<unknown> {
|
|
50
|
+
return this._client.get(path`/agent/v2/run/${id}/details`, options);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Lightweight status poll for a v2 run including neutral runtime metadata.
|
|
55
|
+
*/
|
|
56
|
+
getStatus(id: string, options?: RequestOptions): APIPromise<RunGetStatusResponse> {
|
|
57
|
+
return this._client.get(path`/agent/v2/run/${id}/status`, options);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface RunCreateResponse {
|
|
62
|
+
id?: string;
|
|
63
|
+
|
|
64
|
+
agentId?: string;
|
|
65
|
+
|
|
66
|
+
createdAt?: string;
|
|
67
|
+
|
|
68
|
+
objectIds?: Array<string> | null;
|
|
69
|
+
|
|
70
|
+
status?: 'queued';
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export type RunEventsResponse = string;
|
|
74
|
+
|
|
75
|
+
export interface RunExecResponse {
|
|
76
|
+
id?: string;
|
|
77
|
+
|
|
78
|
+
message?: string;
|
|
79
|
+
|
|
80
|
+
provider?: 'daytona';
|
|
81
|
+
|
|
82
|
+
runtimeState?: 'running';
|
|
83
|
+
|
|
84
|
+
status?: 'running';
|
|
85
|
+
|
|
86
|
+
workflowId?: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export type RunGetDetailsResponse = unknown;
|
|
90
|
+
|
|
91
|
+
export interface RunGetStatusResponse {
|
|
92
|
+
id?: string;
|
|
93
|
+
|
|
94
|
+
completedAt?: string | null;
|
|
95
|
+
|
|
96
|
+
durationMs?: number | null;
|
|
97
|
+
|
|
98
|
+
provider?: string | null;
|
|
99
|
+
|
|
100
|
+
runtimeId?: string | null;
|
|
101
|
+
|
|
102
|
+
runtimeState?: string | null;
|
|
103
|
+
|
|
104
|
+
startedAt?: string | null;
|
|
105
|
+
|
|
106
|
+
status?: 'queued' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export interface RunCreateParams {
|
|
110
|
+
agentId: string;
|
|
111
|
+
|
|
112
|
+
prompt: string;
|
|
113
|
+
|
|
114
|
+
callbackUrl?: string | null;
|
|
115
|
+
|
|
116
|
+
guidance?: string | null;
|
|
117
|
+
|
|
118
|
+
model?: string | null;
|
|
119
|
+
|
|
120
|
+
objectIds?: Array<string> | null;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export interface RunEventsParams {
|
|
124
|
+
lastEventId?: number;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export declare namespace Run {
|
|
128
|
+
export {
|
|
129
|
+
type RunCreateResponse as RunCreateResponse,
|
|
130
|
+
type RunEventsResponse as RunEventsResponse,
|
|
131
|
+
type RunExecResponse as RunExecResponse,
|
|
132
|
+
type RunGetDetailsResponse as RunGetDetailsResponse,
|
|
133
|
+
type RunGetStatusResponse as RunGetStatusResponse,
|
|
134
|
+
type RunCreateParams as RunCreateParams,
|
|
135
|
+
type RunEventsParams as RunEventsParams,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import * as ExecuteAPI from './execute';
|
|
5
|
+
import { Execute, ExecuteCreateParams, ExecuteCreateResponse } from './execute';
|
|
6
|
+
import * as RunAPI from './run';
|
|
7
|
+
import {
|
|
8
|
+
Run,
|
|
9
|
+
RunCreateParams,
|
|
10
|
+
RunCreateResponse,
|
|
11
|
+
RunEventsParams,
|
|
12
|
+
RunEventsResponse,
|
|
13
|
+
RunExecResponse,
|
|
14
|
+
RunGetDetailsResponse,
|
|
15
|
+
RunGetStatusResponse,
|
|
16
|
+
} from './run';
|
|
17
|
+
import * as ChatAPI from './chat/chat';
|
|
18
|
+
import {
|
|
19
|
+
Chat,
|
|
20
|
+
ChatCancelResponse,
|
|
21
|
+
ChatCreateParams,
|
|
22
|
+
ChatCreateResponse,
|
|
23
|
+
ChatDeleteResponse,
|
|
24
|
+
ChatReplyToQuestionParams,
|
|
25
|
+
ChatRespondParams,
|
|
26
|
+
ChatRespondResponse,
|
|
27
|
+
ChatSendMessageParams,
|
|
28
|
+
ChatStreamParams,
|
|
29
|
+
ChatStreamResponse,
|
|
30
|
+
} from './chat/chat';
|
|
31
|
+
|
|
32
|
+
export class V2 extends APIResource {
|
|
33
|
+
run: RunAPI.Run = new RunAPI.Run(this._client);
|
|
34
|
+
execute: ExecuteAPI.Execute = new ExecuteAPI.Execute(this._client);
|
|
35
|
+
chat: ChatAPI.Chat = new ChatAPI.Chat(this._client);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
V2.Run = Run;
|
|
39
|
+
V2.Execute = Execute;
|
|
40
|
+
V2.Chat = Chat;
|
|
41
|
+
|
|
42
|
+
export declare namespace V2 {
|
|
43
|
+
export {
|
|
44
|
+
Run as Run,
|
|
45
|
+
type RunCreateResponse as RunCreateResponse,
|
|
46
|
+
type RunEventsResponse as RunEventsResponse,
|
|
47
|
+
type RunExecResponse as RunExecResponse,
|
|
48
|
+
type RunGetDetailsResponse as RunGetDetailsResponse,
|
|
49
|
+
type RunGetStatusResponse as RunGetStatusResponse,
|
|
50
|
+
type RunCreateParams as RunCreateParams,
|
|
51
|
+
type RunEventsParams as RunEventsParams,
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export {
|
|
55
|
+
Execute as Execute,
|
|
56
|
+
type ExecuteCreateResponse as ExecuteCreateResponse,
|
|
57
|
+
type ExecuteCreateParams as ExecuteCreateParams,
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export {
|
|
61
|
+
Chat as Chat,
|
|
62
|
+
type ChatCreateResponse as ChatCreateResponse,
|
|
63
|
+
type ChatDeleteResponse as ChatDeleteResponse,
|
|
64
|
+
type ChatCancelResponse as ChatCancelResponse,
|
|
65
|
+
type ChatRespondResponse as ChatRespondResponse,
|
|
66
|
+
type ChatStreamResponse as ChatStreamResponse,
|
|
67
|
+
type ChatCreateParams as ChatCreateParams,
|
|
68
|
+
type ChatReplyToQuestionParams as ChatReplyToQuestionParams,
|
|
69
|
+
type ChatRespondParams as ChatRespondParams,
|
|
70
|
+
type ChatSendMessageParams as ChatSendMessageParams,
|
|
71
|
+
type ChatStreamParams as ChatStreamParams,
|
|
72
|
+
};
|
|
73
|
+
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.32.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.32.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.32.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|