@inferencesh/sdk 0.1.1 → 0.2.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/dist/types.d.ts CHANGED
@@ -1,220 +1,247 @@
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 {
1
+ /**
2
+ * InternalToolsConfig controls which built-in tools are enabled for an agent
3
+ */
4
+ export interface InternalToolsConfig {
5
+ plan?: boolean;
6
+ memory?: boolean;
7
+ widget?: boolean;
8
+ finish?: boolean;
9
+ }
10
+ /**
11
+ * ToolType represents the type of tool (used in both AgentTool definition and ToolInvocation)
12
+ */
13
+ export type ToolType = string;
14
+ export declare const ToolTypeApp: ToolType;
15
+ export declare const ToolTypeAgent: ToolType;
16
+ export declare const ToolTypeHook: ToolType;
17
+ export declare const ToolTypeClient: ToolType;
18
+ export declare const ToolTypeInternal: ToolType;
19
+ /**
20
+ * AppToolConfig contains configuration for an app tool
21
+ */
22
+ export interface AppToolConfig {
23
23
  id: string;
24
- version_id: string;
25
- variant: string;
24
+ version_id?: string;
25
+ /**
26
+ * Resolved at runtime, not stored
27
+ */
26
28
  app?: App;
29
+ }
30
+ /**
31
+ * AgentToolConfig contains configuration for a sub-agent tool
32
+ */
33
+ export interface AgentToolConfig {
34
+ id: string;
35
+ version_id?: string;
36
+ /**
37
+ * Resolved at runtime, not stored
38
+ */
39
+ agent?: Agent;
40
+ }
41
+ /**
42
+ * HookToolConfig contains configuration for a webhook tool
43
+ */
44
+ export interface HookToolConfig {
45
+ url: string;
46
+ secret?: string;
47
+ input_schema?: any;
48
+ output_schema?: any;
49
+ }
50
+ /**
51
+ * ClientToolConfig contains configuration for a frontend-executed tool
52
+ */
53
+ export interface ClientToolConfig {
54
+ input_schema?: any;
55
+ output_schema?: any;
56
+ }
57
+ /**
58
+ * AgentTool represents a unified tool that can be used by an agent
59
+ */
60
+ export interface AgentTool {
61
+ name: string;
62
+ display_name?: string;
63
+ description: string;
64
+ type: ToolType;
65
+ /**
66
+ * Human-in-the-Loop: if true, tool execution requires user approval
67
+ */
68
+ require_approval?: boolean;
69
+ /**
70
+ * Type-specific config (exactly one should be set based on Type)
71
+ */
72
+ app?: AppToolConfig;
73
+ agent?: AgentToolConfig;
74
+ hook?: HookToolConfig;
75
+ client?: ClientToolConfig;
76
+ }
77
+ /**
78
+ * AgentToolDTO for API responses
79
+ */
80
+ export interface AgentToolDTO {
81
+ name: string;
82
+ display_name?: string;
27
83
  description: string;
84
+ type: ToolType;
85
+ /**
86
+ * Human-in-the-Loop: if true, tool execution requires user approval
87
+ */
88
+ require_approval?: boolean;
89
+ app?: AppToolConfigDTO;
90
+ agent?: AgentToolConfigDTO;
91
+ hook?: HookToolConfigDTO;
92
+ client?: ClientToolConfigDTO;
28
93
  }
29
- export interface AgentAppDTO {
94
+ export interface AppToolConfigDTO {
30
95
  id: string;
31
- version_id: string;
32
- variant: string;
96
+ version_id?: string;
33
97
  app?: AppDTO;
34
- description: string;
35
98
  }
36
- export interface SubAgent {
99
+ export interface AgentToolConfigDTO {
37
100
  id: string;
38
- version_id: string;
39
- agent?: Agent;
40
- description: string;
101
+ version_id?: string;
102
+ agent?: AgentDTO;
103
+ }
104
+ export interface HookToolConfigDTO {
105
+ url: string;
106
+ secret?: string;
107
+ input_schema?: any;
108
+ output_schema?: any;
41
109
  }
42
- export interface SubAgentDTO {
110
+ export interface ClientToolConfigDTO {
111
+ input_schema?: any;
112
+ output_schema?: any;
113
+ }
114
+ /**
115
+ * CoreAppConfig references an app used as the agent's core
116
+ */
117
+ export interface CoreAppConfig {
43
118
  id: string;
44
119
  version_id: string;
45
- agent?: AgentDTO;
46
- description: string;
120
+ app?: App;
47
121
  }
48
122
  export interface Agent {
49
123
  BaseModel: BaseModel;
50
124
  PermissionModel: PermissionModel;
125
+ ProjectModel: ProjectModel;
51
126
  /**
52
127
  * Basic info
53
128
  */
129
+ namespace: string;
54
130
  name: string;
55
- project_id?: string;
56
- project?: Project;
57
131
  version_id: string;
58
132
  version?: AgentVersion;
59
- is_active: boolean;
60
133
  }
61
134
  /**
62
135
  * AgentDTO for API responses
63
136
  */
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;
137
+ export interface AgentDTO extends BaseModel, PermissionModelDTO, ProjectModelDTO {
138
+ namespace: string;
72
139
  name: string;
73
- project_id?: string;
74
- project?: ProjectDTO;
75
140
  version_id: string;
76
141
  version?: AgentVersionDTO;
77
- is_active: boolean;
78
142
  }
79
143
  export interface AgentVersion {
80
144
  BaseModel: BaseModel;
81
145
  PermissionModel: PermissionModel;
146
+ agent_id: string;
82
147
  description: string;
83
148
  system_prompt: string;
84
- prompt_template: string;
85
149
  example_prompts: string[];
86
- core_app?: AgentApp;
150
+ core_app?: CoreAppConfig;
87
151
  core_app_input?: any;
88
- sub_agents: (SubAgent | undefined)[];
89
- tool_apps: (AgentApp | undefined)[];
152
+ /**
153
+ * Unified tools array (apps, agents, hooks)
154
+ */
155
+ tools: (AgentTool | undefined)[];
156
+ /**
157
+ * Internal tools configuration (plan, memory, widget, finish)
158
+ */
159
+ internal_tools?: InternalToolsConfig;
160
+ /**
161
+ * Output schema for custom finish tool (sub-agents only)
162
+ */
163
+ output_schema?: any;
90
164
  }
91
- export interface AgentVersionDTO {
165
+ export interface CoreAppConfigDTO {
92
166
  id: string;
93
- created_at: string;
94
- updated_at: string;
95
- deleted_at?: string;
96
- user_id: string;
97
- user?: UserRelationDTO;
98
- acl?: ACL;
167
+ version_id: string;
168
+ app?: AppDTO;
169
+ }
170
+ export interface AgentVersionDTO extends BaseModel, PermissionModelDTO {
99
171
  description: string;
100
172
  system_prompt: string;
101
- prompt_template: string;
102
173
  example_prompts: string[];
103
- core_app?: AgentApp;
174
+ core_app?: CoreAppConfigDTO;
104
175
  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
176
  /**
153
- * Total running engines
177
+ * Unified tools array (apps, agents, hooks, client)
154
178
  */
155
- running_engines: number;
179
+ tools: (AgentToolDTO | undefined)[];
156
180
  /**
157
- * Private running engines (acl_other_exec = false or null)
181
+ * Internal tools configuration (plan, memory, widget, finish)
158
182
  */
159
- private_running_engines: number;
183
+ internal_tools?: InternalToolsConfig;
160
184
  /**
161
- * Cloud running engines (acl_other_exec = true)
185
+ * Output schema for custom finish tool (sub-agents only)
162
186
  */
163
- cloud_running_engines: number;
164
- top_apps: AppUsage[];
187
+ output_schema?: any;
165
188
  }
166
189
  /**
167
- * RealtimeMetrics contains current system state
190
+ * AgentRuntimeConfig is a self-contained, flattened config for chat execution.
191
+ * This is either snapshotted from an Agent template or provided ad-hoc.
192
+ * It's portable and can be serialized to JSON or YAML.
168
193
  */
169
- export interface RealtimeMetrics {
194
+ export interface AgentRuntimeConfig {
170
195
  /**
171
- * Total tasks
196
+ * Origin tracking (optional, for lineage when snapshotted from template)
172
197
  */
173
- queued_tasks: number;
174
- running_tasks: number;
198
+ agent_id?: string;
199
+ agent_version_id?: string;
175
200
  /**
176
- * Private tasks (engines with acl_other_exec = false or null)
201
+ * Identity
177
202
  */
178
- private_queued_tasks: number;
179
- private_running_tasks: number;
203
+ name: string;
204
+ namespace?: string;
205
+ description?: string;
180
206
  /**
181
- * Cloud tasks (engines with acl_other_exec = true)
207
+ * Prompts
182
208
  */
183
- cloud_queued_tasks: number;
184
- cloud_running_tasks: number;
209
+ system_prompt: string;
210
+ example_prompts?: string[];
185
211
  /**
186
- * User metrics
212
+ * Core LLM
187
213
  */
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;
214
+ core_app?: CoreAppConfig;
215
+ core_app_input?: any;
216
+ /**
217
+ * Tools (apps, agents, hooks, client tools)
218
+ */
219
+ tools?: (AgentTool | undefined)[];
220
+ /**
221
+ * Internal tools configuration (plan, memory, widget, finish)
222
+ */
223
+ internal_tools?: InternalToolsConfig;
224
+ /**
225
+ * Output schema for custom finish tool (sub-agents only)
226
+ */
227
+ output_schema?: any;
207
228
  }
208
229
  /**
209
- * Define a private context key type
210
- */
211
- /**
212
- * AuthenticatedUser represents the user data we store in context
230
+ * AgentRuntimeConfigDTO for API responses
213
231
  */
214
- export interface AuthenticatedUser {
215
- id: string;
216
- api_key: string;
217
- role: string;
232
+ export interface AgentRuntimeConfigDTO {
233
+ agent_id?: string;
234
+ agent_version_id?: string;
235
+ name: string;
236
+ namespace?: string;
237
+ description?: string;
238
+ system_prompt: string;
239
+ example_prompts?: string[];
240
+ core_app?: CoreAppConfigDTO;
241
+ core_app_input?: any;
242
+ tools?: (AgentToolDTO | undefined)[];
243
+ internal_tools?: InternalToolsConfig;
244
+ output_schema?: any;
218
245
  }
219
246
  export interface APIRequest<T extends any> {
220
247
  timestamp: string;
@@ -230,79 +257,102 @@ export interface APIError {
230
257
  code: string;
231
258
  message: string;
232
259
  }
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[];
260
+ /**
261
+ * ApiAppRunRequest is the request body for /apps/run endpoint.
262
+ * Version pinning is required for stability.
263
+ */
264
+ export interface ApiAppRunRequest {
265
+ /**
266
+ * App reference in format: namespace/name@shortid (version required)
267
+ * Example: "okaris/flux@abc1"
268
+ * The short ID ensures your code always runs the same version.
269
+ */
270
+ app: string;
271
+ /**
272
+ * Deprecated: Use namespace/name@shortid format in App field instead.
273
+ */
274
+ version?: string;
275
+ infra?: Infra;
276
+ workers?: string[];
290
277
  webhook?: string;
278
+ setup?: any;
291
279
  input: any;
292
- flow_id?: string;
293
- flow_run_id?: string;
280
+ /**
281
+ * If true, returns SSE stream instead of JSON response
282
+ */
283
+ stream?: boolean;
284
+ }
285
+ /**
286
+ * ApiTaskRequest is an alias for ApiAppRunRequest (deprecated name)
287
+ */
288
+ export type ApiTaskRequest = ApiAppRunRequest;
289
+ /**
290
+ * ApiAgentRunRequest is the request body for /agents/run endpoint.
291
+ * Supports both template agents and ad-hoc agents.
292
+ */
293
+ export interface ApiAgentRunRequest {
294
+ /**
295
+ * Existing chat ID to continue a conversation (optional)
296
+ */
294
297
  chat_id?: string;
295
- agent_id?: string;
296
- agent_version_id?: string;
297
- tool_call_id?: string;
298
+ /**
299
+ * Template agent reference in format: namespace/name@shortid
300
+ * Example: "my-org/assistant@abc123"
301
+ * Use this OR core_app, not both
302
+ */
303
+ agent?: string;
304
+ /**
305
+ * Core LLM app reference for ad-hoc agents in format: namespace/name@shortid
306
+ * Example: "infsh/claude-sonnet-4@1195p4sq"
307
+ * Use this for ad-hoc agents (without a saved template)
308
+ */
309
+ core_app?: string;
310
+ /**
311
+ * LLM parameters for ad-hoc agents (temperature, top_p, context_size, etc.)
312
+ */
313
+ core_app_input?: any;
314
+ /**
315
+ * Agent configuration for ad-hoc agents
316
+ */
317
+ name?: string;
318
+ description?: string;
319
+ system_prompt?: string;
320
+ example_prompts?: string[];
321
+ /**
322
+ * Tools configuration for ad-hoc agents
323
+ */
324
+ tools?: (AgentTool | undefined)[];
325
+ internal_tools?: InternalToolsConfig;
326
+ /**
327
+ * The message to send
328
+ */
329
+ input: ChatTaskInput;
330
+ /**
331
+ * If true, returns SSE stream instead of JSON response
332
+ */
333
+ stream?: boolean;
298
334
  }
335
+ /**
336
+ * ApiAgentMessageRequest is an alias for ApiAgentRunRequest (deprecated name)
337
+ */
338
+ export type ApiAgentMessageRequest = ApiAgentRunRequest;
299
339
  export interface CreateAgentMessageRequest {
300
340
  chat_id?: string;
301
341
  agent_id?: string;
302
342
  agent_version_id?: string;
343
+ agent?: string;
303
344
  tool_call_id?: string;
304
345
  input: ChatTaskInput;
305
346
  integration_context?: IntegrationContext;
347
+ /**
348
+ * Ad-hoc agent config - use this instead of Agent for embedded configs
349
+ * If provided, creates a chat with this config directly (no agent reference)
350
+ */
351
+ agent_config?: AgentRuntimeConfig;
352
+ }
353
+ export interface CreateChatMessageResponse {
354
+ user_message?: ChatMessageDTO;
355
+ assistant_message?: ChatMessageDTO;
306
356
  }
307
357
  /**
308
358
  * WidgetActionRequest represents a user's response to a widget
@@ -312,56 +362,46 @@ export interface WidgetActionRequest {
312
362
  action: WidgetAction;
313
363
  form_data?: WidgetFormData;
314
364
  }
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
365
  /**
332
- * Request/Response Types
366
+ * ToolResultRequest represents a generic tool result callback
367
+ * Used by hooks and other tools that expect an async callback
333
368
  */
334
- export interface EngineAPIRequest {
335
- data: {
336
- [key: string]: any;
337
- };
338
- metadata: EngineAPIRequestMetadata;
369
+ export interface ToolResultRequest {
370
+ result: string;
339
371
  }
340
- export interface WorkerAPIRequest {
341
- input: {
372
+ /**
373
+ * HookPayload represents the request body sent to a webhook when a hook tool is invoked
374
+ */
375
+ export interface HookPayload {
376
+ /**
377
+ * Identification
378
+ */
379
+ tool_invocation_id: string;
380
+ hook_name: string;
381
+ /**
382
+ * Callback - use this to submit the result back
383
+ */
384
+ callback_url: string;
385
+ callback_method: string;
386
+ /**
387
+ * Timestamp in RFC3339 format
388
+ */
389
+ timestamp: string;
390
+ /**
391
+ * The actual tool arguments from the LLM
392
+ */
393
+ arguments: {
342
394
  [key: string]: any;
343
395
  };
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
396
  }
362
- export interface AppsGetResponse {
363
- apps: App[];
364
- total: number;
397
+ /**
398
+ * HookResponse represents the expected response from the hook URL
399
+ * The hook should return 200 with success:true to acknowledge receipt
400
+ * The actual result should be sent via the callback URL
401
+ */
402
+ export interface HookResponse {
403
+ success: boolean;
404
+ message?: string;
365
405
  }
366
406
  export interface PartialFile {
367
407
  uri: string;
@@ -373,92 +413,86 @@ export interface PartialFile {
373
413
  export interface FileCreateRequest {
374
414
  files: PartialFile[];
375
415
  }
376
- export interface RunTaskRequest {
377
- task: TaskDTO;
378
- user_env: any;
416
+ export interface CreateFlowRequest {
417
+ name: string;
379
418
  }
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
+ export interface CreateFlowRunRequest {
420
+ flow: string;
421
+ input: any;
419
422
  }
420
- export type BlogPostCommentUpdateRequest = BlogPostCommentCreateRequest;
421
- export interface TransactionCreateRequest {
422
- user_id: string;
423
- group_id?: string;
424
- type: TransactionType;
423
+ export interface CheckoutCreateRequest {
425
424
  amount: number;
426
- reference: string;
427
- notes: string;
428
- metadata: {
429
- [key: string]: any;
430
- };
425
+ success_url: string;
426
+ cancel_url: string;
431
427
  }
432
- export interface PublicEnginesForResourcesRequest {
433
- resources: AppResources;
428
+ export interface CheckoutCompleteRequest {
429
+ session_id: string;
434
430
  }
435
- export interface PublicEnginesForResourcesResponse {
436
- can_run: boolean;
437
- min_price: number;
438
- max_price: number;
439
- error?: string;
431
+ /**
432
+ * Legacy aliases for backward compatibility
433
+ */
434
+ export type StripeCheckoutCreateRequest = CheckoutCreateRequest;
435
+ export type StripeCheckoutCompleteRequest = CheckoutCompleteRequest;
436
+ /**
437
+ * DeviceAuthResponse is returned when a device initiates auth
438
+ */
439
+ export interface DeviceAuthResponse {
440
+ user_code: string;
441
+ device_code: string;
442
+ poll_url: string;
443
+ approve_url: string;
444
+ expires_in: number;
445
+ interval: number;
440
446
  }
441
- export interface EnginesForResourcesRequest {
442
- resources: AppResources;
447
+ /**
448
+ * DeviceAuthPollResponse is returned when polling for auth status
449
+ */
450
+ export interface DeviceAuthPollResponse {
451
+ status: DeviceAuthStatus;
452
+ api_key?: string;
453
+ team_id?: string;
454
+ }
455
+ /**
456
+ * DeviceAuthApproveRequest is sent when user approves the auth request
457
+ */
458
+ export interface DeviceAuthApproveRequest {
459
+ code: string;
460
+ team_id: string;
443
461
  }
444
- export interface PrivateEngineResponse {
445
- workers: WorkerStateSummary[];
462
+ /**
463
+ * DeviceAuthApproveResponse is returned after approval
464
+ */
465
+ export interface DeviceAuthApproveResponse {
466
+ success: boolean;
467
+ message?: string;
446
468
  }
447
- export interface CloudEngineResponse {
448
- can_run: boolean;
449
- min_price: number;
450
- max_price: number;
469
+ /**
470
+ * DeviceAuthCodeInfo contains info about a pending auth code (for display on approve page)
471
+ */
472
+ export interface DeviceAuthCodeInfo {
473
+ user_code: string;
474
+ expires_at: string;
475
+ valid: boolean;
476
+ status: DeviceAuthStatus;
451
477
  }
452
- export interface EnginesForResourcesResponse {
453
- private: PrivateEngineResponse;
454
- cloud: CloudEngineResponse;
455
- error?: string;
478
+ /**
479
+ * MeResponse is returned from GET /me with user and current team info
480
+ */
481
+ export interface MeResponse {
482
+ user?: UserDTO;
483
+ team?: TeamDTO;
456
484
  }
457
485
  export interface TeamCreateRequest {
458
486
  name: string;
487
+ username: string;
488
+ email: string;
459
489
  }
460
- export interface FeatureTaskRequest {
461
- is_featured: boolean;
490
+ /**
491
+ * TeamSetupRequest is used for completing team setup (choosing username)
492
+ * This marks the team as setup_completed=true after validation
493
+ */
494
+ export interface TeamSetupRequest {
495
+ username: string;
462
496
  }
463
497
  export interface TeamMemberAddRequest {
464
498
  email: string;
@@ -468,71 +502,72 @@ export interface TeamMemberUpdateRoleRequest {
468
502
  role: TeamRole;
469
503
  }
470
504
  /**
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.
505
+ * SecretCreateRequest for creating a new secret
473
506
  */
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;
507
+ export interface SecretCreateRequest {
508
+ key: string;
509
+ value: string;
510
+ description?: string;
511
+ }
512
+ /**
513
+ * SecretUpdateRequest for updating a secret value
514
+ */
515
+ export interface SecretUpdateRequest {
516
+ value: string;
517
+ description?: string;
501
518
  }
502
519
  /**
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.
520
+ * IntegrationConnectRequest for initiating an integration connection
505
521
  */
506
- export interface SlackMessageEvent {
522
+ export interface IntegrationConnectRequest {
523
+ provider: string;
507
524
  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;
525
+ scopes?: string[];
526
+ /**
527
+ * For API Key type
528
+ */
529
+ api_key?: string;
530
+ /**
531
+ * For BYOK integrations (e.g., X.com) - contains user-provided credentials
532
+ */
533
+ metadata?: {
534
+ [key: string]: any;
518
535
  };
519
536
  }
520
537
  /**
521
- * SlackThreadMessage represents a message from a Slack thread (from conversations.replies)
538
+ * IntegrationCompleteOAuthRequest for completing an OAuth flow
522
539
  */
523
- export interface SlackThreadMessage {
540
+ export interface IntegrationCompleteOAuthRequest {
541
+ provider: string;
524
542
  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
- };
543
+ code: string;
544
+ state: string;
545
+ /**
546
+ * For PKCE - code_verifier to complete the exchange (required by some providers like X/Twitter)
547
+ */
548
+ code_verifier?: string;
549
+ }
550
+ /**
551
+ * IntegrationConnectResponse after connecting
552
+ */
553
+ export interface IntegrationConnectResponse {
554
+ integration?: IntegrationDTO;
555
+ /**
556
+ * For OAuth - redirect URL to start the flow
557
+ */
558
+ auth_url?: string;
559
+ /**
560
+ * For OAuth - state to be returned with the callback (frontend stores this)
561
+ */
562
+ state?: string;
563
+ /**
564
+ * For PKCE - code_verifier to be stored and sent back with CompleteOAuth (required by some providers like X/Twitter)
565
+ */
566
+ code_verifier?: string;
567
+ /**
568
+ * For service accounts - instructions
569
+ */
570
+ instructions?: string;
536
571
  }
537
572
  export interface ProjectCreateRequest {
538
573
  name: string;
@@ -545,30 +580,6 @@ export interface MoveAgentToProjectRequest {
545
580
  agent_id: string;
546
581
  project_id: string;
547
582
  }
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
583
  export type AppCategory = string;
573
584
  export declare const AppCategoryImage: AppCategory;
574
585
  export declare const AppCategoryVideo: AppCategory;
@@ -593,34 +604,31 @@ export interface AppImages {
593
604
  export interface App {
594
605
  BaseModel: BaseModel;
595
606
  PermissionModel: PermissionModel;
607
+ /**
608
+ * Namespace is copied from team.username at creation time and is IMMUTABLE.
609
+ * This ensures stable references like "namespace/name" even if team username changes.
610
+ * Default empty string allows GORM migration to add column, then MigrateAppNamespaces populates it.
611
+ */
612
+ namespace: string;
613
+ /**
614
+ * Name is IMMUTABLE after creation. Combined with Namespace forms unique identifier.
615
+ */
596
616
  name: string;
597
617
  description: string;
598
618
  agent_description: string;
619
+ /**
620
+ * Category is a fundamental classification of the app (image, video, audio, text, chat, 3d, other)
621
+ */
599
622
  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;
623
+ /**
624
+ * Developer's images
625
+ */
610
626
  images: AppImages;
627
+ /**
628
+ * Current version (developer's latest)
629
+ */
611
630
  version_id: string;
612
631
  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
632
  }
625
633
  export interface AppGPUResource {
626
634
  count: number;
@@ -642,286 +650,133 @@ export interface AppVariant {
642
650
  }
643
651
  export interface AppVersion {
644
652
  BaseModel: BaseModel;
653
+ /**
654
+ * ShortID is a human-friendly version identifier (e.g., "abc123")
655
+ * Unique within the app, used in references like "namespace/app@abc123"
656
+ */
657
+ short_id: string;
645
658
  app_id: string;
646
- variants: {
647
- [key: string]: AppVariant;
659
+ metadata: {
660
+ [key: string]: any;
648
661
  };
649
662
  repository: string;
650
663
  flow_id?: string;
651
664
  flow?: Flow;
665
+ setup_schema: any;
652
666
  input_schema: any;
653
667
  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
668
  variants: {
670
669
  [key: string]: AppVariant;
671
670
  };
671
+ env: {
672
+ [key: string]: string;
673
+ };
674
+ kernel: string;
675
+ /**
676
+ * App requirements - secrets and integrations needed to run this app
677
+ */
678
+ required_secrets?: SecretRequirement[];
679
+ required_integrations?: IntegrationRequirement[];
680
+ resources: AppResources;
672
681
  }
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;
682
+ export interface AppDTO extends BaseModel, PermissionModelDTO {
683
+ namespace: string;
689
684
  name: string;
690
685
  description: string;
691
686
  agent_description: string;
692
687
  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
688
  images: AppImages;
705
689
  version_id: string;
706
690
  version?: AppVersionDTO;
707
- variants: {
708
- [key: string]: AppVariant;
709
- };
710
- fees: AppFees;
711
- allows_private_workers: boolean;
712
- allows_cloud_workers: boolean;
713
691
  }
714
- export interface AppVersionDTO {
715
- id: string;
716
- created_at: string;
717
- updated_at: string;
718
- variants: {
719
- [key: string]: AppVariant;
692
+ export interface AppVersionDTO extends BaseModel {
693
+ short_id: string;
694
+ metadata: {
695
+ [key: string]: any;
720
696
  };
721
697
  repository: string;
722
698
  flow?: FlowDTO;
699
+ setup_schema: any;
723
700
  input_schema: any;
724
701
  output_schema: any;
725
- metadata: {
726
- [key: string]: any;
702
+ variants: {
703
+ [key: string]: AppVariant;
727
704
  };
705
+ env: {
706
+ [key: string]: string;
707
+ };
708
+ kernel: string;
709
+ /**
710
+ * App requirements
711
+ */
712
+ required_secrets?: SecretRequirement[];
713
+ required_integrations?: IntegrationRequirement[];
714
+ resources: AppResources;
728
715
  }
729
- export interface ChatModelCapabilities {
730
- Image: boolean;
731
- Images: boolean;
732
- Files: boolean;
733
- Reasoning: boolean;
734
- }
735
- export type Model = any;
736
716
  export interface BaseModel {
737
717
  id: string;
738
718
  created_at: string;
739
719
  updated_at: string;
740
720
  deleted_at?: string;
741
721
  }
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
722
  /**
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
723
+ * Visibility represents the visibility level of a resource
779
724
  */
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;
725
+ export type Visibility = string;
726
+ export declare const VisibilityPrivate: Visibility;
727
+ export declare const VisibilityPublic: Visibility;
728
+ export declare const VisibilityUnlisted: Visibility;
729
+ export interface PermissionModel {
838
730
  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[];
731
+ user?: User;
732
+ team_id: string;
733
+ team?: Team;
734
+ visibility: Visibility;
867
735
  }
868
- export interface BlogPostCommentDTO {
869
- id: string;
870
- created_at: string;
871
- updated_at: string;
872
- deleted_at?: string;
736
+ export interface PermissionModelDTO {
873
737
  user_id: string;
874
738
  user?: UserRelationDTO;
875
- blog_post_id: string;
876
- content: string;
877
- parent_comment_id?: string;
878
- children: BlogPostCommentDTO[];
879
- status: BlogPostCommentStatus;
739
+ team_id: string;
740
+ team?: TeamRelationDTO;
741
+ visibility: Visibility;
880
742
  }
881
- export type ChatType = string;
882
743
  export type ChatStatus = string;
883
- export declare const ChatStatusPending: ChatStatus;
884
- export declare const ChatStatusInProgress: ChatStatus;
744
+ export declare const ChatStatusBusy: ChatStatus;
745
+ export declare const ChatStatusIdle: ChatStatus;
746
+ /**
747
+ * ChatStatusWaitingInput ChatStatus = "waiting_input"
748
+ */
885
749
  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
750
  export interface IntegrationContext {
905
751
  integration_type?: IntegrationType;
906
752
  integration_metadata?: any;
907
753
  }
908
- export interface AgentData {
909
- plan_steps: AgentPlanStep[];
754
+ /**
755
+ * ChatData contains agent-specific data for a chat session
756
+ */
757
+ export interface ChatData {
758
+ plan_steps: PlanStep[];
910
759
  memory: StringEncodedMap;
911
760
  }
912
- export interface AgentPlanStep {
761
+ /**
762
+ * PlanStep represents a step in an agent's execution plan
763
+ */
764
+ export interface PlanStep {
913
765
  index: number;
914
766
  title: string;
915
767
  description: string;
916
768
  notes?: string;
917
- status: AgentPlanStepStatus;
769
+ status: PlanStepStatus;
918
770
  }
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;
771
+ /**
772
+ * PlanStepStatus represents the status of a plan step
773
+ */
774
+ export type PlanStepStatus = string;
775
+ export declare const PlanStepStatusPending: PlanStepStatus;
776
+ export declare const PlanStepStatusInProgress: PlanStepStatus;
777
+ export declare const PlanStepStatusCompleted: PlanStepStatus;
778
+ export declare const PlanStepStatusCancelled: PlanStepStatus;
779
+ export type ChatMessageRole = string;
925
780
  export declare const ChatMessageRoleSystem: ChatMessageRole;
926
781
  export declare const ChatMessageRoleUser: ChatMessageRole;
927
782
  export declare const ChatMessageRoleAssistant: ChatMessageRole;
@@ -943,104 +798,26 @@ export interface ChatMessageContent {
943
798
  text?: string;
944
799
  image?: string;
945
800
  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;
801
+ tool_calls?: ToolCall[];
954
802
  }
955
803
  /**
956
- * Define an auxiliary struct to avoid recursive UnmarshalJSON calls
804
+ * ToolCall represents a tool call from an LLM response (wire format)
805
+ * This is a transport object for parsing LLM responses, not a database model
957
806
  */
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 {
807
+ export interface ToolCall {
989
808
  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;
809
+ type: string;
810
+ function: ToolCallFunction;
1003
811
  }
1004
812
  /**
1005
- * This is a transport object, not a database model
813
+ * ToolCallFunction contains the function name and arguments from an LLM tool call
1006
814
  */
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;
815
+ export interface ToolCallFunction {
816
+ name: string;
817
+ arguments: StringEncodedMap;
1042
818
  }
1043
819
  export interface ChatTaskInput {
820
+ model?: string;
1044
821
  context_size: number;
1045
822
  temperature?: number;
1046
823
  top_p?: number;
@@ -1057,18 +834,6 @@ export interface ChatTaskInput {
1057
834
  tools?: Tool[];
1058
835
  tool_call_id?: string;
1059
836
  }
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
837
  export interface ChatTaskContextMessage {
1073
838
  role: ChatMessageRole;
1074
839
  text?: string;
@@ -1078,35 +843,21 @@ export interface ChatTaskContextMessage {
1078
843
  file?: string;
1079
844
  files?: string[];
1080
845
  tools?: Tool[];
1081
- tool_calls?: ToolInvocation[];
846
+ tool_calls?: ToolCall[];
1082
847
  tool_call_id?: string;
1083
848
  }
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;
849
+ export interface ChatDTO extends BaseModel, PermissionModelDTO {
1092
850
  parent_id?: string;
1093
851
  parent?: ChatDTO;
1094
852
  children: (ChatDTO | undefined)[];
1095
- agent_id?: string;
1096
- agent_version_id?: string;
1097
- agent?: AgentDTO;
853
+ status: ChatStatus;
854
+ agent_config?: AgentRuntimeConfigDTO;
1098
855
  name: string;
1099
856
  description: string;
1100
857
  chat_messages: ChatMessageDTO[];
1101
- agent_data: AgentData;
858
+ agent_data: ChatData;
1102
859
  }
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;
860
+ export interface ChatMessageDTO extends BaseModel, PermissionModelDTO {
1110
861
  chat_id: string;
1111
862
  chat?: ChatDTO;
1112
863
  order: number;
@@ -1116,121 +867,19 @@ export interface ChatMessageDTO {
1116
867
  content: ChatMessageContent[];
1117
868
  tools?: Tool[];
1118
869
  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;
870
+ tool_invocations?: ToolInvocationDTO[];
1233
871
  }
872
+ export type StringEncodedMap = {
873
+ [key: string]: any;
874
+ };
875
+ export type DeviceAuthStatus = string;
876
+ export declare const DeviceAuthStatusPending: DeviceAuthStatus;
877
+ export declare const DeviceAuthStatusApproved: DeviceAuthStatus;
878
+ export declare const DeviceAuthStatusExpired: DeviceAuthStatus;
879
+ export declare const DeviceAuthStatusDenied: DeviceAuthStatus;
880
+ export declare const DeviceAuthStatusValid: DeviceAuthStatus;
881
+ export declare const DeviceAuthStatusInvalid: DeviceAuthStatus;
882
+ export declare const DeviceAuthStatusLoading: DeviceAuthStatus;
1234
883
  /**
1235
884
  * Engine-related types
1236
885
  */
@@ -1239,49 +888,7 @@ export declare const EngineStatusRunning: EngineStatus;
1239
888
  export declare const EngineStatusPending: EngineStatus;
1240
889
  export declare const EngineStatusStopping: EngineStatus;
1241
890
  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;
891
+ export interface EngineStateSummary extends BaseModel, PermissionModelDTO {
1285
892
  instance?: Instance;
1286
893
  name: string;
1287
894
  status: EngineStatus;
@@ -1291,22 +898,6 @@ export interface EngineStateSummary {
1291
898
  * Worker-related types
1292
899
  */
1293
900
  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
901
  export interface WorkerGPU {
1311
902
  id: string;
1312
903
  worker_id: string;
@@ -1330,21 +921,6 @@ export interface WorkerRAM {
1330
921
  worker_id: string;
1331
922
  total: number;
1332
923
  }
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
924
  export interface WorkerStateSummary {
1349
925
  id: string;
1350
926
  user_id: string;
@@ -1355,7 +931,6 @@ export interface WorkerStateSummary {
1355
931
  task_id?: string;
1356
932
  app_id: string;
1357
933
  app_version_id: string;
1358
- app_variant: string;
1359
934
  gpus: WorkerGPU[];
1360
935
  cpus: WorkerCPU[];
1361
936
  rams: WorkerRAM[];
@@ -1370,13 +945,9 @@ export interface File {
1370
945
  content_type: string;
1371
946
  size: number;
1372
947
  filename: string;
948
+ rating: ContentRating;
1373
949
  }
1374
- export interface FileDTO {
1375
- id: string;
1376
- created_at: string;
1377
- updated_at: string;
1378
- user_id: string;
1379
- user: UserRelationDTO;
950
+ export interface FileDTO extends BaseModel, PermissionModelDTO {
1380
951
  path: string;
1381
952
  remote_path: string;
1382
953
  upload_url: string;
@@ -1384,620 +955,132 @@ export interface FileDTO {
1384
955
  content_type: string;
1385
956
  size: number;
1386
957
  filename: string;
958
+ rating: ContentRating;
1387
959
  }
1388
960
  export interface Flow {
1389
961
  BaseModel: BaseModel;
1390
962
  PermissionModel: PermissionModel;
1391
963
  name: string;
1392
964
  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;
965
+ card_image: string;
966
+ thumbnail: string;
967
+ banner_image: string;
968
+ input_schema: any;
969
+ input: FlowRunInputs;
970
+ output_schema: any;
971
+ output_mappings: OutputMappings;
972
+ node_data: FlowNodeDataMap;
973
+ nodes: FlowNode[];
974
+ edges: FlowEdge[];
975
+ viewport?: FlowViewport;
1878
976
  }
1879
- /**
1880
- * PromptMessage represents a message in a prompt
1881
- */
1882
- export interface PromptMessage {
1883
- role: string;
1884
- content: PromptContent;
977
+ export interface FlowViewport {
978
+ x: number;
979
+ y: number;
980
+ zoom: number;
1885
981
  }
1886
- /**
1887
- * PromptContent represents content in a prompt message
1888
- */
1889
- export interface PromptContent {
982
+ export interface FlowNode {
983
+ id: string;
1890
984
  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;
985
+ position: FlowNodePosition;
1917
986
  }
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
- };
987
+ export interface FlowNodePosition {
988
+ x: number;
989
+ y: number;
1926
990
  }
1927
- /**
1928
- * ToolCallResponse represents a response from a tool call
1929
- */
1930
- export interface ToolCallResponse {
1931
- content: ToolContent[];
1932
- structuredContent?: any;
1933
- isError: boolean;
991
+ export interface FlowNodeData {
992
+ app?: AppDTO;
993
+ app_id: string;
994
+ app_version_id: string;
995
+ infra: Infra;
996
+ workers: string[];
997
+ setup?: any;
998
+ additional?: any;
999
+ task?: TaskDTO;
1000
+ task_id?: string;
1934
1001
  }
1935
- /**
1936
- * ToolContent represents content in a tool response
1937
- */
1938
- export interface ToolContent {
1002
+ export type FlowNodeDataMap = {
1003
+ [key: string]: FlowNodeData;
1004
+ };
1005
+ export interface FlowEdge {
1006
+ id: string;
1939
1007
  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;
1008
+ source: string;
1009
+ target: string;
1010
+ source_handle?: string;
1011
+ target_handle?: string;
1953
1012
  }
1954
1013
  /**
1955
- * JSONRPCResponse represents a JSON-RPC response
1014
+ * OutputFieldMapping represents a mapping from a source node's field to an output field in the flow output schema.
1956
1015
  */
1957
- export interface JSONRPCResponse {
1958
- jsonrpc: string;
1959
- id: any;
1960
- result?: any;
1961
- error?: JSONRPCError;
1016
+ export interface OutputFieldMapping {
1017
+ sourceNodeId: string;
1018
+ sourceFieldPath: string;
1019
+ outputFieldName: string;
1020
+ type: string;
1021
+ schema: any;
1962
1022
  }
1963
1023
  /**
1964
- * JSONRPCError represents a JSON-RPC error
1024
+ * OutputMappings is a map of output field name to OutputFieldMapping.
1965
1025
  */
1966
- export interface JSONRPCError {
1967
- code: number;
1968
- message: string;
1969
- data?: any;
1026
+ export type OutputMappings = {
1027
+ [key: string]: OutputFieldMapping;
1028
+ };
1029
+ export interface FlowDTO extends BaseModel, PermissionModelDTO {
1030
+ name: string;
1031
+ description: string;
1032
+ card_image: string;
1033
+ thumbnail: string;
1034
+ banner_image: string;
1035
+ input_schema: any;
1036
+ input: FlowRunInputs;
1037
+ output_schema: any;
1038
+ output_mappings: OutputMappings;
1039
+ node_data: FlowNodeDataMap;
1040
+ nodes: FlowNode[];
1041
+ edges: FlowEdge[];
1042
+ viewport?: FlowViewport;
1970
1043
  }
1971
1044
  /**
1972
- * NotificationMessage represents a notification message
1045
+ * Connection represents a connection between nodes in a flow
1973
1046
  */
1974
- export interface NotificationMessage {
1975
- jsonrpc: string;
1976
- method: string;
1977
- params?: any;
1047
+ export interface FlowNodeConnection {
1048
+ nodeId: string;
1049
+ key: string;
1050
+ type: string;
1051
+ previousValue: any;
1978
1052
  }
1979
- /**
1980
- * ConnectedEvent represents a connected event
1981
- */
1982
- export interface ConnectedEvent {
1983
- event: string;
1984
- timestamp: string;
1053
+ export type FlowRunInputs = {
1054
+ [key: string]: {
1055
+ [key: string]: FlowRunInput;
1056
+ };
1057
+ };
1058
+ export interface FlowRunInput {
1059
+ Connection?: FlowNodeConnection;
1060
+ Value: any;
1985
1061
  }
1986
1062
  /**
1987
- * ResourceTemplate represents a resource template
1063
+ * StringSlice is a custom type for storing string slices in the database
1988
1064
  */
1989
- export interface ResourceTemplate {
1990
- uriTemplate: string;
1991
- name: string;
1992
- title?: string;
1993
- description?: string;
1994
- mimeType?: string;
1995
- }
1065
+ export type StringSlice = string[];
1996
1066
  /**
1997
- * ResourceTemplateResponse represents a response for resource template operations
1067
+ * IntegrationDTO for API responses (never exposes tokens)
1998
1068
  */
1999
- export interface ResourceTemplateResponse {
2000
- resourceTemplates: ResourceTemplate[];
1069
+ export interface IntegrationDTO extends BaseModel, PermissionModelDTO {
1070
+ provider: string;
1071
+ type: string;
1072
+ status: string;
1073
+ display_name: string;
1074
+ scopes: StringSlice;
1075
+ expires_at?: string;
1076
+ service_account_email?: string;
1077
+ metadata?: {
1078
+ [key: string]: any;
1079
+ };
1080
+ account_identifier?: string;
1081
+ account_name?: string;
1082
+ is_primary: boolean;
1083
+ error_message?: string;
2001
1084
  }
2002
1085
  /**
2003
1086
  * ProjectType represents different types of projects
@@ -2007,6 +1090,17 @@ export declare const ProjectTypeAgent: ProjectType;
2007
1090
  export declare const ProjectTypeApp: ProjectType;
2008
1091
  export declare const ProjectTypeFlow: ProjectType;
2009
1092
  export declare const ProjectTypeOther: ProjectType;
1093
+ /**
1094
+ * ProjectModel provides optional project association for models
1095
+ */
1096
+ export interface ProjectModel {
1097
+ project_id?: string;
1098
+ project?: Project;
1099
+ }
1100
+ export interface ProjectModelDTO {
1101
+ project_id?: string;
1102
+ project?: ProjectDTO;
1103
+ }
2010
1104
  /**
2011
1105
  * Project represents a container for organizing related resources
2012
1106
  */
@@ -2028,14 +1122,7 @@ export interface Project {
2028
1122
  /**
2029
1123
  * ProjectDTO for API responses
2030
1124
  */
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;
1125
+ export interface ProjectDTO extends BaseModel, PermissionModelDTO {
2039
1126
  name: string;
2040
1127
  description: string;
2041
1128
  type: ProjectType;
@@ -2045,38 +1132,60 @@ export interface ProjectDTO {
2045
1132
  parent?: ProjectDTO;
2046
1133
  children: (ProjectDTO | undefined)[];
2047
1134
  }
2048
- export interface ResourcePrice {
2049
- CentsPerHour: number;
2050
- NanosPerSecond: number;
1135
+ export type ContentRating = string;
1136
+ export declare const ContentSafe: ContentRating;
1137
+ /**
1138
+ * sexual content
1139
+ */
1140
+ export declare const ContentSexualSuggestive: ContentRating;
1141
+ export declare const ContentSexualExplicit: ContentRating;
1142
+ /**
1143
+ * violence
1144
+ */
1145
+ export declare const ContentViolenceNonGraphic: ContentRating;
1146
+ export declare const ContentViolenceGraphic: ContentRating;
1147
+ /**
1148
+ * gore
1149
+ */
1150
+ export declare const ContentGore: ContentRating;
1151
+ /**
1152
+ * other regulated content
1153
+ */
1154
+ export declare const ContentDrugs: ContentRating;
1155
+ export declare const ContentSelfHarm: ContentRating;
1156
+ export declare const ContentUnrated: ContentRating;
1157
+ /**
1158
+ * SecretRequirement defines a secret that an app requires to run
1159
+ */
1160
+ export interface SecretRequirement {
1161
+ key: string;
1162
+ description?: string;
1163
+ optional?: boolean;
2051
1164
  }
2052
1165
  /**
2053
- * SchemaConverter handles conversion from JSON Schema to tool format
1166
+ * IntegrationRequirement defines an integration capability that an app requires
2054
1167
  */
2055
- export interface SchemaConverter {
1168
+ export interface IntegrationRequirement {
1169
+ key: string;
1170
+ description?: string;
1171
+ optional?: boolean;
2056
1172
  }
2057
1173
  /**
2058
- * RequiredField represents a required field with its name and description
1174
+ * RequirementError represents a single missing requirement with actionable info
2059
1175
  */
2060
- export interface SchemaField {
2061
- Name: string;
2062
- Description: string;
1176
+ export interface RequirementError {
1177
+ type: string;
1178
+ key: string;
1179
+ message: string;
1180
+ action?: SetupAction;
2063
1181
  }
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;
1182
+ /**
1183
+ * SetupAction provides actionable info for resolving a missing requirement
1184
+ */
1185
+ export interface SetupAction {
1186
+ type: string;
1187
+ provider?: string;
1188
+ scopes?: string[];
2080
1189
  }
2081
1190
  export type InstanceCloudProvider = string;
2082
1191
  export declare const CloudAWS: InstanceCloudProvider;
@@ -2097,7 +1206,7 @@ export declare const InstanceStatusPending: InstanceStatus;
2097
1206
  export declare const InstanceStatusActive: InstanceStatus;
2098
1207
  export declare const InstanceStatusDeleted: InstanceStatus;
2099
1208
  export interface Instance {
2100
- id: string;
1209
+ BaseModel: BaseModel;
2101
1210
  PermissionModel: PermissionModel;
2102
1211
  cloud: InstanceCloudProvider;
2103
1212
  name: string;
@@ -2124,23 +1233,6 @@ export interface Instance {
2124
1233
  volume_mount?: InstanceVolumeMountConfig;
2125
1234
  envs?: InstanceEnvVar[];
2126
1235
  }
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
1236
  export interface InstanceConfiguration {
2145
1237
  gpu_type: string;
2146
1238
  interconnect: string;
@@ -2186,187 +1278,12 @@ export interface InstanceEnvVar {
2186
1278
  name: string;
2187
1279
  value: string;
2188
1280
  }
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
1281
  export interface TelemetrySystemInfo {
2352
1282
  cpus: CPU[];
2353
1283
  ram: RAM;
2354
1284
  gpus: GPU[];
2355
1285
  volumes: Volume[];
2356
1286
  }
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
1287
  export interface CPU {
2371
1288
  name: string;
2372
1289
  vendor_id: string;
@@ -2408,54 +1325,6 @@ export interface GPU {
2408
1325
  memory_total: number;
2409
1326
  temperature: number;
2410
1327
  }
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
1328
  export type TaskStatus = number;
2460
1329
  export declare const TaskStatusUnknown: TaskStatus;
2461
1330
  export declare const TaskStatusReceived: TaskStatus;
@@ -2473,54 +1342,6 @@ export type Infra = string;
2473
1342
  export declare const InfraPrivate: Infra;
2474
1343
  export declare const InfraCloud: Infra;
2475
1344
  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
1345
  export interface TaskEvent {
2525
1346
  id: string;
2526
1347
  created_at: string;
@@ -2542,15 +1363,8 @@ export interface TaskLog {
2542
1363
  log_type: TaskLogType;
2543
1364
  content: string;
2544
1365
  }
2545
- export interface TaskDTO {
2546
- id: string;
1366
+ export interface TaskDTO extends BaseModel, PermissionModelDTO {
2547
1367
  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
1368
  user_public_key: string;
2555
1369
  engine_public_key: string;
2556
1370
  is_featured: boolean;
@@ -2574,10 +1388,11 @@ export interface TaskDTO {
2574
1388
  worker_id?: string;
2575
1389
  worker?: WorkerStateSummary;
2576
1390
  webhook?: string;
1391
+ setup?: any;
2577
1392
  input: any;
2578
1393
  output: any;
2579
1394
  error: string;
2580
- nsfw: boolean;
1395
+ rating: ContentRating;
2581
1396
  events: TaskEvent[];
2582
1397
  logs: TaskLog[];
2583
1398
  telemetry: TimescaleTask[];
@@ -2592,69 +1407,87 @@ export interface TimescaleTask {
2592
1407
  task_seq: number;
2593
1408
  app_id: string;
2594
1409
  app_version_id: string;
2595
- app_variant: string;
2596
1410
  engine_id: string;
2597
1411
  engine_resources: TelemetrySystemInfo;
2598
1412
  worker_id: string;
2599
1413
  system_info: TelemetrySystemInfo;
2600
1414
  }
1415
+ export type TeamType = string;
1416
+ export declare const TeamTypePersonal: TeamType;
1417
+ export declare const TeamTypeTeam: TeamType;
1418
+ export declare const TeamTypeSystem: TeamType;
2601
1419
  export interface Team {
2602
1420
  BaseModel: BaseModel;
1421
+ type: TeamType;
1422
+ username: string;
1423
+ email: string;
1424
+ name: string;
1425
+ avatar_url: string;
1426
+ /**
1427
+ * SetupCompleted indicates whether the team has completed initial setup (chosen a username)
1428
+ * Personal teams start with SetupCompleted=false and a generated temporary username
1429
+ */
1430
+ setup_completed: boolean;
2603
1431
  }
2604
- export interface TeamDTO {
2605
- id: string;
1432
+ export interface TeamDTO extends BaseModel {
1433
+ type: TeamType;
2606
1434
  name: string;
2607
- logo: string;
2608
- balance: number;
2609
- env: string;
1435
+ username: string;
1436
+ avatar_url: string;
1437
+ email: string;
1438
+ setup_completed: boolean;
2610
1439
  }
2611
1440
  export type TeamRole = string;
2612
1441
  export declare const TeamRoleOwner: TeamRole;
2613
1442
  export declare const TeamRoleAdmin: TeamRole;
2614
1443
  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
1444
  /**
2643
- * Tool types and parameter types
1445
+ * Team-related types
2644
1446
  */
2645
- export declare const ToolParamTypeNumber = "number";
1447
+ export interface TeamRelationDTO {
1448
+ id: string;
1449
+ created_at: string;
1450
+ updated_at: string;
1451
+ type: TeamType;
1452
+ username: string;
1453
+ avatar_url: string;
1454
+ setup_completed: boolean;
1455
+ }
2646
1456
  /**
2647
- * Tool types and parameter types
1457
+ * ToolInvocationFunction contains the function details for a tool invocation
2648
1458
  */
2649
- export declare const ToolParamTypeBoolean = "boolean";
1459
+ export interface ToolInvocationFunction {
1460
+ name: string;
1461
+ arguments: StringEncodedMap;
1462
+ }
2650
1463
  /**
2651
- * Tool types and parameter types
1464
+ * ToolInvocationStatus represents the execution status of a tool invocation
2652
1465
  */
2653
- export declare const ToolParamTypeArray = "array";
1466
+ export type ToolInvocationStatus = string;
1467
+ export declare const ToolInvocationStatusPending: ToolInvocationStatus;
1468
+ export declare const ToolInvocationStatusInProgress: ToolInvocationStatus;
1469
+ export declare const ToolInvocationStatusAwaitingInput: ToolInvocationStatus;
1470
+ export declare const ToolInvocationStatusAwaitingApproval: ToolInvocationStatus;
1471
+ export declare const ToolInvocationStatusCompleted: ToolInvocationStatus;
1472
+ export declare const ToolInvocationStatusFailed: ToolInvocationStatus;
1473
+ export declare const ToolInvocationStatusCancelled: ToolInvocationStatus;
2654
1474
  /**
2655
- * Tool types and parameter types
1475
+ * ToolInvocationDTO for API responses
2656
1476
  */
2657
- export declare const ToolParamTypeNull = "null";
1477
+ export interface ToolInvocationDTO extends BaseModel, PermissionModelDTO {
1478
+ chat_message_id: string;
1479
+ tool_invocation_id: string;
1480
+ type: ToolType;
1481
+ execution_id?: string;
1482
+ function: ToolInvocationFunction;
1483
+ status: ToolInvocationStatus;
1484
+ result?: string;
1485
+ /**
1486
+ * Unified fields
1487
+ */
1488
+ data?: any;
1489
+ widget?: Widget;
1490
+ }
2658
1491
  export interface Tool {
2659
1492
  type: string;
2660
1493
  function: ToolFunction;
@@ -2662,13 +1495,13 @@ export interface Tool {
2662
1495
  export interface ToolFunction {
2663
1496
  name: string;
2664
1497
  description: string;
2665
- parameters: ToolParameters;
1498
+ parameters?: ToolParameters;
2666
1499
  required?: string[];
2667
1500
  }
2668
1501
  export interface ToolParameters {
2669
1502
  type: string;
2670
1503
  title: string;
2671
- properties: ToolParameterProperties;
1504
+ properties?: ToolParameterProperties;
2672
1505
  required?: string[];
2673
1506
  }
2674
1507
  export type ToolParameterProperties = {
@@ -2705,47 +1538,107 @@ export interface Transaction {
2705
1538
  [key: string]: any;
2706
1539
  };
2707
1540
  }
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 {
1541
+ /**
1542
+ * PaymentRecordStatus represents the status of a payment
1543
+ */
1544
+ export type PaymentRecordStatus = number;
1545
+ export declare const PaymentRecordStatusPending: PaymentRecordStatus;
1546
+ export declare const PaymentRecordStatusComplete: PaymentRecordStatus;
1547
+ export declare const PaymentRecordStatusFailed: PaymentRecordStatus;
1548
+ export declare const PaymentRecordStatusExpired: PaymentRecordStatus;
1549
+ /**
1550
+ * PaymentRecordType represents the type of payment
1551
+ */
1552
+ export type PaymentRecordType = string;
1553
+ export declare const PaymentRecordTypeCheckout: PaymentRecordType;
1554
+ export declare const PaymentRecordTypeAutoRecharge: PaymentRecordType;
1555
+ /**
1556
+ * PaymentRecord stores Stripe payment details for both checkout sessions and direct charges
1557
+ */
1558
+ export interface PaymentRecord {
2732
1559
  BaseModel: BaseModel;
2733
1560
  PermissionModel: PermissionModel;
1561
+ type: PaymentRecordType;
1562
+ status: PaymentRecordStatus;
1563
+ amount: number;
1564
+ stripe_customer_id: string;
1565
+ payment_intent_id: string;
1566
+ receipt_url: string;
1567
+ /**
1568
+ * Checkout-specific fields (only set for checkout type)
1569
+ */
2734
1570
  session_id: string;
2735
1571
  session_url: string;
2736
- status: StripeTransactionStatus;
2737
1572
  }
2738
1573
  export type UsageEventResourceTier = string;
2739
1574
  export declare const UsageEventResourceTierPrivate: UsageEventResourceTier;
2740
1575
  export declare const UsageEventResourceTierCloud: UsageEventResourceTier;
1576
+ /**
1577
+ * MetaItemType is the type discriminator for MetaItem
1578
+ */
1579
+ export type MetaItemType = string;
1580
+ export declare const MetaItemTypeText: MetaItemType;
1581
+ export declare const MetaItemTypeImage: MetaItemType;
1582
+ export declare const MetaItemTypeVideo: MetaItemType;
1583
+ export declare const MetaItemTypeAudio: MetaItemType;
1584
+ export declare const MetaItemTypeRaw: MetaItemType;
1585
+ /**
1586
+ * VideoResolution represents standard video resolution presets
1587
+ */
1588
+ export type VideoResolution = string;
1589
+ export declare const VideoRes480P: VideoResolution;
1590
+ export declare const VideoRes720P: VideoResolution;
1591
+ export declare const VideoRes1080P: VideoResolution;
1592
+ export declare const VideoRes1440P: VideoResolution;
1593
+ export declare const VideoRes4K: VideoResolution;
1594
+ /**
1595
+ * MetaItem represents metadata about an input or output item
1596
+ */
1597
+ export interface MetaItem {
1598
+ type: MetaItemType;
1599
+ /**
1600
+ * Text fields
1601
+ */
1602
+ tokens?: number;
1603
+ /**
1604
+ * Image/Video shared fields
1605
+ */
1606
+ width?: number;
1607
+ height?: number;
1608
+ resolution_mp?: number;
1609
+ /**
1610
+ * Image specific fields
1611
+ */
1612
+ steps?: number;
1613
+ count?: number;
1614
+ /**
1615
+ * Video specific fields
1616
+ */
1617
+ resolution?: VideoResolution;
1618
+ seconds?: number;
1619
+ fps?: number;
1620
+ /**
1621
+ * Audio specific fields
1622
+ */
1623
+ sample_rate?: number;
1624
+ /**
1625
+ * App-specific key-value pairs for custom pricing factors
1626
+ */
1627
+ extra?: {
1628
+ [key: string]: any;
1629
+ };
1630
+ }
1631
+ /**
1632
+ * OutputMeta contains structured metadata about task inputs and outputs for pricing calculation
1633
+ */
1634
+ export interface OutputMeta {
1635
+ inputs: MetaItem[];
1636
+ outputs: MetaItem[];
1637
+ }
2741
1638
  export interface UsageEvent {
2742
1639
  BaseModel: BaseModel;
1640
+ PermissionModel: PermissionModel;
2743
1641
  usage_billing_record_id: string;
2744
- /**
2745
- * Event owner
2746
- */
2747
- user_id: string;
2748
- group_id?: string;
2749
1642
  reference_id: string;
2750
1643
  resource_id: string;
2751
1644
  /**
@@ -2757,77 +1650,95 @@ export interface UsageEvent {
2757
1650
  quantity: number;
2758
1651
  unit: string;
2759
1652
  }
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
1653
  export interface UsageBillingRecord {
2773
1654
  BaseModel: BaseModel;
2774
- user_id: string;
2775
- group_id?: string;
2776
- usage_events: (UsageEvent | undefined)[];
1655
+ PermissionModel: PermissionModel;
1656
+ /**
1657
+ * Fee breakdown (all in microcents)
1658
+ */
2777
1659
  total: number;
1660
+ /**
1661
+ * User debit (total charged)
1662
+ */
2778
1663
  user_debit_transaction_id: string;
2779
1664
  user_debit_transaction?: Transaction;
2780
- owner_credit_transaction_id: string;
2781
- owner_credit_transaction?: Transaction;
1665
+ /**
1666
+ * Resource owner credit (for providing compute)
1667
+ */
1668
+ resource_credit_transaction_id: string;
1669
+ resource_credit_transaction?: Transaction;
1670
+ /**
1671
+ * Creator royalty credit (app creator earnings)
1672
+ */
1673
+ royalty_credit_transaction_id: string;
1674
+ royalty_credit_transaction?: Transaction;
1675
+ /**
1676
+ * Inference fee credit (platform fee)
1677
+ */
1678
+ inference_credit_transaction_id: string;
1679
+ inference_credit_transaction?: Transaction;
1680
+ /**
1681
+ * Partner fee credit (cloud API fee)
1682
+ */
1683
+ partner_credit_transaction_id: string;
1684
+ partner_credit_transaction?: Transaction;
2782
1685
  }
2783
1686
  export interface UsageBillingRefund {
2784
1687
  BaseModel: BaseModel;
2785
- user_id: string;
2786
- group_id?: string;
1688
+ PermissionModel: PermissionModel;
2787
1689
  usage_billing_record_id: string;
2788
1690
  usage_billing_record?: UsageBillingRecord;
1691
+ /**
1692
+ * User refund (total refunded)
1693
+ */
2789
1694
  user_debit_refund_transaction_id: string;
2790
1695
  user_debit_refund_transaction?: Transaction;
2791
- owner_credit_refund_transaction_id: string;
2792
- owner_credit_refund_transaction?: Transaction;
1696
+ /**
1697
+ * Resource owner reversal
1698
+ */
1699
+ resource_credit_refund_transaction_id: string;
1700
+ resource_credit_refund_transaction?: Transaction;
1701
+ /**
1702
+ * Creator royalty reversal
1703
+ */
1704
+ royalty_credit_refund_transaction_id: string;
1705
+ royalty_credit_refund_transaction?: Transaction;
1706
+ /**
1707
+ * Inference fee reversal
1708
+ */
1709
+ inference_credit_refund_transaction_id: string;
1710
+ inference_credit_refund_transaction?: Transaction;
1711
+ /**
1712
+ * Partner fee reversal
1713
+ */
1714
+ partner_credit_refund_transaction_id: string;
1715
+ partner_credit_refund_transaction?: Transaction;
2793
1716
  }
2794
1717
  /**
2795
1718
  * User-related types
2796
1719
  */
2797
1720
  export interface User {
2798
1721
  BaseModel: BaseModel;
1722
+ default_team_id: string;
2799
1723
  role: Role;
2800
- username: string;
2801
1724
  email: string;
2802
1725
  name: string;
2803
1726
  full_name: string;
2804
1727
  avatar_url: string;
2805
- email_verified: boolean;
2806
- phone_verified: boolean;
2807
- is_anonymous: boolean;
2808
- env: string;
2809
- balance: number;
2810
1728
  metadata: UserMetadata;
2811
1729
  }
2812
1730
  export type Role = string;
1731
+ export declare const RoleGuest: Role;
2813
1732
  export declare const RoleUser: Role;
2814
1733
  export declare const RoleAdmin: Role;
2815
1734
  export declare const RoleSystem: Role;
2816
- export interface UserDTO {
2817
- id: string;
2818
- created_at: string;
2819
- updated_at: string;
2820
- deleted_at?: string;
1735
+ export interface UserDTO extends BaseModel {
1736
+ default_team_id: string;
2821
1737
  role: Role;
2822
- username: string;
2823
1738
  email: string;
2824
- email_verified: boolean;
2825
- is_anonymous: boolean;
2826
1739
  name: string;
2827
1740
  full_name: string;
2828
1741
  avatar_url: string;
2829
- env: string;
2830
- balance: number;
2831
1742
  metadata: UserMetadata;
2832
1743
  }
2833
1744
  /**
@@ -2838,7 +1749,6 @@ export interface UserRelationDTO {
2838
1749
  created_at: string;
2839
1750
  updated_at: string;
2840
1751
  role: Role;
2841
- username: string;
2842
1752
  avatar_url: string;
2843
1753
  }
2844
1754
  export interface UserMetadata {
@@ -2848,12 +1758,6 @@ export interface UserMetadata {
2848
1758
  use_case_reason: string;
2849
1759
  use_case_privacy: string;
2850
1760
  }
2851
- /**
2852
- * Environment represents a map of environment variables
2853
- */
2854
- export type Environment = {
2855
- [key: string]: string;
2856
- };
2857
1761
  /**
2858
1762
  * WidgetAction represents an action triggered by a widget button
2859
1763
  */
@@ -2871,7 +1775,15 @@ export interface WidgetActionButton {
2871
1775
  action: WidgetAction;
2872
1776
  variant?: string;
2873
1777
  }
1778
+ /**
1779
+ * WidgetNodeType constants
1780
+ * Primitives (literal values): text, markdown, image, badge, button, input, select, checkbox, row, col
1781
+ * Data-bound (read from ToolInvocation.Data): plan-list, key-value, status-badge
1782
+ */
2874
1783
  export type WidgetNodeType = string;
1784
+ /**
1785
+ * Primitive node types (render literal values)
1786
+ */
2875
1787
  export declare const WidgetNodeTypeText: WidgetNodeType;
2876
1788
  export declare const WidgetNodeTypeMarkdown: WidgetNodeType;
2877
1789
  export declare const WidgetNodeTypeImage: WidgetNodeType;
@@ -2882,6 +1794,12 @@ export declare const WidgetNodeTypeSelect: WidgetNodeType;
2882
1794
  export declare const WidgetNodeTypeCheckbox: WidgetNodeType;
2883
1795
  export declare const WidgetNodeTypeRow: WidgetNodeType;
2884
1796
  export declare const WidgetNodeTypeCol: WidgetNodeType;
1797
+ /**
1798
+ * Data-bound node types (read from ToolInvocation.Data via DataKey)
1799
+ */
1800
+ export declare const WidgetNodeTypePlanList: WidgetNodeType;
1801
+ export declare const WidgetNodeTypeKeyValue: WidgetNodeType;
1802
+ export declare const WidgetNodeTypeStatusBadge: WidgetNodeType;
2885
1803
  /**
2886
1804
  * WidgetNode represents a UI element in a widget (text, input, select, etc.)
2887
1805
  */
@@ -2900,6 +1818,11 @@ export interface WidgetNode {
2900
1818
  defaultChecked?: boolean;
2901
1819
  children?: WidgetNode[];
2902
1820
  gap?: number;
1821
+ /**
1822
+ * Data binding - for data-bound node types, specifies which key in ToolInvocation.Data to read
1823
+ * Empty string means read entire Data object (useful for key-value display)
1824
+ */
1825
+ dataKey?: string;
2903
1826
  }
2904
1827
  /**
2905
1828
  * WidgetSelectOption represents an option in a select widget
@@ -2909,10 +1832,13 @@ export interface WidgetSelectOption {
2909
1832
  value: string;
2910
1833
  }
2911
1834
  /**
2912
- * Widget represents an interactive card widget
1835
+ * Widget represents an interactive widget for display in chat
1836
+ * Type is either "ui" (structured nodes) or "html" (raw HTML)
1837
+ * For "ui" widgets, data-bound nodes read values from ToolInvocation.Data
2913
1838
  */
2914
1839
  export interface Widget {
2915
1840
  type: string;
1841
+ interactive?: boolean;
2916
1842
  title?: string;
2917
1843
  html?: string;
2918
1844
  json?: string;
@@ -2925,95 +1851,3 @@ export interface Widget {
2925
1851
  export type WidgetFormData = {
2926
1852
  [key: string]: any;
2927
1853
  };
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
- }