@inferencesh/sdk 0.1.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 +34 -0
- package/LICENSE +22 -0
- package/README.md +216 -0
- package/dist/client.d.ts +77 -0
- package/dist/client.js +249 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +23 -0
- package/dist/index.mjs +1 -0
- package/dist/stream.d.ts +29 -0
- package/dist/stream.js +120 -0
- package/dist/types.d.ts +3019 -0
- package/dist/types.js +257 -0
- package/package.json +77 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,3019 @@
|
|
|
1
|
+
export interface ACL {
|
|
2
|
+
id: string;
|
|
3
|
+
created_at: string;
|
|
4
|
+
updated_at: string;
|
|
5
|
+
deleted_at?: string;
|
|
6
|
+
resource_id: string;
|
|
7
|
+
owner_id: string;
|
|
8
|
+
group_id?: string;
|
|
9
|
+
owner_read: boolean;
|
|
10
|
+
owner_write: boolean;
|
|
11
|
+
owner_exec: boolean;
|
|
12
|
+
group_read: boolean;
|
|
13
|
+
group_write: boolean;
|
|
14
|
+
group_exec: boolean;
|
|
15
|
+
other_read: boolean;
|
|
16
|
+
other_write: boolean;
|
|
17
|
+
other_exec: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Agent represents a configurable AI agent in the system
|
|
21
|
+
*/
|
|
22
|
+
export interface AgentApp {
|
|
23
|
+
id: string;
|
|
24
|
+
version_id: string;
|
|
25
|
+
variant: string;
|
|
26
|
+
app?: App;
|
|
27
|
+
description: string;
|
|
28
|
+
}
|
|
29
|
+
export interface AgentAppDTO {
|
|
30
|
+
id: string;
|
|
31
|
+
version_id: string;
|
|
32
|
+
variant: string;
|
|
33
|
+
app?: AppDTO;
|
|
34
|
+
description: string;
|
|
35
|
+
}
|
|
36
|
+
export interface SubAgent {
|
|
37
|
+
id: string;
|
|
38
|
+
version_id: string;
|
|
39
|
+
agent?: Agent;
|
|
40
|
+
description: string;
|
|
41
|
+
}
|
|
42
|
+
export interface SubAgentDTO {
|
|
43
|
+
id: string;
|
|
44
|
+
version_id: string;
|
|
45
|
+
agent?: AgentDTO;
|
|
46
|
+
description: string;
|
|
47
|
+
}
|
|
48
|
+
export interface Agent {
|
|
49
|
+
BaseModel: BaseModel;
|
|
50
|
+
PermissionModel: PermissionModel;
|
|
51
|
+
/**
|
|
52
|
+
* Basic info
|
|
53
|
+
*/
|
|
54
|
+
name: string;
|
|
55
|
+
project_id?: string;
|
|
56
|
+
project?: Project;
|
|
57
|
+
version_id: string;
|
|
58
|
+
version?: AgentVersion;
|
|
59
|
+
is_active: boolean;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* AgentDTO for API responses
|
|
63
|
+
*/
|
|
64
|
+
export interface AgentDTO {
|
|
65
|
+
id: string;
|
|
66
|
+
created_at: string;
|
|
67
|
+
updated_at: string;
|
|
68
|
+
deleted_at?: string;
|
|
69
|
+
user_id: string;
|
|
70
|
+
user?: UserRelationDTO;
|
|
71
|
+
acl?: ACL;
|
|
72
|
+
name: string;
|
|
73
|
+
project_id?: string;
|
|
74
|
+
project?: ProjectDTO;
|
|
75
|
+
version_id: string;
|
|
76
|
+
version?: AgentVersionDTO;
|
|
77
|
+
is_active: boolean;
|
|
78
|
+
}
|
|
79
|
+
export interface AgentVersion {
|
|
80
|
+
BaseModel: BaseModel;
|
|
81
|
+
PermissionModel: PermissionModel;
|
|
82
|
+
description: string;
|
|
83
|
+
system_prompt: string;
|
|
84
|
+
prompt_template: string;
|
|
85
|
+
example_prompts: string[];
|
|
86
|
+
core_app?: AgentApp;
|
|
87
|
+
core_app_input?: any;
|
|
88
|
+
sub_agents: (SubAgent | undefined)[];
|
|
89
|
+
tool_apps: (AgentApp | undefined)[];
|
|
90
|
+
}
|
|
91
|
+
export interface AgentVersionDTO {
|
|
92
|
+
id: string;
|
|
93
|
+
created_at: string;
|
|
94
|
+
updated_at: string;
|
|
95
|
+
deleted_at?: string;
|
|
96
|
+
user_id: string;
|
|
97
|
+
user?: UserRelationDTO;
|
|
98
|
+
acl?: ACL;
|
|
99
|
+
description: string;
|
|
100
|
+
system_prompt: string;
|
|
101
|
+
prompt_template: string;
|
|
102
|
+
example_prompts: string[];
|
|
103
|
+
core_app?: AgentApp;
|
|
104
|
+
core_app_input?: any;
|
|
105
|
+
sub_agents: (SubAgentDTO | undefined)[];
|
|
106
|
+
tool_apps: (AgentAppDTO | undefined)[];
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* TimeWindow represents a single analytics time window
|
|
110
|
+
*/
|
|
111
|
+
export interface TimeWindow {
|
|
112
|
+
start: string;
|
|
113
|
+
end: string;
|
|
114
|
+
count: number;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* TaskStatusWindow represents a single analytics time window with task status
|
|
118
|
+
*/
|
|
119
|
+
export interface TaskStatusWindow {
|
|
120
|
+
start: string;
|
|
121
|
+
status: TaskStatus;
|
|
122
|
+
count: number;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* AppUsage represents usage statistics for an app
|
|
126
|
+
*/
|
|
127
|
+
export interface AppUsage {
|
|
128
|
+
app_id: string;
|
|
129
|
+
app_username: string;
|
|
130
|
+
app_name: string;
|
|
131
|
+
version_id: string;
|
|
132
|
+
variant: string;
|
|
133
|
+
task_count: number;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* TimeSeriesMetrics contains all time-series data
|
|
137
|
+
*/
|
|
138
|
+
export interface TimeSeriesMetrics {
|
|
139
|
+
active_users: TimeWindow[];
|
|
140
|
+
new_users: TimeWindow[];
|
|
141
|
+
tasks_by_status: TaskStatusWindow[];
|
|
142
|
+
new_engines: TimeWindow[];
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* TotalMetrics contains total counts for the time window
|
|
146
|
+
*/
|
|
147
|
+
export interface TotalMetrics {
|
|
148
|
+
active_users: number;
|
|
149
|
+
new_users: number;
|
|
150
|
+
tasks: number;
|
|
151
|
+
new_engines: number;
|
|
152
|
+
/**
|
|
153
|
+
* Total running engines
|
|
154
|
+
*/
|
|
155
|
+
running_engines: number;
|
|
156
|
+
/**
|
|
157
|
+
* Private running engines (acl_other_exec = false or null)
|
|
158
|
+
*/
|
|
159
|
+
private_running_engines: number;
|
|
160
|
+
/**
|
|
161
|
+
* Cloud running engines (acl_other_exec = true)
|
|
162
|
+
*/
|
|
163
|
+
cloud_running_engines: number;
|
|
164
|
+
top_apps: AppUsage[];
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* RealtimeMetrics contains current system state
|
|
168
|
+
*/
|
|
169
|
+
export interface RealtimeMetrics {
|
|
170
|
+
/**
|
|
171
|
+
* Total tasks
|
|
172
|
+
*/
|
|
173
|
+
queued_tasks: number;
|
|
174
|
+
running_tasks: number;
|
|
175
|
+
/**
|
|
176
|
+
* Private tasks (engines with acl_other_exec = false or null)
|
|
177
|
+
*/
|
|
178
|
+
private_queued_tasks: number;
|
|
179
|
+
private_running_tasks: number;
|
|
180
|
+
/**
|
|
181
|
+
* Cloud tasks (engines with acl_other_exec = true)
|
|
182
|
+
*/
|
|
183
|
+
cloud_queued_tasks: number;
|
|
184
|
+
cloud_running_tasks: number;
|
|
185
|
+
/**
|
|
186
|
+
* User metrics
|
|
187
|
+
*/
|
|
188
|
+
total_users: number;
|
|
189
|
+
users_with_no_engines: number;
|
|
190
|
+
users_with_no_tasks: number;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* AnalyticsResponse contains all analytics data
|
|
194
|
+
*/
|
|
195
|
+
export interface AnalyticsResponse {
|
|
196
|
+
time_series: TimeSeriesMetrics;
|
|
197
|
+
totals: TotalMetrics;
|
|
198
|
+
realtime: RealtimeMetrics;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* AnalyticsRequest represents the query parameters for analytics
|
|
202
|
+
*/
|
|
203
|
+
export interface AnalyticsRequest {
|
|
204
|
+
start: string;
|
|
205
|
+
end: string;
|
|
206
|
+
resolution: string;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Define a private context key type
|
|
210
|
+
*/
|
|
211
|
+
/**
|
|
212
|
+
* AuthenticatedUser represents the user data we store in context
|
|
213
|
+
*/
|
|
214
|
+
export interface AuthenticatedUser {
|
|
215
|
+
id: string;
|
|
216
|
+
api_key: string;
|
|
217
|
+
role: string;
|
|
218
|
+
}
|
|
219
|
+
export interface APIRequest<T extends any> {
|
|
220
|
+
timestamp: string;
|
|
221
|
+
data: T;
|
|
222
|
+
}
|
|
223
|
+
export interface APIResponse<T extends any> {
|
|
224
|
+
success: boolean;
|
|
225
|
+
status: number;
|
|
226
|
+
data?: T;
|
|
227
|
+
error?: APIError;
|
|
228
|
+
}
|
|
229
|
+
export interface APIError {
|
|
230
|
+
code: string;
|
|
231
|
+
message: string;
|
|
232
|
+
}
|
|
233
|
+
export interface WorkerGPUConfig {
|
|
234
|
+
gpus: number[];
|
|
235
|
+
}
|
|
236
|
+
export interface WorkerCPUConfig {
|
|
237
|
+
count: number;
|
|
238
|
+
}
|
|
239
|
+
export interface WorkerConfig {
|
|
240
|
+
gpu: WorkerGPUConfig[];
|
|
241
|
+
cpu: WorkerCPUConfig;
|
|
242
|
+
}
|
|
243
|
+
export interface EngineConfig {
|
|
244
|
+
id: string;
|
|
245
|
+
name: string;
|
|
246
|
+
api_url: string;
|
|
247
|
+
engine_port: string;
|
|
248
|
+
workers: WorkerConfig;
|
|
249
|
+
api_key: string;
|
|
250
|
+
container_mode: boolean;
|
|
251
|
+
network_name: string;
|
|
252
|
+
cache_path: string;
|
|
253
|
+
gpus: string[];
|
|
254
|
+
}
|
|
255
|
+
export interface RemoteEngineCreateRequest {
|
|
256
|
+
name: string;
|
|
257
|
+
instance_type?: InstanceType;
|
|
258
|
+
start_time: string;
|
|
259
|
+
end_time: string;
|
|
260
|
+
}
|
|
261
|
+
export interface StripeCheckoutCreateRequest {
|
|
262
|
+
amount: number;
|
|
263
|
+
success_url: string;
|
|
264
|
+
cancel_url: string;
|
|
265
|
+
}
|
|
266
|
+
export interface StripeCheckoutCompleteRequest {
|
|
267
|
+
session_id: string;
|
|
268
|
+
}
|
|
269
|
+
export interface EngineCreateResponse {
|
|
270
|
+
engine_state?: EngineState;
|
|
271
|
+
}
|
|
272
|
+
export interface EngineRegisterRequest {
|
|
273
|
+
local_engine_state?: LocalEngineState;
|
|
274
|
+
api_url: string;
|
|
275
|
+
system_info?: SystemInfo;
|
|
276
|
+
worker_config: WorkerConfig;
|
|
277
|
+
}
|
|
278
|
+
export interface EngineRegisterResponse {
|
|
279
|
+
engine_state?: EngineState;
|
|
280
|
+
}
|
|
281
|
+
export interface CreateApiKeyRequest {
|
|
282
|
+
name: string;
|
|
283
|
+
}
|
|
284
|
+
export interface CreateTaskRequest {
|
|
285
|
+
app_id: string;
|
|
286
|
+
version_id?: string;
|
|
287
|
+
variant?: string;
|
|
288
|
+
infra: Infra;
|
|
289
|
+
workers: string[];
|
|
290
|
+
webhook?: string;
|
|
291
|
+
input: any;
|
|
292
|
+
flow_id?: string;
|
|
293
|
+
flow_run_id?: string;
|
|
294
|
+
chat_id?: string;
|
|
295
|
+
agent_id?: string;
|
|
296
|
+
agent_version_id?: string;
|
|
297
|
+
tool_call_id?: string;
|
|
298
|
+
}
|
|
299
|
+
export interface CreateAgentMessageRequest {
|
|
300
|
+
chat_id?: string;
|
|
301
|
+
agent_id?: string;
|
|
302
|
+
agent_version_id?: string;
|
|
303
|
+
tool_call_id?: string;
|
|
304
|
+
input: ChatTaskInput;
|
|
305
|
+
integration_context?: IntegrationContext;
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* WidgetActionRequest represents a user's response to a widget
|
|
309
|
+
* Uses WidgetAction and WidgetFormData from chat.go
|
|
310
|
+
*/
|
|
311
|
+
export interface WidgetActionRequest {
|
|
312
|
+
action: WidgetAction;
|
|
313
|
+
form_data?: WidgetFormData;
|
|
314
|
+
}
|
|
315
|
+
export interface ApiTaskRequest {
|
|
316
|
+
app: string;
|
|
317
|
+
version?: string;
|
|
318
|
+
variant?: string;
|
|
319
|
+
infra?: Infra;
|
|
320
|
+
workers?: string[];
|
|
321
|
+
webhook?: string;
|
|
322
|
+
input: any;
|
|
323
|
+
}
|
|
324
|
+
export interface CreateFlowRequest {
|
|
325
|
+
name: string;
|
|
326
|
+
}
|
|
327
|
+
export interface CreateFlowRunRequest {
|
|
328
|
+
flow: string;
|
|
329
|
+
input: any;
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Request/Response Types
|
|
333
|
+
*/
|
|
334
|
+
export interface EngineAPIRequest {
|
|
335
|
+
data: {
|
|
336
|
+
[key: string]: any;
|
|
337
|
+
};
|
|
338
|
+
metadata: EngineAPIRequestMetadata;
|
|
339
|
+
}
|
|
340
|
+
export interface WorkerAPIRequest {
|
|
341
|
+
input: {
|
|
342
|
+
[key: string]: any;
|
|
343
|
+
};
|
|
344
|
+
metadata: WorkerAPIRequestMetadata;
|
|
345
|
+
}
|
|
346
|
+
export interface EngineAPIRequestMetadata {
|
|
347
|
+
worker_id: string;
|
|
348
|
+
app_id: string;
|
|
349
|
+
app_version_id: string;
|
|
350
|
+
app_variant: string;
|
|
351
|
+
gpu_ids: string[];
|
|
352
|
+
task_id: string;
|
|
353
|
+
}
|
|
354
|
+
export interface WorkerAPIRequestMetadata {
|
|
355
|
+
worker_id: string;
|
|
356
|
+
app_id: string;
|
|
357
|
+
app_version_id: string;
|
|
358
|
+
app_variant: string;
|
|
359
|
+
gpu_ids: string[];
|
|
360
|
+
task_id: string;
|
|
361
|
+
}
|
|
362
|
+
export interface AppsGetResponse {
|
|
363
|
+
apps: App[];
|
|
364
|
+
total: number;
|
|
365
|
+
}
|
|
366
|
+
export interface PartialFile {
|
|
367
|
+
uri: string;
|
|
368
|
+
path?: string;
|
|
369
|
+
content_type?: string;
|
|
370
|
+
size?: number;
|
|
371
|
+
filename?: string;
|
|
372
|
+
}
|
|
373
|
+
export interface FileCreateRequest {
|
|
374
|
+
files: PartialFile[];
|
|
375
|
+
}
|
|
376
|
+
export interface RunTaskRequest {
|
|
377
|
+
task: TaskDTO;
|
|
378
|
+
user_env: any;
|
|
379
|
+
}
|
|
380
|
+
export interface CreateChatMessageResponse {
|
|
381
|
+
user_message?: ChatMessageDTO;
|
|
382
|
+
assistant_message?: ChatMessageDTO;
|
|
383
|
+
}
|
|
384
|
+
export interface SchedulerMetrics {
|
|
385
|
+
tasks_queued: number;
|
|
386
|
+
tasks_processed: number;
|
|
387
|
+
tasks_failed: number;
|
|
388
|
+
processing_errors: number;
|
|
389
|
+
last_error?: string;
|
|
390
|
+
last_error_time?: string;
|
|
391
|
+
queue_metrics?: QueueMetrics[];
|
|
392
|
+
updated_at: string;
|
|
393
|
+
}
|
|
394
|
+
export interface QueueMetrics {
|
|
395
|
+
enqueued: number;
|
|
396
|
+
dequeued: number;
|
|
397
|
+
expired: number;
|
|
398
|
+
dlq: number;
|
|
399
|
+
in_flight: number;
|
|
400
|
+
}
|
|
401
|
+
export interface BlogPostCreateRequest {
|
|
402
|
+
title: string;
|
|
403
|
+
content: string;
|
|
404
|
+
excerpt: string;
|
|
405
|
+
status: BlogPostStatus;
|
|
406
|
+
metadata: BlogPostMetadata;
|
|
407
|
+
slug: string;
|
|
408
|
+
category_title?: string;
|
|
409
|
+
category_slug?: string;
|
|
410
|
+
sub_category_title?: string;
|
|
411
|
+
sub_category_slug?: string;
|
|
412
|
+
acl?: ACL;
|
|
413
|
+
is_featured: boolean;
|
|
414
|
+
}
|
|
415
|
+
export type BlogPostUpdateRequest = BlogPostCreateRequest;
|
|
416
|
+
export interface BlogPostCommentCreateRequest {
|
|
417
|
+
blog_post_id: string;
|
|
418
|
+
content: string;
|
|
419
|
+
}
|
|
420
|
+
export type BlogPostCommentUpdateRequest = BlogPostCommentCreateRequest;
|
|
421
|
+
export interface TransactionCreateRequest {
|
|
422
|
+
user_id: string;
|
|
423
|
+
group_id?: string;
|
|
424
|
+
type: TransactionType;
|
|
425
|
+
amount: number;
|
|
426
|
+
reference: string;
|
|
427
|
+
notes: string;
|
|
428
|
+
metadata: {
|
|
429
|
+
[key: string]: any;
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
export interface PublicEnginesForResourcesRequest {
|
|
433
|
+
resources: AppResources;
|
|
434
|
+
}
|
|
435
|
+
export interface PublicEnginesForResourcesResponse {
|
|
436
|
+
can_run: boolean;
|
|
437
|
+
min_price: number;
|
|
438
|
+
max_price: number;
|
|
439
|
+
error?: string;
|
|
440
|
+
}
|
|
441
|
+
export interface EnginesForResourcesRequest {
|
|
442
|
+
resources: AppResources;
|
|
443
|
+
}
|
|
444
|
+
export interface PrivateEngineResponse {
|
|
445
|
+
workers: WorkerStateSummary[];
|
|
446
|
+
}
|
|
447
|
+
export interface CloudEngineResponse {
|
|
448
|
+
can_run: boolean;
|
|
449
|
+
min_price: number;
|
|
450
|
+
max_price: number;
|
|
451
|
+
}
|
|
452
|
+
export interface EnginesForResourcesResponse {
|
|
453
|
+
private: PrivateEngineResponse;
|
|
454
|
+
cloud: CloudEngineResponse;
|
|
455
|
+
error?: string;
|
|
456
|
+
}
|
|
457
|
+
export interface TeamCreateRequest {
|
|
458
|
+
name: string;
|
|
459
|
+
}
|
|
460
|
+
export interface FeatureTaskRequest {
|
|
461
|
+
is_featured: boolean;
|
|
462
|
+
}
|
|
463
|
+
export interface TeamMemberAddRequest {
|
|
464
|
+
email: string;
|
|
465
|
+
role: TeamRole;
|
|
466
|
+
}
|
|
467
|
+
export interface TeamMemberUpdateRoleRequest {
|
|
468
|
+
role: TeamRole;
|
|
469
|
+
}
|
|
470
|
+
/**
|
|
471
|
+
* HandleSlackEventRequest models the outer event envelope and its inner event ("event") as received from Slack Events API.
|
|
472
|
+
* It is designed for maximum compatibility with the event_callback style JSON, url_verification, and app_rate_limited events.
|
|
473
|
+
*/
|
|
474
|
+
export interface HandleSlackEventRequest {
|
|
475
|
+
type: string;
|
|
476
|
+
token: string;
|
|
477
|
+
team_id?: string;
|
|
478
|
+
api_app_id?: string;
|
|
479
|
+
event?: any;
|
|
480
|
+
authed_users?: string[];
|
|
481
|
+
authed_teams?: string[];
|
|
482
|
+
authorizations?: SlackEventAuthorization[];
|
|
483
|
+
event_context?: string;
|
|
484
|
+
event_id?: string;
|
|
485
|
+
event_time?: number;
|
|
486
|
+
challenge?: string;
|
|
487
|
+
is_ext_shared_channel?: boolean;
|
|
488
|
+
context_team_id?: string;
|
|
489
|
+
context_enterprise_id?: string;
|
|
490
|
+
/**
|
|
491
|
+
* App Rate Limiting
|
|
492
|
+
*/
|
|
493
|
+
minute_rate_limited?: number;
|
|
494
|
+
}
|
|
495
|
+
export interface SlackEventAuthorization {
|
|
496
|
+
enterprise_id?: string;
|
|
497
|
+
team_id: string;
|
|
498
|
+
user_id: string;
|
|
499
|
+
is_bot: boolean;
|
|
500
|
+
is_enterprise_install?: boolean;
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* Example: define inner events you want to care about and unmarshal HandleSlackEventRequest.Event as needed.
|
|
504
|
+
* Common message event payload, not all fields are present for all types.
|
|
505
|
+
*/
|
|
506
|
+
export interface SlackMessageEvent {
|
|
507
|
+
type: string;
|
|
508
|
+
subtype?: string;
|
|
509
|
+
channel?: string;
|
|
510
|
+
user?: string;
|
|
511
|
+
text?: string;
|
|
512
|
+
ts?: string;
|
|
513
|
+
event_ts?: string;
|
|
514
|
+
thread_ts?: string;
|
|
515
|
+
bot_id?: string;
|
|
516
|
+
bot_profile?: {
|
|
517
|
+
id?: string;
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
/**
|
|
521
|
+
* SlackThreadMessage represents a message from a Slack thread (from conversations.replies)
|
|
522
|
+
*/
|
|
523
|
+
export interface SlackThreadMessage {
|
|
524
|
+
type: string;
|
|
525
|
+
subtype?: string;
|
|
526
|
+
user?: string;
|
|
527
|
+
text?: string;
|
|
528
|
+
ts?: string;
|
|
529
|
+
thread_ts?: string;
|
|
530
|
+
parent_user_id?: string;
|
|
531
|
+
bot_id?: string;
|
|
532
|
+
bot_profile?: {
|
|
533
|
+
id?: string;
|
|
534
|
+
name?: string;
|
|
535
|
+
};
|
|
536
|
+
}
|
|
537
|
+
export interface ProjectCreateRequest {
|
|
538
|
+
name: string;
|
|
539
|
+
type: ProjectType;
|
|
540
|
+
}
|
|
541
|
+
export interface ProjectUpdateRequest {
|
|
542
|
+
name: string;
|
|
543
|
+
}
|
|
544
|
+
export interface MoveAgentToProjectRequest {
|
|
545
|
+
agent_id: string;
|
|
546
|
+
project_id: string;
|
|
547
|
+
}
|
|
548
|
+
export interface ApiKey {
|
|
549
|
+
BaseModel: BaseModel;
|
|
550
|
+
PermissionModel: PermissionModel;
|
|
551
|
+
name: string;
|
|
552
|
+
key: string;
|
|
553
|
+
last_used_at: string;
|
|
554
|
+
}
|
|
555
|
+
export interface ApiKeyDTO {
|
|
556
|
+
id: string;
|
|
557
|
+
created_at: string;
|
|
558
|
+
updated_at: string;
|
|
559
|
+
user_id: string;
|
|
560
|
+
user: UserRelationDTO;
|
|
561
|
+
name: string;
|
|
562
|
+
key: string;
|
|
563
|
+
last_used_at: string;
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* App-related types
|
|
567
|
+
*/
|
|
568
|
+
export type AppStatus = string;
|
|
569
|
+
export declare const AppStatusActive: AppStatus;
|
|
570
|
+
export declare const AppStatusInactive: AppStatus;
|
|
571
|
+
export declare const AppStatusPending: AppStatus;
|
|
572
|
+
export type AppCategory = string;
|
|
573
|
+
export declare const AppCategoryImage: AppCategory;
|
|
574
|
+
export declare const AppCategoryVideo: AppCategory;
|
|
575
|
+
export declare const AppCategoryAudio: AppCategory;
|
|
576
|
+
export declare const AppCategoryText: AppCategory;
|
|
577
|
+
export declare const AppCategoryChat: AppCategory;
|
|
578
|
+
export declare const AppCategory3D: AppCategory;
|
|
579
|
+
export declare const AppCategoryOther: AppCategory;
|
|
580
|
+
export declare const AppCategoryFlow: AppCategory;
|
|
581
|
+
export type GPUType = string;
|
|
582
|
+
export declare const GPUTypeAny: GPUType;
|
|
583
|
+
export declare const GPUTypeNone: GPUType;
|
|
584
|
+
export declare const GPUTypeIntel: GPUType;
|
|
585
|
+
export declare const GPUTypeNvidia: GPUType;
|
|
586
|
+
export declare const GPUTypeAMD: GPUType;
|
|
587
|
+
export declare const GPUTypeApple: GPUType;
|
|
588
|
+
export interface AppImages {
|
|
589
|
+
card: string;
|
|
590
|
+
thumbnail: string;
|
|
591
|
+
banner: string;
|
|
592
|
+
}
|
|
593
|
+
export interface App {
|
|
594
|
+
BaseModel: BaseModel;
|
|
595
|
+
PermissionModel: PermissionModel;
|
|
596
|
+
name: string;
|
|
597
|
+
description: string;
|
|
598
|
+
agent_description: string;
|
|
599
|
+
category: AppCategory;
|
|
600
|
+
blog_post_id?: string;
|
|
601
|
+
license: string;
|
|
602
|
+
license_mandatory: boolean;
|
|
603
|
+
needs_hf_token: boolean;
|
|
604
|
+
hf_model_url: string;
|
|
605
|
+
commercial: boolean;
|
|
606
|
+
status: AppStatus;
|
|
607
|
+
is_featured: boolean;
|
|
608
|
+
is_verified: boolean;
|
|
609
|
+
rank: number;
|
|
610
|
+
images: AppImages;
|
|
611
|
+
version_id: string;
|
|
612
|
+
version?: AppVersion;
|
|
613
|
+
allows_private_workers: boolean;
|
|
614
|
+
allows_cloud_workers: boolean;
|
|
615
|
+
fees: AppFees;
|
|
616
|
+
}
|
|
617
|
+
export type PartnerFeeType = string;
|
|
618
|
+
export declare const PartnerFeeTypeFixed: PartnerFeeType;
|
|
619
|
+
export declare const PartnerFeeTypePerSecond: PartnerFeeType;
|
|
620
|
+
export interface AppFees {
|
|
621
|
+
royalty_fee: number;
|
|
622
|
+
partner_fee: number;
|
|
623
|
+
partner_fee_type: PartnerFeeType;
|
|
624
|
+
}
|
|
625
|
+
export interface AppGPUResource {
|
|
626
|
+
count: number;
|
|
627
|
+
vram: number;
|
|
628
|
+
type: GPUType;
|
|
629
|
+
}
|
|
630
|
+
export interface AppResources {
|
|
631
|
+
gpu: AppGPUResource;
|
|
632
|
+
ram: number;
|
|
633
|
+
}
|
|
634
|
+
export interface AppVariant {
|
|
635
|
+
name: string;
|
|
636
|
+
order: number;
|
|
637
|
+
resources: AppResources;
|
|
638
|
+
env: {
|
|
639
|
+
[key: string]: string;
|
|
640
|
+
};
|
|
641
|
+
python: string;
|
|
642
|
+
}
|
|
643
|
+
export interface AppVersion {
|
|
644
|
+
BaseModel: BaseModel;
|
|
645
|
+
app_id: string;
|
|
646
|
+
variants: {
|
|
647
|
+
[key: string]: AppVariant;
|
|
648
|
+
};
|
|
649
|
+
repository: string;
|
|
650
|
+
flow_id?: string;
|
|
651
|
+
flow?: Flow;
|
|
652
|
+
input_schema: any;
|
|
653
|
+
output_schema: any;
|
|
654
|
+
metadata: {
|
|
655
|
+
[key: string]: any;
|
|
656
|
+
};
|
|
657
|
+
}
|
|
658
|
+
export interface AppConfig {
|
|
659
|
+
name: string;
|
|
660
|
+
description: string;
|
|
661
|
+
category: AppCategory;
|
|
662
|
+
status: AppStatus;
|
|
663
|
+
images: AppImages;
|
|
664
|
+
input_schema: any;
|
|
665
|
+
output_schema: any;
|
|
666
|
+
metadata: {
|
|
667
|
+
[key: string]: any;
|
|
668
|
+
};
|
|
669
|
+
variants: {
|
|
670
|
+
[key: string]: AppVariant;
|
|
671
|
+
};
|
|
672
|
+
}
|
|
673
|
+
export interface LicenseRecord {
|
|
674
|
+
id: string;
|
|
675
|
+
created_at: string;
|
|
676
|
+
updated_at: string;
|
|
677
|
+
deleted_at?: string;
|
|
678
|
+
user_id: string;
|
|
679
|
+
app_id: string;
|
|
680
|
+
license: string;
|
|
681
|
+
}
|
|
682
|
+
export interface AppDTO {
|
|
683
|
+
id: string;
|
|
684
|
+
created_at: string;
|
|
685
|
+
updated_at: string;
|
|
686
|
+
deleted_at?: string;
|
|
687
|
+
user_id: string;
|
|
688
|
+
user?: UserRelationDTO;
|
|
689
|
+
name: string;
|
|
690
|
+
description: string;
|
|
691
|
+
agent_description: string;
|
|
692
|
+
category: AppCategory;
|
|
693
|
+
blog_post_id?: string;
|
|
694
|
+
license: string;
|
|
695
|
+
license_mandatory: boolean;
|
|
696
|
+
needs_hf_token: boolean;
|
|
697
|
+
hf_model_url: string;
|
|
698
|
+
commercial: boolean;
|
|
699
|
+
status: AppStatus;
|
|
700
|
+
acl?: ACL;
|
|
701
|
+
is_featured: boolean;
|
|
702
|
+
is_verified: boolean;
|
|
703
|
+
rank: number;
|
|
704
|
+
images: AppImages;
|
|
705
|
+
version_id: string;
|
|
706
|
+
version?: AppVersionDTO;
|
|
707
|
+
variants: {
|
|
708
|
+
[key: string]: AppVariant;
|
|
709
|
+
};
|
|
710
|
+
fees: AppFees;
|
|
711
|
+
allows_private_workers: boolean;
|
|
712
|
+
allows_cloud_workers: boolean;
|
|
713
|
+
}
|
|
714
|
+
export interface AppVersionDTO {
|
|
715
|
+
id: string;
|
|
716
|
+
created_at: string;
|
|
717
|
+
updated_at: string;
|
|
718
|
+
variants: {
|
|
719
|
+
[key: string]: AppVariant;
|
|
720
|
+
};
|
|
721
|
+
repository: string;
|
|
722
|
+
flow?: FlowDTO;
|
|
723
|
+
input_schema: any;
|
|
724
|
+
output_schema: any;
|
|
725
|
+
metadata: {
|
|
726
|
+
[key: string]: any;
|
|
727
|
+
};
|
|
728
|
+
}
|
|
729
|
+
export interface ChatModelCapabilities {
|
|
730
|
+
Image: boolean;
|
|
731
|
+
Images: boolean;
|
|
732
|
+
Files: boolean;
|
|
733
|
+
Reasoning: boolean;
|
|
734
|
+
}
|
|
735
|
+
export type Model = any;
|
|
736
|
+
export interface BaseModel {
|
|
737
|
+
id: string;
|
|
738
|
+
created_at: string;
|
|
739
|
+
updated_at: string;
|
|
740
|
+
deleted_at?: string;
|
|
741
|
+
}
|
|
742
|
+
export type Permissioned = any;
|
|
743
|
+
export interface PermissionModel {
|
|
744
|
+
user_id: string;
|
|
745
|
+
user?: User;
|
|
746
|
+
group_id?: string;
|
|
747
|
+
acl?: ACL;
|
|
748
|
+
}
|
|
749
|
+
export declare const PermRead = "read";
|
|
750
|
+
export declare const PermWrite = "write";
|
|
751
|
+
export declare const PermExec = "exec";
|
|
752
|
+
export interface AuthContext {
|
|
753
|
+
IsAnonymous: boolean;
|
|
754
|
+
UserID: string;
|
|
755
|
+
GroupID?: string;
|
|
756
|
+
}
|
|
757
|
+
/**
|
|
758
|
+
* Versioned interface for optimistic locking
|
|
759
|
+
*/
|
|
760
|
+
export type Versioned = any;
|
|
761
|
+
/**
|
|
762
|
+
* VersionedStruct provides optimistic locking functionality
|
|
763
|
+
*/
|
|
764
|
+
export interface VersionedStruct {
|
|
765
|
+
document_version: number;
|
|
766
|
+
}
|
|
767
|
+
export type Encrypted = any;
|
|
768
|
+
export interface EncryptedModel {
|
|
769
|
+
user_public_key: string;
|
|
770
|
+
/**
|
|
771
|
+
* PRE key is extremely sensitive, it must be deleted as soon as the task is delivered to the engine
|
|
772
|
+
*/
|
|
773
|
+
user_pre_key: string;
|
|
774
|
+
engine_public_key: string;
|
|
775
|
+
}
|
|
776
|
+
/**
|
|
777
|
+
* Billing holds billing information that can be owned by a user or team
|
|
778
|
+
* OwnerID is the user ID if no group, or the team/group ID if a group exists
|
|
779
|
+
*/
|
|
780
|
+
export interface Billing {
|
|
781
|
+
BaseModel: BaseModel;
|
|
782
|
+
PermissionModel: PermissionModel;
|
|
783
|
+
/**
|
|
784
|
+
* Balance in micro-cents (1 cent = 1,000,000)
|
|
785
|
+
*/
|
|
786
|
+
balance: number;
|
|
787
|
+
/**
|
|
788
|
+
* Currency code (e.g., "USD")
|
|
789
|
+
*/
|
|
790
|
+
currency: string;
|
|
791
|
+
}
|
|
792
|
+
/**
|
|
793
|
+
* BillingDTO is the data transfer object for Billing
|
|
794
|
+
*/
|
|
795
|
+
export interface BillingDTO {
|
|
796
|
+
id: string;
|
|
797
|
+
user_id: string;
|
|
798
|
+
group_id?: string;
|
|
799
|
+
created_at: string;
|
|
800
|
+
updated_at: string;
|
|
801
|
+
deleted_at?: string;
|
|
802
|
+
balance: number;
|
|
803
|
+
currency: string;
|
|
804
|
+
}
|
|
805
|
+
export type BlogPostStatus = number;
|
|
806
|
+
export declare const BlogPostStatusUnknown: BlogPostStatus;
|
|
807
|
+
export declare const BlogPostStatusDraft: BlogPostStatus;
|
|
808
|
+
export declare const BlogPostStatusPublished: BlogPostStatus;
|
|
809
|
+
export declare const BlogPostStatusArchived: BlogPostStatus;
|
|
810
|
+
export interface BlogPostMetadata {
|
|
811
|
+
title: string;
|
|
812
|
+
description: string;
|
|
813
|
+
image: string;
|
|
814
|
+
tags: string[];
|
|
815
|
+
}
|
|
816
|
+
export interface BlogPost {
|
|
817
|
+
BaseModel: BaseModel;
|
|
818
|
+
PermissionModel: PermissionModel;
|
|
819
|
+
is_featured: boolean;
|
|
820
|
+
title: string;
|
|
821
|
+
content: string;
|
|
822
|
+
excerpt: string;
|
|
823
|
+
status: BlogPostStatus;
|
|
824
|
+
slug: string;
|
|
825
|
+
category_title?: string;
|
|
826
|
+
category_slug?: string;
|
|
827
|
+
sub_category_title?: string;
|
|
828
|
+
sub_category_slug?: string;
|
|
829
|
+
metadata: BlogPostMetadata;
|
|
830
|
+
}
|
|
831
|
+
export interface BlogPostDTO {
|
|
832
|
+
id: string;
|
|
833
|
+
created_at: string;
|
|
834
|
+
updated_at: string;
|
|
835
|
+
deleted_at?: string;
|
|
836
|
+
acl?: ACL;
|
|
837
|
+
is_featured: boolean;
|
|
838
|
+
user_id: string;
|
|
839
|
+
user?: UserRelationDTO;
|
|
840
|
+
title: string;
|
|
841
|
+
content: string;
|
|
842
|
+
excerpt: string;
|
|
843
|
+
status: BlogPostStatus;
|
|
844
|
+
metadata: BlogPostMetadata;
|
|
845
|
+
slug: string;
|
|
846
|
+
category_title?: string;
|
|
847
|
+
category_slug?: string;
|
|
848
|
+
sub_category_title?: string;
|
|
849
|
+
sub_category_slug?: string;
|
|
850
|
+
}
|
|
851
|
+
export type BlogPostCommentStatus = number;
|
|
852
|
+
export declare const BlogPostCommentStatusUnknown: BlogPostCommentStatus;
|
|
853
|
+
export declare const BlogPostCommentStatusDraft: BlogPostCommentStatus;
|
|
854
|
+
export declare const BlogPostCommentStatusPublished: BlogPostCommentStatus;
|
|
855
|
+
export declare const BlogPostCommentStatusArchived: BlogPostCommentStatus;
|
|
856
|
+
export interface BlogPostComment {
|
|
857
|
+
BaseModel: BaseModel;
|
|
858
|
+
PermissionModel: PermissionModel;
|
|
859
|
+
blog_post_id: string;
|
|
860
|
+
content: string;
|
|
861
|
+
status: BlogPostCommentStatus;
|
|
862
|
+
/**
|
|
863
|
+
* Relationships
|
|
864
|
+
*/
|
|
865
|
+
parent_comment_id?: string;
|
|
866
|
+
children: BlogPostComment[];
|
|
867
|
+
}
|
|
868
|
+
export interface BlogPostCommentDTO {
|
|
869
|
+
id: string;
|
|
870
|
+
created_at: string;
|
|
871
|
+
updated_at: string;
|
|
872
|
+
deleted_at?: string;
|
|
873
|
+
user_id: string;
|
|
874
|
+
user?: UserRelationDTO;
|
|
875
|
+
blog_post_id: string;
|
|
876
|
+
content: string;
|
|
877
|
+
parent_comment_id?: string;
|
|
878
|
+
children: BlogPostCommentDTO[];
|
|
879
|
+
status: BlogPostCommentStatus;
|
|
880
|
+
}
|
|
881
|
+
export type ChatType = string;
|
|
882
|
+
export type ChatStatus = string;
|
|
883
|
+
export declare const ChatStatusPending: ChatStatus;
|
|
884
|
+
export declare const ChatStatusInProgress: ChatStatus;
|
|
885
|
+
export declare const ChatStatusCompleted: ChatStatus;
|
|
886
|
+
export declare const ChatStatusCancelled: ChatStatus;
|
|
887
|
+
export interface Chat {
|
|
888
|
+
BaseModel: BaseModel;
|
|
889
|
+
PermissionModel: PermissionModel;
|
|
890
|
+
agent_id?: string;
|
|
891
|
+
agent_version_id?: string;
|
|
892
|
+
agent?: Agent;
|
|
893
|
+
tool_call_id?: string;
|
|
894
|
+
parent_id?: string;
|
|
895
|
+
parent?: Chat;
|
|
896
|
+
children: (Chat | undefined)[];
|
|
897
|
+
name: string;
|
|
898
|
+
description: string;
|
|
899
|
+
chat_messages: ChatMessage[];
|
|
900
|
+
agent_data: AgentData;
|
|
901
|
+
status: ChatStatus;
|
|
902
|
+
integration_context?: IntegrationContext;
|
|
903
|
+
}
|
|
904
|
+
export interface IntegrationContext {
|
|
905
|
+
integration_type?: IntegrationType;
|
|
906
|
+
integration_metadata?: any;
|
|
907
|
+
}
|
|
908
|
+
export interface AgentData {
|
|
909
|
+
plan_steps: AgentPlanStep[];
|
|
910
|
+
memory: StringEncodedMap;
|
|
911
|
+
}
|
|
912
|
+
export interface AgentPlanStep {
|
|
913
|
+
index: number;
|
|
914
|
+
title: string;
|
|
915
|
+
description: string;
|
|
916
|
+
notes?: string;
|
|
917
|
+
status: AgentPlanStepStatus;
|
|
918
|
+
}
|
|
919
|
+
export type AgentPlanStepStatus = string;
|
|
920
|
+
export declare const AgentPlanStepStatusPending: AgentPlanStepStatus;
|
|
921
|
+
export declare const AgentPlanStepStatusInProgress: AgentPlanStepStatus;
|
|
922
|
+
export declare const AgentPlanStepStatusCompleted: AgentPlanStepStatus;
|
|
923
|
+
export declare const AgentPlanStepStatusCancelled: AgentPlanStepStatus;
|
|
924
|
+
export type ChatMessageRole = string;
|
|
925
|
+
export declare const ChatMessageRoleSystem: ChatMessageRole;
|
|
926
|
+
export declare const ChatMessageRoleUser: ChatMessageRole;
|
|
927
|
+
export declare const ChatMessageRoleAssistant: ChatMessageRole;
|
|
928
|
+
export declare const ChatMessageRoleTool: ChatMessageRole;
|
|
929
|
+
export type ChatMessageContentType = string;
|
|
930
|
+
export declare const ChatMessageContentTypeText: ChatMessageContentType;
|
|
931
|
+
export declare const ChatMessageContentTypeReasoning: ChatMessageContentType;
|
|
932
|
+
export declare const ChatMessageContentTypeImage: ChatMessageContentType;
|
|
933
|
+
export declare const ChatMessageContentTypeFile: ChatMessageContentType;
|
|
934
|
+
export declare const ChatMessageContentTypeTool: ChatMessageContentType;
|
|
935
|
+
export type IntegrationType = string;
|
|
936
|
+
export declare const IntegrationTypeSlack: IntegrationType;
|
|
937
|
+
export declare const IntegrationTypeDiscord: IntegrationType;
|
|
938
|
+
export declare const IntegrationTypeTeams: IntegrationType;
|
|
939
|
+
export declare const IntegrationTypeTelegram: IntegrationType;
|
|
940
|
+
export interface ChatMessageContent {
|
|
941
|
+
type: ChatMessageContentType;
|
|
942
|
+
error?: string;
|
|
943
|
+
text?: string;
|
|
944
|
+
image?: string;
|
|
945
|
+
file?: string;
|
|
946
|
+
tool_calls?: ToolInvocation[];
|
|
947
|
+
}
|
|
948
|
+
export type StringEncodedMap = {
|
|
949
|
+
[key: string]: any;
|
|
950
|
+
};
|
|
951
|
+
export interface ToolInvocationFunction {
|
|
952
|
+
name: string;
|
|
953
|
+
arguments: StringEncodedMap;
|
|
954
|
+
}
|
|
955
|
+
/**
|
|
956
|
+
* Define an auxiliary struct to avoid recursive UnmarshalJSON calls
|
|
957
|
+
*/
|
|
958
|
+
export interface Aux {
|
|
959
|
+
name: string;
|
|
960
|
+
arguments: any;
|
|
961
|
+
}
|
|
962
|
+
export type ToolInvocationType = string;
|
|
963
|
+
export declare const ToolInvocationTypeInternal: ToolInvocationType;
|
|
964
|
+
export declare const ToolInvocationTypeApp: ToolInvocationType;
|
|
965
|
+
export declare const ToolInvocationTypeAgent: ToolInvocationType;
|
|
966
|
+
export declare const ToolInvocationTypeWidget: ToolInvocationType;
|
|
967
|
+
export declare const ToolInvocationTypeUnknown: ToolInvocationType;
|
|
968
|
+
export type ToolInvocationStatus = string;
|
|
969
|
+
export declare const ToolInvocationStatusPending: ToolInvocationStatus;
|
|
970
|
+
export declare const ToolInvocationStatusInProgress: ToolInvocationStatus;
|
|
971
|
+
export declare const ToolInvocationStatusAwaitingInput: ToolInvocationStatus;
|
|
972
|
+
export declare const ToolInvocationStatusCompleted: ToolInvocationStatus;
|
|
973
|
+
export declare const ToolInvocationStatusFailed: ToolInvocationStatus;
|
|
974
|
+
export declare const ToolInvocationStatusCancelled: ToolInvocationStatus;
|
|
975
|
+
export interface AgentToolInvocation {
|
|
976
|
+
BaseModel: BaseModel;
|
|
977
|
+
PermissionModel: PermissionModel;
|
|
978
|
+
chat_message_id: string;
|
|
979
|
+
tool_invocation_id: string;
|
|
980
|
+
type: ToolInvocationType;
|
|
981
|
+
function: ToolInvocationFunction;
|
|
982
|
+
status: ToolInvocationStatus;
|
|
983
|
+
result?: string;
|
|
984
|
+
widget: Widget;
|
|
985
|
+
task_id?: string;
|
|
986
|
+
chat_id?: string;
|
|
987
|
+
}
|
|
988
|
+
export interface AgentToolInvocationDTO {
|
|
989
|
+
id: string;
|
|
990
|
+
created_at: string;
|
|
991
|
+
updated_at: string;
|
|
992
|
+
deleted_at?: string;
|
|
993
|
+
user_id: string;
|
|
994
|
+
chat_message_id: string;
|
|
995
|
+
tool_invocation_id: string;
|
|
996
|
+
type: ToolInvocationType;
|
|
997
|
+
function: ToolInvocationFunction;
|
|
998
|
+
status: ToolInvocationStatus;
|
|
999
|
+
result?: string;
|
|
1000
|
+
widget: Widget;
|
|
1001
|
+
task_id?: string;
|
|
1002
|
+
chat_id?: string;
|
|
1003
|
+
}
|
|
1004
|
+
/**
|
|
1005
|
+
* This is a transport object, not a database model
|
|
1006
|
+
*/
|
|
1007
|
+
export interface ToolInvocation {
|
|
1008
|
+
id: string;
|
|
1009
|
+
type: string;
|
|
1010
|
+
function: ToolInvocationFunction;
|
|
1011
|
+
}
|
|
1012
|
+
export interface ChatMessage {
|
|
1013
|
+
BaseModel: BaseModel;
|
|
1014
|
+
PermissionModel: PermissionModel;
|
|
1015
|
+
chat_id: string;
|
|
1016
|
+
chat?: Chat;
|
|
1017
|
+
order: number;
|
|
1018
|
+
task_id?: string;
|
|
1019
|
+
task_status?: TaskStatus;
|
|
1020
|
+
role: ChatMessageRole;
|
|
1021
|
+
content: ChatMessageContent[];
|
|
1022
|
+
tools?: Tool[];
|
|
1023
|
+
tool_call_id?: string;
|
|
1024
|
+
tool_invocations?: AgentToolInvocation[];
|
|
1025
|
+
integration_context?: IntegrationContext;
|
|
1026
|
+
}
|
|
1027
|
+
export interface LLMUsage {
|
|
1028
|
+
stop_reason: string;
|
|
1029
|
+
time_to_first_token: number;
|
|
1030
|
+
tokens_per_second: number;
|
|
1031
|
+
prompt_tokens: number;
|
|
1032
|
+
completion_tokens: number;
|
|
1033
|
+
total_tokens: number;
|
|
1034
|
+
reasoning_tokens: number;
|
|
1035
|
+
reasoning_time: number;
|
|
1036
|
+
}
|
|
1037
|
+
export interface ChatTaskOutput {
|
|
1038
|
+
response: string;
|
|
1039
|
+
reasoning?: string;
|
|
1040
|
+
tool_calls?: ToolInvocation[];
|
|
1041
|
+
usage?: LLMUsage;
|
|
1042
|
+
}
|
|
1043
|
+
export interface ChatTaskInput {
|
|
1044
|
+
context_size: number;
|
|
1045
|
+
temperature?: number;
|
|
1046
|
+
top_p?: number;
|
|
1047
|
+
reasoning_effort?: string;
|
|
1048
|
+
reasoning_max_tokens?: number;
|
|
1049
|
+
system_prompt: string;
|
|
1050
|
+
context: ChatTaskContextMessage[];
|
|
1051
|
+
role: ChatMessageRole;
|
|
1052
|
+
text?: string;
|
|
1053
|
+
reasoning?: string;
|
|
1054
|
+
image?: string;
|
|
1055
|
+
images?: string[];
|
|
1056
|
+
files?: string[];
|
|
1057
|
+
tools?: Tool[];
|
|
1058
|
+
tool_call_id?: string;
|
|
1059
|
+
}
|
|
1060
|
+
export interface BaseLLMInput {
|
|
1061
|
+
app_id: string;
|
|
1062
|
+
app_version_id?: string;
|
|
1063
|
+
app_variant?: string;
|
|
1064
|
+
system_prompt: string;
|
|
1065
|
+
tools?: Tool[];
|
|
1066
|
+
context_size: number;
|
|
1067
|
+
temperature?: number;
|
|
1068
|
+
top_p?: number;
|
|
1069
|
+
reasoning_effort?: string;
|
|
1070
|
+
reasoning_max_tokens?: number;
|
|
1071
|
+
}
|
|
1072
|
+
export interface ChatTaskContextMessage {
|
|
1073
|
+
role: ChatMessageRole;
|
|
1074
|
+
text?: string;
|
|
1075
|
+
reasoning?: string;
|
|
1076
|
+
image?: string;
|
|
1077
|
+
images?: string[];
|
|
1078
|
+
file?: string;
|
|
1079
|
+
files?: string[];
|
|
1080
|
+
tools?: Tool[];
|
|
1081
|
+
tool_calls?: ToolInvocation[];
|
|
1082
|
+
tool_call_id?: string;
|
|
1083
|
+
}
|
|
1084
|
+
export interface ChatDTO {
|
|
1085
|
+
id: string;
|
|
1086
|
+
created_at: string;
|
|
1087
|
+
updated_at: string;
|
|
1088
|
+
deleted_at?: string;
|
|
1089
|
+
user_id: string;
|
|
1090
|
+
user: UserRelationDTO;
|
|
1091
|
+
acl?: ACL;
|
|
1092
|
+
parent_id?: string;
|
|
1093
|
+
parent?: ChatDTO;
|
|
1094
|
+
children: (ChatDTO | undefined)[];
|
|
1095
|
+
agent_id?: string;
|
|
1096
|
+
agent_version_id?: string;
|
|
1097
|
+
agent?: AgentDTO;
|
|
1098
|
+
name: string;
|
|
1099
|
+
description: string;
|
|
1100
|
+
chat_messages: ChatMessageDTO[];
|
|
1101
|
+
agent_data: AgentData;
|
|
1102
|
+
}
|
|
1103
|
+
export interface ChatMessageDTO {
|
|
1104
|
+
id: string;
|
|
1105
|
+
created_at: string;
|
|
1106
|
+
updated_at: string;
|
|
1107
|
+
deleted_at?: string;
|
|
1108
|
+
user_id: string;
|
|
1109
|
+
user?: UserRelationDTO;
|
|
1110
|
+
chat_id: string;
|
|
1111
|
+
chat?: ChatDTO;
|
|
1112
|
+
order: number;
|
|
1113
|
+
task_id?: string;
|
|
1114
|
+
task_status?: TaskStatus;
|
|
1115
|
+
role: ChatMessageRole;
|
|
1116
|
+
content: ChatMessageContent[];
|
|
1117
|
+
tools?: Tool[];
|
|
1118
|
+
tool_call_id?: string;
|
|
1119
|
+
tool_invocations?: AgentToolInvocationDTO[];
|
|
1120
|
+
}
|
|
1121
|
+
/**
|
|
1122
|
+
* SearchRequest represents a search request
|
|
1123
|
+
*/
|
|
1124
|
+
export interface SearchRequest {
|
|
1125
|
+
fields: string[];
|
|
1126
|
+
term: string;
|
|
1127
|
+
exact: boolean;
|
|
1128
|
+
}
|
|
1129
|
+
/**
|
|
1130
|
+
* FilterRequest represents a filter request
|
|
1131
|
+
*/
|
|
1132
|
+
export interface FilterRequest {
|
|
1133
|
+
field: string;
|
|
1134
|
+
operator: string;
|
|
1135
|
+
value: any;
|
|
1136
|
+
}
|
|
1137
|
+
/**
|
|
1138
|
+
* ListRequest represents a list request with all options
|
|
1139
|
+
*/
|
|
1140
|
+
export interface ListRequest {
|
|
1141
|
+
page: number;
|
|
1142
|
+
page_size: number;
|
|
1143
|
+
search?: SearchRequest;
|
|
1144
|
+
filters: Filter[];
|
|
1145
|
+
sort: SortOrder[];
|
|
1146
|
+
preloads: string[];
|
|
1147
|
+
fields: string[];
|
|
1148
|
+
permissions: string[];
|
|
1149
|
+
include_others: boolean;
|
|
1150
|
+
}
|
|
1151
|
+
export interface ListResponse<T extends any> {
|
|
1152
|
+
items: T[];
|
|
1153
|
+
total: number;
|
|
1154
|
+
page: number;
|
|
1155
|
+
page_size: number;
|
|
1156
|
+
total_pages: number;
|
|
1157
|
+
}
|
|
1158
|
+
/**
|
|
1159
|
+
* Filter represents a single filter condition
|
|
1160
|
+
*/
|
|
1161
|
+
export interface Filter {
|
|
1162
|
+
field: string;
|
|
1163
|
+
operator: FilterOperator;
|
|
1164
|
+
value: any;
|
|
1165
|
+
}
|
|
1166
|
+
/**
|
|
1167
|
+
* FilterOperator represents the type of filter operation
|
|
1168
|
+
*/
|
|
1169
|
+
export type FilterOperator = string;
|
|
1170
|
+
export declare const OpEqual: FilterOperator;
|
|
1171
|
+
export declare const OpNotEqual: FilterOperator;
|
|
1172
|
+
export declare const OpIn: FilterOperator;
|
|
1173
|
+
export declare const OpNotIn: FilterOperator;
|
|
1174
|
+
export declare const OpGreater: FilterOperator;
|
|
1175
|
+
export declare const OpGreaterEqual: FilterOperator;
|
|
1176
|
+
export declare const OpLess: FilterOperator;
|
|
1177
|
+
export declare const OpLessEqual: FilterOperator;
|
|
1178
|
+
export declare const OpLike: FilterOperator;
|
|
1179
|
+
export declare const OpILike: FilterOperator;
|
|
1180
|
+
export declare const OpContains: FilterOperator;
|
|
1181
|
+
export declare const OpNotContains: FilterOperator;
|
|
1182
|
+
/**
|
|
1183
|
+
* Null checks
|
|
1184
|
+
*/
|
|
1185
|
+
export declare const OpIsNull: FilterOperator;
|
|
1186
|
+
export declare const OpIsNotNull: FilterOperator;
|
|
1187
|
+
/**
|
|
1188
|
+
* Empty checks (for strings)
|
|
1189
|
+
*/
|
|
1190
|
+
export declare const OpIsEmpty: FilterOperator;
|
|
1191
|
+
export declare const OpIsNotEmpty: FilterOperator;
|
|
1192
|
+
/**
|
|
1193
|
+
* SortOrder represents sorting configuration
|
|
1194
|
+
*/
|
|
1195
|
+
export interface SortOrder {
|
|
1196
|
+
field: string;
|
|
1197
|
+
dir: string;
|
|
1198
|
+
}
|
|
1199
|
+
/**
|
|
1200
|
+
* CursorListRequest represents a cursor-based list request with all options
|
|
1201
|
+
*/
|
|
1202
|
+
export interface CursorListRequest {
|
|
1203
|
+
cursor: string;
|
|
1204
|
+
limit: number;
|
|
1205
|
+
direction: string;
|
|
1206
|
+
search?: SearchRequest;
|
|
1207
|
+
filters: Filter[];
|
|
1208
|
+
preloads: string[];
|
|
1209
|
+
sort: SortOrder[];
|
|
1210
|
+
fields: string[];
|
|
1211
|
+
permissions: string[];
|
|
1212
|
+
include_others: boolean;
|
|
1213
|
+
}
|
|
1214
|
+
/**
|
|
1215
|
+
* CursorListResponse represents a cursor-based paginated response
|
|
1216
|
+
*/
|
|
1217
|
+
export interface CursorListResponse<T extends any> {
|
|
1218
|
+
items: T[];
|
|
1219
|
+
next_cursor: string;
|
|
1220
|
+
prev_cursor: string;
|
|
1221
|
+
has_next: boolean;
|
|
1222
|
+
has_previous: boolean;
|
|
1223
|
+
items_per_page: number;
|
|
1224
|
+
total_items: number;
|
|
1225
|
+
}
|
|
1226
|
+
/**
|
|
1227
|
+
* CursorConfig represents the configuration for cursor-based pagination
|
|
1228
|
+
*/
|
|
1229
|
+
export interface CursorConfig {
|
|
1230
|
+
field: string;
|
|
1231
|
+
direction: string;
|
|
1232
|
+
value: any;
|
|
1233
|
+
}
|
|
1234
|
+
/**
|
|
1235
|
+
* Engine-related types
|
|
1236
|
+
*/
|
|
1237
|
+
export type EngineStatus = string;
|
|
1238
|
+
export declare const EngineStatusRunning: EngineStatus;
|
|
1239
|
+
export declare const EngineStatusPending: EngineStatus;
|
|
1240
|
+
export declare const EngineStatusStopping: EngineStatus;
|
|
1241
|
+
export declare const EngineStatusStopped: EngineStatus;
|
|
1242
|
+
export interface EngineState {
|
|
1243
|
+
BaseModel: BaseModel;
|
|
1244
|
+
PermissionModel: PermissionModel;
|
|
1245
|
+
instance?: Instance;
|
|
1246
|
+
transaction_id: string;
|
|
1247
|
+
config: EngineConfig;
|
|
1248
|
+
public_key: string;
|
|
1249
|
+
name: string;
|
|
1250
|
+
api_url: string;
|
|
1251
|
+
status: EngineStatus;
|
|
1252
|
+
system_info?: SystemInfo;
|
|
1253
|
+
workers: (WorkerState | undefined)[];
|
|
1254
|
+
}
|
|
1255
|
+
export interface LocalEngineState {
|
|
1256
|
+
id: string;
|
|
1257
|
+
name: string;
|
|
1258
|
+
config: EngineConfig;
|
|
1259
|
+
public_key: string;
|
|
1260
|
+
}
|
|
1261
|
+
export interface EngineStateDTO {
|
|
1262
|
+
id: string;
|
|
1263
|
+
created_at: string;
|
|
1264
|
+
updated_at: string;
|
|
1265
|
+
user_id: string;
|
|
1266
|
+
user?: UserRelationDTO;
|
|
1267
|
+
group_id?: string;
|
|
1268
|
+
acl?: ACL;
|
|
1269
|
+
instance?: Instance;
|
|
1270
|
+
config: EngineConfig;
|
|
1271
|
+
name: string;
|
|
1272
|
+
api_url: string;
|
|
1273
|
+
status: EngineStatus;
|
|
1274
|
+
system_info?: SystemInfo;
|
|
1275
|
+
workers: (WorkerStateDTO | undefined)[];
|
|
1276
|
+
}
|
|
1277
|
+
export interface EngineStateSummary {
|
|
1278
|
+
id: string;
|
|
1279
|
+
created_at: string;
|
|
1280
|
+
updated_at: string;
|
|
1281
|
+
user_id: string;
|
|
1282
|
+
user?: UserRelationDTO;
|
|
1283
|
+
group_id?: string;
|
|
1284
|
+
acl?: ACL;
|
|
1285
|
+
instance?: Instance;
|
|
1286
|
+
name: string;
|
|
1287
|
+
status: EngineStatus;
|
|
1288
|
+
workers: (WorkerStateSummary | undefined)[];
|
|
1289
|
+
}
|
|
1290
|
+
/**
|
|
1291
|
+
* Worker-related types
|
|
1292
|
+
*/
|
|
1293
|
+
export type WorkerStatus = string;
|
|
1294
|
+
export interface WorkerState {
|
|
1295
|
+
BaseModel: BaseModel;
|
|
1296
|
+
PermissionModel: PermissionModel;
|
|
1297
|
+
index: number;
|
|
1298
|
+
status: WorkerStatus;
|
|
1299
|
+
status_updated_at?: string;
|
|
1300
|
+
engine_id: string;
|
|
1301
|
+
engine?: EngineState;
|
|
1302
|
+
task_id?: string;
|
|
1303
|
+
app_id: string;
|
|
1304
|
+
app_version_id: string;
|
|
1305
|
+
variant: string;
|
|
1306
|
+
gpus: WorkerGPU[];
|
|
1307
|
+
cpus: WorkerCPU[];
|
|
1308
|
+
rams: WorkerRAM[];
|
|
1309
|
+
}
|
|
1310
|
+
export interface WorkerGPU {
|
|
1311
|
+
id: string;
|
|
1312
|
+
worker_id: string;
|
|
1313
|
+
gpu_id: string;
|
|
1314
|
+
type: GPUType;
|
|
1315
|
+
name: string;
|
|
1316
|
+
vram: number;
|
|
1317
|
+
}
|
|
1318
|
+
export interface WorkerCPU {
|
|
1319
|
+
id: string;
|
|
1320
|
+
worker_id: string;
|
|
1321
|
+
name: string;
|
|
1322
|
+
vendor_id: string;
|
|
1323
|
+
family: string;
|
|
1324
|
+
model: string;
|
|
1325
|
+
cores: number;
|
|
1326
|
+
frequency: string;
|
|
1327
|
+
}
|
|
1328
|
+
export interface WorkerRAM {
|
|
1329
|
+
id: string;
|
|
1330
|
+
worker_id: string;
|
|
1331
|
+
total: number;
|
|
1332
|
+
}
|
|
1333
|
+
export interface WorkerStateDTO {
|
|
1334
|
+
id: string;
|
|
1335
|
+
user_id: string;
|
|
1336
|
+
index: number;
|
|
1337
|
+
status: WorkerStatus;
|
|
1338
|
+
engine_id: string;
|
|
1339
|
+
task_id?: string;
|
|
1340
|
+
app_id: string;
|
|
1341
|
+
app_version_id: string;
|
|
1342
|
+
app_variant: string;
|
|
1343
|
+
gpus: WorkerGPU[];
|
|
1344
|
+
cpus: WorkerCPU[];
|
|
1345
|
+
rams: WorkerRAM[];
|
|
1346
|
+
system_info: SystemInfo;
|
|
1347
|
+
}
|
|
1348
|
+
export interface WorkerStateSummary {
|
|
1349
|
+
id: string;
|
|
1350
|
+
user_id: string;
|
|
1351
|
+
index: number;
|
|
1352
|
+
status: WorkerStatus;
|
|
1353
|
+
engine_id: string;
|
|
1354
|
+
engine_name: string;
|
|
1355
|
+
task_id?: string;
|
|
1356
|
+
app_id: string;
|
|
1357
|
+
app_version_id: string;
|
|
1358
|
+
app_variant: string;
|
|
1359
|
+
gpus: WorkerGPU[];
|
|
1360
|
+
cpus: WorkerCPU[];
|
|
1361
|
+
rams: WorkerRAM[];
|
|
1362
|
+
}
|
|
1363
|
+
export interface File {
|
|
1364
|
+
BaseModel: BaseModel;
|
|
1365
|
+
PermissionModel: PermissionModel;
|
|
1366
|
+
path: string;
|
|
1367
|
+
remote_path: string;
|
|
1368
|
+
upload_url: string;
|
|
1369
|
+
uri: string;
|
|
1370
|
+
content_type: string;
|
|
1371
|
+
size: number;
|
|
1372
|
+
filename: string;
|
|
1373
|
+
}
|
|
1374
|
+
export interface FileDTO {
|
|
1375
|
+
id: string;
|
|
1376
|
+
created_at: string;
|
|
1377
|
+
updated_at: string;
|
|
1378
|
+
user_id: string;
|
|
1379
|
+
user: UserRelationDTO;
|
|
1380
|
+
path: string;
|
|
1381
|
+
remote_path: string;
|
|
1382
|
+
upload_url: string;
|
|
1383
|
+
uri: string;
|
|
1384
|
+
content_type: string;
|
|
1385
|
+
size: number;
|
|
1386
|
+
filename: string;
|
|
1387
|
+
}
|
|
1388
|
+
export interface Flow {
|
|
1389
|
+
BaseModel: BaseModel;
|
|
1390
|
+
PermissionModel: PermissionModel;
|
|
1391
|
+
name: string;
|
|
1392
|
+
description: string;
|
|
1393
|
+
card_image: string;
|
|
1394
|
+
thumbnail: string;
|
|
1395
|
+
banner_image: string;
|
|
1396
|
+
input_schema: any;
|
|
1397
|
+
input: FlowRunInputs;
|
|
1398
|
+
output_schema: any;
|
|
1399
|
+
output_mappings: OutputMappings;
|
|
1400
|
+
node_data: FlowNodeDataMap;
|
|
1401
|
+
nodes: FlowNode[];
|
|
1402
|
+
edges: FlowEdge[];
|
|
1403
|
+
viewport?: FlowViewport;
|
|
1404
|
+
}
|
|
1405
|
+
export interface FlowViewport {
|
|
1406
|
+
x: number;
|
|
1407
|
+
y: number;
|
|
1408
|
+
zoom: number;
|
|
1409
|
+
}
|
|
1410
|
+
export interface FlowNode {
|
|
1411
|
+
id: string;
|
|
1412
|
+
type: string;
|
|
1413
|
+
position: FlowNodePosition;
|
|
1414
|
+
}
|
|
1415
|
+
export interface FlowNodePosition {
|
|
1416
|
+
x: number;
|
|
1417
|
+
y: number;
|
|
1418
|
+
}
|
|
1419
|
+
export interface FlowNodeData {
|
|
1420
|
+
app?: AppDTO;
|
|
1421
|
+
app_id: string;
|
|
1422
|
+
app_version_id: string;
|
|
1423
|
+
app_variant: string;
|
|
1424
|
+
infra: Infra;
|
|
1425
|
+
workers: string[];
|
|
1426
|
+
additional?: any;
|
|
1427
|
+
task?: TaskDTO;
|
|
1428
|
+
task_id?: string;
|
|
1429
|
+
}
|
|
1430
|
+
export type FlowNodeDataMap = {
|
|
1431
|
+
[key: string]: FlowNodeData;
|
|
1432
|
+
};
|
|
1433
|
+
export interface FlowEdge {
|
|
1434
|
+
id: string;
|
|
1435
|
+
type: string;
|
|
1436
|
+
source: string;
|
|
1437
|
+
target: string;
|
|
1438
|
+
source_handle?: string;
|
|
1439
|
+
target_handle?: string;
|
|
1440
|
+
}
|
|
1441
|
+
/**
|
|
1442
|
+
* OutputFieldMapping represents a mapping from a source node's field to an output field in the flow output schema.
|
|
1443
|
+
*/
|
|
1444
|
+
export interface OutputFieldMapping {
|
|
1445
|
+
sourceNodeId: string;
|
|
1446
|
+
sourceFieldPath: string;
|
|
1447
|
+
outputFieldName: string;
|
|
1448
|
+
type: string;
|
|
1449
|
+
schema: any;
|
|
1450
|
+
}
|
|
1451
|
+
/**
|
|
1452
|
+
* OutputMappings is a map of output field name to OutputFieldMapping.
|
|
1453
|
+
*/
|
|
1454
|
+
export type OutputMappings = {
|
|
1455
|
+
[key: string]: OutputFieldMapping;
|
|
1456
|
+
};
|
|
1457
|
+
export interface FlowDTO {
|
|
1458
|
+
id: string;
|
|
1459
|
+
created_at: string;
|
|
1460
|
+
updated_at: string;
|
|
1461
|
+
deleted_at?: string;
|
|
1462
|
+
user_id: string;
|
|
1463
|
+
user?: UserRelationDTO;
|
|
1464
|
+
name: string;
|
|
1465
|
+
description: string;
|
|
1466
|
+
card_image: string;
|
|
1467
|
+
thumbnail: string;
|
|
1468
|
+
banner_image: string;
|
|
1469
|
+
input_schema: any;
|
|
1470
|
+
input: FlowRunInputs;
|
|
1471
|
+
output_schema: any;
|
|
1472
|
+
output_mappings: OutputMappings;
|
|
1473
|
+
node_data: FlowNodeDataMap;
|
|
1474
|
+
nodes: FlowNode[];
|
|
1475
|
+
edges: FlowEdge[];
|
|
1476
|
+
viewport?: FlowViewport;
|
|
1477
|
+
}
|
|
1478
|
+
export interface NodeTaskDTO {
|
|
1479
|
+
task_id: string;
|
|
1480
|
+
task?: TaskDTO;
|
|
1481
|
+
}
|
|
1482
|
+
export type FlowRunStatus = number;
|
|
1483
|
+
export declare const FlowRunStatusUnknown: FlowRunStatus;
|
|
1484
|
+
export declare const FlowRunStatusPending: FlowRunStatus;
|
|
1485
|
+
export declare const FlowRunStatusRunning: FlowRunStatus;
|
|
1486
|
+
export declare const FlowRunStatusCompleted: FlowRunStatus;
|
|
1487
|
+
export declare const FlowRunStatusFailed: FlowRunStatus;
|
|
1488
|
+
export declare const FlowRunStatusCancelled: FlowRunStatus;
|
|
1489
|
+
export interface FlowRun {
|
|
1490
|
+
BaseModel: BaseModel;
|
|
1491
|
+
PermissionModel: PermissionModel;
|
|
1492
|
+
task_id?: string;
|
|
1493
|
+
flow_id: string;
|
|
1494
|
+
flow: Flow;
|
|
1495
|
+
status: FlowRunStatus;
|
|
1496
|
+
error?: string;
|
|
1497
|
+
flow_run_started?: string;
|
|
1498
|
+
flow_run_finished?: string;
|
|
1499
|
+
flow_run_cancelled?: string;
|
|
1500
|
+
input: FlowRunInputs;
|
|
1501
|
+
fail_on_error: boolean;
|
|
1502
|
+
output: any;
|
|
1503
|
+
infra?: Infra;
|
|
1504
|
+
workers?: string[];
|
|
1505
|
+
node_task_map: {
|
|
1506
|
+
[key: string]: string;
|
|
1507
|
+
};
|
|
1508
|
+
node_tasks: {
|
|
1509
|
+
[key: string]: NodeTask;
|
|
1510
|
+
};
|
|
1511
|
+
}
|
|
1512
|
+
export interface FlowRunDTO {
|
|
1513
|
+
id: string;
|
|
1514
|
+
created_at: string;
|
|
1515
|
+
updated_at: string;
|
|
1516
|
+
acl?: ACL;
|
|
1517
|
+
user_id: string;
|
|
1518
|
+
user?: UserRelationDTO;
|
|
1519
|
+
flow_id: string;
|
|
1520
|
+
flow?: FlowDTO;
|
|
1521
|
+
task_id?: string;
|
|
1522
|
+
status: FlowRunStatus;
|
|
1523
|
+
error?: string;
|
|
1524
|
+
flow_run_started?: string;
|
|
1525
|
+
flow_run_finished?: string;
|
|
1526
|
+
flow_run_cancelled?: string;
|
|
1527
|
+
input: FlowRunInputs;
|
|
1528
|
+
fail_on_error: boolean;
|
|
1529
|
+
output: any;
|
|
1530
|
+
node_tasks: {
|
|
1531
|
+
[key: string]: NodeTaskDTO | undefined;
|
|
1532
|
+
};
|
|
1533
|
+
}
|
|
1534
|
+
/**
|
|
1535
|
+
* Connection represents a connection between nodes in a flow
|
|
1536
|
+
*/
|
|
1537
|
+
export interface FlowNodeConnection {
|
|
1538
|
+
nodeId: string;
|
|
1539
|
+
key: string;
|
|
1540
|
+
type: string;
|
|
1541
|
+
previousValue: any;
|
|
1542
|
+
}
|
|
1543
|
+
export type FlowRunInputs = {
|
|
1544
|
+
[key: string]: {
|
|
1545
|
+
[key: string]: FlowRunInput;
|
|
1546
|
+
};
|
|
1547
|
+
};
|
|
1548
|
+
export interface FlowRunInput {
|
|
1549
|
+
Connection?: FlowNodeConnection;
|
|
1550
|
+
Value: any;
|
|
1551
|
+
}
|
|
1552
|
+
export interface NodeTask {
|
|
1553
|
+
task_id: string;
|
|
1554
|
+
task?: Task;
|
|
1555
|
+
}
|
|
1556
|
+
/**
|
|
1557
|
+
* NodePosition represents x,y coordinates
|
|
1558
|
+
*/
|
|
1559
|
+
export interface NodePosition {
|
|
1560
|
+
x: number;
|
|
1561
|
+
y: number;
|
|
1562
|
+
}
|
|
1563
|
+
/**
|
|
1564
|
+
* CoordinateExtent represents a bounding box with [x1, y1, x2, y2]
|
|
1565
|
+
*/
|
|
1566
|
+
export type CoordinateExtent = number[];
|
|
1567
|
+
export interface NodeHandle {
|
|
1568
|
+
x: number;
|
|
1569
|
+
y: number;
|
|
1570
|
+
position: string;
|
|
1571
|
+
id: string;
|
|
1572
|
+
width: number;
|
|
1573
|
+
height: number;
|
|
1574
|
+
type: string;
|
|
1575
|
+
name: string;
|
|
1576
|
+
}
|
|
1577
|
+
export interface GraphModel {
|
|
1578
|
+
graph_id?: string;
|
|
1579
|
+
}
|
|
1580
|
+
/**
|
|
1581
|
+
* Graph represents a persistent directed acyclic graph for tracking execution dependencies
|
|
1582
|
+
*/
|
|
1583
|
+
export interface Graph {
|
|
1584
|
+
BaseModel: BaseModel;
|
|
1585
|
+
PermissionModel: PermissionModel;
|
|
1586
|
+
/**
|
|
1587
|
+
* Source reference - what created this graph
|
|
1588
|
+
*/
|
|
1589
|
+
source_id: string;
|
|
1590
|
+
source_type: string;
|
|
1591
|
+
/**
|
|
1592
|
+
* Status
|
|
1593
|
+
*/
|
|
1594
|
+
status: GraphStatus;
|
|
1595
|
+
/**
|
|
1596
|
+
* Metadata
|
|
1597
|
+
*/
|
|
1598
|
+
started_at?: string;
|
|
1599
|
+
completed_at?: string;
|
|
1600
|
+
error?: string;
|
|
1601
|
+
/**
|
|
1602
|
+
* Relationships - loaded via GORM joins
|
|
1603
|
+
*/
|
|
1604
|
+
nodes?: (GraphNode | undefined)[];
|
|
1605
|
+
edges?: (GraphEdge | undefined)[];
|
|
1606
|
+
node_states?: (GraphNodeState | undefined)[];
|
|
1607
|
+
}
|
|
1608
|
+
/**
|
|
1609
|
+
* GraphNode represents a node in the execution graph
|
|
1610
|
+
*/
|
|
1611
|
+
export interface GraphNode {
|
|
1612
|
+
id: string;
|
|
1613
|
+
graph_id: string;
|
|
1614
|
+
type: string;
|
|
1615
|
+
/**
|
|
1616
|
+
* Optional metadata for the node
|
|
1617
|
+
*/
|
|
1618
|
+
name?: string;
|
|
1619
|
+
description?: string;
|
|
1620
|
+
metadata?: {
|
|
1621
|
+
[key: string]: any;
|
|
1622
|
+
};
|
|
1623
|
+
created_at: string;
|
|
1624
|
+
updated_at: string;
|
|
1625
|
+
}
|
|
1626
|
+
/**
|
|
1627
|
+
* GraphEdge represents a dependency between nodes
|
|
1628
|
+
*/
|
|
1629
|
+
export interface GraphEdge {
|
|
1630
|
+
id: string;
|
|
1631
|
+
graph_id: string;
|
|
1632
|
+
from: string;
|
|
1633
|
+
to: string;
|
|
1634
|
+
/**
|
|
1635
|
+
* Edge properties
|
|
1636
|
+
*/
|
|
1637
|
+
type: GraphEdgeType;
|
|
1638
|
+
required: boolean;
|
|
1639
|
+
completed: boolean;
|
|
1640
|
+
metadata?: {
|
|
1641
|
+
[key: string]: any;
|
|
1642
|
+
};
|
|
1643
|
+
created_at: string;
|
|
1644
|
+
updated_at: string;
|
|
1645
|
+
}
|
|
1646
|
+
/**
|
|
1647
|
+
* GraphNodeState tracks the execution state of a node
|
|
1648
|
+
*/
|
|
1649
|
+
export interface GraphNodeState {
|
|
1650
|
+
node_id: string;
|
|
1651
|
+
graph_id: string;
|
|
1652
|
+
status: GraphNodeStatus;
|
|
1653
|
+
/**
|
|
1654
|
+
* Dependency barrier counters
|
|
1655
|
+
*/
|
|
1656
|
+
required_deps: number;
|
|
1657
|
+
completed_deps: number;
|
|
1658
|
+
/**
|
|
1659
|
+
* Link to the actual execution entity (TaskID, ChatMessageID, etc.)
|
|
1660
|
+
*/
|
|
1661
|
+
execution_id?: string;
|
|
1662
|
+
execution_type?: string;
|
|
1663
|
+
/**
|
|
1664
|
+
* Timing
|
|
1665
|
+
*/
|
|
1666
|
+
ready_at?: string;
|
|
1667
|
+
started_at?: string;
|
|
1668
|
+
completed_at?: string;
|
|
1669
|
+
/**
|
|
1670
|
+
* Error tracking
|
|
1671
|
+
*/
|
|
1672
|
+
error?: string;
|
|
1673
|
+
retry_count?: number;
|
|
1674
|
+
/**
|
|
1675
|
+
* Optional: Store outputs if needed for input resolution
|
|
1676
|
+
*/
|
|
1677
|
+
outputs?: {
|
|
1678
|
+
[key: string]: any;
|
|
1679
|
+
};
|
|
1680
|
+
created_at: string;
|
|
1681
|
+
updated_at: string;
|
|
1682
|
+
}
|
|
1683
|
+
/**
|
|
1684
|
+
* GraphStatus represents the overall status of the graph
|
|
1685
|
+
*/
|
|
1686
|
+
export type GraphStatus = string;
|
|
1687
|
+
export declare const GraphStatusPending: GraphStatus;
|
|
1688
|
+
export declare const GraphStatusRunning: GraphStatus;
|
|
1689
|
+
export declare const GraphStatusCompleted: GraphStatus;
|
|
1690
|
+
export declare const GraphStatusFailed: GraphStatus;
|
|
1691
|
+
export declare const GraphStatusCancelled: GraphStatus;
|
|
1692
|
+
/**
|
|
1693
|
+
* GraphNodeStatus represents the status of a node
|
|
1694
|
+
*/
|
|
1695
|
+
export type GraphNodeStatus = string;
|
|
1696
|
+
export declare const GraphNodeStatusPending: GraphNodeStatus;
|
|
1697
|
+
export declare const GraphNodeStatusReady: GraphNodeStatus;
|
|
1698
|
+
export declare const GraphNodeStatusRunning: GraphNodeStatus;
|
|
1699
|
+
export declare const GraphNodeStatusCompleted: GraphNodeStatus;
|
|
1700
|
+
export declare const GraphNodeStatusFailed: GraphNodeStatus;
|
|
1701
|
+
export declare const GraphNodeStatusCancelled: GraphNodeStatus;
|
|
1702
|
+
export declare const GraphNodeStatusSkipped: GraphNodeStatus;
|
|
1703
|
+
export declare const GraphNodeStatusBlocked: GraphNodeStatus;
|
|
1704
|
+
/**
|
|
1705
|
+
* GraphEdgeType defines the type of edge relationship
|
|
1706
|
+
*/
|
|
1707
|
+
export type GraphEdgeType = string;
|
|
1708
|
+
export declare const GraphEdgeTypeDependency: GraphEdgeType;
|
|
1709
|
+
export declare const GraphEdgeTypeFlow: GraphEdgeType;
|
|
1710
|
+
export declare const GraphEdgeTypeConditional: GraphEdgeType;
|
|
1711
|
+
export declare const GraphEdgeTypeError: GraphEdgeType;
|
|
1712
|
+
/**
|
|
1713
|
+
* GraphSpec is used to create a new execution graph
|
|
1714
|
+
*/
|
|
1715
|
+
export interface GraphSpec {
|
|
1716
|
+
SourceID: string;
|
|
1717
|
+
SourceType: string;
|
|
1718
|
+
Nodes: GraphNodeSpec[];
|
|
1719
|
+
Edges: GraphEdgeSpec[];
|
|
1720
|
+
}
|
|
1721
|
+
/**
|
|
1722
|
+
* GraphNodeSpec specifies a node to be created
|
|
1723
|
+
*/
|
|
1724
|
+
export interface GraphNodeSpec {
|
|
1725
|
+
ID: string;
|
|
1726
|
+
Type: string;
|
|
1727
|
+
Name: string;
|
|
1728
|
+
Description: string;
|
|
1729
|
+
Metadata: {
|
|
1730
|
+
[key: string]: any;
|
|
1731
|
+
};
|
|
1732
|
+
}
|
|
1733
|
+
/**
|
|
1734
|
+
* GraphEdgeSpec specifies an edge to be created
|
|
1735
|
+
*/
|
|
1736
|
+
export interface GraphEdgeSpec {
|
|
1737
|
+
ID: string;
|
|
1738
|
+
From: string;
|
|
1739
|
+
To: string;
|
|
1740
|
+
Type: GraphEdgeType;
|
|
1741
|
+
Required: boolean;
|
|
1742
|
+
Metadata: {
|
|
1743
|
+
[key: string]: any;
|
|
1744
|
+
};
|
|
1745
|
+
}
|
|
1746
|
+
/**
|
|
1747
|
+
* ServerCapabilities represents the server's supported features
|
|
1748
|
+
*/
|
|
1749
|
+
export interface ServerCapabilitiesLogging {
|
|
1750
|
+
level: string;
|
|
1751
|
+
}
|
|
1752
|
+
export interface ServerCapabilitiesPrompts {
|
|
1753
|
+
listChanged: boolean;
|
|
1754
|
+
}
|
|
1755
|
+
export interface ServerCapabilitiesResources {
|
|
1756
|
+
subscribe: boolean;
|
|
1757
|
+
listChanged: boolean;
|
|
1758
|
+
}
|
|
1759
|
+
export interface ServerCapabilitiesTools {
|
|
1760
|
+
listChanged: boolean;
|
|
1761
|
+
}
|
|
1762
|
+
export interface ServerCapabilities {
|
|
1763
|
+
logging: ServerCapabilitiesLogging;
|
|
1764
|
+
prompts: ServerCapabilitiesPrompts;
|
|
1765
|
+
resources: ServerCapabilitiesResources;
|
|
1766
|
+
tools: ServerCapabilitiesTools;
|
|
1767
|
+
}
|
|
1768
|
+
/**
|
|
1769
|
+
* ServerInfo represents information about the server
|
|
1770
|
+
*/
|
|
1771
|
+
export interface ServerInfo {
|
|
1772
|
+
name: string;
|
|
1773
|
+
title: string;
|
|
1774
|
+
version: string;
|
|
1775
|
+
}
|
|
1776
|
+
/**
|
|
1777
|
+
* InitializeResponse represents the server's response to an initialization request
|
|
1778
|
+
*/
|
|
1779
|
+
export interface InitializeResponse {
|
|
1780
|
+
protocolVersion: string;
|
|
1781
|
+
capabilities: ServerCapabilities;
|
|
1782
|
+
serverInfo: ServerInfo;
|
|
1783
|
+
instructions?: string;
|
|
1784
|
+
}
|
|
1785
|
+
/**
|
|
1786
|
+
* CancellationParams represents the parameters for a cancellation notification
|
|
1787
|
+
*/
|
|
1788
|
+
export interface CancellationParams {
|
|
1789
|
+
requestId: string;
|
|
1790
|
+
reason?: string;
|
|
1791
|
+
}
|
|
1792
|
+
/**
|
|
1793
|
+
* ProgressParams represents progress update parameters
|
|
1794
|
+
*/
|
|
1795
|
+
export interface ProgressParams {
|
|
1796
|
+
requestId: string;
|
|
1797
|
+
progress: number;
|
|
1798
|
+
message?: string;
|
|
1799
|
+
}
|
|
1800
|
+
/**
|
|
1801
|
+
* ResourceRequest represents a request for resource operations
|
|
1802
|
+
*/
|
|
1803
|
+
export interface ResourceRequest {
|
|
1804
|
+
operation: string;
|
|
1805
|
+
id?: string;
|
|
1806
|
+
userId?: string;
|
|
1807
|
+
resource?: any;
|
|
1808
|
+
listOptions?: ListRequest;
|
|
1809
|
+
}
|
|
1810
|
+
/**
|
|
1811
|
+
* ResourceResponse represents a response for resource operations
|
|
1812
|
+
*/
|
|
1813
|
+
export interface ResourceResponse {
|
|
1814
|
+
resources: Resource[];
|
|
1815
|
+
nextCursor?: string;
|
|
1816
|
+
}
|
|
1817
|
+
/**
|
|
1818
|
+
* Resource represents a resource item
|
|
1819
|
+
*/
|
|
1820
|
+
export interface Resource {
|
|
1821
|
+
uri: string;
|
|
1822
|
+
name: string;
|
|
1823
|
+
title?: string;
|
|
1824
|
+
description?: string;
|
|
1825
|
+
mimeType?: string;
|
|
1826
|
+
size?: number;
|
|
1827
|
+
}
|
|
1828
|
+
/**
|
|
1829
|
+
* ResourceContent represents resource content
|
|
1830
|
+
*/
|
|
1831
|
+
export interface ResourceContent {
|
|
1832
|
+
uri: string;
|
|
1833
|
+
name: string;
|
|
1834
|
+
title?: string;
|
|
1835
|
+
mimeType?: string;
|
|
1836
|
+
text?: string;
|
|
1837
|
+
blob?: string;
|
|
1838
|
+
}
|
|
1839
|
+
/**
|
|
1840
|
+
* ResourceReadResponse represents a response for resource read operations
|
|
1841
|
+
*/
|
|
1842
|
+
export interface ResourceReadResponse {
|
|
1843
|
+
contents: ResourceContent[];
|
|
1844
|
+
}
|
|
1845
|
+
/**
|
|
1846
|
+
* PromptRequest represents a request for prompt operations
|
|
1847
|
+
*/
|
|
1848
|
+
export interface PromptRequest {
|
|
1849
|
+
operation: string;
|
|
1850
|
+
id?: string;
|
|
1851
|
+
prompt?: string;
|
|
1852
|
+
listOptions?: ListRequest;
|
|
1853
|
+
}
|
|
1854
|
+
/**
|
|
1855
|
+
* PromptResponse represents a response for prompt operations
|
|
1856
|
+
*/
|
|
1857
|
+
export interface PromptResponse {
|
|
1858
|
+
prompts: Prompt[];
|
|
1859
|
+
nextCursor?: string;
|
|
1860
|
+
}
|
|
1861
|
+
/**
|
|
1862
|
+
* Prompt represents a prompt item
|
|
1863
|
+
*/
|
|
1864
|
+
export interface Prompt {
|
|
1865
|
+
name: string;
|
|
1866
|
+
title?: string;
|
|
1867
|
+
description?: string;
|
|
1868
|
+
arguments?: PromptArg[];
|
|
1869
|
+
messages?: PromptMessage[];
|
|
1870
|
+
}
|
|
1871
|
+
/**
|
|
1872
|
+
* PromptArg represents a prompt argument
|
|
1873
|
+
*/
|
|
1874
|
+
export interface PromptArg {
|
|
1875
|
+
name: string;
|
|
1876
|
+
description: string;
|
|
1877
|
+
required: boolean;
|
|
1878
|
+
}
|
|
1879
|
+
/**
|
|
1880
|
+
* PromptMessage represents a message in a prompt
|
|
1881
|
+
*/
|
|
1882
|
+
export interface PromptMessage {
|
|
1883
|
+
role: string;
|
|
1884
|
+
content: PromptContent;
|
|
1885
|
+
}
|
|
1886
|
+
/**
|
|
1887
|
+
* PromptContent represents content in a prompt message
|
|
1888
|
+
*/
|
|
1889
|
+
export interface PromptContent {
|
|
1890
|
+
type: string;
|
|
1891
|
+
text?: string;
|
|
1892
|
+
data?: string;
|
|
1893
|
+
mimeType?: string;
|
|
1894
|
+
}
|
|
1895
|
+
/**
|
|
1896
|
+
* ToolRequest represents a request for tool operations
|
|
1897
|
+
*/
|
|
1898
|
+
export interface ToolListRequest {
|
|
1899
|
+
cursor?: string;
|
|
1900
|
+
}
|
|
1901
|
+
/**
|
|
1902
|
+
* ToolResponse represents a response for tool operations
|
|
1903
|
+
*/
|
|
1904
|
+
export interface ToolListResponse {
|
|
1905
|
+
tools: MCPTool[];
|
|
1906
|
+
nextCursor?: string;
|
|
1907
|
+
}
|
|
1908
|
+
/**
|
|
1909
|
+
* Tool represents a tool item
|
|
1910
|
+
*/
|
|
1911
|
+
export interface MCPTool {
|
|
1912
|
+
name: string;
|
|
1913
|
+
title?: string;
|
|
1914
|
+
description: string;
|
|
1915
|
+
inputSchema: any;
|
|
1916
|
+
outputSchema?: any;
|
|
1917
|
+
}
|
|
1918
|
+
/**
|
|
1919
|
+
* ToolCallRequest represents a request to call a tool
|
|
1920
|
+
*/
|
|
1921
|
+
export interface ToolCallRequest {
|
|
1922
|
+
name: string;
|
|
1923
|
+
arguments: {
|
|
1924
|
+
[key: string]: any;
|
|
1925
|
+
};
|
|
1926
|
+
}
|
|
1927
|
+
/**
|
|
1928
|
+
* ToolCallResponse represents a response from a tool call
|
|
1929
|
+
*/
|
|
1930
|
+
export interface ToolCallResponse {
|
|
1931
|
+
content: ToolContent[];
|
|
1932
|
+
structuredContent?: any;
|
|
1933
|
+
isError: boolean;
|
|
1934
|
+
}
|
|
1935
|
+
/**
|
|
1936
|
+
* ToolContent represents content in a tool response
|
|
1937
|
+
*/
|
|
1938
|
+
export interface ToolContent {
|
|
1939
|
+
type: string;
|
|
1940
|
+
text?: string;
|
|
1941
|
+
data?: string;
|
|
1942
|
+
mimeType?: string;
|
|
1943
|
+
resource?: ResourceContent;
|
|
1944
|
+
}
|
|
1945
|
+
/**
|
|
1946
|
+
* JSONRPCRequest represents a JSON-RPC request
|
|
1947
|
+
*/
|
|
1948
|
+
export interface JSONRPCRequest {
|
|
1949
|
+
jsonrpc: string;
|
|
1950
|
+
id: any;
|
|
1951
|
+
method: string;
|
|
1952
|
+
params?: any;
|
|
1953
|
+
}
|
|
1954
|
+
/**
|
|
1955
|
+
* JSONRPCResponse represents a JSON-RPC response
|
|
1956
|
+
*/
|
|
1957
|
+
export interface JSONRPCResponse {
|
|
1958
|
+
jsonrpc: string;
|
|
1959
|
+
id: any;
|
|
1960
|
+
result?: any;
|
|
1961
|
+
error?: JSONRPCError;
|
|
1962
|
+
}
|
|
1963
|
+
/**
|
|
1964
|
+
* JSONRPCError represents a JSON-RPC error
|
|
1965
|
+
*/
|
|
1966
|
+
export interface JSONRPCError {
|
|
1967
|
+
code: number;
|
|
1968
|
+
message: string;
|
|
1969
|
+
data?: any;
|
|
1970
|
+
}
|
|
1971
|
+
/**
|
|
1972
|
+
* NotificationMessage represents a notification message
|
|
1973
|
+
*/
|
|
1974
|
+
export interface NotificationMessage {
|
|
1975
|
+
jsonrpc: string;
|
|
1976
|
+
method: string;
|
|
1977
|
+
params?: any;
|
|
1978
|
+
}
|
|
1979
|
+
/**
|
|
1980
|
+
* ConnectedEvent represents a connected event
|
|
1981
|
+
*/
|
|
1982
|
+
export interface ConnectedEvent {
|
|
1983
|
+
event: string;
|
|
1984
|
+
timestamp: string;
|
|
1985
|
+
}
|
|
1986
|
+
/**
|
|
1987
|
+
* ResourceTemplate represents a resource template
|
|
1988
|
+
*/
|
|
1989
|
+
export interface ResourceTemplate {
|
|
1990
|
+
uriTemplate: string;
|
|
1991
|
+
name: string;
|
|
1992
|
+
title?: string;
|
|
1993
|
+
description?: string;
|
|
1994
|
+
mimeType?: string;
|
|
1995
|
+
}
|
|
1996
|
+
/**
|
|
1997
|
+
* ResourceTemplateResponse represents a response for resource template operations
|
|
1998
|
+
*/
|
|
1999
|
+
export interface ResourceTemplateResponse {
|
|
2000
|
+
resourceTemplates: ResourceTemplate[];
|
|
2001
|
+
}
|
|
2002
|
+
/**
|
|
2003
|
+
* ProjectType represents different types of projects
|
|
2004
|
+
*/
|
|
2005
|
+
export type ProjectType = string;
|
|
2006
|
+
export declare const ProjectTypeAgent: ProjectType;
|
|
2007
|
+
export declare const ProjectTypeApp: ProjectType;
|
|
2008
|
+
export declare const ProjectTypeFlow: ProjectType;
|
|
2009
|
+
export declare const ProjectTypeOther: ProjectType;
|
|
2010
|
+
/**
|
|
2011
|
+
* Project represents a container for organizing related resources
|
|
2012
|
+
*/
|
|
2013
|
+
export interface Project {
|
|
2014
|
+
BaseModel: BaseModel;
|
|
2015
|
+
PermissionModel: PermissionModel;
|
|
2016
|
+
name: string;
|
|
2017
|
+
description: string;
|
|
2018
|
+
type: ProjectType;
|
|
2019
|
+
color?: string;
|
|
2020
|
+
icon?: string;
|
|
2021
|
+
/**
|
|
2022
|
+
* For future: nested folders/projects
|
|
2023
|
+
*/
|
|
2024
|
+
parent_id?: string;
|
|
2025
|
+
parent?: Project;
|
|
2026
|
+
children: (Project | undefined)[];
|
|
2027
|
+
}
|
|
2028
|
+
/**
|
|
2029
|
+
* ProjectDTO for API responses
|
|
2030
|
+
*/
|
|
2031
|
+
export interface ProjectDTO {
|
|
2032
|
+
id: string;
|
|
2033
|
+
created_at: string;
|
|
2034
|
+
updated_at: string;
|
|
2035
|
+
deleted_at?: string;
|
|
2036
|
+
user_id: string;
|
|
2037
|
+
user?: UserRelationDTO;
|
|
2038
|
+
acl?: ACL;
|
|
2039
|
+
name: string;
|
|
2040
|
+
description: string;
|
|
2041
|
+
type: ProjectType;
|
|
2042
|
+
color?: string;
|
|
2043
|
+
icon?: string;
|
|
2044
|
+
parent_id?: string;
|
|
2045
|
+
parent?: ProjectDTO;
|
|
2046
|
+
children: (ProjectDTO | undefined)[];
|
|
2047
|
+
}
|
|
2048
|
+
export interface ResourcePrice {
|
|
2049
|
+
CentsPerHour: number;
|
|
2050
|
+
NanosPerSecond: number;
|
|
2051
|
+
}
|
|
2052
|
+
/**
|
|
2053
|
+
* SchemaConverter handles conversion from JSON Schema to tool format
|
|
2054
|
+
*/
|
|
2055
|
+
export interface SchemaConverter {
|
|
2056
|
+
}
|
|
2057
|
+
/**
|
|
2058
|
+
* RequiredField represents a required field with its name and description
|
|
2059
|
+
*/
|
|
2060
|
+
export interface SchemaField {
|
|
2061
|
+
Name: string;
|
|
2062
|
+
Description: string;
|
|
2063
|
+
}
|
|
2064
|
+
export interface Session {
|
|
2065
|
+
id: string;
|
|
2066
|
+
hash: string;
|
|
2067
|
+
token: string;
|
|
2068
|
+
user_id: string;
|
|
2069
|
+
user?: User;
|
|
2070
|
+
created_at: string;
|
|
2071
|
+
expires_at: string;
|
|
2072
|
+
ip: string;
|
|
2073
|
+
user_agent: string;
|
|
2074
|
+
city: string;
|
|
2075
|
+
country: string;
|
|
2076
|
+
os: string;
|
|
2077
|
+
browser: string;
|
|
2078
|
+
browser_version: string;
|
|
2079
|
+
is_anonymous: boolean;
|
|
2080
|
+
}
|
|
2081
|
+
export type InstanceCloudProvider = string;
|
|
2082
|
+
export declare const CloudAWS: InstanceCloudProvider;
|
|
2083
|
+
export declare const CloudAzure: InstanceCloudProvider;
|
|
2084
|
+
export declare const CloudLambdaLabs: InstanceCloudProvider;
|
|
2085
|
+
export declare const CloudTensorDock: InstanceCloudProvider;
|
|
2086
|
+
export declare const CloudRunPod: InstanceCloudProvider;
|
|
2087
|
+
export declare const CloudLatitude: InstanceCloudProvider;
|
|
2088
|
+
export declare const CloudJarvisLabs: InstanceCloudProvider;
|
|
2089
|
+
export declare const CloudOblivus: InstanceCloudProvider;
|
|
2090
|
+
export declare const CloudPaperspace: InstanceCloudProvider;
|
|
2091
|
+
export declare const CloudDatacrunch: InstanceCloudProvider;
|
|
2092
|
+
export declare const CloudMassedCompute: InstanceCloudProvider;
|
|
2093
|
+
export declare const CloudVultr: InstanceCloudProvider;
|
|
2094
|
+
export declare const CloudShade: InstanceCloudProvider;
|
|
2095
|
+
export type InstanceStatus = string;
|
|
2096
|
+
export declare const InstanceStatusPending: InstanceStatus;
|
|
2097
|
+
export declare const InstanceStatusActive: InstanceStatus;
|
|
2098
|
+
export declare const InstanceStatusDeleted: InstanceStatus;
|
|
2099
|
+
export interface Instance {
|
|
2100
|
+
id: string;
|
|
2101
|
+
PermissionModel: PermissionModel;
|
|
2102
|
+
cloud: InstanceCloudProvider;
|
|
2103
|
+
name: string;
|
|
2104
|
+
region: string;
|
|
2105
|
+
shade_cloud: boolean;
|
|
2106
|
+
shade_instance_type: string;
|
|
2107
|
+
cloud_instance_type: string;
|
|
2108
|
+
cloud_assigned_id: string;
|
|
2109
|
+
os?: string;
|
|
2110
|
+
ssh_key_id?: string;
|
|
2111
|
+
ssh_user: string;
|
|
2112
|
+
ssh_port: number;
|
|
2113
|
+
ip: string;
|
|
2114
|
+
status: InstanceStatus;
|
|
2115
|
+
cost_estimate: string;
|
|
2116
|
+
hourly_price: number;
|
|
2117
|
+
template_id?: string;
|
|
2118
|
+
volume_ids?: string[];
|
|
2119
|
+
tags?: string[];
|
|
2120
|
+
configuration?: InstanceConfiguration;
|
|
2121
|
+
launch_configuration?: InstanceLaunchConfiguration;
|
|
2122
|
+
auto_delete?: InstanceThresholdConfig;
|
|
2123
|
+
alert?: InstanceThresholdConfig;
|
|
2124
|
+
volume_mount?: InstanceVolumeMountConfig;
|
|
2125
|
+
envs?: InstanceEnvVar[];
|
|
2126
|
+
}
|
|
2127
|
+
export interface InstanceRequest {
|
|
2128
|
+
cloud: InstanceCloudProvider;
|
|
2129
|
+
name: string;
|
|
2130
|
+
region: string;
|
|
2131
|
+
shade_cloud: boolean;
|
|
2132
|
+
shade_instance_type: string;
|
|
2133
|
+
os?: string;
|
|
2134
|
+
ssh_key_id?: string;
|
|
2135
|
+
template_id?: string;
|
|
2136
|
+
volume_ids?: string[];
|
|
2137
|
+
tags?: string[];
|
|
2138
|
+
launch_configuration?: InstanceLaunchConfiguration;
|
|
2139
|
+
auto_delete?: InstanceThresholdConfig;
|
|
2140
|
+
alert?: InstanceThresholdConfig;
|
|
2141
|
+
volume_mount?: InstanceVolumeMountConfig;
|
|
2142
|
+
envs?: InstanceEnvVar[];
|
|
2143
|
+
}
|
|
2144
|
+
export interface InstanceConfiguration {
|
|
2145
|
+
gpu_type: string;
|
|
2146
|
+
interconnect: string;
|
|
2147
|
+
memory_in_gb: number;
|
|
2148
|
+
num_gpus: number;
|
|
2149
|
+
os: string;
|
|
2150
|
+
storage_in_gb: number;
|
|
2151
|
+
vcpus: number;
|
|
2152
|
+
vram_per_gpu_in_gb: number;
|
|
2153
|
+
}
|
|
2154
|
+
export interface InstanceLaunchConfiguration {
|
|
2155
|
+
type: string;
|
|
2156
|
+
docker_configuration?: InstanceDockerConfig;
|
|
2157
|
+
script_configuration?: InstanceScriptConfig;
|
|
2158
|
+
}
|
|
2159
|
+
export interface InstanceDockerConfig {
|
|
2160
|
+
image: string;
|
|
2161
|
+
args?: string;
|
|
2162
|
+
shared_memory_in_gb?: number;
|
|
2163
|
+
envs?: InstanceEnvVar[];
|
|
2164
|
+
port_mappings?: InstancePortMapping[];
|
|
2165
|
+
volume_mounts?: InstanceVolumeMount[];
|
|
2166
|
+
}
|
|
2167
|
+
export interface InstanceScriptConfig {
|
|
2168
|
+
base64_script: string;
|
|
2169
|
+
}
|
|
2170
|
+
export interface InstancePortMapping {
|
|
2171
|
+
host_port: number;
|
|
2172
|
+
container_port: number;
|
|
2173
|
+
}
|
|
2174
|
+
export interface InstanceVolumeMount {
|
|
2175
|
+
host_path: string;
|
|
2176
|
+
container_path: string;
|
|
2177
|
+
}
|
|
2178
|
+
export interface InstanceThresholdConfig {
|
|
2179
|
+
date_threshold?: string;
|
|
2180
|
+
spend_threshold?: string;
|
|
2181
|
+
}
|
|
2182
|
+
export interface InstanceVolumeMountConfig {
|
|
2183
|
+
auto: boolean;
|
|
2184
|
+
}
|
|
2185
|
+
export interface InstanceEnvVar {
|
|
2186
|
+
name: string;
|
|
2187
|
+
value: string;
|
|
2188
|
+
}
|
|
2189
|
+
export type InstanceTypeDeploymentType = string;
|
|
2190
|
+
export declare const InstanceTypeDeploymentTypeVM: InstanceTypeDeploymentType;
|
|
2191
|
+
export declare const InstanceTypeDeploymentTypeContainer: InstanceTypeDeploymentType;
|
|
2192
|
+
export declare const InstanceTypeDeploymentTypeBaremetal: InstanceTypeDeploymentType;
|
|
2193
|
+
export interface InstanceType {
|
|
2194
|
+
id: string;
|
|
2195
|
+
PermissionModel: PermissionModel;
|
|
2196
|
+
cloud: InstanceCloudProvider;
|
|
2197
|
+
region: string;
|
|
2198
|
+
shade_instance_type: string;
|
|
2199
|
+
cloud_instance_type: string;
|
|
2200
|
+
deployment_type: InstanceTypeDeploymentType;
|
|
2201
|
+
hourly_price: number;
|
|
2202
|
+
configuration?: InstanceTypeConfiguration;
|
|
2203
|
+
availability: InstanceTypeAvailability[];
|
|
2204
|
+
boot_time?: InstanceTypeBootTime;
|
|
2205
|
+
}
|
|
2206
|
+
export interface InstanceTypeConfiguration {
|
|
2207
|
+
gpu_type: string;
|
|
2208
|
+
interconnect: string;
|
|
2209
|
+
memory_in_gb: number;
|
|
2210
|
+
num_gpus: number;
|
|
2211
|
+
os_options: string[];
|
|
2212
|
+
storage_in_gb: number;
|
|
2213
|
+
vcpus: number;
|
|
2214
|
+
vram_per_gpu_in_gb: number;
|
|
2215
|
+
}
|
|
2216
|
+
export interface InstanceTypeAvailability {
|
|
2217
|
+
available: boolean;
|
|
2218
|
+
region: string;
|
|
2219
|
+
}
|
|
2220
|
+
export interface InstanceTypeBootTime {
|
|
2221
|
+
average_seconds: number;
|
|
2222
|
+
updated_at: string;
|
|
2223
|
+
sample_size: number;
|
|
2224
|
+
}
|
|
2225
|
+
export interface SlackResponse {
|
|
2226
|
+
Body: string;
|
|
2227
|
+
ContentType: string;
|
|
2228
|
+
}
|
|
2229
|
+
/**
|
|
2230
|
+
* SlackIntegrationMetadata contains Slack-specific context for chat messages
|
|
2231
|
+
* This is stored in ChatMessage.IntegrationMetadata as JSON
|
|
2232
|
+
*/
|
|
2233
|
+
export interface SlackIntegrationMetadata {
|
|
2234
|
+
channel: string;
|
|
2235
|
+
thread_ts: string;
|
|
2236
|
+
team_id?: string;
|
|
2237
|
+
user_id?: string;
|
|
2238
|
+
bot_message_ts?: string;
|
|
2239
|
+
stream_started?: boolean;
|
|
2240
|
+
stream_ts?: string;
|
|
2241
|
+
}
|
|
2242
|
+
/**
|
|
2243
|
+
* SlackBlock represents a Slack Block Kit block
|
|
2244
|
+
*/
|
|
2245
|
+
export interface SlackBlock {
|
|
2246
|
+
type: string;
|
|
2247
|
+
text?: any;
|
|
2248
|
+
}
|
|
2249
|
+
/**
|
|
2250
|
+
* SlackTextObject represents a text object in Slack Block Kit
|
|
2251
|
+
*/
|
|
2252
|
+
export interface SlackTextObject {
|
|
2253
|
+
type: string;
|
|
2254
|
+
text: string;
|
|
2255
|
+
}
|
|
2256
|
+
/**
|
|
2257
|
+
* SlackPostMessageRequest represents the payload for posting a message to Slack
|
|
2258
|
+
*/
|
|
2259
|
+
export interface SlackPostMessageRequest {
|
|
2260
|
+
channel: string;
|
|
2261
|
+
text?: string;
|
|
2262
|
+
markdown_text?: string;
|
|
2263
|
+
blocks?: SlackBlock[];
|
|
2264
|
+
thread_ts?: string;
|
|
2265
|
+
mrkdwn?: boolean;
|
|
2266
|
+
}
|
|
2267
|
+
/**
|
|
2268
|
+
* SlackUpdateMessageRequest represents the payload for updating a Slack message
|
|
2269
|
+
*/
|
|
2270
|
+
export interface SlackUpdateMessageRequest {
|
|
2271
|
+
channel: string;
|
|
2272
|
+
ts: string;
|
|
2273
|
+
text?: string;
|
|
2274
|
+
blocks?: SlackBlock[];
|
|
2275
|
+
}
|
|
2276
|
+
/**
|
|
2277
|
+
* SlackAssistantThreadsSetStatusRequest represents the payload for setting assistant thread status
|
|
2278
|
+
* This shows a typing indicator in Slack (requires assistant:write scope)
|
|
2279
|
+
*/
|
|
2280
|
+
export interface SlackAssistantThreadsSetStatusRequest {
|
|
2281
|
+
channel_id: string;
|
|
2282
|
+
thread_ts: string;
|
|
2283
|
+
status: string;
|
|
2284
|
+
loading_messages?: string[];
|
|
2285
|
+
}
|
|
2286
|
+
/**
|
|
2287
|
+
* SlackAssistantThreadsSetStopSuggestedRequest represents the payload to stop the typing indicator
|
|
2288
|
+
*/
|
|
2289
|
+
export interface SlackAssistantThreadsSetStopSuggestedRequest {
|
|
2290
|
+
channel_id: string;
|
|
2291
|
+
thread_ts: string;
|
|
2292
|
+
}
|
|
2293
|
+
/**
|
|
2294
|
+
* SlackAPIResponse represents a standard Slack API response
|
|
2295
|
+
*/
|
|
2296
|
+
export interface SlackAPIResponse {
|
|
2297
|
+
ok: boolean;
|
|
2298
|
+
error?: string;
|
|
2299
|
+
ts?: string;
|
|
2300
|
+
}
|
|
2301
|
+
/**
|
|
2302
|
+
* SlackConversationsRepliesResponse represents the response from conversations.replies
|
|
2303
|
+
*/
|
|
2304
|
+
export interface SlackConversationsRepliesResponse {
|
|
2305
|
+
ok: boolean;
|
|
2306
|
+
error?: string;
|
|
2307
|
+
messages: SlackThreadMessage[];
|
|
2308
|
+
}
|
|
2309
|
+
/**
|
|
2310
|
+
* SlackStartStreamRequest represents the payload for starting a streaming message
|
|
2311
|
+
*/
|
|
2312
|
+
export interface SlackStartStreamRequest {
|
|
2313
|
+
channel: string;
|
|
2314
|
+
thread_ts: string;
|
|
2315
|
+
markdown_text?: string;
|
|
2316
|
+
recipient_user_id?: string;
|
|
2317
|
+
recipient_team_id?: string;
|
|
2318
|
+
}
|
|
2319
|
+
/**
|
|
2320
|
+
* SlackAppendStreamRequest represents the payload for appending to a streaming message
|
|
2321
|
+
*/
|
|
2322
|
+
export interface SlackAppendStreamRequest {
|
|
2323
|
+
channel: string;
|
|
2324
|
+
ts: string;
|
|
2325
|
+
markdown_text?: string;
|
|
2326
|
+
}
|
|
2327
|
+
/**
|
|
2328
|
+
* SlackStopStreamRequest represents the payload for stopping a streaming message
|
|
2329
|
+
*/
|
|
2330
|
+
export interface SlackStopStreamRequest {
|
|
2331
|
+
channel: string;
|
|
2332
|
+
ts: string;
|
|
2333
|
+
}
|
|
2334
|
+
/**
|
|
2335
|
+
* Hardware/System related types
|
|
2336
|
+
*/
|
|
2337
|
+
export interface SystemInfo {
|
|
2338
|
+
hostname: string;
|
|
2339
|
+
ipv4: string;
|
|
2340
|
+
ipv6: string;
|
|
2341
|
+
mac_address: string;
|
|
2342
|
+
os: string;
|
|
2343
|
+
docker: Docker;
|
|
2344
|
+
wsl2: WSL2;
|
|
2345
|
+
cpus: CPU[];
|
|
2346
|
+
ram: RAM;
|
|
2347
|
+
volumes: Volume[];
|
|
2348
|
+
hf_cache: HFCacheInfo;
|
|
2349
|
+
gpus: GPU[];
|
|
2350
|
+
}
|
|
2351
|
+
export interface TelemetrySystemInfo {
|
|
2352
|
+
cpus: CPU[];
|
|
2353
|
+
ram: RAM;
|
|
2354
|
+
gpus: GPU[];
|
|
2355
|
+
volumes: Volume[];
|
|
2356
|
+
}
|
|
2357
|
+
export interface Docker {
|
|
2358
|
+
binary_path: string;
|
|
2359
|
+
installed: boolean;
|
|
2360
|
+
socket_path: string;
|
|
2361
|
+
socket_available: boolean;
|
|
2362
|
+
running: boolean;
|
|
2363
|
+
version: string;
|
|
2364
|
+
}
|
|
2365
|
+
export interface WSL2 {
|
|
2366
|
+
installed: boolean;
|
|
2367
|
+
enabled: boolean;
|
|
2368
|
+
version: string;
|
|
2369
|
+
}
|
|
2370
|
+
export interface CPU {
|
|
2371
|
+
name: string;
|
|
2372
|
+
vendor_id: string;
|
|
2373
|
+
family: string;
|
|
2374
|
+
model: string;
|
|
2375
|
+
cores: number;
|
|
2376
|
+
frequency: string;
|
|
2377
|
+
usage: number;
|
|
2378
|
+
normalized_usage: number;
|
|
2379
|
+
}
|
|
2380
|
+
export interface Volume {
|
|
2381
|
+
name: string;
|
|
2382
|
+
size: number;
|
|
2383
|
+
used: number;
|
|
2384
|
+
free: number;
|
|
2385
|
+
usage: number;
|
|
2386
|
+
}
|
|
2387
|
+
export interface RAM {
|
|
2388
|
+
total: number;
|
|
2389
|
+
available: number;
|
|
2390
|
+
used: number;
|
|
2391
|
+
free: number;
|
|
2392
|
+
usage: number;
|
|
2393
|
+
total_physical: number;
|
|
2394
|
+
total_usable: number;
|
|
2395
|
+
bootloader_usage: number;
|
|
2396
|
+
swap_total: number;
|
|
2397
|
+
swap_used: number;
|
|
2398
|
+
swap_free: number;
|
|
2399
|
+
swap_usage: number;
|
|
2400
|
+
}
|
|
2401
|
+
export interface GPU {
|
|
2402
|
+
id: string;
|
|
2403
|
+
name: string;
|
|
2404
|
+
index: number;
|
|
2405
|
+
cuda_version: string;
|
|
2406
|
+
driver_version: string;
|
|
2407
|
+
memory_used: number;
|
|
2408
|
+
memory_total: number;
|
|
2409
|
+
temperature: number;
|
|
2410
|
+
}
|
|
2411
|
+
/**
|
|
2412
|
+
* CachedRevisionInfo represents information about a cached revision
|
|
2413
|
+
*/
|
|
2414
|
+
export interface CachedRevisionInfo {
|
|
2415
|
+
commit_hash: string;
|
|
2416
|
+
snapshot_path: string;
|
|
2417
|
+
last_modified: string;
|
|
2418
|
+
size_on_disk: number;
|
|
2419
|
+
size_on_disk_str: string;
|
|
2420
|
+
nb_files: number;
|
|
2421
|
+
refs: string[];
|
|
2422
|
+
}
|
|
2423
|
+
/**
|
|
2424
|
+
* CachedRepoInfo represents information about a cached repository
|
|
2425
|
+
*/
|
|
2426
|
+
export interface CachedRepoInfo {
|
|
2427
|
+
repo_id: string;
|
|
2428
|
+
repo_type: string;
|
|
2429
|
+
repo_path: string;
|
|
2430
|
+
last_accessed: string;
|
|
2431
|
+
last_modified: string;
|
|
2432
|
+
size_on_disk: number;
|
|
2433
|
+
size_on_disk_str: string;
|
|
2434
|
+
nb_files: number;
|
|
2435
|
+
refs: string[];
|
|
2436
|
+
Revisions: CachedRevisionInfo[];
|
|
2437
|
+
}
|
|
2438
|
+
/**
|
|
2439
|
+
* HFCacheInfo represents information about the Huggingface cache
|
|
2440
|
+
*/
|
|
2441
|
+
export interface HFCacheInfo {
|
|
2442
|
+
cache_dir: string;
|
|
2443
|
+
repos: CachedRepoInfo[];
|
|
2444
|
+
size_on_disk: number;
|
|
2445
|
+
warnings: string[];
|
|
2446
|
+
}
|
|
2447
|
+
/**
|
|
2448
|
+
* DeletionStrategy represents a strategy for deleting revisions
|
|
2449
|
+
*/
|
|
2450
|
+
export interface DeletionStrategy {
|
|
2451
|
+
repos: CachedRepoInfo[];
|
|
2452
|
+
snapshots: string[];
|
|
2453
|
+
expected_freed_size: number;
|
|
2454
|
+
expected_freed_size_str: string;
|
|
2455
|
+
}
|
|
2456
|
+
export interface CacheNotFoundError {
|
|
2457
|
+
cache_dir: string;
|
|
2458
|
+
}
|
|
2459
|
+
export type TaskStatus = number;
|
|
2460
|
+
export declare const TaskStatusUnknown: TaskStatus;
|
|
2461
|
+
export declare const TaskStatusReceived: TaskStatus;
|
|
2462
|
+
export declare const TaskStatusQueued: TaskStatus;
|
|
2463
|
+
export declare const TaskStatusScheduled: TaskStatus;
|
|
2464
|
+
export declare const TaskStatusPreparing: TaskStatus;
|
|
2465
|
+
export declare const TaskStatusServing: TaskStatus;
|
|
2466
|
+
export declare const TaskStatusSettingUp: TaskStatus;
|
|
2467
|
+
export declare const TaskStatusRunning: TaskStatus;
|
|
2468
|
+
export declare const TaskStatusUploading: TaskStatus;
|
|
2469
|
+
export declare const TaskStatusCompleted: TaskStatus;
|
|
2470
|
+
export declare const TaskStatusFailed: TaskStatus;
|
|
2471
|
+
export declare const TaskStatusCancelled: TaskStatus;
|
|
2472
|
+
export type Infra = string;
|
|
2473
|
+
export declare const InfraPrivate: Infra;
|
|
2474
|
+
export declare const InfraCloud: Infra;
|
|
2475
|
+
export declare const InfraPrivateFirst: Infra;
|
|
2476
|
+
export interface Task {
|
|
2477
|
+
BaseModel: BaseModel;
|
|
2478
|
+
PermissionModel: PermissionModel;
|
|
2479
|
+
VersionedStruct: VersionedStruct;
|
|
2480
|
+
EncryptedModel: EncryptedModel;
|
|
2481
|
+
GraphModel: GraphModel;
|
|
2482
|
+
is_featured: boolean;
|
|
2483
|
+
status: TaskStatus;
|
|
2484
|
+
/**
|
|
2485
|
+
* Foreign keys
|
|
2486
|
+
*/
|
|
2487
|
+
app_id: string;
|
|
2488
|
+
app?: App;
|
|
2489
|
+
version_id: string;
|
|
2490
|
+
app_version?: AppVersion;
|
|
2491
|
+
variant: string;
|
|
2492
|
+
infra: Infra;
|
|
2493
|
+
workers: string[];
|
|
2494
|
+
engine_id?: string;
|
|
2495
|
+
engine?: EngineState;
|
|
2496
|
+
worker_id?: string;
|
|
2497
|
+
worker?: WorkerState;
|
|
2498
|
+
flow_id?: string;
|
|
2499
|
+
flow_run_id?: string;
|
|
2500
|
+
sub_flow_run_id?: string;
|
|
2501
|
+
/**
|
|
2502
|
+
* This part should be all replaced by the new graph model
|
|
2503
|
+
*/
|
|
2504
|
+
chat_id?: string;
|
|
2505
|
+
agent_id?: string;
|
|
2506
|
+
agent_version_id?: string;
|
|
2507
|
+
agent?: Agent;
|
|
2508
|
+
tool_call_id?: string;
|
|
2509
|
+
webhook?: string;
|
|
2510
|
+
input: any;
|
|
2511
|
+
output: any;
|
|
2512
|
+
error: string;
|
|
2513
|
+
nsfw: boolean;
|
|
2514
|
+
/**
|
|
2515
|
+
* Relationships
|
|
2516
|
+
*/
|
|
2517
|
+
events: TaskEvent[];
|
|
2518
|
+
logs: TaskLog[];
|
|
2519
|
+
telemetry: TimescaleTask[];
|
|
2520
|
+
usage_events: (UsageEvent | undefined)[];
|
|
2521
|
+
transaction_id?: string;
|
|
2522
|
+
transaction?: Transaction;
|
|
2523
|
+
}
|
|
2524
|
+
export interface TaskEvent {
|
|
2525
|
+
id: string;
|
|
2526
|
+
created_at: string;
|
|
2527
|
+
event_time: string;
|
|
2528
|
+
task_id: string;
|
|
2529
|
+
status: TaskStatus;
|
|
2530
|
+
}
|
|
2531
|
+
export type TaskLogType = number;
|
|
2532
|
+
export declare const TaskLogTypeBuild: TaskLogType;
|
|
2533
|
+
export declare const TaskLogTypeRun: TaskLogType;
|
|
2534
|
+
export declare const TaskLogTypeServe: TaskLogType;
|
|
2535
|
+
export declare const TaskLogTypeSetup: TaskLogType;
|
|
2536
|
+
export declare const TaskLogTypeTask: TaskLogType;
|
|
2537
|
+
export interface TaskLog {
|
|
2538
|
+
id: string;
|
|
2539
|
+
created_at: string;
|
|
2540
|
+
updated_at: string;
|
|
2541
|
+
task_id: string;
|
|
2542
|
+
log_type: TaskLogType;
|
|
2543
|
+
content: string;
|
|
2544
|
+
}
|
|
2545
|
+
export interface TaskDTO {
|
|
2546
|
+
id: string;
|
|
2547
|
+
graph_id?: string;
|
|
2548
|
+
created_at: string;
|
|
2549
|
+
updated_at: string;
|
|
2550
|
+
deleted_at?: string;
|
|
2551
|
+
acl?: ACL;
|
|
2552
|
+
user_id: string;
|
|
2553
|
+
user?: UserRelationDTO;
|
|
2554
|
+
user_public_key: string;
|
|
2555
|
+
engine_public_key: string;
|
|
2556
|
+
is_featured: boolean;
|
|
2557
|
+
status: TaskStatus;
|
|
2558
|
+
app_id: string;
|
|
2559
|
+
app?: AppDTO;
|
|
2560
|
+
app_version_id: string;
|
|
2561
|
+
app_version?: AppVersionDTO;
|
|
2562
|
+
app_variant: string;
|
|
2563
|
+
infra: Infra;
|
|
2564
|
+
workers: string[];
|
|
2565
|
+
flow_id?: string;
|
|
2566
|
+
flow_run_id?: string;
|
|
2567
|
+
sub_flow_run_id?: string;
|
|
2568
|
+
chat_id?: string;
|
|
2569
|
+
agent_id?: string;
|
|
2570
|
+
agent_version_id?: string;
|
|
2571
|
+
agent?: AgentDTO;
|
|
2572
|
+
engine_id?: string;
|
|
2573
|
+
engine?: EngineStateSummary;
|
|
2574
|
+
worker_id?: string;
|
|
2575
|
+
worker?: WorkerStateSummary;
|
|
2576
|
+
webhook?: string;
|
|
2577
|
+
input: any;
|
|
2578
|
+
output: any;
|
|
2579
|
+
error: string;
|
|
2580
|
+
nsfw: boolean;
|
|
2581
|
+
events: TaskEvent[];
|
|
2582
|
+
logs: TaskLog[];
|
|
2583
|
+
telemetry: TimescaleTask[];
|
|
2584
|
+
usage_events: (UsageEvent | undefined)[];
|
|
2585
|
+
transaction_id?: string;
|
|
2586
|
+
transaction?: Transaction;
|
|
2587
|
+
}
|
|
2588
|
+
export interface TimescaleTask {
|
|
2589
|
+
id: string;
|
|
2590
|
+
timestamp: string;
|
|
2591
|
+
task_id?: string;
|
|
2592
|
+
task_seq: number;
|
|
2593
|
+
app_id: string;
|
|
2594
|
+
app_version_id: string;
|
|
2595
|
+
app_variant: string;
|
|
2596
|
+
engine_id: string;
|
|
2597
|
+
engine_resources: TelemetrySystemInfo;
|
|
2598
|
+
worker_id: string;
|
|
2599
|
+
system_info: TelemetrySystemInfo;
|
|
2600
|
+
}
|
|
2601
|
+
export interface Team {
|
|
2602
|
+
BaseModel: BaseModel;
|
|
2603
|
+
}
|
|
2604
|
+
export interface TeamDTO {
|
|
2605
|
+
id: string;
|
|
2606
|
+
name: string;
|
|
2607
|
+
logo: string;
|
|
2608
|
+
balance: number;
|
|
2609
|
+
env: string;
|
|
2610
|
+
}
|
|
2611
|
+
export type TeamRole = string;
|
|
2612
|
+
export declare const TeamRoleOwner: TeamRole;
|
|
2613
|
+
export declare const TeamRoleAdmin: TeamRole;
|
|
2614
|
+
export declare const TeamRoleMember: TeamRole;
|
|
2615
|
+
export interface TeamMember {
|
|
2616
|
+
BaseModel: BaseModel;
|
|
2617
|
+
}
|
|
2618
|
+
export interface TeamMemberDTO {
|
|
2619
|
+
id: string;
|
|
2620
|
+
user_id: string;
|
|
2621
|
+
team_id: string;
|
|
2622
|
+
role: TeamRole;
|
|
2623
|
+
user?: UserRelationDTO;
|
|
2624
|
+
team?: TeamDTO;
|
|
2625
|
+
}
|
|
2626
|
+
/**
|
|
2627
|
+
* Tool types and parameter types
|
|
2628
|
+
*/
|
|
2629
|
+
export declare const ToolTypeFunction = "function";
|
|
2630
|
+
/**
|
|
2631
|
+
* Tool types and parameter types
|
|
2632
|
+
*/
|
|
2633
|
+
export declare const ToolParamTypeObject = "object";
|
|
2634
|
+
/**
|
|
2635
|
+
* Tool types and parameter types
|
|
2636
|
+
*/
|
|
2637
|
+
export declare const ToolParamTypeString = "string";
|
|
2638
|
+
/**
|
|
2639
|
+
* Tool types and parameter types
|
|
2640
|
+
*/
|
|
2641
|
+
export declare const ToolParamTypeInteger = "integer";
|
|
2642
|
+
/**
|
|
2643
|
+
* Tool types and parameter types
|
|
2644
|
+
*/
|
|
2645
|
+
export declare const ToolParamTypeNumber = "number";
|
|
2646
|
+
/**
|
|
2647
|
+
* Tool types and parameter types
|
|
2648
|
+
*/
|
|
2649
|
+
export declare const ToolParamTypeBoolean = "boolean";
|
|
2650
|
+
/**
|
|
2651
|
+
* Tool types and parameter types
|
|
2652
|
+
*/
|
|
2653
|
+
export declare const ToolParamTypeArray = "array";
|
|
2654
|
+
/**
|
|
2655
|
+
* Tool types and parameter types
|
|
2656
|
+
*/
|
|
2657
|
+
export declare const ToolParamTypeNull = "null";
|
|
2658
|
+
export interface Tool {
|
|
2659
|
+
type: string;
|
|
2660
|
+
function: ToolFunction;
|
|
2661
|
+
}
|
|
2662
|
+
export interface ToolFunction {
|
|
2663
|
+
name: string;
|
|
2664
|
+
description: string;
|
|
2665
|
+
parameters: ToolParameters;
|
|
2666
|
+
required?: string[];
|
|
2667
|
+
}
|
|
2668
|
+
export interface ToolParameters {
|
|
2669
|
+
type: string;
|
|
2670
|
+
title: string;
|
|
2671
|
+
properties: ToolParameterProperties;
|
|
2672
|
+
required?: string[];
|
|
2673
|
+
}
|
|
2674
|
+
export type ToolParameterProperties = {
|
|
2675
|
+
[key: string]: ToolParameterProperty;
|
|
2676
|
+
};
|
|
2677
|
+
export interface ToolParameterProperty {
|
|
2678
|
+
type: string;
|
|
2679
|
+
title: string;
|
|
2680
|
+
description: string;
|
|
2681
|
+
properties?: ToolParameterProperties;
|
|
2682
|
+
items?: ToolParameterProperty;
|
|
2683
|
+
required?: string[];
|
|
2684
|
+
}
|
|
2685
|
+
/**
|
|
2686
|
+
* TransactionType represents the type of credit transaction
|
|
2687
|
+
*/
|
|
2688
|
+
export type TransactionType = string;
|
|
2689
|
+
export declare const TransactionTypeCredit: TransactionType;
|
|
2690
|
+
export declare const TransactionTypeDebit: TransactionType;
|
|
2691
|
+
/**
|
|
2692
|
+
* Transaction represents a single credit transaction
|
|
2693
|
+
*/
|
|
2694
|
+
export interface Transaction {
|
|
2695
|
+
BaseModel: BaseModel;
|
|
2696
|
+
PermissionModel: PermissionModel;
|
|
2697
|
+
type: TransactionType;
|
|
2698
|
+
amount: number;
|
|
2699
|
+
reference: string;
|
|
2700
|
+
notes: string;
|
|
2701
|
+
/**
|
|
2702
|
+
* Metadata for the transaction
|
|
2703
|
+
*/
|
|
2704
|
+
metadata: {
|
|
2705
|
+
[key: string]: any;
|
|
2706
|
+
};
|
|
2707
|
+
}
|
|
2708
|
+
export interface TransactionDTO {
|
|
2709
|
+
id: string;
|
|
2710
|
+
created_at: string;
|
|
2711
|
+
updated_at: string;
|
|
2712
|
+
deleted_at?: string;
|
|
2713
|
+
user_id: string;
|
|
2714
|
+
user?: UserRelationDTO;
|
|
2715
|
+
type: TransactionType;
|
|
2716
|
+
amount: number;
|
|
2717
|
+
reference: string;
|
|
2718
|
+
notes: string;
|
|
2719
|
+
usage_billing_record_id?: string;
|
|
2720
|
+
usage_billing_record?: UsageBillingRecord;
|
|
2721
|
+
usage_billing_refund_id?: string;
|
|
2722
|
+
usage_billing_refund?: UsageBillingRefund;
|
|
2723
|
+
metadata: {
|
|
2724
|
+
[key: string]: any;
|
|
2725
|
+
};
|
|
2726
|
+
}
|
|
2727
|
+
export type StripeTransactionStatus = number;
|
|
2728
|
+
export declare const StripeTransactionStatusOpen: StripeTransactionStatus;
|
|
2729
|
+
export declare const StripeTransactionStatusComplete: StripeTransactionStatus;
|
|
2730
|
+
export declare const StripeTransactionStatusExpired: StripeTransactionStatus;
|
|
2731
|
+
export interface StripeTransaction {
|
|
2732
|
+
BaseModel: BaseModel;
|
|
2733
|
+
PermissionModel: PermissionModel;
|
|
2734
|
+
session_id: string;
|
|
2735
|
+
session_url: string;
|
|
2736
|
+
status: StripeTransactionStatus;
|
|
2737
|
+
}
|
|
2738
|
+
export type UsageEventResourceTier = string;
|
|
2739
|
+
export declare const UsageEventResourceTierPrivate: UsageEventResourceTier;
|
|
2740
|
+
export declare const UsageEventResourceTierCloud: UsageEventResourceTier;
|
|
2741
|
+
export interface UsageEvent {
|
|
2742
|
+
BaseModel: BaseModel;
|
|
2743
|
+
usage_billing_record_id: string;
|
|
2744
|
+
/**
|
|
2745
|
+
* Event owner
|
|
2746
|
+
*/
|
|
2747
|
+
user_id: string;
|
|
2748
|
+
group_id?: string;
|
|
2749
|
+
reference_id: string;
|
|
2750
|
+
resource_id: string;
|
|
2751
|
+
/**
|
|
2752
|
+
* Resource tier
|
|
2753
|
+
*/
|
|
2754
|
+
tier: UsageEventResourceTier;
|
|
2755
|
+
type: string;
|
|
2756
|
+
model: string;
|
|
2757
|
+
quantity: number;
|
|
2758
|
+
unit: string;
|
|
2759
|
+
}
|
|
2760
|
+
export interface UsageEventSummary {
|
|
2761
|
+
tier_usage: {
|
|
2762
|
+
[key: UsageEventResourceTier]: number;
|
|
2763
|
+
};
|
|
2764
|
+
type_usage: {
|
|
2765
|
+
[key: string]: number;
|
|
2766
|
+
};
|
|
2767
|
+
model_usage: {
|
|
2768
|
+
[key: string]: number;
|
|
2769
|
+
};
|
|
2770
|
+
total_usage: number;
|
|
2771
|
+
}
|
|
2772
|
+
export interface UsageBillingRecord {
|
|
2773
|
+
BaseModel: BaseModel;
|
|
2774
|
+
user_id: string;
|
|
2775
|
+
group_id?: string;
|
|
2776
|
+
usage_events: (UsageEvent | undefined)[];
|
|
2777
|
+
total: number;
|
|
2778
|
+
user_debit_transaction_id: string;
|
|
2779
|
+
user_debit_transaction?: Transaction;
|
|
2780
|
+
owner_credit_transaction_id: string;
|
|
2781
|
+
owner_credit_transaction?: Transaction;
|
|
2782
|
+
}
|
|
2783
|
+
export interface UsageBillingRefund {
|
|
2784
|
+
BaseModel: BaseModel;
|
|
2785
|
+
user_id: string;
|
|
2786
|
+
group_id?: string;
|
|
2787
|
+
usage_billing_record_id: string;
|
|
2788
|
+
usage_billing_record?: UsageBillingRecord;
|
|
2789
|
+
user_debit_refund_transaction_id: string;
|
|
2790
|
+
user_debit_refund_transaction?: Transaction;
|
|
2791
|
+
owner_credit_refund_transaction_id: string;
|
|
2792
|
+
owner_credit_refund_transaction?: Transaction;
|
|
2793
|
+
}
|
|
2794
|
+
/**
|
|
2795
|
+
* User-related types
|
|
2796
|
+
*/
|
|
2797
|
+
export interface User {
|
|
2798
|
+
BaseModel: BaseModel;
|
|
2799
|
+
role: Role;
|
|
2800
|
+
username: string;
|
|
2801
|
+
email: string;
|
|
2802
|
+
name: string;
|
|
2803
|
+
full_name: string;
|
|
2804
|
+
avatar_url: string;
|
|
2805
|
+
email_verified: boolean;
|
|
2806
|
+
phone_verified: boolean;
|
|
2807
|
+
is_anonymous: boolean;
|
|
2808
|
+
env: string;
|
|
2809
|
+
balance: number;
|
|
2810
|
+
metadata: UserMetadata;
|
|
2811
|
+
}
|
|
2812
|
+
export type Role = string;
|
|
2813
|
+
export declare const RoleUser: Role;
|
|
2814
|
+
export declare const RoleAdmin: Role;
|
|
2815
|
+
export declare const RoleSystem: Role;
|
|
2816
|
+
export interface UserDTO {
|
|
2817
|
+
id: string;
|
|
2818
|
+
created_at: string;
|
|
2819
|
+
updated_at: string;
|
|
2820
|
+
deleted_at?: string;
|
|
2821
|
+
role: Role;
|
|
2822
|
+
username: string;
|
|
2823
|
+
email: string;
|
|
2824
|
+
email_verified: boolean;
|
|
2825
|
+
is_anonymous: boolean;
|
|
2826
|
+
name: string;
|
|
2827
|
+
full_name: string;
|
|
2828
|
+
avatar_url: string;
|
|
2829
|
+
env: string;
|
|
2830
|
+
balance: number;
|
|
2831
|
+
metadata: UserMetadata;
|
|
2832
|
+
}
|
|
2833
|
+
/**
|
|
2834
|
+
* User-related types
|
|
2835
|
+
*/
|
|
2836
|
+
export interface UserRelationDTO {
|
|
2837
|
+
id: string;
|
|
2838
|
+
created_at: string;
|
|
2839
|
+
updated_at: string;
|
|
2840
|
+
role: Role;
|
|
2841
|
+
username: string;
|
|
2842
|
+
avatar_url: string;
|
|
2843
|
+
}
|
|
2844
|
+
export interface UserMetadata {
|
|
2845
|
+
user_id: string;
|
|
2846
|
+
completed_onboarding: boolean;
|
|
2847
|
+
use_case: string;
|
|
2848
|
+
use_case_reason: string;
|
|
2849
|
+
use_case_privacy: string;
|
|
2850
|
+
}
|
|
2851
|
+
/**
|
|
2852
|
+
* Environment represents a map of environment variables
|
|
2853
|
+
*/
|
|
2854
|
+
export type Environment = {
|
|
2855
|
+
[key: string]: string;
|
|
2856
|
+
};
|
|
2857
|
+
/**
|
|
2858
|
+
* WidgetAction represents an action triggered by a widget button
|
|
2859
|
+
*/
|
|
2860
|
+
export interface WidgetAction {
|
|
2861
|
+
type: string;
|
|
2862
|
+
payload?: {
|
|
2863
|
+
[key: string]: any;
|
|
2864
|
+
};
|
|
2865
|
+
}
|
|
2866
|
+
/**
|
|
2867
|
+
* WidgetActionButton represents a button in a widget's action bar
|
|
2868
|
+
*/
|
|
2869
|
+
export interface WidgetActionButton {
|
|
2870
|
+
label: string;
|
|
2871
|
+
action: WidgetAction;
|
|
2872
|
+
variant?: string;
|
|
2873
|
+
}
|
|
2874
|
+
export type WidgetNodeType = string;
|
|
2875
|
+
export declare const WidgetNodeTypeText: WidgetNodeType;
|
|
2876
|
+
export declare const WidgetNodeTypeMarkdown: WidgetNodeType;
|
|
2877
|
+
export declare const WidgetNodeTypeImage: WidgetNodeType;
|
|
2878
|
+
export declare const WidgetNodeTypeBadge: WidgetNodeType;
|
|
2879
|
+
export declare const WidgetNodeTypeButton: WidgetNodeType;
|
|
2880
|
+
export declare const WidgetNodeTypeInput: WidgetNodeType;
|
|
2881
|
+
export declare const WidgetNodeTypeSelect: WidgetNodeType;
|
|
2882
|
+
export declare const WidgetNodeTypeCheckbox: WidgetNodeType;
|
|
2883
|
+
export declare const WidgetNodeTypeRow: WidgetNodeType;
|
|
2884
|
+
export declare const WidgetNodeTypeCol: WidgetNodeType;
|
|
2885
|
+
/**
|
|
2886
|
+
* WidgetNode represents a UI element in a widget (text, input, select, etc.)
|
|
2887
|
+
*/
|
|
2888
|
+
export interface WidgetNode {
|
|
2889
|
+
type: WidgetNodeType;
|
|
2890
|
+
value?: string;
|
|
2891
|
+
src?: string;
|
|
2892
|
+
alt?: string;
|
|
2893
|
+
label?: string;
|
|
2894
|
+
name?: string;
|
|
2895
|
+
placeholder?: string;
|
|
2896
|
+
defaultValue?: string;
|
|
2897
|
+
variant?: string;
|
|
2898
|
+
action?: WidgetAction;
|
|
2899
|
+
options?: WidgetSelectOption[];
|
|
2900
|
+
defaultChecked?: boolean;
|
|
2901
|
+
children?: WidgetNode[];
|
|
2902
|
+
gap?: number;
|
|
2903
|
+
}
|
|
2904
|
+
/**
|
|
2905
|
+
* WidgetSelectOption represents an option in a select widget
|
|
2906
|
+
*/
|
|
2907
|
+
export interface WidgetSelectOption {
|
|
2908
|
+
label: string;
|
|
2909
|
+
value: string;
|
|
2910
|
+
}
|
|
2911
|
+
/**
|
|
2912
|
+
* Widget represents an interactive card widget
|
|
2913
|
+
*/
|
|
2914
|
+
export interface Widget {
|
|
2915
|
+
type: string;
|
|
2916
|
+
title?: string;
|
|
2917
|
+
html?: string;
|
|
2918
|
+
json?: string;
|
|
2919
|
+
children?: WidgetNode[];
|
|
2920
|
+
actions?: WidgetActionButton[];
|
|
2921
|
+
}
|
|
2922
|
+
/**
|
|
2923
|
+
* WidgetFormData represents the form data collected from widget inputs
|
|
2924
|
+
*/
|
|
2925
|
+
export type WidgetFormData = {
|
|
2926
|
+
[key: string]: any;
|
|
2927
|
+
};
|
|
2928
|
+
/**
|
|
2929
|
+
* WidgetActionResult represents the result of a widget action submission
|
|
2930
|
+
*/
|
|
2931
|
+
export interface WidgetActionResult {
|
|
2932
|
+
action: WidgetAction;
|
|
2933
|
+
form_data?: WidgetFormData;
|
|
2934
|
+
}
|
|
2935
|
+
/**
|
|
2936
|
+
* WebSocket message types
|
|
2937
|
+
*/
|
|
2938
|
+
export declare const WSEventTaskStatus = "task_status";
|
|
2939
|
+
/**
|
|
2940
|
+
* Task WebSocket
|
|
2941
|
+
*/
|
|
2942
|
+
export declare const WSEventTaskLog = "task_log";
|
|
2943
|
+
/**
|
|
2944
|
+
* Task WebSocket
|
|
2945
|
+
*/
|
|
2946
|
+
export declare const WSEventTaskProgress = "task_progress";
|
|
2947
|
+
/**
|
|
2948
|
+
* Task WebSocket
|
|
2949
|
+
*/
|
|
2950
|
+
export declare const WSEventTaskOutput = "task_output";
|
|
2951
|
+
/**
|
|
2952
|
+
* Task WebSocket
|
|
2953
|
+
*/
|
|
2954
|
+
export declare const WSEventTaskFailed = "task_failed";
|
|
2955
|
+
export interface WsTaskStatusPayload {
|
|
2956
|
+
task_id: string;
|
|
2957
|
+
time: string;
|
|
2958
|
+
status: TaskStatus;
|
|
2959
|
+
}
|
|
2960
|
+
export interface WsTaskLogPayload {
|
|
2961
|
+
task_id: string;
|
|
2962
|
+
log_type: TaskLogType;
|
|
2963
|
+
logs: string;
|
|
2964
|
+
}
|
|
2965
|
+
export interface WsTaskOutputPayload {
|
|
2966
|
+
task_id: string;
|
|
2967
|
+
output: string;
|
|
2968
|
+
}
|
|
2969
|
+
export interface WsTaskFailedPayload {
|
|
2970
|
+
task_id: string;
|
|
2971
|
+
error: string;
|
|
2972
|
+
}
|
|
2973
|
+
export declare const WSEventTaskRun = "task_run";
|
|
2974
|
+
export declare const WSEventTaskCancel = "task_cancel";
|
|
2975
|
+
export declare const WSEventTaskForceCancel = "task_force_cancel";
|
|
2976
|
+
export declare const WSEventEngineStop = "engine_stop";
|
|
2977
|
+
export declare const WSEventEngineDeleteHFCacheRepo = "engine_delete_hfcache_repo";
|
|
2978
|
+
export interface WsTaskRunPayload {
|
|
2979
|
+
task: TaskDTO;
|
|
2980
|
+
user_env: string;
|
|
2981
|
+
}
|
|
2982
|
+
export interface WsTaskCancelPayload {
|
|
2983
|
+
task: TaskDTO;
|
|
2984
|
+
}
|
|
2985
|
+
export interface WsTaskForceCancelPayload {
|
|
2986
|
+
task: TaskDTO;
|
|
2987
|
+
}
|
|
2988
|
+
/**
|
|
2989
|
+
* Engine WebSocket
|
|
2990
|
+
*/
|
|
2991
|
+
export declare const WSEventEngineHeartbeat = "engine_heartbeat";
|
|
2992
|
+
/**
|
|
2993
|
+
* Engine WebSocket
|
|
2994
|
+
*/
|
|
2995
|
+
export declare const WSEventEngineTelemetry = "engine_telemetry";
|
|
2996
|
+
export type WorkerStatusMap = {
|
|
2997
|
+
[key: string]: WorkerStatus;
|
|
2998
|
+
};
|
|
2999
|
+
export interface WsEngineHeartbeatPayload {
|
|
3000
|
+
engine_id: string;
|
|
3001
|
+
engine_status: EngineStatus;
|
|
3002
|
+
worker_statuses: WorkerStatusMap;
|
|
3003
|
+
}
|
|
3004
|
+
export interface WsEngineTelemetryPayload {
|
|
3005
|
+
engine_id: string;
|
|
3006
|
+
engine_state: EngineState;
|
|
3007
|
+
}
|
|
3008
|
+
export interface WsEngineDeleteHFCacheRepoPayload {
|
|
3009
|
+
repo_id: string;
|
|
3010
|
+
}
|
|
3011
|
+
/**
|
|
3012
|
+
* Worker WebSocket
|
|
3013
|
+
*/
|
|
3014
|
+
export declare const WSEventWorkerUpdate = "worker_update";
|
|
3015
|
+
export interface WsWorkerUpdatePayload {
|
|
3016
|
+
engine_id: string;
|
|
3017
|
+
worker_id: string;
|
|
3018
|
+
worker_state: WorkerState;
|
|
3019
|
+
}
|