@inferencesh/sdk 0.1.3 → 0.2.1

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,228 +1,277 @@
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
- team_id: string;
9
- owner_read: boolean;
10
- owner_write: boolean;
11
- owner_exec: boolean;
12
- team_read: boolean;
13
- team_write: boolean;
14
- team_exec: boolean;
15
- other_read: boolean;
16
- other_write: boolean;
17
- other_exec: boolean;
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;
18
9
  }
19
10
  /**
20
- * Agent represents a configurable AI agent in the system
11
+ * ToolType represents the type of tool (used in both AgentTool definition and ToolInvocation)
21
12
  */
22
- export interface AgentApp {
23
- id: string;
24
- version_id: string;
25
- variant: string;
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
+ /**
24
+ * Ref is the human-readable reference: "namespace/name@shortVersionId"
25
+ * This is what users specify in configs/SDKs
26
+ */
27
+ ref: string;
28
+ /**
29
+ * ID and VersionID are resolved full database UUIDs (populated at runtime)
30
+ */
31
+ id?: string;
32
+ version_id?: string;
33
+ /**
34
+ * Resolved app object (populated at runtime)
35
+ */
26
36
  app?: App;
27
- description: string;
28
- }
29
- export interface AgentAppDTO {
30
- id: string;
31
- version_id: string;
32
- variant: string;
33
- app?: AppDTO;
34
- description: string;
35
37
  }
36
- export interface SubAgent {
37
- id: string;
38
- version_id: string;
38
+ /**
39
+ * AgentToolConfig contains configuration for a sub-agent tool
40
+ */
41
+ export interface AgentToolConfig {
42
+ /**
43
+ * Ref is the human-readable reference: "namespace/name@shortVersionId"
44
+ * This is what users specify in configs/SDKs
45
+ */
46
+ ref: string;
47
+ /**
48
+ * ID and VersionID are resolved full database UUIDs (populated at runtime)
49
+ */
50
+ id?: string;
51
+ version_id?: string;
52
+ /**
53
+ * Resolved agent object (populated at runtime)
54
+ */
39
55
  agent?: Agent;
40
- description: string;
41
- }
42
- export interface SubAgentDTO {
43
- id: string;
44
- version_id: string;
45
- agent?: AgentDTO;
46
- description: string;
47
56
  }
48
57
  /**
49
- * AgentHook represents a webhook that can be called as a tool
58
+ * HookToolConfig contains configuration for a webhook tool
50
59
  */
51
- export interface AgentHook {
52
- name: string;
53
- description: string;
60
+ export interface HookToolConfig {
54
61
  url: string;
55
62
  secret?: string;
56
63
  input_schema?: any;
64
+ output_schema?: any;
65
+ }
66
+ /**
67
+ * ClientToolConfig contains configuration for a frontend-executed tool
68
+ */
69
+ export interface ClientToolConfig {
70
+ input_schema?: any;
71
+ output_schema?: any;
72
+ }
73
+ /**
74
+ * AgentTool represents a unified tool that can be used by an agent
75
+ */
76
+ export interface AgentTool {
77
+ name: string;
78
+ display_name?: string;
79
+ description: string;
80
+ type: ToolType;
81
+ /**
82
+ * Human-in-the-Loop: if true, tool execution requires user approval
83
+ */
84
+ require_approval?: boolean;
85
+ /**
86
+ * Type-specific config (exactly one should be set based on Type)
87
+ */
88
+ app?: AppToolConfig;
89
+ agent?: AgentToolConfig;
90
+ hook?: HookToolConfig;
91
+ client?: ClientToolConfig;
92
+ internal?: InternalToolConfig;
93
+ }
94
+ /**
95
+ * InternalToolConfig contains configuration for internal/built-in tools
96
+ */
97
+ export interface InternalToolConfig {
98
+ category: string;
99
+ operation: string;
57
100
  }
58
101
  /**
59
- * AgentHookDTO for API responses
102
+ * AgentToolDTO for API responses
60
103
  */
61
- export interface AgentHookDTO {
104
+ export interface AgentToolDTO {
62
105
  name: string;
106
+ display_name?: string;
63
107
  description: string;
108
+ type: ToolType;
109
+ /**
110
+ * Human-in-the-Loop: if true, tool execution requires user approval
111
+ */
112
+ require_approval?: boolean;
113
+ app?: AppToolConfigDTO;
114
+ agent?: AgentToolConfigDTO;
115
+ hook?: HookToolConfigDTO;
116
+ client?: ClientToolConfigDTO;
117
+ }
118
+ export interface AppToolConfigDTO {
119
+ ref: string;
120
+ id?: string;
121
+ version_id?: string;
122
+ app?: AppDTO;
123
+ }
124
+ export interface AgentToolConfigDTO {
125
+ ref: string;
126
+ id?: string;
127
+ version_id?: string;
128
+ agent?: AgentDTO;
129
+ }
130
+ export interface HookToolConfigDTO {
64
131
  url: string;
65
132
  secret?: string;
66
133
  input_schema?: any;
134
+ output_schema?: any;
135
+ }
136
+ export interface ClientToolConfigDTO {
137
+ input_schema?: any;
138
+ output_schema?: any;
139
+ }
140
+ /**
141
+ * CoreAppConfig references an app used as the agent's core
142
+ */
143
+ export interface CoreAppConfig {
144
+ id: string;
145
+ version_id: string;
146
+ app?: App;
67
147
  }
68
148
  export interface Agent {
69
149
  BaseModel: BaseModel;
70
150
  PermissionModel: PermissionModel;
151
+ ProjectModel: ProjectModel;
71
152
  /**
72
153
  * Basic info
73
154
  */
155
+ namespace: string;
74
156
  name: string;
75
- project_id?: string;
76
- project?: Project;
77
157
  version_id: string;
78
158
  version?: AgentVersion;
79
- is_active: boolean;
80
159
  }
81
160
  /**
82
161
  * AgentDTO for API responses
83
162
  */
84
- export interface AgentDTO extends BaseModel, PermissionModelDTO {
163
+ export interface AgentDTO extends BaseModel, PermissionModelDTO, ProjectModelDTO {
164
+ namespace: string;
85
165
  name: string;
86
- project_id?: string;
87
- project?: ProjectDTO;
88
166
  version_id: string;
89
167
  version?: AgentVersionDTO;
90
- is_active: boolean;
91
168
  }
92
169
  export interface AgentVersion {
93
170
  BaseModel: BaseModel;
94
171
  PermissionModel: PermissionModel;
172
+ agent_id: string;
95
173
  description: string;
96
174
  system_prompt: string;
97
- prompt_template: string;
98
175
  example_prompts: string[];
99
- core_app?: AgentApp;
176
+ core_app?: CoreAppConfig;
100
177
  core_app_input?: any;
101
- sub_agents: (SubAgent | undefined)[];
102
- apps: (AgentApp | undefined)[];
103
- hooks: (AgentHook | undefined)[];
178
+ /**
179
+ * Unified tools array (apps, agents, hooks)
180
+ */
181
+ tools: (AgentTool | undefined)[];
182
+ /**
183
+ * Internal tools configuration (plan, memory, widget, finish)
184
+ */
185
+ internal_tools?: InternalToolsConfig;
186
+ /**
187
+ * Output schema for custom finish tool (sub-agents only)
188
+ */
189
+ output_schema?: any;
190
+ }
191
+ export interface CoreAppConfigDTO {
192
+ id: string;
193
+ version_id: string;
194
+ app?: AppDTO;
104
195
  }
105
196
  export interface AgentVersionDTO extends BaseModel, PermissionModelDTO {
106
197
  description: string;
107
198
  system_prompt: string;
108
- prompt_template: string;
109
199
  example_prompts: string[];
110
- core_app?: AgentApp;
200
+ core_app?: CoreAppConfigDTO;
111
201
  core_app_input?: any;
112
- sub_agents: (SubAgentDTO | undefined)[];
113
- apps: (AgentAppDTO | undefined)[];
114
- hooks: (AgentHookDTO | undefined)[];
115
- }
116
- /**
117
- * TimeWindow represents a single analytics time window
118
- */
119
- export interface TimeWindow {
120
- start: string;
121
- end: string;
122
- count: number;
123
- }
124
- /**
125
- * TaskStatusWindow represents a single analytics time window with task status
126
- */
127
- export interface TaskStatusWindow {
128
- start: string;
129
- status: TaskStatus;
130
- count: number;
131
- }
132
- /**
133
- * AppAnalytics represents usage statistics for an app
134
- */
135
- export interface AppAnalytics {
136
- app_id: string;
137
- app_username: string;
138
- app_name: string;
139
- version_id: string;
140
- variant: string;
141
- task_count: number;
142
- }
143
- /**
144
- * TimeSeriesMetrics contains all time-series data
145
- */
146
- export interface TimeSeriesMetrics {
147
- active_users: TimeWindow[];
148
- new_users: TimeWindow[];
149
- tasks_by_status: TaskStatusWindow[];
150
- new_engines: TimeWindow[];
151
- }
152
- /**
153
- * TotalMetrics contains total counts for the time window
154
- */
155
- export interface TotalMetrics {
156
- active_users: number;
157
- new_users: number;
158
- tasks: number;
159
- new_engines: number;
160
202
  /**
161
- * Total running engines
203
+ * Unified tools array (apps, agents, hooks, client)
162
204
  */
163
- running_engines: number;
205
+ tools: (AgentToolDTO | undefined)[];
164
206
  /**
165
- * Private running engines (acl_other_exec = false or null)
207
+ * Internal tools configuration (plan, memory, widget, finish)
166
208
  */
167
- private_running_engines: number;
209
+ internal_tools?: InternalToolsConfig;
168
210
  /**
169
- * Cloud running engines (acl_other_exec = true)
211
+ * Output schema for custom finish tool (sub-agents only)
170
212
  */
171
- cloud_running_engines: number;
172
- top_apps: AppAnalytics[];
213
+ output_schema?: any;
173
214
  }
174
215
  /**
175
- * RealtimeMetrics contains current system state
216
+ * AgentRuntimeConfig is a self-contained, flattened config for chat execution.
217
+ * This is either snapshotted from an Agent template or provided ad-hoc.
218
+ * It's portable and can be serialized to JSON or YAML.
176
219
  */
177
- export interface RealtimeMetrics {
220
+ export interface AgentRuntimeConfig {
178
221
  /**
179
- * Total tasks
222
+ * Origin tracking (optional, for lineage when snapshotted from template)
180
223
  */
181
- queued_tasks: number;
182
- running_tasks: number;
224
+ agent_id?: string;
225
+ agent_version_id?: string;
183
226
  /**
184
- * Private tasks (engines with acl_other_exec = false or null)
227
+ * Identity
185
228
  */
186
- private_queued_tasks: number;
187
- private_running_tasks: number;
229
+ name: string;
230
+ namespace?: string;
231
+ description?: string;
188
232
  /**
189
- * Cloud tasks (engines with acl_other_exec = true)
233
+ * Prompts
190
234
  */
191
- cloud_queued_tasks: number;
192
- cloud_running_tasks: number;
235
+ system_prompt: string;
236
+ example_prompts?: string[];
193
237
  /**
194
- * User metrics
238
+ * Core LLM
239
+ * CoreAppRef is the user-facing ref (namespace/name@shortid) - used in ad-hoc configs
240
+ * CoreApp is the resolved config - populated by backend after resolving CoreAppRef
195
241
  */
196
- total_users: number;
197
- users_with_no_engines: number;
198
- users_with_no_tasks: number;
199
- }
200
- /**
201
- * AnalyticsResponse contains all analytics data
202
- */
203
- export interface AnalyticsResponse {
204
- time_series: TimeSeriesMetrics;
205
- totals: TotalMetrics;
206
- realtime: RealtimeMetrics;
207
- }
208
- /**
209
- * AnalyticsRequest represents the query parameters for analytics
210
- */
211
- export interface AnalyticsRequest {
212
- start: string;
213
- end: string;
214
- resolution: string;
242
+ core_app_ref?: string;
243
+ core_app?: CoreAppConfig;
244
+ core_app_input?: any;
245
+ /**
246
+ * Tools (apps, agents, hooks, client tools)
247
+ */
248
+ tools?: (AgentTool | undefined)[];
249
+ /**
250
+ * Internal tools configuration (plan, memory, widget, finish)
251
+ */
252
+ internal_tools?: InternalToolsConfig;
253
+ /**
254
+ * Output schema for custom finish tool (sub-agents only)
255
+ */
256
+ output_schema?: any;
215
257
  }
216
258
  /**
217
- * Define a private context key type
218
- */
219
- /**
220
- * AuthenticatedUser represents the user data we store in context
259
+ * AgentRuntimeConfigDTO for API responses
221
260
  */
222
- export interface AuthenticatedUser {
223
- id: string;
224
- api_key: string;
225
- role: string;
261
+ export interface AgentRuntimeConfigDTO {
262
+ agent_id?: string;
263
+ agent_version_id?: string;
264
+ name: string;
265
+ namespace?: string;
266
+ description?: string;
267
+ system_prompt: string;
268
+ example_prompts?: string[];
269
+ core_app_ref?: string;
270
+ core_app?: CoreAppConfigDTO;
271
+ core_app_input?: any;
272
+ tools?: (AgentToolDTO | undefined)[];
273
+ internal_tools?: InternalToolsConfig;
274
+ output_schema?: any;
226
275
  }
227
276
  export interface APIRequest<T extends any> {
228
277
  timestamp: string;
@@ -238,98 +287,98 @@ export interface APIError {
238
287
  code: string;
239
288
  message: string;
240
289
  }
241
- export interface WorkerGPUConfig {
242
- gpus: number[];
243
- }
244
- export interface WorkerCPUConfig {
245
- count: number;
246
- }
247
- export interface WorkerConfig {
248
- gpu: WorkerGPUConfig[];
249
- cpu: WorkerCPUConfig;
250
- }
251
- export interface EngineConfig {
252
- id: string;
253
- name: string;
254
- api_url: string;
255
- engine_port: string;
256
- workers: WorkerConfig;
257
- api_key: string;
258
- container_mode: boolean;
259
- network_name: string;
260
- cache_path: string;
261
- gpus: string[];
262
- }
263
- export interface RemoteEngineCreateRequest {
264
- name: string;
265
- instance_type?: InstanceType;
266
- start_time: string;
267
- end_time: string;
268
- }
269
- export interface CheckoutCreateRequest {
270
- amount: number;
271
- success_url: string;
272
- cancel_url: string;
273
- }
274
- export interface CheckoutCompleteRequest {
275
- session_id: string;
276
- }
277
290
  /**
278
- * Legacy aliases for backward compatibility
291
+ * ApiAppRunRequest is the request body for /apps/run endpoint.
292
+ * Version pinning is required for stability.
279
293
  */
280
- export type StripeCheckoutCreateRequest = CheckoutCreateRequest;
281
- export type StripeCheckoutCompleteRequest = CheckoutCompleteRequest;
282
- export interface EngineCreateResponse {
283
- engine_state?: EngineState;
284
- }
285
- export interface EngineRegisterRequest {
286
- local_engine_state?: LocalEngineState;
287
- api_url: string;
288
- system_info?: SystemInfo;
289
- worker_config: WorkerConfig;
290
- }
291
- export interface EngineRegisterResponse {
292
- engine_state?: EngineState;
293
- }
294
- export interface CreateApiKeyRequest {
295
- name: string;
296
- }
297
- export interface CreateTaskRequest {
298
- id?: string;
299
- app_id: string;
300
- version_id?: string;
301
- variant?: string;
302
- infra: Infra;
303
- workers: string[];
294
+ export interface ApiAppRunRequest {
295
+ /**
296
+ * App reference in format: namespace/name@shortid (version required)
297
+ * Example: "okaris/flux@abc1"
298
+ * The short ID ensures your code always runs the same version.
299
+ */
300
+ app: string;
301
+ /**
302
+ * Deprecated: Use namespace/name@shortid format in App field instead.
303
+ */
304
+ version?: string;
305
+ infra?: Infra;
306
+ workers?: string[];
304
307
  webhook?: string;
308
+ setup?: any;
305
309
  input: any;
306
- flow_id?: string;
307
- flow_run_id?: string;
310
+ /**
311
+ * If true, returns SSE stream instead of JSON response
312
+ */
313
+ stream?: boolean;
314
+ }
315
+ /**
316
+ * ApiTaskRequest is an alias for ApiAppRunRequest (deprecated name)
317
+ */
318
+ export type ApiTaskRequest = ApiAppRunRequest;
319
+ /**
320
+ * ApiAgentRunRequest is the request body for /agents/run endpoint.
321
+ * Supports both template agents and ad-hoc agents.
322
+ */
323
+ export interface ApiAgentRunRequest {
324
+ /**
325
+ * Existing chat ID to continue a conversation (optional)
326
+ */
308
327
  chat_id?: string;
309
- agent_id?: string;
310
- agent_version_id?: string;
311
- tool_call_id?: string;
312
- graph_id?: string;
328
+ /**
329
+ * Template agent reference in format: namespace/name@shortid
330
+ * Example: "my-org/assistant@abc123"
331
+ * Use this OR AgentConfig, not both
332
+ */
333
+ agent?: string;
334
+ /**
335
+ * Ad-hoc agent configuration
336
+ * For ad-hoc agents, set core_app_ref to the LLM app reference
337
+ * Example: { "core_app_ref": "infsh/claude-sonnet-4@abc123", "system_prompt": "..." }
338
+ */
339
+ agent_config?: AgentRuntimeConfig;
340
+ /**
341
+ * The message to send
342
+ */
343
+ input: ChatTaskInput;
344
+ /**
345
+ * If true, returns SSE stream instead of JSON response
346
+ */
347
+ stream?: boolean;
313
348
  }
349
+ /**
350
+ * ApiAgentMessageRequest is an alias for ApiAgentRunRequest (deprecated name)
351
+ */
352
+ export type ApiAgentMessageRequest = ApiAgentRunRequest;
314
353
  export interface CreateAgentMessageRequest {
315
354
  chat_id?: string;
316
355
  agent_id?: string;
317
356
  agent_version_id?: string;
357
+ agent?: string;
318
358
  tool_call_id?: string;
319
359
  input: ChatTaskInput;
320
360
  integration_context?: IntegrationContext;
361
+ /**
362
+ * Ad-hoc agent config - use this instead of Agent for embedded configs
363
+ * If provided, creates a chat with this config directly (no agent reference)
364
+ */
365
+ agent_config?: AgentRuntimeConfig;
366
+ }
367
+ export interface CreateChatMessageResponse {
368
+ user_message?: ChatMessageDTO;
369
+ assistant_message?: ChatMessageDTO;
321
370
  }
322
371
  /**
323
372
  * WidgetActionRequest represents a user's response to a widget
324
- * Uses WidgetAction and WidgetFormData from chat.go
373
+ * @deprecated Use ToolResultRequest with action field instead
325
374
  */
326
375
  export interface WidgetActionRequest {
327
376
  action: WidgetAction;
328
377
  form_data?: WidgetFormData;
329
378
  }
330
379
  /**
331
- * ToolResultRequest represents a generic tool result callback
332
- * Used by hooks and other tools that expect an async callback
380
+ * ToolResultRequest represents a tool result submission
381
+ * For widget actions, clients should JSON-serialize { action, form_data } as the result string
333
382
  */
334
383
  export interface ToolResultRequest {
335
384
  result: string;
@@ -343,12 +392,6 @@ export interface HookPayload {
343
392
  */
344
393
  tool_invocation_id: string;
345
394
  hook_name: string;
346
- /**
347
- * Context
348
- */
349
- chat_id: string;
350
- agent_id?: string;
351
- agent_version_id?: string;
352
395
  /**
353
396
  * Callback - use this to submit the result back
354
397
  */
@@ -374,57 +417,6 @@ export interface HookResponse {
374
417
  success: boolean;
375
418
  message?: string;
376
419
  }
377
- export interface ApiTaskRequest {
378
- app: string;
379
- version?: string;
380
- variant?: string;
381
- infra?: Infra;
382
- workers?: string[];
383
- webhook?: string;
384
- input: any;
385
- }
386
- export interface CreateFlowRequest {
387
- name: string;
388
- }
389
- export interface CreateFlowRunRequest {
390
- flow: string;
391
- input: any;
392
- }
393
- /**
394
- * Request/Response Types
395
- */
396
- export interface EngineAPIRequest {
397
- data: {
398
- [key: string]: any;
399
- };
400
- metadata: EngineAPIRequestMetadata;
401
- }
402
- export interface WorkerAPIRequest {
403
- input: {
404
- [key: string]: any;
405
- };
406
- metadata: WorkerAPIRequestMetadata;
407
- }
408
- export interface EngineAPIRequestMetadata {
409
- worker_id: string;
410
- app_id: string;
411
- app_version_id: string;
412
- app_variant: string;
413
- gpu_ids: string[];
414
- task_id: string;
415
- }
416
- export interface WorkerAPIRequestMetadata {
417
- worker_id: string;
418
- app_id: string;
419
- app_version_id: string;
420
- app_variant: string;
421
- gpu_ids: string[];
422
- task_id: string;
423
- }
424
- export interface AppsGetResponse {
425
- apps: App[];
426
- total: number;
427
- }
428
420
  export interface PartialFile {
429
421
  uri: string;
430
422
  path?: string;
@@ -435,209 +427,26 @@ export interface PartialFile {
435
427
  export interface FileCreateRequest {
436
428
  files: PartialFile[];
437
429
  }
438
- export interface RunTaskRequest {
439
- task: TaskDTO;
440
- user_env: any;
441
- }
442
- export interface CreateChatMessageResponse {
443
- user_message?: ChatMessageDTO;
444
- assistant_message?: ChatMessageDTO;
445
- }
446
- export interface SchedulerMetrics {
447
- tasks_queued: number;
448
- tasks_processed: number;
449
- tasks_failed: number;
450
- processing_errors: number;
451
- last_error?: string;
452
- last_error_time?: string;
453
- queue_metrics?: QueueMetrics[];
454
- updated_at: string;
455
- }
456
- export interface QueueMetrics {
457
- enqueued: number;
458
- dequeued: number;
459
- expired: number;
460
- dlq: number;
461
- in_flight: number;
462
- }
463
- export interface PageCreateRequest {
464
- title: string;
465
- content: string;
466
- excerpt: string;
467
- status: PageStatus;
468
- metadata: PageMetadata;
469
- slug: string;
470
- visibility: Visibility;
471
- is_featured: boolean;
472
- }
473
- export type PageUpdateRequest = PageCreateRequest;
474
- export interface CommentCreateRequest {
475
- page_id: string;
476
- content: string;
477
- }
478
- export type CommentUpdateRequest = CommentCreateRequest;
479
- export interface MenuCreateRequest {
480
- name: string;
481
- slug: string;
482
- description: string;
483
- items: MenuItem[];
484
- }
485
- export type MenuUpdateRequest = MenuCreateRequest;
486
- export interface TransactionCreateRequest {
487
- user_id: string;
488
- team_id: string;
489
- type: TransactionType;
490
- amount: number;
491
- reference: string;
492
- notes: string;
493
- metadata: {
494
- [key: string]: any;
495
- };
496
- }
497
- export interface PublicEnginesForResourcesRequest {
498
- resources: AppResources;
499
- }
500
- export interface PublicEnginesForResourcesResponse {
501
- can_run: boolean;
502
- min_price: number;
503
- max_price: number;
504
- error?: string;
505
- }
506
- export interface EnginesForResourcesRequest {
507
- resources: AppResources;
508
- }
509
- export interface PrivateEngineResponse {
510
- workers: WorkerStateSummary[];
511
- }
512
- export interface CloudEngineResponse {
513
- can_run: boolean;
514
- min_price: number;
515
- max_price: number;
516
- }
517
- export interface EnginesForResourcesResponse {
518
- private: PrivateEngineResponse;
519
- cloud: CloudEngineResponse;
520
- error?: string;
521
- }
522
- export interface TeamCreateRequest {
523
- name: string;
524
- username: string;
525
- email: string;
526
- }
527
- export interface FeatureTaskRequest {
528
- is_featured: boolean;
529
- }
530
- export interface TeamMemberAddRequest {
531
- email: string;
532
- role: TeamRole;
533
- }
534
- export interface TeamMemberUpdateRoleRequest {
535
- role: TeamRole;
536
- }
537
- /**
538
- * HandleSlackEventRequest models the outer event envelope and its inner event ("event") as received from Slack Events API.
539
- * It is designed for maximum compatibility with the event_callback style JSON, url_verification, and app_rate_limited events.
540
- */
541
- export interface HandleSlackEventRequest {
542
- type: string;
543
- token: string;
544
- team_id?: string;
545
- api_app_id?: string;
546
- event?: any;
547
- authed_users?: string[];
548
- authed_teams?: string[];
549
- authorizations?: SlackEventAuthorization[];
550
- event_context?: string;
551
- event_id?: string;
552
- event_time?: number;
553
- challenge?: string;
554
- is_ext_shared_channel?: boolean;
555
- context_team_id?: string;
556
- context_enterprise_id?: string;
557
- /**
558
- * App Rate Limiting
559
- */
560
- minute_rate_limited?: number;
561
- }
562
- export interface SlackEventAuthorization {
563
- enterprise_id?: string;
564
- team_id: string;
565
- user_id: string;
566
- is_bot: boolean;
567
- is_enterprise_install?: boolean;
568
- }
569
- /**
570
- * Example: define inner events you want to care about and unmarshal HandleSlackEventRequest.Event as needed.
571
- * Common message event payload, not all fields are present for all types.
572
- */
573
- export interface SlackMessageEvent {
574
- type: string;
575
- subtype?: string;
576
- channel?: string;
577
- user?: string;
578
- text?: string;
579
- ts?: string;
580
- event_ts?: string;
581
- thread_ts?: string;
582
- bot_id?: string;
583
- bot_profile?: {
584
- id?: string;
585
- };
586
- }
587
- /**
588
- * SlackThreadMessage represents a message from a Slack thread (from conversations.replies)
589
- */
590
- export interface SlackThreadMessage {
591
- type: string;
592
- subtype?: string;
593
- user?: string;
594
- text?: string;
595
- ts?: string;
596
- thread_ts?: string;
597
- parent_user_id?: string;
598
- bot_id?: string;
599
- bot_profile?: {
600
- id?: string;
601
- name?: string;
602
- };
603
- }
604
- export interface ProjectCreateRequest {
605
- name: string;
606
- type: ProjectType;
607
- }
608
- export interface ProjectUpdateRequest {
430
+ export interface CreateFlowRequest {
609
431
  name: string;
610
432
  }
611
- export interface MoveAgentToProjectRequest {
612
- agent_id: string;
613
- project_id: string;
433
+ export interface CreateFlowRunRequest {
434
+ flow: string;
435
+ input: any;
614
436
  }
615
- /**
616
- * CELEvalRequest is the request for evaluating CEL expressions
617
- */
618
- export interface CELEvalRequest {
619
- pricing: AppPricing;
620
- output_meta?: OutputMeta;
621
- resource_cost: number;
622
- resource_ms: number;
437
+ export interface CheckoutCreateRequest {
438
+ amount: number;
439
+ success_url: string;
440
+ cancel_url: string;
623
441
  }
624
- /**
625
- * CELEvalResult is the result of a single expression evaluation
626
- */
627
- export interface CELEvalResult {
628
- value: number;
629
- error?: string;
442
+ export interface CheckoutCompleteRequest {
443
+ session_id: string;
630
444
  }
631
445
  /**
632
- * CELEvalResponse is the response from evaluating CEL expressions
446
+ * Legacy aliases for backward compatibility
633
447
  */
634
- export interface CELEvalResponse {
635
- inference_fee: CELEvalResult;
636
- royalty_fee: CELEvalResult;
637
- partner_fee: CELEvalResult;
638
- total: CELEvalResult;
639
- description: string;
640
- }
448
+ export type StripeCheckoutCreateRequest = CheckoutCreateRequest;
449
+ export type StripeCheckoutCompleteRequest = CheckoutCompleteRequest;
641
450
  /**
642
451
  * DeviceAuthResponse is returned when a device initiates auth
643
452
  */
@@ -687,6 +496,25 @@ export interface MeResponse {
687
496
  user?: UserDTO;
688
497
  team?: TeamDTO;
689
498
  }
499
+ export interface TeamCreateRequest {
500
+ name: string;
501
+ username: string;
502
+ email: string;
503
+ }
504
+ /**
505
+ * TeamSetupRequest is used for completing team setup (choosing username)
506
+ * This marks the team as setup_completed=true after validation
507
+ */
508
+ export interface TeamSetupRequest {
509
+ username: string;
510
+ }
511
+ export interface TeamMemberAddRequest {
512
+ email: string;
513
+ role: TeamRole;
514
+ }
515
+ export interface TeamMemberUpdateRoleRequest {
516
+ role: TeamRole;
517
+ }
690
518
  /**
691
519
  * SecretCreateRequest for creating a new secret
692
520
  */
@@ -713,6 +541,12 @@ export interface IntegrationConnectRequest {
713
541
  * For API Key type
714
542
  */
715
543
  api_key?: string;
544
+ /**
545
+ * For BYOK integrations (e.g., X.com) - contains user-provided credentials
546
+ */
547
+ metadata?: {
548
+ [key: string]: any;
549
+ };
716
550
  }
717
551
  /**
718
552
  * IntegrationCompleteOAuthRequest for completing an OAuth flow
@@ -722,6 +556,10 @@ export interface IntegrationCompleteOAuthRequest {
722
556
  type: string;
723
557
  code: string;
724
558
  state: string;
559
+ /**
560
+ * For PKCE - code_verifier to complete the exchange (required by some providers like X/Twitter)
561
+ */
562
+ code_verifier?: string;
725
563
  }
726
564
  /**
727
565
  * IntegrationConnectResponse after connecting
@@ -736,30 +574,26 @@ export interface IntegrationConnectResponse {
736
574
  * For OAuth - state to be returned with the callback (frontend stores this)
737
575
  */
738
576
  state?: string;
577
+ /**
578
+ * For PKCE - code_verifier to be stored and sent back with CompleteOAuth (required by some providers like X/Twitter)
579
+ */
580
+ code_verifier?: string;
739
581
  /**
740
582
  * For service accounts - instructions
741
583
  */
742
584
  instructions?: string;
743
585
  }
744
- export interface ApiKey {
745
- BaseModel: BaseModel;
746
- PermissionModel: PermissionModel;
586
+ export interface ProjectCreateRequest {
747
587
  name: string;
748
- key: string;
749
- last_used_at: string;
588
+ type: ProjectType;
750
589
  }
751
- export interface ApiKeyDTO extends BaseModel, PermissionModelDTO {
590
+ export interface ProjectUpdateRequest {
752
591
  name: string;
753
- key: string;
754
- last_used_at: string;
755
592
  }
756
- /**
757
- * App-related types
758
- */
759
- export type AppStatus = string;
760
- export declare const AppStatusActive: AppStatus;
761
- export declare const AppStatusInactive: AppStatus;
762
- export declare const AppStatusPending: AppStatus;
593
+ export interface MoveAgentToProjectRequest {
594
+ agent_id: string;
595
+ project_id: string;
596
+ }
763
597
  export type AppCategory = string;
764
598
  export declare const AppCategoryImage: AppCategory;
765
599
  export declare const AppCategoryVideo: AppCategory;
@@ -784,56 +618,31 @@ export interface AppImages {
784
618
  export interface App {
785
619
  BaseModel: BaseModel;
786
620
  PermissionModel: PermissionModel;
621
+ /**
622
+ * Namespace is copied from team.username at creation time and is IMMUTABLE.
623
+ * This ensures stable references like "namespace/name" even if team username changes.
624
+ * Default empty string allows GORM migration to add column, then MigrateAppNamespaces populates it.
625
+ */
626
+ namespace: string;
627
+ /**
628
+ * Name is IMMUTABLE after creation. Combined with Namespace forms unique identifier.
629
+ */
787
630
  name: string;
788
631
  description: string;
789
632
  agent_description: string;
633
+ /**
634
+ * Category is a fundamental classification of the app (image, video, audio, text, chat, 3d, other)
635
+ */
790
636
  category: AppCategory;
791
- page_id?: string;
792
- license: string;
793
- license_mandatory: boolean;
794
- needs_hf_token: boolean;
795
- hf_model_url: string;
796
- commercial: boolean;
797
- status: AppStatus;
798
- is_featured: boolean;
799
- is_verified: boolean;
800
- rank: number;
801
- images: AppImages;
802
- version_id: string;
803
- version?: AppVersion;
804
- allows_private_workers: boolean;
805
- allows_cloud_workers: boolean;
806
- fees: AppFees;
807
- }
808
- /**
809
- * AppPricing configures all pricing using CEL expressions
810
- * CEL context includes: inputs, outputs, prices, resource_cost
811
- * Empty expressions are skipped (evaluate to 0)
812
- */
813
- export interface AppPricing {
814
- prices: {
815
- [key: string]: number;
816
- };
817
637
  /**
818
- * CEL expressions for each fee type (result in microcents)
819
- * Available variables: inputs, outputs, prices, resource_cost
638
+ * Developer's images
820
639
  */
821
- inference_expression: string;
822
- royalty_expression: string;
823
- partner_expression: string;
640
+ images: AppImages;
824
641
  /**
825
- * Total expression combines all fees (can apply weights/discounts)
826
- * Available variables: inputs, outputs, prices, resource_cost, inference_fee, royalty_fee, partner_fee
827
- * If empty, defaults to: resource_cost + inference_fee + royalty_fee + partner_fee
642
+ * Current version (developer's latest)
828
643
  */
829
- total_expression: string;
830
- description: string;
831
- }
832
- /**
833
- * AppFees contains pricing configuration for an app
834
- */
835
- export interface AppFees {
836
- app_pricing: AppPricing;
644
+ version_id: string;
645
+ version?: AppVersion;
837
646
  }
838
647
  export interface AppGPUResource {
839
648
  count: number;
@@ -855,102 +664,69 @@ export interface AppVariant {
855
664
  }
856
665
  export interface AppVersion {
857
666
  BaseModel: BaseModel;
667
+ /**
668
+ * ShortID is a human-friendly version identifier (e.g., "abc123")
669
+ * Unique within the app, used in references like "namespace/app@abc123"
670
+ */
671
+ short_id: string;
858
672
  app_id: string;
859
- variants: {
860
- [key: string]: AppVariant;
673
+ metadata: {
674
+ [key: string]: any;
861
675
  };
862
676
  repository: string;
863
677
  flow_id?: string;
864
678
  flow?: Flow;
679
+ setup_schema: any;
865
680
  input_schema: any;
866
681
  output_schema: any;
867
- metadata: {
868
- [key: string]: any;
869
- };
870
- /**
871
- * App requirements - secrets and integrations needed to run this app
872
- */
873
- required_secrets?: SecretRequirement[];
874
- required_integrations?: IntegrationRequirement[];
875
- }
876
- export interface AppConfig {
877
- name: string;
878
- description: string;
879
- category: AppCategory;
880
- status: AppStatus;
881
- images: AppImages;
882
- input_schema: any;
883
- output_schema: any;
884
- metadata: {
885
- [key: string]: any;
886
- };
887
682
  variants: {
888
683
  [key: string]: AppVariant;
889
684
  };
685
+ env: {
686
+ [key: string]: string;
687
+ };
688
+ kernel: string;
890
689
  /**
891
- * App requirements - parsed from YAML
690
+ * App requirements - secrets and integrations needed to run this app
892
691
  */
893
692
  required_secrets?: SecretRequirement[];
894
693
  required_integrations?: IntegrationRequirement[];
895
- }
896
- export interface LicenseRecord {
897
- id: string;
898
- created_at: string;
899
- updated_at: string;
900
- deleted_at?: string;
901
- user_id: string;
902
- app_id: string;
903
- license: string;
694
+ resources: AppResources;
904
695
  }
905
696
  export interface AppDTO extends BaseModel, PermissionModelDTO {
697
+ namespace: string;
906
698
  name: string;
907
699
  description: string;
908
700
  agent_description: string;
909
701
  category: AppCategory;
910
- page_id?: string;
911
- license: string;
912
- license_mandatory: boolean;
913
- needs_hf_token: boolean;
914
- hf_model_url: string;
915
- commercial: boolean;
916
- status: AppStatus;
917
- is_featured: boolean;
918
- is_verified: boolean;
919
- rank: number;
920
702
  images: AppImages;
921
703
  version_id: string;
922
704
  version?: AppVersionDTO;
923
- variants: {
924
- [key: string]: AppVariant;
925
- };
926
- fees: AppFees;
927
- allows_private_workers: boolean;
928
- allows_cloud_workers: boolean;
929
705
  }
930
706
  export interface AppVersionDTO extends BaseModel {
931
- variants: {
932
- [key: string]: AppVariant;
707
+ short_id: string;
708
+ metadata: {
709
+ [key: string]: any;
933
710
  };
934
711
  repository: string;
935
712
  flow?: FlowDTO;
713
+ setup_schema: any;
936
714
  input_schema: any;
937
715
  output_schema: any;
938
- metadata: {
939
- [key: string]: any;
716
+ variants: {
717
+ [key: string]: AppVariant;
718
+ };
719
+ env: {
720
+ [key: string]: string;
940
721
  };
722
+ kernel: string;
941
723
  /**
942
724
  * App requirements
943
725
  */
944
726
  required_secrets?: SecretRequirement[];
945
727
  required_integrations?: IntegrationRequirement[];
728
+ resources: AppResources;
946
729
  }
947
- export interface ChatModelCapabilities {
948
- Image: boolean;
949
- Images: boolean;
950
- Files: boolean;
951
- Reasoning: boolean;
952
- }
953
- export type Model = any;
954
730
  export interface BaseModel {
955
731
  id: string;
956
732
  created_at: string;
@@ -964,7 +740,6 @@ export type Visibility = string;
964
740
  export declare const VisibilityPrivate: Visibility;
965
741
  export declare const VisibilityPublic: Visibility;
966
742
  export declare const VisibilityUnlisted: Visibility;
967
- export type Permissioned = any;
968
743
  export interface PermissionModel {
969
744
  user_id: string;
970
745
  user?: User;
@@ -979,278 +754,55 @@ export interface PermissionModelDTO {
979
754
  team?: TeamRelationDTO;
980
755
  visibility: Visibility;
981
756
  }
982
- export declare const PermRead = "read";
983
- export declare const PermWrite = "write";
984
- export interface AuthContext {
985
- Role: Role;
986
- UserID: string;
987
- TeamID: string;
988
- }
989
- /**
990
- * Versioned interface for optimistic locking
991
- */
992
- export type Versioned = any;
993
- /**
994
- * VersionedStruct provides optimistic locking functionality
995
- */
996
- export interface VersionedStruct {
997
- document_version: number;
998
- }
999
- export type Encrypted = any;
1000
- export interface EncryptedModel {
1001
- user_public_key: string;
1002
- /**
1003
- * PRE key is extremely sensitive, it must be deleted as soon as the task is delivered to the engine
1004
- */
1005
- user_pre_key: string;
1006
- engine_public_key: string;
1007
- }
1008
- /**
1009
- * StripePaymentMetadata holds Stripe-specific payment method details
1010
- */
1011
- export interface StripePaymentMetadata {
1012
- payment_method_id?: string;
1013
- last4?: string;
1014
- brand?: string;
1015
- exp_month?: number;
1016
- exp_year?: number;
1017
- }
1018
- /**
1019
- * PaymentProvider represents the payment provider being used
1020
- */
1021
- export type PaymentProvider = string;
1022
- export declare const PaymentProviderNone: PaymentProvider;
1023
- export declare const PaymentProviderStripe: PaymentProvider;
1024
- export type BillingStatus = string;
1025
- export declare const BillingStatusActive: BillingStatus;
1026
- export declare const BillingStatusSpendLocked: BillingStatus;
1027
- export declare const BillingStatusManualHold: BillingStatus;
1028
- export declare const BillingStatusSuspended: BillingStatus;
757
+ export type ChatStatus = string;
758
+ export declare const ChatStatusBusy: ChatStatus;
759
+ export declare const ChatStatusIdle: ChatStatus;
1029
760
  /**
1030
- * Billing holds billing information that can be owned by a user or team
1031
- * OwnerID is the user ID if no group, or the team/group ID if a group exists
761
+ * ChatStatusWaitingInput ChatStatus = "waiting_input"
1032
762
  */
1033
- export interface Billing {
1034
- BaseModel: BaseModel;
1035
- PermissionModel: PermissionModel;
1036
- status: BillingStatus;
1037
- /**
1038
- * Balance in micro-cents (1 cent = 1,000,000)
1039
- */
1040
- balance: number;
1041
- /**
1042
- * Currency code (e.g., "USD")
1043
- */
1044
- currency: string;
763
+ export declare const ChatStatusCompleted: ChatStatus;
764
+ export interface IntegrationContext {
765
+ integration_type?: IntegrationType;
766
+ integration_metadata?: any;
1045
767
  }
1046
768
  /**
1047
- * BillingDTO is the data transfer object for Billing
769
+ * ChatData contains agent-specific data for a chat session
1048
770
  */
1049
- export interface BillingDTO extends BaseModel, PermissionModelDTO {
1050
- balance: number;
1051
- currency: string;
1052
- status: BillingStatus;
771
+ export interface ChatData {
772
+ plan_steps: PlanStep[];
773
+ memory: StringEncodedMap;
1053
774
  }
1054
775
  /**
1055
- * BillingStatusUpdateRequest is the request to update billing status (admin only)
776
+ * PlanStep represents a step in an agent's execution plan
1056
777
  */
1057
- export interface BillingStatusUpdateRequest {
1058
- status: BillingStatus;
778
+ export interface PlanStep {
779
+ index: number;
780
+ title: string;
781
+ description: string;
782
+ notes?: string;
783
+ status: PlanStepStatus;
1059
784
  }
1060
785
  /**
1061
- * Address represents a structured postal address for billing/invoicing
1062
- * Fields align with Stripe's address format for easy integration
786
+ * PlanStepStatus represents the status of a plan step
1063
787
  */
1064
- export interface Address {
1065
- line1: string;
1066
- line2: string;
1067
- city: string;
1068
- state: string;
1069
- postal_code: string;
1070
- country: string;
1071
- }
788
+ export type PlanStepStatus = string;
789
+ export declare const PlanStepStatusPending: PlanStepStatus;
790
+ export declare const PlanStepStatusInProgress: PlanStepStatus;
791
+ export declare const PlanStepStatusCompleted: PlanStepStatus;
792
+ export declare const PlanStepStatusCancelled: PlanStepStatus;
793
+ export type ChatMessageRole = string;
794
+ export declare const ChatMessageRoleSystem: ChatMessageRole;
795
+ export declare const ChatMessageRoleUser: ChatMessageRole;
796
+ export declare const ChatMessageRoleAssistant: ChatMessageRole;
797
+ export declare const ChatMessageRoleTool: ChatMessageRole;
1072
798
  /**
1073
- * BillingSettings holds user-editable billing preferences and configuration
1074
- * Linked to a Billing account via BillingID
799
+ * ChatMessageStatus represents the lifecycle status of a chat message
1075
800
  */
1076
- export interface BillingSettings {
1077
- BaseModel: BaseModel;
1078
- PermissionModel: PermissionModel;
1079
- /**
1080
- * Spending Controls
1081
- * SpendingLimit is the maximum amount allowed to spend per billing period (in micro-cents, 0 = unlimited)
1082
- */
1083
- spending_limit: number;
1084
- /**
1085
- * LowBalanceThreshold triggers alerts when balance drops below this amount (in micro-cents) default to 1 USD
1086
- */
1087
- low_balance_threshold: number;
1088
- /**
1089
- * Auto-Recharge Settings
1090
- */
1091
- auto_recharge_enabled: boolean;
1092
- auto_recharge_amount: number;
1093
- auto_recharge_threshold: number;
1094
- /**
1095
- * Notification Settings
1096
- */
1097
- billing_email: string;
1098
- low_balance_alerts: boolean;
1099
- usage_summary_enabled: boolean;
1100
- usage_summary_interval: string;
1101
- /**
1102
- * Business Information (for invoicing)
1103
- */
1104
- company_name: string;
1105
- tax_id: string;
1106
- /**
1107
- * Payment Integration (provider-agnostic)
1108
- */
1109
- payment_provider: PaymentProvider;
1110
- provider_customer_id: string;
1111
- payment_method_id?: string;
1112
- payment_method_label?: string;
1113
- provider_metadata: {
1114
- [key: string]: any;
1115
- };
1116
- }
1117
- /**
1118
- * BillingSettingsDTO is the data transfer object for BillingSettings
1119
- */
1120
- export interface BillingSettingsDTO extends BaseModel, PermissionModelDTO {
1121
- /**
1122
- * Spending Controls
1123
- */
1124
- spending_limit: number;
1125
- low_balance_threshold: number;
1126
- /**
1127
- * Auto-Recharge Settings
1128
- */
1129
- auto_recharge_enabled: boolean;
1130
- auto_recharge_amount: number;
1131
- auto_recharge_threshold: number;
1132
- /**
1133
- * Notification Settings
1134
- */
1135
- billing_email: string;
1136
- low_balance_alerts: boolean;
1137
- usage_summary_enabled: boolean;
1138
- usage_summary_interval: string;
1139
- /**
1140
- * Business Information
1141
- */
1142
- company_name: string;
1143
- tax_id: string;
1144
- address: Address;
1145
- /**
1146
- * Payment Integration (read-only for user, provider-agnostic)
1147
- */
1148
- payment_provider: PaymentProvider;
1149
- has_payment_method: boolean;
1150
- payment_method_label?: string;
1151
- }
1152
- /**
1153
- * BillingSettingsUpdateRequest represents the fields a user can update
1154
- */
1155
- export interface BillingSettingsUpdateRequest {
1156
- /**
1157
- * Spending Controls
1158
- */
1159
- spending_limit?: number;
1160
- low_balance_threshold?: number;
1161
- /**
1162
- * Auto-Recharge Settings
1163
- */
1164
- auto_recharge_enabled?: boolean;
1165
- auto_recharge_amount?: number;
1166
- auto_recharge_threshold?: number;
1167
- /**
1168
- * Notification Settings
1169
- */
1170
- billing_email?: string;
1171
- low_balance_alerts?: boolean;
1172
- usage_summary_enabled?: boolean;
1173
- usage_summary_interval?: string;
1174
- /**
1175
- * Business Information
1176
- */
1177
- company_name?: string;
1178
- tax_id?: string;
1179
- address?: Address;
1180
- }
1181
- /**
1182
- * SetupCheckoutRequest is the request to create a Stripe Checkout session for saving payment methods
1183
- */
1184
- export interface SetupCheckoutRequest {
1185
- success_url: string;
1186
- cancel_url: string;
1187
- }
1188
- /**
1189
- * SetupCheckoutResponse is returned when creating a Stripe Checkout session for setup
1190
- */
1191
- export interface SetupCheckoutResponse {
1192
- session_id: string;
1193
- session_url: string;
1194
- }
1195
- /**
1196
- * SetupCheckoutCompleteRequest is the request to complete the setup after returning from Stripe
1197
- */
1198
- export interface SetupCheckoutCompleteRequest {
1199
- session_id: string;
1200
- }
1201
- /**
1202
- * PaymentMethodResponse is the response after successfully saving a payment method
1203
- */
1204
- export interface PaymentMethodResponse {
1205
- last4: string;
1206
- brand: string;
1207
- }
1208
- export type ChatType = string;
1209
- export type ChatStatus = string;
1210
- export declare const ChatStatusBusy: ChatStatus;
1211
- export declare const ChatStatusIdle: ChatStatus;
1212
- export interface Chat {
1213
- BaseModel: BaseModel;
1214
- PermissionModel: PermissionModel;
1215
- agent_id?: string;
1216
- agent_version_id?: string;
1217
- agent?: Agent;
1218
- tool_call_id?: string;
1219
- parent_id?: string;
1220
- parent?: Chat;
1221
- children: (Chat | undefined)[];
1222
- name: string;
1223
- description: string;
1224
- chat_messages: ChatMessage[];
1225
- agent_data: AgentData;
1226
- status: ChatStatus;
1227
- integration_context?: IntegrationContext;
1228
- }
1229
- export interface IntegrationContext {
1230
- integration_type?: IntegrationType;
1231
- integration_metadata?: any;
1232
- }
1233
- export interface AgentData {
1234
- plan_steps: AgentPlanStep[];
1235
- memory: StringEncodedMap;
1236
- }
1237
- export interface AgentPlanStep {
1238
- index: number;
1239
- title: string;
1240
- description: string;
1241
- notes?: string;
1242
- status: AgentPlanStepStatus;
1243
- }
1244
- export type AgentPlanStepStatus = string;
1245
- export declare const AgentPlanStepStatusPending: AgentPlanStepStatus;
1246
- export declare const AgentPlanStepStatusInProgress: AgentPlanStepStatus;
1247
- export declare const AgentPlanStepStatusCompleted: AgentPlanStepStatus;
1248
- export declare const AgentPlanStepStatusCancelled: AgentPlanStepStatus;
1249
- export type ChatMessageRole = string;
1250
- export declare const ChatMessageRoleSystem: ChatMessageRole;
1251
- export declare const ChatMessageRoleUser: ChatMessageRole;
1252
- export declare const ChatMessageRoleAssistant: ChatMessageRole;
1253
- export declare const ChatMessageRoleTool: ChatMessageRole;
801
+ export type ChatMessageStatus = string;
802
+ export declare const ChatMessageStatusPending: ChatMessageStatus;
803
+ export declare const ChatMessageStatusReady: ChatMessageStatus;
804
+ export declare const ChatMessageStatusFailed: ChatMessageStatus;
805
+ export declare const ChatMessageStatusCancelled: ChatMessageStatus;
1254
806
  export type ChatMessageContentType = string;
1255
807
  export declare const ChatMessageContentTypeText: ChatMessageContentType;
1256
808
  export declare const ChatMessageContentTypeReasoning: ChatMessageContentType;
@@ -1268,96 +820,23 @@ export interface ChatMessageContent {
1268
820
  text?: string;
1269
821
  image?: string;
1270
822
  file?: string;
1271
- tool_calls?: ToolInvocation[];
1272
- }
1273
- export interface ToolInvocationFunction {
1274
- name: string;
1275
- arguments: StringEncodedMap;
1276
- }
1277
- /**
1278
- * Define an auxiliary struct to avoid recursive UnmarshalJSON calls
1279
- */
1280
- export interface Aux {
1281
- name: string;
1282
- arguments: any;
1283
- }
1284
- export type ToolInvocationType = string;
1285
- export declare const ToolInvocationTypeInternal: ToolInvocationType;
1286
- export declare const ToolInvocationTypeApp: ToolInvocationType;
1287
- export declare const ToolInvocationTypeAgent: ToolInvocationType;
1288
- export declare const ToolInvocationTypeWidget: ToolInvocationType;
1289
- export declare const ToolInvocationTypePlan: ToolInvocationType;
1290
- export declare const ToolInvocationTypeHook: ToolInvocationType;
1291
- export declare const ToolInvocationTypeUnknown: ToolInvocationType;
1292
- export type ToolInvocationStatus = string;
1293
- export declare const ToolInvocationStatusPending: ToolInvocationStatus;
1294
- export declare const ToolInvocationStatusInProgress: ToolInvocationStatus;
1295
- export declare const ToolInvocationStatusAwaitingInput: ToolInvocationStatus;
1296
- export declare const ToolInvocationStatusCompleted: ToolInvocationStatus;
1297
- export declare const ToolInvocationStatusFailed: ToolInvocationStatus;
1298
- export declare const ToolInvocationStatusCancelled: ToolInvocationStatus;
1299
- export interface AgentToolInvocation {
1300
- BaseModel: BaseModel;
1301
- PermissionModel: PermissionModel;
1302
- chat_message_id: string;
1303
- tool_invocation_id: string;
1304
- type: ToolInvocationType;
1305
- execution_id?: string;
1306
- function: ToolInvocationFunction;
1307
- status: ToolInvocationStatus;
1308
- result?: string;
1309
- widget?: Widget;
1310
- plan_steps?: AgentPlanStep[];
1311
- }
1312
- export interface AgentToolInvocationDTO extends BaseModel, PermissionModelDTO {
1313
- chat_message_id: string;
1314
- tool_invocation_id: string;
1315
- type: ToolInvocationType;
1316
- execution_id?: string;
1317
- function: ToolInvocationFunction;
1318
- status: ToolInvocationStatus;
1319
- result?: string;
1320
- widget?: Widget;
1321
- plan_steps?: AgentPlanStep[];
823
+ tool_calls?: ToolCall[];
1322
824
  }
1323
825
  /**
1324
- * This is a transport object, not a database model
826
+ * ToolCall represents a tool call from an LLM response (wire format)
827
+ * This is a transport object for parsing LLM responses, not a database model
1325
828
  */
1326
- export interface ToolInvocation {
829
+ export interface ToolCall {
1327
830
  id: string;
1328
831
  type: string;
1329
- function: ToolInvocationFunction;
1330
- }
1331
- export interface ChatMessage {
1332
- BaseModel: BaseModel;
1333
- PermissionModel: PermissionModel;
1334
- chat_id: string;
1335
- chat?: Chat;
1336
- order: number;
1337
- task_id?: string;
1338
- task_status?: TaskStatus;
1339
- role: ChatMessageRole;
1340
- content: ChatMessageContent[];
1341
- tools?: Tool[];
1342
- tool_call_id?: string;
1343
- tool_invocations?: AgentToolInvocation[];
1344
- integration_context?: IntegrationContext;
832
+ function: ToolCallFunction;
1345
833
  }
1346
- export interface LLMUsage {
1347
- stop_reason: string;
1348
- time_to_first_token: number;
1349
- tokens_per_second: number;
1350
- prompt_tokens: number;
1351
- completion_tokens: number;
1352
- total_tokens: number;
1353
- reasoning_tokens: number;
1354
- reasoning_time: number;
1355
- }
1356
- export interface ChatTaskOutput {
1357
- response: string;
1358
- reasoning?: string;
1359
- tool_calls?: ToolInvocation[];
1360
- usage?: LLMUsage;
834
+ /**
835
+ * ToolCallFunction contains the function name and arguments from an LLM tool call
836
+ */
837
+ export interface ToolCallFunction {
838
+ name: string;
839
+ arguments: StringEncodedMap;
1361
840
  }
1362
841
  export interface ChatTaskInput {
1363
842
  model?: string;
@@ -1377,19 +856,6 @@ export interface ChatTaskInput {
1377
856
  tools?: Tool[];
1378
857
  tool_call_id?: string;
1379
858
  }
1380
- export interface BaseLLMInput {
1381
- app_id: string;
1382
- app_version_id?: string;
1383
- app_variant?: string;
1384
- model?: string;
1385
- system_prompt: string;
1386
- tools?: Tool[];
1387
- context_size: number;
1388
- temperature?: number;
1389
- top_p?: number;
1390
- reasoning_effort?: string;
1391
- reasoning_max_tokens?: number;
1392
- }
1393
859
  export interface ChatTaskContextMessage {
1394
860
  role: ChatMessageRole;
1395
861
  text?: string;
@@ -1399,7 +865,7 @@ export interface ChatTaskContextMessage {
1399
865
  file?: string;
1400
866
  files?: string[];
1401
867
  tools?: Tool[];
1402
- tool_calls?: ToolInvocation[];
868
+ tool_calls?: ToolCall[];
1403
869
  tool_call_id?: string;
1404
870
  }
1405
871
  export interface ChatDTO extends BaseModel, PermissionModelDTO {
@@ -1407,142 +873,27 @@ export interface ChatDTO extends BaseModel, PermissionModelDTO {
1407
873
  parent?: ChatDTO;
1408
874
  children: (ChatDTO | undefined)[];
1409
875
  status: ChatStatus;
1410
- agent_id?: string;
1411
- agent_version_id?: string;
1412
- agent?: AgentDTO;
876
+ agent_config?: AgentRuntimeConfigDTO;
1413
877
  name: string;
1414
878
  description: string;
1415
879
  chat_messages: ChatMessageDTO[];
1416
- agent_data: AgentData;
880
+ agent_data: ChatData;
1417
881
  }
1418
882
  export interface ChatMessageDTO extends BaseModel, PermissionModelDTO {
1419
883
  chat_id: string;
1420
884
  chat?: ChatDTO;
1421
885
  order: number;
886
+ status: ChatMessageStatus;
1422
887
  task_id?: string;
1423
- task_status?: TaskStatus;
1424
888
  role: ChatMessageRole;
1425
889
  content: ChatMessageContent[];
1426
890
  tools?: Tool[];
1427
891
  tool_call_id?: string;
1428
- tool_invocations?: AgentToolInvocationDTO[];
892
+ tool_invocations?: ToolInvocationDTO[];
1429
893
  }
1430
894
  export type StringEncodedMap = {
1431
895
  [key: string]: any;
1432
896
  };
1433
- /**
1434
- * SearchRequest represents a search request
1435
- */
1436
- export interface SearchRequest {
1437
- fields: string[];
1438
- term: string;
1439
- exact: boolean;
1440
- }
1441
- /**
1442
- * FilterRequest represents a filter request
1443
- */
1444
- export interface FilterRequest {
1445
- field: string;
1446
- operator: string;
1447
- value: any;
1448
- }
1449
- /**
1450
- * ListRequest represents a list request with all options
1451
- */
1452
- export interface ListRequest {
1453
- page: number;
1454
- page_size: number;
1455
- search?: SearchRequest;
1456
- filters: Filter[];
1457
- sort: SortOrder[];
1458
- preloads: string[];
1459
- fields: string[];
1460
- permissions: string[];
1461
- include_others: boolean;
1462
- }
1463
- export interface ListResponse<T extends any> {
1464
- items: T[];
1465
- total: number;
1466
- page: number;
1467
- page_size: number;
1468
- total_pages: number;
1469
- }
1470
- /**
1471
- * Filter represents a single filter condition
1472
- */
1473
- export interface Filter {
1474
- field: string;
1475
- operator: FilterOperator;
1476
- value: any;
1477
- }
1478
- /**
1479
- * FilterOperator represents the type of filter operation
1480
- */
1481
- export type FilterOperator = string;
1482
- export declare const OpEqual: FilterOperator;
1483
- export declare const OpNotEqual: FilterOperator;
1484
- export declare const OpIn: FilterOperator;
1485
- export declare const OpNotIn: FilterOperator;
1486
- export declare const OpGreater: FilterOperator;
1487
- export declare const OpGreaterEqual: FilterOperator;
1488
- export declare const OpLess: FilterOperator;
1489
- export declare const OpLessEqual: FilterOperator;
1490
- export declare const OpLike: FilterOperator;
1491
- export declare const OpILike: FilterOperator;
1492
- export declare const OpContains: FilterOperator;
1493
- export declare const OpNotContains: FilterOperator;
1494
- /**
1495
- * Null checks
1496
- */
1497
- export declare const OpIsNull: FilterOperator;
1498
- export declare const OpIsNotNull: FilterOperator;
1499
- /**
1500
- * Empty checks (for strings)
1501
- */
1502
- export declare const OpIsEmpty: FilterOperator;
1503
- export declare const OpIsNotEmpty: FilterOperator;
1504
- /**
1505
- * SortOrder represents sorting configuration
1506
- */
1507
- export interface SortOrder {
1508
- field: string;
1509
- dir: string;
1510
- }
1511
- /**
1512
- * CursorListRequest represents a cursor-based list request with all options
1513
- */
1514
- export interface CursorListRequest {
1515
- cursor: string;
1516
- limit: number;
1517
- direction: string;
1518
- search?: SearchRequest;
1519
- filters: Filter[];
1520
- preloads: string[];
1521
- sort: SortOrder[];
1522
- fields: string[];
1523
- permissions: string[];
1524
- include_others: boolean;
1525
- }
1526
- /**
1527
- * CursorListResponse represents a cursor-based paginated response
1528
- */
1529
- export interface CursorListResponse<T extends any> {
1530
- items: T[];
1531
- next_cursor: string;
1532
- prev_cursor: string;
1533
- has_next: boolean;
1534
- has_previous: boolean;
1535
- items_per_page: number;
1536
- total_items: number;
1537
- }
1538
- /**
1539
- * CursorConfig represents the configuration for cursor-based pagination
1540
- */
1541
- export interface CursorConfig {
1542
- field: string;
1543
- direction: string;
1544
- value: any;
1545
- }
1546
897
  export type DeviceAuthStatus = string;
1547
898
  export declare const DeviceAuthStatusPending: DeviceAuthStatus;
1548
899
  export declare const DeviceAuthStatusApproved: DeviceAuthStatus;
@@ -1551,21 +902,6 @@ export declare const DeviceAuthStatusDenied: DeviceAuthStatus;
1551
902
  export declare const DeviceAuthStatusValid: DeviceAuthStatus;
1552
903
  export declare const DeviceAuthStatusInvalid: DeviceAuthStatus;
1553
904
  export declare const DeviceAuthStatusLoading: DeviceAuthStatus;
1554
- /**
1555
- * DeviceAuthCode represents a device authorization code for device/CLI authentication
1556
- */
1557
- export interface DeviceAuthCode {
1558
- id: string;
1559
- user_code: string;
1560
- device_code: string;
1561
- status: DeviceAuthStatus;
1562
- user_id: string;
1563
- team_id: string;
1564
- api_key: string;
1565
- expires_at: string;
1566
- created_at: string;
1567
- updated_at: string;
1568
- }
1569
905
  /**
1570
906
  * Engine-related types
1571
907
  */
@@ -1574,34 +910,6 @@ export declare const EngineStatusRunning: EngineStatus;
1574
910
  export declare const EngineStatusPending: EngineStatus;
1575
911
  export declare const EngineStatusStopping: EngineStatus;
1576
912
  export declare const EngineStatusStopped: EngineStatus;
1577
- export interface EngineState {
1578
- BaseModel: BaseModel;
1579
- PermissionModel: PermissionModel;
1580
- instance?: Instance;
1581
- transaction_id: string;
1582
- config: EngineConfig;
1583
- public_key: string;
1584
- name: string;
1585
- api_url: string;
1586
- status: EngineStatus;
1587
- system_info?: SystemInfo;
1588
- workers: (WorkerState | undefined)[];
1589
- }
1590
- export interface LocalEngineState {
1591
- id: string;
1592
- name: string;
1593
- config: EngineConfig;
1594
- public_key: string;
1595
- }
1596
- export interface EngineStateDTO extends BaseModel, PermissionModelDTO {
1597
- instance?: Instance;
1598
- config: EngineConfig;
1599
- name: string;
1600
- api_url: string;
1601
- status: EngineStatus;
1602
- system_info?: SystemInfo;
1603
- workers: (WorkerStateDTO | undefined)[];
1604
- }
1605
913
  export interface EngineStateSummary extends BaseModel, PermissionModelDTO {
1606
914
  instance?: Instance;
1607
915
  name: string;
@@ -1612,22 +920,6 @@ export interface EngineStateSummary extends BaseModel, PermissionModelDTO {
1612
920
  * Worker-related types
1613
921
  */
1614
922
  export type WorkerStatus = string;
1615
- export interface WorkerState {
1616
- BaseModel: BaseModel;
1617
- PermissionModel: PermissionModel;
1618
- index: number;
1619
- status: WorkerStatus;
1620
- status_updated_at?: string;
1621
- engine_id: string;
1622
- engine?: EngineState;
1623
- task_id?: string;
1624
- app_id: string;
1625
- app_version_id: string;
1626
- variant: string;
1627
- gpus: WorkerGPU[];
1628
- cpus: WorkerCPU[];
1629
- rams: WorkerRAM[];
1630
- }
1631
923
  export interface WorkerGPU {
1632
924
  id: string;
1633
925
  worker_id: string;
@@ -1651,21 +943,6 @@ export interface WorkerRAM {
1651
943
  worker_id: string;
1652
944
  total: number;
1653
945
  }
1654
- export interface WorkerStateDTO extends BaseModel {
1655
- user_id: string;
1656
- team_id: string;
1657
- index: number;
1658
- status: WorkerStatus;
1659
- engine_id: string;
1660
- task_id?: string;
1661
- app_id: string;
1662
- app_version_id: string;
1663
- app_variant: string;
1664
- gpus: WorkerGPU[];
1665
- cpus: WorkerCPU[];
1666
- rams: WorkerRAM[];
1667
- system_info: SystemInfo;
1668
- }
1669
946
  export interface WorkerStateSummary {
1670
947
  id: string;
1671
948
  user_id: string;
@@ -1676,7 +953,6 @@ export interface WorkerStateSummary {
1676
953
  task_id?: string;
1677
954
  app_id: string;
1678
955
  app_version_id: string;
1679
- app_variant: string;
1680
956
  gpus: WorkerGPU[];
1681
957
  cpus: WorkerCPU[];
1682
958
  rams: WorkerRAM[];
@@ -1691,6 +967,7 @@ export interface File {
1691
967
  content_type: string;
1692
968
  size: number;
1693
969
  filename: string;
970
+ rating: ContentRating;
1694
971
  }
1695
972
  export interface FileDTO extends BaseModel, PermissionModelDTO {
1696
973
  path: string;
@@ -1700,6 +977,7 @@ export interface FileDTO extends BaseModel, PermissionModelDTO {
1700
977
  content_type: string;
1701
978
  size: number;
1702
979
  filename: string;
980
+ rating: ContentRating;
1703
981
  }
1704
982
  export interface Flow {
1705
983
  BaseModel: BaseModel;
@@ -1736,9 +1014,9 @@ export interface FlowNodeData {
1736
1014
  app?: AppDTO;
1737
1015
  app_id: string;
1738
1016
  app_version_id: string;
1739
- app_variant: string;
1740
1017
  infra: Infra;
1741
1018
  workers: string[];
1019
+ setup?: any;
1742
1020
  additional?: any;
1743
1021
  task?: TaskDTO;
1744
1022
  task_id?: string;
@@ -1785,56 +1063,6 @@ export interface FlowDTO extends BaseModel, PermissionModelDTO {
1785
1063
  edges: FlowEdge[];
1786
1064
  viewport?: FlowViewport;
1787
1065
  }
1788
- export interface NodeTaskDTO {
1789
- task_id: string;
1790
- task?: TaskDTO;
1791
- }
1792
- export type FlowRunStatus = number;
1793
- export declare const FlowRunStatusUnknown: FlowRunStatus;
1794
- export declare const FlowRunStatusPending: FlowRunStatus;
1795
- export declare const FlowRunStatusRunning: FlowRunStatus;
1796
- export declare const FlowRunStatusCompleted: FlowRunStatus;
1797
- export declare const FlowRunStatusFailed: FlowRunStatus;
1798
- export declare const FlowRunStatusCancelled: FlowRunStatus;
1799
- export interface FlowRun {
1800
- BaseModel: BaseModel;
1801
- PermissionModel: PermissionModel;
1802
- task_id?: string;
1803
- flow_id: string;
1804
- flow: Flow;
1805
- status: FlowRunStatus;
1806
- error?: string;
1807
- flow_run_started?: string;
1808
- flow_run_finished?: string;
1809
- flow_run_cancelled?: string;
1810
- input: FlowRunInputs;
1811
- fail_on_error: boolean;
1812
- output: any;
1813
- infra?: Infra;
1814
- workers?: string[];
1815
- node_task_map: {
1816
- [key: string]: string;
1817
- };
1818
- node_tasks: {
1819
- [key: string]: NodeTask;
1820
- };
1821
- }
1822
- export interface FlowRunDTO extends BaseModel, PermissionModelDTO {
1823
- flow_id: string;
1824
- flow?: FlowDTO;
1825
- task_id?: string;
1826
- status: FlowRunStatus;
1827
- error?: string;
1828
- flow_run_started?: string;
1829
- flow_run_finished?: string;
1830
- flow_run_cancelled?: string;
1831
- input: FlowRunInputs;
1832
- fail_on_error: boolean;
1833
- output: any;
1834
- node_tasks: {
1835
- [key: string]: NodeTaskDTO | undefined;
1836
- };
1837
- }
1838
1066
  /**
1839
1067
  * Connection represents a connection between nodes in a flow
1840
1068
  */
@@ -1853,805 +1081,28 @@ export interface FlowRunInput {
1853
1081
  Connection?: FlowNodeConnection;
1854
1082
  Value: any;
1855
1083
  }
1856
- export interface NodeTask {
1857
- task_id: string;
1858
- task?: Task;
1859
- }
1860
1084
  /**
1861
- * NodePosition represents x,y coordinates
1085
+ * StringSlice is a custom type for storing string slices in the database
1862
1086
  */
1863
- export interface NodePosition {
1864
- x: number;
1865
- y: number;
1866
- }
1867
- /**
1868
- * CoordinateExtent represents a bounding box with [x1, y1, x2, y2]
1869
- */
1870
- export type CoordinateExtent = number[];
1871
- export interface NodeHandle {
1872
- x: number;
1873
- y: number;
1874
- position: string;
1875
- id: string;
1876
- width: number;
1877
- height: number;
1878
- type: string;
1879
- name: string;
1880
- }
1881
- export type GraphNodeType = string;
1882
- export declare const GraphNodeTypeUnknown: GraphNodeType;
1883
- export declare const GraphNodeTypeJoin: GraphNodeType;
1884
- export declare const GraphNodeTypeSplit: GraphNodeType;
1885
- export declare const GraphNodeTypeTask: GraphNodeType;
1886
- export declare const GraphNodeTypeResource: GraphNodeType;
1887
- export declare const GraphNodeTypeConditional: GraphNodeType;
1888
- /**
1889
- * GraphNode represents a node in the execution graph
1890
- */
1891
- export interface GraphNode {
1892
- BaseModel: BaseModel;
1893
- graph_id: string;
1894
- type: GraphNodeType;
1895
- resource_id: string;
1896
- resource_type: string;
1897
- status: GraphNodeStatus;
1898
- /**
1899
- * Dependency barrier counters
1900
- */
1901
- required_deps: number;
1902
- completed_deps: number;
1903
- metadata: StringEncodedMap;
1904
- /**
1905
- * Timing
1906
- */
1907
- ready_at?: string;
1908
- started_at?: string;
1909
- completed_at?: string;
1910
- retry_count?: number;
1911
- }
1912
- /**
1913
- * GraphEdge represents a dependency between nodes
1914
- */
1915
- export interface GraphEdge {
1916
- BaseModel: BaseModel;
1917
- type: GraphEdgeType;
1918
- from: string;
1919
- to: string;
1920
- }
1921
- /**
1922
- * GraphStatus represents the overall status of the graph
1923
- */
1924
- export type GraphStatus = string;
1925
- export declare const GraphStatusPending: GraphStatus;
1926
- export declare const GraphStatusRunning: GraphStatus;
1927
- export declare const GraphStatusCompleted: GraphStatus;
1928
- export declare const GraphStatusFailed: GraphStatus;
1929
- export declare const GraphStatusCancelled: GraphStatus;
1930
- /**
1931
- * GraphNodeStatus represents the status of a node
1932
- */
1933
- export type GraphNodeStatus = string;
1934
- export declare const GraphNodeStatusPending: GraphNodeStatus;
1935
- export declare const GraphNodeStatusReady: GraphNodeStatus;
1936
- export declare const GraphNodeStatusRunning: GraphNodeStatus;
1937
- export declare const GraphNodeStatusCompleted: GraphNodeStatus;
1938
- export declare const GraphNodeStatusFailed: GraphNodeStatus;
1939
- export declare const GraphNodeStatusCancelled: GraphNodeStatus;
1940
- export declare const GraphNodeStatusSkipped: GraphNodeStatus;
1941
- export declare const GraphNodeStatusBlocked: GraphNodeStatus;
1942
- /**
1943
- * GraphEdgeType defines the type of edge relationship
1944
- */
1945
- export type GraphEdgeType = string;
1946
- export declare const GraphEdgeTypeDependency: GraphEdgeType;
1947
- export declare const GraphEdgeTypeFlow: GraphEdgeType;
1948
- export declare const GraphEdgeTypeConditional: GraphEdgeType;
1949
- /**
1950
- * EdgeBuilder is the fluent API for creating graph edges
1951
- * Usage: service.Wire(ctx, authCtx).Resource(x).FlowsTo().Resource(y)
1952
- */
1953
- export type GraphEdgeBuilder = any;
1954
- /**
1955
- * GraphEdgeTarget completes the edge to a target
1956
- */
1957
- export type GraphEdgeTarget = any;
1958
- /**
1959
- * Integration providers
1960
- */
1961
- export declare const IntegrationProviderGoogle = "google";
1962
- /**
1963
- * Integration providers
1964
- */
1965
- export declare const IntegrationProviderSlack = "slack";
1966
- /**
1967
- * Integration providers
1968
- */
1969
- export declare const IntegrationProviderNotion = "notion";
1970
- /**
1971
- * Integration providers
1972
- */
1973
- export declare const IntegrationProviderGitHub = "github";
1974
- /**
1975
- * Integration types
1976
- */
1977
- export declare const IntegrationTypeServiceAccount = "service_account";
1978
- /**
1979
- * Integration types
1980
- */
1981
- export declare const IntegrationTypeOAuth = "oauth";
1982
- /**
1983
- * Integration types
1984
- */
1985
- export declare const IntegrationTypeAPIKey = "api_key";
1986
- /**
1987
- * Integration statuses
1988
- */
1989
- export declare const IntegrationStatusConnected = "connected";
1990
- /**
1991
- * Integration statuses
1992
- */
1993
- export declare const IntegrationStatusDisconnected = "disconnected";
1994
- /**
1995
- * Integration statuses
1996
- */
1997
- export declare const IntegrationStatusExpired = "expired";
1998
- /**
1999
- * Integration statuses
2000
- */
2001
- export declare const IntegrationStatusError = "error";
2002
- /**
2003
- * StringSlice is a custom type for storing string slices in the database
2004
- */
2005
- export type StringSlice = string[];
2006
- /**
2007
- * Integration represents a connected external service integration
2008
- */
2009
- export interface Integration {
2010
- BaseModel: BaseModel;
2011
- PermissionModel: PermissionModel;
2012
- /**
2013
- * Provider identifies the service (google, slack, notion, etc.)
2014
- */
2015
- provider: string;
2016
- /**
2017
- * Type identifies the integration type (service_account, oauth, api_key)
2018
- */
2019
- type: string;
2020
- /**
2021
- * Status of the integration
2022
- */
2023
- status: string;
2024
- /**
2025
- * Display name for the integration (user-friendly)
2026
- */
2027
- display_name: string;
2028
- /**
2029
- * OAuth fields - tokens stored in secrets table for centralized encryption/rotation
2030
- */
2031
- scopes: StringSlice;
2032
- expires_at?: string;
2033
- /**
2034
- * Service Account fields
2035
- */
2036
- service_account_email: string;
2037
- /**
2038
- * Generic metadata for provider-specific data
2039
- */
2040
- metadata: {
2041
- [key: string]: any;
2042
- };
2043
- /**
2044
- * Error message if status is "error"
2045
- */
2046
- error_message?: string;
2047
- }
2048
- /**
2049
- * IntegrationDTO for API responses (never exposes tokens)
2050
- */
2051
- export interface IntegrationDTO extends BaseModel, PermissionModelDTO {
2052
- provider: string;
2053
- type: string;
2054
- status: string;
2055
- display_name: string;
2056
- scopes: StringSlice;
2057
- expires_at?: string;
2058
- service_account_email?: string;
2059
- metadata?: {
2060
- [key: string]: any;
2061
- };
2062
- error_message?: string;
2063
- }
2064
- /**
2065
- * OAuthConfig for OAuth providers
2066
- */
2067
- export interface OAuthConfig {
2068
- ClientID: string;
2069
- ClientSecret: string;
2070
- RedirectURL: string;
2071
- Scopes: string[];
2072
- }
2073
- /**
2074
- * IntegrationCredentials returned by GetCredentials for runtime injection
2075
- */
2076
- export interface IntegrationCredentials {
2077
- Provider: string;
2078
- Type: string;
2079
- Secrets: {
2080
- [key: string]: string;
2081
- };
2082
- }
2083
- /**
2084
- * ServerCapabilities represents the server's supported features
2085
- */
2086
- export interface ServerCapabilitiesLogging {
2087
- level: string;
2088
- }
2089
- export interface ServerCapabilitiesPrompts {
2090
- listChanged: boolean;
2091
- }
2092
- export interface ServerCapabilitiesResources {
2093
- subscribe: boolean;
2094
- listChanged: boolean;
2095
- }
2096
- export interface ServerCapabilitiesTools {
2097
- listChanged: boolean;
2098
- }
2099
- export interface ServerCapabilities {
2100
- logging: ServerCapabilitiesLogging;
2101
- prompts: ServerCapabilitiesPrompts;
2102
- resources: ServerCapabilitiesResources;
2103
- tools: ServerCapabilitiesTools;
2104
- }
2105
- /**
2106
- * ServerInfo represents information about the server
2107
- */
2108
- export interface ServerInfo {
2109
- name: string;
2110
- title: string;
2111
- version: string;
2112
- }
2113
- /**
2114
- * InitializeResponse represents the server's response to an initialization request
2115
- */
2116
- export interface InitializeResponse {
2117
- protocolVersion: string;
2118
- capabilities: ServerCapabilities;
2119
- serverInfo: ServerInfo;
2120
- instructions?: string;
2121
- }
2122
- /**
2123
- * CancellationParams represents the parameters for a cancellation notification
2124
- */
2125
- export interface CancellationParams {
2126
- requestId: string;
2127
- reason?: string;
2128
- }
2129
- /**
2130
- * ProgressParams represents progress update parameters
2131
- */
2132
- export interface ProgressParams {
2133
- requestId: string;
2134
- progress: number;
2135
- message?: string;
2136
- }
2137
- /**
2138
- * ResourceRequest represents a request for resource operations
2139
- */
2140
- export interface ResourceRequest {
2141
- operation: string;
2142
- id?: string;
2143
- userId?: string;
2144
- resource?: any;
2145
- listOptions?: ListRequest;
2146
- }
2147
- /**
2148
- * ResourceResponse represents a response for resource operations
2149
- */
2150
- export interface ResourceResponse {
2151
- resources: Resource[];
2152
- nextCursor?: string;
2153
- }
2154
- /**
2155
- * Resource represents a resource item
2156
- */
2157
- export interface Resource {
2158
- uri: string;
2159
- name: string;
2160
- title?: string;
2161
- description?: string;
2162
- mimeType?: string;
2163
- size?: number;
2164
- }
2165
- /**
2166
- * ResourceContent represents resource content
2167
- */
2168
- export interface ResourceContent {
2169
- uri: string;
2170
- name: string;
2171
- title?: string;
2172
- mimeType?: string;
2173
- text?: string;
2174
- blob?: string;
2175
- }
2176
- /**
2177
- * ResourceReadResponse represents a response for resource read operations
2178
- */
2179
- export interface ResourceReadResponse {
2180
- contents: ResourceContent[];
2181
- }
2182
- /**
2183
- * PromptRequest represents a request for prompt operations
2184
- */
2185
- export interface PromptRequest {
2186
- operation: string;
2187
- id?: string;
2188
- prompt?: string;
2189
- listOptions?: ListRequest;
2190
- }
2191
- /**
2192
- * PromptResponse represents a response for prompt operations
2193
- */
2194
- export interface PromptResponse {
2195
- prompts: Prompt[];
2196
- nextCursor?: string;
2197
- }
2198
- /**
2199
- * Prompt represents a prompt item
2200
- */
2201
- export interface Prompt {
2202
- name: string;
2203
- title?: string;
2204
- description?: string;
2205
- arguments?: PromptArg[];
2206
- messages?: PromptMessage[];
2207
- }
2208
- /**
2209
- * PromptArg represents a prompt argument
2210
- */
2211
- export interface PromptArg {
2212
- name: string;
2213
- description: string;
2214
- required: boolean;
2215
- }
2216
- /**
2217
- * PromptMessage represents a message in a prompt
2218
- */
2219
- export interface PromptMessage {
2220
- role: string;
2221
- content: PromptContent;
2222
- }
2223
- /**
2224
- * PromptContent represents content in a prompt message
2225
- */
2226
- export interface PromptContent {
2227
- type: string;
2228
- text?: string;
2229
- data?: string;
2230
- mimeType?: string;
2231
- }
2232
- /**
2233
- * ToolRequest represents a request for tool operations
2234
- */
2235
- export interface ToolListRequest {
2236
- cursor?: string;
2237
- }
2238
- /**
2239
- * ToolResponse represents a response for tool operations
2240
- */
2241
- export interface ToolListResponse {
2242
- tools: MCPTool[];
2243
- nextCursor?: string;
2244
- }
2245
- /**
2246
- * Tool represents a tool item
2247
- */
2248
- export interface MCPTool {
2249
- name: string;
2250
- title?: string;
2251
- description: string;
2252
- inputSchema: any;
2253
- outputSchema?: any;
2254
- }
2255
- /**
2256
- * ToolCallRequest represents a request to call a tool
2257
- */
2258
- export interface ToolCallRequest {
2259
- name: string;
2260
- arguments: {
2261
- [key: string]: any;
2262
- };
2263
- }
2264
- /**
2265
- * ToolCallResponse represents a response from a tool call
2266
- */
2267
- export interface ToolCallResponse {
2268
- content: ToolContent[];
2269
- structuredContent?: any;
2270
- isError: boolean;
2271
- }
2272
- /**
2273
- * ToolContent represents content in a tool response
2274
- */
2275
- export interface ToolContent {
2276
- type: string;
2277
- text?: string;
2278
- data?: string;
2279
- mimeType?: string;
2280
- resource?: ResourceContent;
2281
- }
2282
- /**
2283
- * JSONRPCRequest represents a JSON-RPC request
2284
- */
2285
- export interface JSONRPCRequest {
2286
- jsonrpc: string;
2287
- id: any;
2288
- method: string;
2289
- params?: any;
2290
- }
2291
- /**
2292
- * JSONRPCResponse represents a JSON-RPC response
2293
- */
2294
- export interface JSONRPCResponse {
2295
- jsonrpc: string;
2296
- id: any;
2297
- result?: any;
2298
- error?: JSONRPCError;
2299
- }
2300
- /**
2301
- * JSONRPCError represents a JSON-RPC error
2302
- */
2303
- export interface JSONRPCError {
2304
- code: number;
2305
- message: string;
2306
- data?: any;
2307
- }
2308
- /**
2309
- * NotificationMessage represents a notification message
2310
- */
2311
- export interface NotificationMessage {
2312
- jsonrpc: string;
2313
- method: string;
2314
- params?: any;
2315
- }
2316
- /**
2317
- * ConnectedEvent represents a connected event
2318
- */
2319
- export interface ConnectedEvent {
2320
- event: string;
2321
- timestamp: string;
2322
- }
2323
- /**
2324
- * ResourceTemplate represents a resource template
2325
- */
2326
- export interface ResourceTemplate {
2327
- uriTemplate: string;
2328
- name: string;
2329
- title?: string;
2330
- description?: string;
2331
- mimeType?: string;
2332
- }
2333
- /**
2334
- * ResourceTemplateResponse represents a response for resource template operations
2335
- */
2336
- export interface ResourceTemplateResponse {
2337
- resourceTemplates: ResourceTemplate[];
2338
- }
2339
- /**
2340
- * NotificationChannel represents a delivery channel
2341
- */
2342
- export type NotificationChannel = string;
2343
- export declare const NotificationChannelEmail: NotificationChannel;
2344
- export declare const NotificationChannelSMS: NotificationChannel;
2345
- export declare const NotificationChannelPush: NotificationChannel;
2346
- export declare const NotificationChannelSlack: NotificationChannel;
2347
- /**
2348
- * NotificationPriority represents notification priority
2349
- */
2350
- export type NotificationPriority = string;
2351
- export declare const NotificationPriorityLow: NotificationPriority;
2352
- export declare const NotificationPriorityNormal: NotificationPriority;
2353
- export declare const NotificationPriorityHigh: NotificationPriority;
2354
- export declare const NotificationPriorityCritical: NotificationPriority;
2355
- /**
2356
- * NotificationType represents the type/category of notification
2357
- */
2358
- export type NotificationType = string;
2359
- /**
2360
- * Billing notifications
2361
- */
2362
- export declare const NotificationTypeLowBalance: NotificationType;
2363
- export declare const NotificationTypeAutoRecharge: NotificationType;
2364
- export declare const NotificationTypePaymentSuccess: NotificationType;
2365
- export declare const NotificationTypePaymentFailed: NotificationType;
2366
- export declare const NotificationTypeUsageSummary: NotificationType;
2367
- export declare const NotificationTypeSpendingLimit: NotificationType;
2368
- /**
2369
- * Account notifications
2370
- */
2371
- export declare const NotificationTypeWelcome: NotificationType;
2372
- export declare const NotificationTypePasswordReset: NotificationType;
2373
- export declare const NotificationTypeEmailVerify: NotificationType;
2374
- export declare const NotificationTypeSecurityAlert: NotificationType;
2375
- /**
2376
- * Task notifications
2377
- */
2378
- export declare const NotificationTypeTaskComplete: NotificationType;
2379
- export declare const NotificationTypeTaskFailed: NotificationType;
2380
- /**
2381
- * System notifications
2382
- */
2383
- export declare const NotificationTypeSystemAlert: NotificationType;
2384
- export declare const NotificationTypeMaintenance: NotificationType;
2385
- /**
2386
- * NotificationStatus represents the status of a notification
2387
- */
2388
- export type NotificationStatus = string;
2389
- export declare const NotificationStatusPending: NotificationStatus;
2390
- export declare const NotificationStatusSent: NotificationStatus;
2391
- export declare const NotificationStatusDelivered: NotificationStatus;
2392
- export declare const NotificationStatusFailed: NotificationStatus;
2393
- export declare const NotificationStatusBounced: NotificationStatus;
2394
- export declare const NotificationStatusCancelled: NotificationStatus;
2395
- /**
2396
- * Notification represents a notification stored in the database
2397
- */
2398
- export interface Notification {
2399
- BaseModel: BaseModel;
2400
- PermissionModel: PermissionModel;
2401
- /**
2402
- * Notification details
2403
- */
2404
- type: NotificationType;
2405
- channel: NotificationChannel;
2406
- priority: NotificationPriority;
2407
- status: NotificationStatus;
2408
- /**
2409
- * Recipient info
2410
- */
2411
- recipient_email: string;
2412
- recipient_phone: string;
2413
- /**
2414
- * Content
2415
- */
2416
- subject: string;
2417
- body: string;
2418
- html_body: string;
2419
- /**
2420
- * Template support
2421
- */
2422
- template_id: string;
2423
- template_data: {
2424
- [key: string]: any;
2425
- };
2426
- /**
2427
- * Metadata for extensibility
2428
- */
2429
- metadata: {
2430
- [key: string]: any;
2431
- };
2432
- /**
2433
- * Scheduling
2434
- */
2435
- scheduled_at?: string;
2436
- expires_at?: string;
2437
- /**
2438
- * Delivery tracking
2439
- */
2440
- sent_at?: string;
2441
- delivered_at?: string;
2442
- failed_at?: string;
2443
- /**
2444
- * Provider info
2445
- */
2446
- provider_name: string;
2447
- provider_id: string;
2448
- /**
2449
- * Error tracking
2450
- */
2451
- error_message: string;
2452
- retry_count: number;
2453
- max_retries: number;
2454
- /**
2455
- * Reference to related entity (e.g., task_id, transaction_id)
2456
- */
2457
- reference_type: string;
2458
- reference_id: string;
2459
- }
2460
- /**
2461
- * NotificationDTO is the data transfer object
2462
- */
2463
- export interface NotificationDTO extends BaseModel, PermissionModelDTO {
2464
- type: NotificationType;
2465
- channel: NotificationChannel;
2466
- priority: NotificationPriority;
2467
- status: NotificationStatus;
2468
- recipient_email?: string;
2469
- subject: string;
2470
- body?: string;
2471
- scheduled_at?: string;
2472
- sent_at?: string;
2473
- delivered_at?: string;
2474
- failed_at?: string;
2475
- error_message?: string;
2476
- retry_count: number;
2477
- reference_type?: string;
2478
- reference_id?: string;
2479
- }
2480
- export interface NotificationPreferences {
2481
- BaseModel: BaseModel;
2482
- PermissionModel: PermissionModel;
2483
- /**
2484
- * Channel preferences
2485
- */
2486
- email_enabled: boolean;
2487
- sms_enabled: boolean;
2488
- push_enabled: boolean;
2489
- slack_enabled: boolean;
2490
- /**
2491
- * Type preferences (which notification types to receive)
2492
- */
2493
- billing_notifications: boolean;
2494
- task_notifications: boolean;
2495
- system_notifications: boolean;
2496
- marketing_emails: boolean;
2497
- /**
2498
- * Quiet hours (don't send non-critical notifications during these hours)
2499
- */
2500
- quiet_hours_enabled: boolean;
2501
- quiet_hours_start: string;
2502
- quiet_hours_end: string;
2503
- timezone: string;
2504
- }
2505
- /**
2506
- * NotificationPreferencesDTO is the data transfer object
2507
- */
2508
- export interface NotificationPreferencesDTO extends BaseModel, PermissionModelDTO {
2509
- email_enabled: boolean;
2510
- sms_enabled: boolean;
2511
- push_enabled: boolean;
2512
- slack_enabled: boolean;
2513
- billing_notifications: boolean;
2514
- task_notifications: boolean;
2515
- system_notifications: boolean;
2516
- marketing_emails: boolean;
2517
- quiet_hours_enabled: boolean;
2518
- quiet_hours_start?: string;
2519
- quiet_hours_end?: string;
2520
- timezone: string;
2521
- }
2522
- /**
2523
- * CreateNotificationRequest is the request to create a notification
2524
- */
2525
- export interface CreateNotificationRequest {
2526
- type: NotificationType;
2527
- channel: NotificationChannel;
2528
- priority?: NotificationPriority;
2529
- recipient_email?: string;
2530
- recipient_phone?: string;
2531
- subject: string;
2532
- body: string;
2533
- html_body?: string;
2534
- template_id?: string;
2535
- template_data?: {
2536
- [key: string]: any;
2537
- };
2538
- metadata?: {
2539
- [key: string]: any;
2540
- };
2541
- scheduled_at?: string;
2542
- reference_type?: string;
2543
- reference_id?: string;
2544
- }
2545
- /**
2546
- * UpdateNotificationPreferencesRequest is the request to update preferences
2547
- */
2548
- export interface UpdateNotificationPreferencesRequest {
2549
- email_enabled?: boolean;
2550
- sms_enabled?: boolean;
2551
- push_enabled?: boolean;
2552
- slack_enabled?: boolean;
2553
- billing_notifications?: boolean;
2554
- task_notifications?: boolean;
2555
- system_notifications?: boolean;
2556
- marketing_emails?: boolean;
2557
- quiet_hours_enabled?: boolean;
2558
- quiet_hours_start?: string;
2559
- quiet_hours_end?: string;
2560
- timezone?: string;
2561
- }
2562
- export type PageStatus = number;
2563
- export declare const PageStatusUnknown: PageStatus;
2564
- export declare const PageStatusDraft: PageStatus;
2565
- export declare const PageStatusPublished: PageStatus;
2566
- export declare const PageStatusArchived: PageStatus;
2567
- export interface PageMetadata {
2568
- title: string;
2569
- description: string;
2570
- image: string;
2571
- tags: string[];
2572
- /**
2573
- * Docs-specific fields
2574
- */
2575
- order?: number;
2576
- type?: string;
2577
- icon?: string;
2578
- hide_from_nav?: boolean;
2579
- }
2580
- export interface Page {
2581
- BaseModel: BaseModel;
2582
- PermissionModel: PermissionModel;
2583
- is_featured: boolean;
2584
- title: string;
2585
- content: string;
2586
- excerpt: string;
2587
- status: PageStatus;
2588
- slug: string;
2589
- metadata: PageMetadata;
2590
- }
2591
- export interface PageDTO extends BaseModel, PermissionModelDTO {
2592
- is_featured: boolean;
2593
- title: string;
2594
- content: string;
2595
- excerpt: string;
2596
- status: PageStatus;
2597
- metadata: PageMetadata;
2598
- slug: string;
2599
- }
2600
- export type CommentStatus = number;
2601
- export declare const CommentStatusUnknown: CommentStatus;
2602
- export declare const CommentStatusDraft: CommentStatus;
2603
- export declare const CommentStatusPublished: CommentStatus;
2604
- export declare const CommentStatusArchived: CommentStatus;
2605
- export interface Comment {
2606
- BaseModel: BaseModel;
2607
- PermissionModel: PermissionModel;
2608
- page_id: string;
2609
- content: string;
2610
- status: CommentStatus;
2611
- /**
2612
- * Relationships
2613
- */
2614
- parent_comment_id?: string;
2615
- children: Comment[];
2616
- }
2617
- export interface CommentDTO extends BaseModel, PermissionModelDTO {
2618
- page_id: string;
2619
- content: string;
2620
- parent_comment_id?: string;
2621
- children: CommentDTO[];
2622
- status: CommentStatus;
2623
- }
2624
- export interface Menu {
2625
- BaseModel: BaseModel;
2626
- PermissionModel: PermissionModel;
2627
- name: string;
2628
- slug: string;
2629
- description: string;
2630
- /**
2631
- * Nested items stored as JSON for flexibility
2632
- */
2633
- items: MenuItem[];
2634
- }
1087
+ export type StringSlice = string[];
2635
1088
  /**
2636
- * MenuItem represents an item in a menu (can be nested)
1089
+ * IntegrationDTO for API responses (never exposes tokens)
2637
1090
  */
2638
- export interface MenuItem {
2639
- id: string;
2640
- label: string;
2641
- slug?: string;
2642
- page_id?: string;
2643
- url?: string;
2644
- icon?: string;
2645
- order: number;
2646
- is_group?: boolean;
2647
- expanded?: boolean;
2648
- children?: MenuItem[];
2649
- }
2650
- export interface MenuDTO extends BaseModel, PermissionModelDTO {
2651
- name: string;
2652
- slug: string;
2653
- description: string;
2654
- items: MenuItem[];
1091
+ export interface IntegrationDTO extends BaseModel, PermissionModelDTO {
1092
+ provider: string;
1093
+ type: string;
1094
+ status: string;
1095
+ display_name: string;
1096
+ scopes: StringSlice;
1097
+ expires_at?: string;
1098
+ service_account_email?: string;
1099
+ metadata?: {
1100
+ [key: string]: any;
1101
+ };
1102
+ account_identifier?: string;
1103
+ account_name?: string;
1104
+ is_primary: boolean;
1105
+ error_message?: string;
2655
1106
  }
2656
1107
  /**
2657
1108
  * ProjectType represents different types of projects
@@ -2661,6 +1112,17 @@ export declare const ProjectTypeAgent: ProjectType;
2661
1112
  export declare const ProjectTypeApp: ProjectType;
2662
1113
  export declare const ProjectTypeFlow: ProjectType;
2663
1114
  export declare const ProjectTypeOther: ProjectType;
1115
+ /**
1116
+ * ProjectModel provides optional project association for models
1117
+ */
1118
+ export interface ProjectModel {
1119
+ project_id?: string;
1120
+ project?: Project;
1121
+ }
1122
+ export interface ProjectModelDTO {
1123
+ project_id?: string;
1124
+ project?: ProjectDTO;
1125
+ }
2664
1126
  /**
2665
1127
  * Project represents a container for organizing related resources
2666
1128
  */
@@ -2692,6 +1154,28 @@ export interface ProjectDTO extends BaseModel, PermissionModelDTO {
2692
1154
  parent?: ProjectDTO;
2693
1155
  children: (ProjectDTO | undefined)[];
2694
1156
  }
1157
+ export type ContentRating = string;
1158
+ export declare const ContentSafe: ContentRating;
1159
+ /**
1160
+ * sexual content
1161
+ */
1162
+ export declare const ContentSexualSuggestive: ContentRating;
1163
+ export declare const ContentSexualExplicit: ContentRating;
1164
+ /**
1165
+ * violence
1166
+ */
1167
+ export declare const ContentViolenceNonGraphic: ContentRating;
1168
+ export declare const ContentViolenceGraphic: ContentRating;
1169
+ /**
1170
+ * gore
1171
+ */
1172
+ export declare const ContentGore: ContentRating;
1173
+ /**
1174
+ * other regulated content
1175
+ */
1176
+ export declare const ContentDrugs: ContentRating;
1177
+ export declare const ContentSelfHarm: ContentRating;
1178
+ export declare const ContentUnrated: ContentRating;
2695
1179
  /**
2696
1180
  * SecretRequirement defines a secret that an app requires to run
2697
1181
  */
@@ -2725,205 +1209,6 @@ export interface SetupAction {
2725
1209
  provider?: string;
2726
1210
  scopes?: string[];
2727
1211
  }
2728
- /**
2729
- * Capability represents an integration capability that can be requested by apps
2730
- */
2731
- export interface Capability {
2732
- key: string;
2733
- provider: string;
2734
- type: string;
2735
- scopes?: string[];
2736
- satisfies?: string[];
2737
- display_name: string;
2738
- description?: string;
2739
- available: boolean;
2740
- }
2741
- /**
2742
- * CapabilitiesResponse is the API response for listing available capabilities
2743
- */
2744
- export interface CapabilitiesResponse {
2745
- capabilities: Capability[];
2746
- }
2747
- /**
2748
- * CheckRequirementsRequest is the request body for checking requirements
2749
- */
2750
- export interface CheckRequirementsRequest {
2751
- secrets?: SecretRequirement[];
2752
- integrations?: IntegrationRequirement[];
2753
- }
2754
- /**
2755
- * CheckRequirementsResponse is the API response for checking requirements
2756
- */
2757
- export interface CheckRequirementsResponse {
2758
- satisfied: boolean;
2759
- errors?: RequirementError[];
2760
- }
2761
- /**
2762
- * RequirementsNotMetError is a specific error type for missing requirements
2763
- * This allows API handlers to detect this case and return structured errors
2764
- */
2765
- export interface RequirementsNotMetError {
2766
- Errors: RequirementError[];
2767
- }
2768
- export interface ResourcePrice {
2769
- CentsPerHour: number;
2770
- NanosPerSecond: number;
2771
- }
2772
- /**
2773
- * SchemaConverter handles conversion from JSON Schema to tool format
2774
- */
2775
- export interface SchemaConverter {
2776
- }
2777
- /**
2778
- * RequiredField represents a required field with its name and description
2779
- */
2780
- export interface SchemaField {
2781
- Name: string;
2782
- Description: string;
2783
- }
2784
- /**
2785
- * Secret represents a single key-value secret for a team (one row per key)
2786
- */
2787
- export interface Secret {
2788
- BaseModel: BaseModel;
2789
- PermissionModel: PermissionModel;
2790
- /**
2791
- * Key is the environment variable name (e.g., "API_KEY", "DATABASE_URL")
2792
- */
2793
- key: string;
2794
- /**
2795
- * Value is the secret value - uses SensitiveString to prevent accidental exposure
2796
- */
2797
- value: SensitiveString;
2798
- /**
2799
- * Description is optional metadata about the secret
2800
- */
2801
- description?: string;
2802
- /**
2803
- * Internal marks this secret as system-managed (e.g., integration tokens)
2804
- * Internal secrets are hidden from user-facing lists but can still be used
2805
- */
2806
- internal: boolean;
2807
- }
2808
- /**
2809
- * SecretDTO for API responses - VALUE IS NEVER EXPOSED
2810
- */
2811
- export interface SecretDTO extends BaseModel, PermissionModelDTO {
2812
- key: string;
2813
- masked_value: string;
2814
- description?: string;
2815
- internal?: boolean;
2816
- }
2817
- /**
2818
- * SecretMap represents a map of secret key-value pairs (used for transport to workers)
2819
- */
2820
- export type SecretMap = {
2821
- [key: string]: string;
2822
- };
2823
- /**
2824
- * SecretsLegacy stores encrypted key-value pairs as a blob (DEPRECATED)
2825
- * Use Secret (individual rows) instead
2826
- */
2827
- export interface SecretsLegacy {
2828
- BaseModel: BaseModel;
2829
- PermissionModel: PermissionModel;
2830
- /**
2831
- * base64 encoded JSON of key-value pairs
2832
- */
2833
- data: SensitiveString;
2834
- }
2835
- /**
2836
- * GoogleIntegration represents the Google Cloud integration state for a team
2837
- */
2838
- export interface GoogleIntegration {
2839
- enabled: boolean;
2840
- service_account_email: string;
2841
- created_at?: string;
2842
- }
2843
- /**
2844
- * GoogleIntegrationDTO for API responses (doesn't expose the key)
2845
- */
2846
- export interface GoogleIntegrationDTO {
2847
- enabled: boolean;
2848
- service_account_email: string;
2849
- created_at?: string;
2850
- }
2851
- /**
2852
- * GoogleIntegrationCreateRequest is the request to enable Google integration
2853
- */
2854
- export interface GoogleIntegrationCreateRequest {
2855
- }
2856
- /**
2857
- * GoogleIntegrationCreateResponse is the response after enabling Google integration
2858
- */
2859
- export interface GoogleIntegrationCreateResponse {
2860
- service_account_email: string;
2861
- instructions: string;
2862
- }
2863
- /**
2864
- * Secret keys for Google integration
2865
- */
2866
- export declare const SecretGoogleServiceAccountEmail = "GOOGLE_SERVICE_ACCOUNT_EMAIL";
2867
- /**
2868
- * Secret keys for Google integration
2869
- */
2870
- export declare const SecretGoogleServiceAccountJSON = "GOOGLE_SERVICE_ACCOUNT_JSON";
2871
- /**
2872
- * Secret keys for Google integration
2873
- */
2874
- export declare const SecretGoogleAccessToken = "GOOGLE_ACCESS_TOKEN";
2875
- /**
2876
- * GoogleAccessToken represents a temporary access token for a service account
2877
- */
2878
- export interface GoogleAccessToken {
2879
- access_token: string;
2880
- token_type: string;
2881
- expires_in: number;
2882
- service_account_email: string;
2883
- }
2884
- /**
2885
- * SystemMetadata stores system-level configuration that needs to persist
2886
- */
2887
- export interface SystemMetadata {
2888
- key: string;
2889
- value: string;
2890
- }
2891
- /**
2892
- * SystemMetadataKeyFingerprint stores the current encryption key fingerprint
2893
- */
2894
- export declare const SystemMetadataKeyFingerprint = "encryption_key_fingerprint";
2895
- /**
2896
- * SensitiveString is a string type that prevents accidental exposure of secrets.
2897
- * It implements custom JSON marshaling, SQL scanning, and fmt.Stringer to always
2898
- * redact the value unless explicitly accessed via .Expose().
2899
- * Security features:
2900
- * - Envelope encryption at rest: DEK encrypted with KEK, data encrypted with DEK
2901
- * - JSON serialization: always returns "" (empty string)
2902
- * - fmt.Sprintf with %s, %v, %#v: always returns "[REDACTED]"
2903
- * - Only .Expose() returns the actual value - audit all call sites!
2904
- * Encryption is enabled when SECRETS_ENCRYPTION_KEY env var is set.
2905
- * Values are stored as "enc:v2:<encrypted_dek>:<encrypted_data>" in the database.
2906
- * Key rotation only re-encrypts the DEK, not the data.
2907
- */
2908
- export interface SensitiveString {
2909
- }
2910
- export interface Session {
2911
- id: string;
2912
- hash: string;
2913
- token: string;
2914
- user_id: string;
2915
- user?: User;
2916
- created_at: string;
2917
- expires_at: string;
2918
- ip: string;
2919
- user_agent: string;
2920
- city: string;
2921
- country: string;
2922
- os: string;
2923
- browser: string;
2924
- browser_version: string;
2925
- is_anonymous: boolean;
2926
- }
2927
1212
  export type InstanceCloudProvider = string;
2928
1213
  export declare const CloudAWS: InstanceCloudProvider;
2929
1214
  export declare const CloudAzure: InstanceCloudProvider;
@@ -2962,235 +1247,58 @@ export interface Instance {
2962
1247
  hourly_price: number;
2963
1248
  template_id?: string;
2964
1249
  volume_ids?: string[];
2965
- tags?: string[];
2966
- configuration?: InstanceConfiguration;
2967
- launch_configuration?: InstanceLaunchConfiguration;
2968
- auto_delete?: InstanceThresholdConfig;
2969
- alert?: InstanceThresholdConfig;
2970
- volume_mount?: InstanceVolumeMountConfig;
2971
- envs?: InstanceEnvVar[];
2972
- }
2973
- export interface InstanceRequest {
2974
- cloud: InstanceCloudProvider;
2975
- name: string;
2976
- region: string;
2977
- shade_cloud: boolean;
2978
- shade_instance_type: string;
2979
- os?: string;
2980
- ssh_key_id?: string;
2981
- template_id?: string;
2982
- volume_ids?: string[];
2983
- tags?: string[];
2984
- launch_configuration?: InstanceLaunchConfiguration;
2985
- auto_delete?: InstanceThresholdConfig;
2986
- alert?: InstanceThresholdConfig;
2987
- volume_mount?: InstanceVolumeMountConfig;
2988
- envs?: InstanceEnvVar[];
2989
- }
2990
- export interface InstanceConfiguration {
2991
- gpu_type: string;
2992
- interconnect: string;
2993
- memory_in_gb: number;
2994
- num_gpus: number;
2995
- os: string;
2996
- storage_in_gb: number;
2997
- vcpus: number;
2998
- vram_per_gpu_in_gb: number;
2999
- }
3000
- export interface InstanceLaunchConfiguration {
3001
- type: string;
3002
- docker_configuration?: InstanceDockerConfig;
3003
- script_configuration?: InstanceScriptConfig;
3004
- }
3005
- export interface InstanceDockerConfig {
3006
- image: string;
3007
- args?: string;
3008
- shared_memory_in_gb?: number;
3009
- envs?: InstanceEnvVar[];
3010
- port_mappings?: InstancePortMapping[];
3011
- volume_mounts?: InstanceVolumeMount[];
3012
- }
3013
- export interface InstanceScriptConfig {
3014
- base64_script: string;
3015
- }
3016
- export interface InstancePortMapping {
3017
- host_port: number;
3018
- container_port: number;
3019
- }
3020
- export interface InstanceVolumeMount {
3021
- host_path: string;
3022
- container_path: string;
3023
- }
3024
- export interface InstanceThresholdConfig {
3025
- date_threshold?: string;
3026
- spend_threshold?: string;
3027
- }
3028
- export interface InstanceVolumeMountConfig {
3029
- auto: boolean;
3030
- }
3031
- export interface InstanceEnvVar {
3032
- name: string;
3033
- value: string;
3034
- }
3035
- export type InstanceTypeDeploymentType = string;
3036
- export declare const InstanceTypeDeploymentTypeVM: InstanceTypeDeploymentType;
3037
- export declare const InstanceTypeDeploymentTypeContainer: InstanceTypeDeploymentType;
3038
- export declare const InstanceTypeDeploymentTypeBaremetal: InstanceTypeDeploymentType;
3039
- export interface InstanceType extends BaseModel, PermissionModel {
3040
- cloud: InstanceCloudProvider;
3041
- region: string;
3042
- shade_instance_type: string;
3043
- cloud_instance_type: string;
3044
- deployment_type: InstanceTypeDeploymentType;
3045
- hourly_price: number;
3046
- configuration?: InstanceTypeConfiguration;
3047
- availability: InstanceTypeAvailability[];
3048
- boot_time?: InstanceTypeBootTime;
3049
- }
3050
- export interface InstanceTypeConfiguration {
3051
- gpu_type: string;
3052
- interconnect: string;
3053
- memory_in_gb: number;
3054
- num_gpus: number;
3055
- os_options: string[];
3056
- storage_in_gb: number;
3057
- vcpus: number;
3058
- vram_per_gpu_in_gb: number;
3059
- }
3060
- export interface InstanceTypeAvailability {
3061
- available: boolean;
3062
- region: string;
3063
- }
3064
- export interface InstanceTypeBootTime {
3065
- average_seconds: number;
3066
- updated_at: string;
3067
- sample_size: number;
3068
- }
3069
- export interface SlackResponse {
3070
- Body: string;
3071
- ContentType: string;
3072
- }
3073
- /**
3074
- * SlackIntegrationMetadata contains Slack-specific context for chat messages
3075
- * This is stored in ChatMessage.IntegrationMetadata as JSON
3076
- */
3077
- export interface SlackIntegrationMetadata {
3078
- channel: string;
3079
- thread_ts: string;
3080
- team_id?: string;
3081
- user_id?: string;
3082
- bot_message_ts?: string;
3083
- stream_started?: boolean;
3084
- stream_ts?: string;
3085
- }
3086
- /**
3087
- * SlackBlock represents a Slack Block Kit block
3088
- */
3089
- export interface SlackBlock {
3090
- type: string;
3091
- text?: any;
3092
- }
3093
- /**
3094
- * SlackTextObject represents a text object in Slack Block Kit
3095
- */
3096
- export interface SlackTextObject {
3097
- type: string;
3098
- text: string;
3099
- }
3100
- /**
3101
- * SlackPostMessageRequest represents the payload for posting a message to Slack
3102
- */
3103
- export interface SlackPostMessageRequest {
3104
- channel: string;
3105
- text?: string;
3106
- markdown_text?: string;
3107
- blocks?: SlackBlock[];
3108
- thread_ts?: string;
3109
- mrkdwn?: boolean;
1250
+ tags?: string[];
1251
+ configuration?: InstanceConfiguration;
1252
+ launch_configuration?: InstanceLaunchConfiguration;
1253
+ auto_delete?: InstanceThresholdConfig;
1254
+ alert?: InstanceThresholdConfig;
1255
+ volume_mount?: InstanceVolumeMountConfig;
1256
+ envs?: InstanceEnvVar[];
3110
1257
  }
3111
- /**
3112
- * SlackUpdateMessageRequest represents the payload for updating a Slack message
3113
- */
3114
- export interface SlackUpdateMessageRequest {
3115
- channel: string;
3116
- ts: string;
3117
- text?: string;
3118
- blocks?: SlackBlock[];
1258
+ export interface InstanceConfiguration {
1259
+ gpu_type: string;
1260
+ interconnect: string;
1261
+ memory_in_gb: number;
1262
+ num_gpus: number;
1263
+ os: string;
1264
+ storage_in_gb: number;
1265
+ vcpus: number;
1266
+ vram_per_gpu_in_gb: number;
3119
1267
  }
3120
- /**
3121
- * SlackAssistantThreadsSetStatusRequest represents the payload for setting assistant thread status
3122
- * This shows a typing indicator in Slack (requires assistant:write scope)
3123
- */
3124
- export interface SlackAssistantThreadsSetStatusRequest {
3125
- channel_id: string;
3126
- thread_ts: string;
3127
- status: string;
3128
- loading_messages?: string[];
1268
+ export interface InstanceLaunchConfiguration {
1269
+ type: string;
1270
+ docker_configuration?: InstanceDockerConfig;
1271
+ script_configuration?: InstanceScriptConfig;
3129
1272
  }
3130
- /**
3131
- * SlackAssistantThreadsSetStopSuggestedRequest represents the payload to stop the typing indicator
3132
- */
3133
- export interface SlackAssistantThreadsSetStopSuggestedRequest {
3134
- channel_id: string;
3135
- thread_ts: string;
1273
+ export interface InstanceDockerConfig {
1274
+ image: string;
1275
+ args?: string;
1276
+ shared_memory_in_gb?: number;
1277
+ envs?: InstanceEnvVar[];
1278
+ port_mappings?: InstancePortMapping[];
1279
+ volume_mounts?: InstanceVolumeMount[];
3136
1280
  }
3137
- /**
3138
- * SlackAPIResponse represents a standard Slack API response
3139
- */
3140
- export interface SlackAPIResponse {
3141
- ok: boolean;
3142
- error?: string;
3143
- ts?: string;
1281
+ export interface InstanceScriptConfig {
1282
+ base64_script: string;
3144
1283
  }
3145
- /**
3146
- * SlackConversationsRepliesResponse represents the response from conversations.replies
3147
- */
3148
- export interface SlackConversationsRepliesResponse {
3149
- ok: boolean;
3150
- error?: string;
3151
- messages: SlackThreadMessage[];
1284
+ export interface InstancePortMapping {
1285
+ host_port: number;
1286
+ container_port: number;
3152
1287
  }
3153
- /**
3154
- * SlackStartStreamRequest represents the payload for starting a streaming message
3155
- */
3156
- export interface SlackStartStreamRequest {
3157
- channel: string;
3158
- thread_ts: string;
3159
- markdown_text?: string;
3160
- recipient_user_id?: string;
3161
- recipient_team_id?: string;
1288
+ export interface InstanceVolumeMount {
1289
+ host_path: string;
1290
+ container_path: string;
3162
1291
  }
3163
- /**
3164
- * SlackAppendStreamRequest represents the payload for appending to a streaming message
3165
- */
3166
- export interface SlackAppendStreamRequest {
3167
- channel: string;
3168
- ts: string;
3169
- markdown_text?: string;
1292
+ export interface InstanceThresholdConfig {
1293
+ date_threshold?: string;
1294
+ spend_threshold?: string;
3170
1295
  }
3171
- /**
3172
- * SlackStopStreamRequest represents the payload for stopping a streaming message
3173
- */
3174
- export interface SlackStopStreamRequest {
3175
- channel: string;
3176
- ts: string;
1296
+ export interface InstanceVolumeMountConfig {
1297
+ auto: boolean;
3177
1298
  }
3178
- /**
3179
- * Hardware/System related types
3180
- */
3181
- export interface SystemInfo {
3182
- hostname: string;
3183
- ipv4: string;
3184
- ipv6: string;
3185
- mac_address: string;
3186
- os: string;
3187
- docker: Docker;
3188
- wsl2: WSL2;
3189
- cpus: CPU[];
3190
- ram: RAM;
3191
- volumes: Volume[];
3192
- hf_cache: HFCacheInfo;
3193
- gpus: GPU[];
1299
+ export interface InstanceEnvVar {
1300
+ name: string;
1301
+ value: string;
3194
1302
  }
3195
1303
  export interface TelemetrySystemInfo {
3196
1304
  cpus: CPU[];
@@ -3198,19 +1306,6 @@ export interface TelemetrySystemInfo {
3198
1306
  gpus: GPU[];
3199
1307
  volumes: Volume[];
3200
1308
  }
3201
- export interface Docker {
3202
- binary_path: string;
3203
- installed: boolean;
3204
- socket_path: string;
3205
- socket_available: boolean;
3206
- running: boolean;
3207
- version: string;
3208
- }
3209
- export interface WSL2 {
3210
- installed: boolean;
3211
- enabled: boolean;
3212
- version: string;
3213
- }
3214
1309
  export interface CPU {
3215
1310
  name: string;
3216
1311
  vendor_id: string;
@@ -3252,54 +1347,6 @@ export interface GPU {
3252
1347
  memory_total: number;
3253
1348
  temperature: number;
3254
1349
  }
3255
- /**
3256
- * CachedRevisionInfo represents information about a cached revision
3257
- */
3258
- export interface CachedRevisionInfo {
3259
- commit_hash: string;
3260
- snapshot_path: string;
3261
- last_modified: string;
3262
- size_on_disk: number;
3263
- size_on_disk_str: string;
3264
- nb_files: number;
3265
- refs: string[];
3266
- }
3267
- /**
3268
- * CachedRepoInfo represents information about a cached repository
3269
- */
3270
- export interface CachedRepoInfo {
3271
- repo_id: string;
3272
- repo_type: string;
3273
- repo_path: string;
3274
- last_accessed: string;
3275
- last_modified: string;
3276
- size_on_disk: number;
3277
- size_on_disk_str: string;
3278
- nb_files: number;
3279
- refs: string[];
3280
- Revisions: CachedRevisionInfo[];
3281
- }
3282
- /**
3283
- * HFCacheInfo represents information about the Huggingface cache
3284
- */
3285
- export interface HFCacheInfo {
3286
- cache_dir: string;
3287
- repos: CachedRepoInfo[];
3288
- size_on_disk: number;
3289
- warnings: string[];
3290
- }
3291
- /**
3292
- * DeletionStrategy represents a strategy for deleting revisions
3293
- */
3294
- export interface DeletionStrategy {
3295
- repos: CachedRepoInfo[];
3296
- snapshots: string[];
3297
- expected_freed_size: number;
3298
- expected_freed_size_str: string;
3299
- }
3300
- export interface CacheNotFoundError {
3301
- cache_dir: string;
3302
- }
3303
1350
  export type TaskStatus = number;
3304
1351
  export declare const TaskStatusUnknown: TaskStatus;
3305
1352
  export declare const TaskStatusReceived: TaskStatus;
@@ -3317,53 +1364,6 @@ export type Infra = string;
3317
1364
  export declare const InfraPrivate: Infra;
3318
1365
  export declare const InfraCloud: Infra;
3319
1366
  export declare const InfraPrivateFirst: Infra;
3320
- export interface Task {
3321
- BaseModel: BaseModel;
3322
- PermissionModel: PermissionModel;
3323
- VersionedStruct: VersionedStruct;
3324
- EncryptedModel: EncryptedModel;
3325
- is_featured: boolean;
3326
- status: TaskStatus;
3327
- /**
3328
- * Foreign keys
3329
- */
3330
- app_id: string;
3331
- app?: App;
3332
- version_id: string;
3333
- app_version?: AppVersion;
3334
- variant: string;
3335
- infra: Infra;
3336
- workers: string[];
3337
- engine_id?: string;
3338
- engine?: EngineState;
3339
- worker_id?: string;
3340
- worker?: WorkerState;
3341
- flow_id?: string;
3342
- flow_run_id?: string;
3343
- sub_flow_run_id?: string;
3344
- /**
3345
- * This part should be all replaced by the new graph model
3346
- */
3347
- chat_id?: string;
3348
- agent_id?: string;
3349
- agent_version_id?: string;
3350
- agent?: Agent;
3351
- tool_call_id?: string;
3352
- webhook?: string;
3353
- input: any;
3354
- output: any;
3355
- error: string;
3356
- nsfw: boolean;
3357
- /**
3358
- * Relationships
3359
- */
3360
- events: TaskEvent[];
3361
- logs: TaskLog[];
3362
- telemetry: TimescaleTask[];
3363
- usage_events: (UsageEvent | undefined)[];
3364
- transaction_id?: string;
3365
- transaction?: Transaction;
3366
- }
3367
1367
  export interface TaskEvent {
3368
1368
  id: string;
3369
1369
  created_at: string;
@@ -3410,10 +1410,11 @@ export interface TaskDTO extends BaseModel, PermissionModelDTO {
3410
1410
  worker_id?: string;
3411
1411
  worker?: WorkerStateSummary;
3412
1412
  webhook?: string;
1413
+ setup?: any;
3413
1414
  input: any;
3414
1415
  output: any;
3415
1416
  error: string;
3416
- nsfw: boolean;
1417
+ rating: ContentRating;
3417
1418
  events: TaskEvent[];
3418
1419
  logs: TaskLog[];
3419
1420
  telemetry: TimescaleTask[];
@@ -3428,7 +1429,6 @@ export interface TimescaleTask {
3428
1429
  task_seq: number;
3429
1430
  app_id: string;
3430
1431
  app_version_id: string;
3431
- app_variant: string;
3432
1432
  engine_id: string;
3433
1433
  engine_resources: TelemetrySystemInfo;
3434
1434
  worker_id: string;
@@ -3445,6 +1445,11 @@ export interface Team {
3445
1445
  email: string;
3446
1446
  name: string;
3447
1447
  avatar_url: string;
1448
+ /**
1449
+ * SetupCompleted indicates whether the team has completed initial setup (chosen a username)
1450
+ * Personal teams start with SetupCompleted=false and a generated temporary username
1451
+ */
1452
+ setup_completed: boolean;
3448
1453
  }
3449
1454
  export interface TeamDTO extends BaseModel {
3450
1455
  type: TeamType;
@@ -3452,21 +1457,12 @@ export interface TeamDTO extends BaseModel {
3452
1457
  username: string;
3453
1458
  avatar_url: string;
3454
1459
  email: string;
1460
+ setup_completed: boolean;
3455
1461
  }
3456
1462
  export type TeamRole = string;
3457
1463
  export declare const TeamRoleOwner: TeamRole;
3458
1464
  export declare const TeamRoleAdmin: TeamRole;
3459
1465
  export declare const TeamRoleMember: TeamRole;
3460
- export interface TeamMember {
3461
- BaseModel: BaseModel;
3462
- }
3463
- export interface TeamMemberDTO {
3464
- id: string;
3465
- user_id: string;
3466
- team_id: string;
3467
- role: TeamRole;
3468
- user?: UserRelationDTO;
3469
- }
3470
1466
  /**
3471
1467
  * Team-related types
3472
1468
  */
@@ -3477,39 +1473,43 @@ export interface TeamRelationDTO {
3477
1473
  type: TeamType;
3478
1474
  username: string;
3479
1475
  avatar_url: string;
1476
+ setup_completed: boolean;
3480
1477
  }
3481
1478
  /**
3482
- * Tool types and parameter types
3483
- */
3484
- export declare const ToolTypeFunction = "function";
3485
- /**
3486
- * Tool types and parameter types
3487
- */
3488
- export declare const ToolParamTypeObject = "object";
3489
- /**
3490
- * Tool types and parameter types
1479
+ * ToolInvocationFunction contains the function details for a tool invocation
3491
1480
  */
3492
- export declare const ToolParamTypeString = "string";
3493
- /**
3494
- * Tool types and parameter types
3495
- */
3496
- export declare const ToolParamTypeInteger = "integer";
3497
- /**
3498
- * Tool types and parameter types
3499
- */
3500
- export declare const ToolParamTypeNumber = "number";
3501
- /**
3502
- * Tool types and parameter types
3503
- */
3504
- export declare const ToolParamTypeBoolean = "boolean";
1481
+ export interface ToolInvocationFunction {
1482
+ name: string;
1483
+ arguments: StringEncodedMap;
1484
+ }
3505
1485
  /**
3506
- * Tool types and parameter types
1486
+ * ToolInvocationStatus represents the execution status of a tool invocation
3507
1487
  */
3508
- export declare const ToolParamTypeArray = "array";
1488
+ export type ToolInvocationStatus = string;
1489
+ export declare const ToolInvocationStatusPending: ToolInvocationStatus;
1490
+ export declare const ToolInvocationStatusInProgress: ToolInvocationStatus;
1491
+ export declare const ToolInvocationStatusAwaitingInput: ToolInvocationStatus;
1492
+ export declare const ToolInvocationStatusAwaitingApproval: ToolInvocationStatus;
1493
+ export declare const ToolInvocationStatusCompleted: ToolInvocationStatus;
1494
+ export declare const ToolInvocationStatusFailed: ToolInvocationStatus;
1495
+ export declare const ToolInvocationStatusCancelled: ToolInvocationStatus;
3509
1496
  /**
3510
- * Tool types and parameter types
1497
+ * ToolInvocationDTO for API responses
3511
1498
  */
3512
- export declare const ToolParamTypeNull = "null";
1499
+ export interface ToolInvocationDTO extends BaseModel, PermissionModelDTO {
1500
+ chat_message_id: string;
1501
+ tool_invocation_id: string;
1502
+ type: ToolType;
1503
+ execution_id?: string;
1504
+ function: ToolInvocationFunction;
1505
+ status: ToolInvocationStatus;
1506
+ result?: string;
1507
+ /**
1508
+ * Unified fields
1509
+ */
1510
+ data?: any;
1511
+ widget?: Widget;
1512
+ }
3513
1513
  export interface Tool {
3514
1514
  type: string;
3515
1515
  function: ToolFunction;
@@ -3560,21 +1560,6 @@ export interface Transaction {
3560
1560
  [key: string]: any;
3561
1561
  };
3562
1562
  }
3563
- export interface TransactionDTO extends BaseModel, PermissionModelDTO {
3564
- type: TransactionType;
3565
- amount: number;
3566
- reference: string;
3567
- notes: string;
3568
- payment_record_id?: string;
3569
- payment_record?: PaymentRecord;
3570
- usage_billing_record_id?: string;
3571
- usage_billing_record?: UsageBillingRecord;
3572
- usage_billing_refund_id?: string;
3573
- usage_billing_refund?: UsageBillingRefund;
3574
- metadata: {
3575
- [key: string]: any;
3576
- };
3577
- }
3578
1563
  /**
3579
1564
  * PaymentRecordStatus represents the status of a payment
3580
1565
  */
@@ -3607,19 +1592,6 @@ export interface PaymentRecord {
3607
1592
  session_id: string;
3608
1593
  session_url: string;
3609
1594
  }
3610
- /**
3611
- * Legacy aliases for backward compatibility
3612
- */
3613
- export type CheckoutSessionStatus = PaymentRecordStatus;
3614
- export type CheckoutSession = PaymentRecord;
3615
- export type StripeTransactionStatus = PaymentRecordStatus;
3616
- export type StripeTransaction = PaymentRecord;
3617
- export declare const CheckoutSessionStatusOpen: number;
3618
- export declare const CheckoutSessionStatusComplete: number;
3619
- export declare const CheckoutSessionStatusExpired: number;
3620
- export declare const StripeTransactionStatusOpen: number;
3621
- export declare const StripeTransactionStatusComplete: number;
3622
- export declare const StripeTransactionStatusExpired: number;
3623
1595
  export type UsageEventResourceTier = string;
3624
1596
  export declare const UsageEventResourceTierPrivate: UsageEventResourceTier;
3625
1597
  export declare const UsageEventResourceTierCloud: UsageEventResourceTier;
@@ -3631,6 +1603,7 @@ export declare const MetaItemTypeText: MetaItemType;
3631
1603
  export declare const MetaItemTypeImage: MetaItemType;
3632
1604
  export declare const MetaItemTypeVideo: MetaItemType;
3633
1605
  export declare const MetaItemTypeAudio: MetaItemType;
1606
+ export declare const MetaItemTypeRaw: MetaItemType;
3634
1607
  /**
3635
1608
  * VideoResolution represents standard video resolution presets
3636
1609
  */
@@ -3699,40 +1672,69 @@ export interface UsageEvent {
3699
1672
  quantity: number;
3700
1673
  unit: string;
3701
1674
  }
3702
- export interface UsageEventSummary {
3703
- tier_usage: {
3704
- [key: UsageEventResourceTier]: number;
3705
- };
3706
- type_usage: {
3707
- [key: string]: number;
3708
- };
3709
- model_usage: {
3710
- [key: string]: number;
3711
- };
3712
- total_usage: number;
3713
- }
3714
1675
  export interface UsageBillingRecord {
3715
1676
  BaseModel: BaseModel;
3716
1677
  PermissionModel: PermissionModel;
3717
- usage_events: (UsageEvent | undefined)[];
3718
1678
  /**
3719
1679
  * Fee breakdown (all in microcents)
3720
1680
  */
3721
1681
  total: number;
1682
+ /**
1683
+ * User debit (total charged)
1684
+ */
3722
1685
  user_debit_transaction_id: string;
3723
1686
  user_debit_transaction?: Transaction;
3724
- owner_credit_transaction_id: string;
3725
- owner_credit_transaction?: Transaction;
1687
+ /**
1688
+ * Resource owner credit (for providing compute)
1689
+ */
1690
+ resource_credit_transaction_id: string;
1691
+ resource_credit_transaction?: Transaction;
1692
+ /**
1693
+ * Creator royalty credit (app creator earnings)
1694
+ */
1695
+ royalty_credit_transaction_id: string;
1696
+ royalty_credit_transaction?: Transaction;
1697
+ /**
1698
+ * Inference fee credit (platform fee)
1699
+ */
1700
+ inference_credit_transaction_id: string;
1701
+ inference_credit_transaction?: Transaction;
1702
+ /**
1703
+ * Partner fee credit (cloud API fee)
1704
+ */
1705
+ partner_credit_transaction_id: string;
1706
+ partner_credit_transaction?: Transaction;
3726
1707
  }
3727
1708
  export interface UsageBillingRefund {
3728
1709
  BaseModel: BaseModel;
3729
1710
  PermissionModel: PermissionModel;
3730
1711
  usage_billing_record_id: string;
3731
1712
  usage_billing_record?: UsageBillingRecord;
1713
+ /**
1714
+ * User refund (total refunded)
1715
+ */
3732
1716
  user_debit_refund_transaction_id: string;
3733
1717
  user_debit_refund_transaction?: Transaction;
3734
- owner_credit_refund_transaction_id: string;
3735
- owner_credit_refund_transaction?: Transaction;
1718
+ /**
1719
+ * Resource owner reversal
1720
+ */
1721
+ resource_credit_refund_transaction_id: string;
1722
+ resource_credit_refund_transaction?: Transaction;
1723
+ /**
1724
+ * Creator royalty reversal
1725
+ */
1726
+ royalty_credit_refund_transaction_id: string;
1727
+ royalty_credit_refund_transaction?: Transaction;
1728
+ /**
1729
+ * Inference fee reversal
1730
+ */
1731
+ inference_credit_refund_transaction_id: string;
1732
+ inference_credit_refund_transaction?: Transaction;
1733
+ /**
1734
+ * Partner fee reversal
1735
+ */
1736
+ partner_credit_refund_transaction_id: string;
1737
+ partner_credit_refund_transaction?: Transaction;
3736
1738
  }
3737
1739
  /**
3738
1740
  * User-related types
@@ -3741,7 +1743,6 @@ export interface User {
3741
1743
  BaseModel: BaseModel;
3742
1744
  default_team_id: string;
3743
1745
  role: Role;
3744
- username: string;
3745
1746
  email: string;
3746
1747
  name: string;
3747
1748
  full_name: string;
@@ -3756,7 +1757,6 @@ export declare const RoleSystem: Role;
3756
1757
  export interface UserDTO extends BaseModel {
3757
1758
  default_team_id: string;
3758
1759
  role: Role;
3759
- username: string;
3760
1760
  email: string;
3761
1761
  name: string;
3762
1762
  full_name: string;
@@ -3771,7 +1771,6 @@ export interface UserRelationDTO {
3771
1771
  created_at: string;
3772
1772
  updated_at: string;
3773
1773
  role: Role;
3774
- username: string;
3775
1774
  avatar_url: string;
3776
1775
  }
3777
1776
  export interface UserMetadata {
@@ -3798,7 +1797,15 @@ export interface WidgetActionButton {
3798
1797
  action: WidgetAction;
3799
1798
  variant?: string;
3800
1799
  }
1800
+ /**
1801
+ * WidgetNodeType constants
1802
+ * Primitives (literal values): text, markdown, image, badge, button, input, select, checkbox, row, col
1803
+ * Data-bound (read from ToolInvocation.Data): plan-list, key-value, status-badge
1804
+ */
3801
1805
  export type WidgetNodeType = string;
1806
+ /**
1807
+ * Primitive node types (render literal values)
1808
+ */
3802
1809
  export declare const WidgetNodeTypeText: WidgetNodeType;
3803
1810
  export declare const WidgetNodeTypeMarkdown: WidgetNodeType;
3804
1811
  export declare const WidgetNodeTypeImage: WidgetNodeType;
@@ -3809,6 +1816,12 @@ export declare const WidgetNodeTypeSelect: WidgetNodeType;
3809
1816
  export declare const WidgetNodeTypeCheckbox: WidgetNodeType;
3810
1817
  export declare const WidgetNodeTypeRow: WidgetNodeType;
3811
1818
  export declare const WidgetNodeTypeCol: WidgetNodeType;
1819
+ /**
1820
+ * Data-bound node types (read from ToolInvocation.Data via DataKey)
1821
+ */
1822
+ export declare const WidgetNodeTypePlanList: WidgetNodeType;
1823
+ export declare const WidgetNodeTypeKeyValue: WidgetNodeType;
1824
+ export declare const WidgetNodeTypeStatusBadge: WidgetNodeType;
3812
1825
  /**
3813
1826
  * WidgetNode represents a UI element in a widget (text, input, select, etc.)
3814
1827
  */
@@ -3827,6 +1840,11 @@ export interface WidgetNode {
3827
1840
  defaultChecked?: boolean;
3828
1841
  children?: WidgetNode[];
3829
1842
  gap?: number;
1843
+ /**
1844
+ * Data binding - for data-bound node types, specifies which key in ToolInvocation.Data to read
1845
+ * Empty string means read entire Data object (useful for key-value display)
1846
+ */
1847
+ dataKey?: string;
3830
1848
  }
3831
1849
  /**
3832
1850
  * WidgetSelectOption represents an option in a select widget
@@ -3836,7 +1854,9 @@ export interface WidgetSelectOption {
3836
1854
  value: string;
3837
1855
  }
3838
1856
  /**
3839
- * Widget represents an interactive card widget
1857
+ * Widget represents an interactive widget for display in chat
1858
+ * Type is either "ui" (structured nodes) or "html" (raw HTML)
1859
+ * For "ui" widgets, data-bound nodes read values from ToolInvocation.Data
3840
1860
  */
3841
1861
  export interface Widget {
3842
1862
  type: string;
@@ -3853,95 +1873,3 @@ export interface Widget {
3853
1873
  export type WidgetFormData = {
3854
1874
  [key: string]: any;
3855
1875
  };
3856
- /**
3857
- * WidgetActionResult represents the result of a widget action submission
3858
- */
3859
- export interface WidgetActionResult {
3860
- action: WidgetAction;
3861
- form_data?: WidgetFormData;
3862
- }
3863
- /**
3864
- * WebSocket message types
3865
- */
3866
- export declare const WSEventTaskStatus = "task_status";
3867
- /**
3868
- * Task WebSocket
3869
- */
3870
- export declare const WSEventTaskLog = "task_log";
3871
- /**
3872
- * Task WebSocket
3873
- */
3874
- export declare const WSEventTaskProgress = "task_progress";
3875
- /**
3876
- * Task WebSocket
3877
- */
3878
- export declare const WSEventTaskOutput = "task_output";
3879
- /**
3880
- * Task WebSocket
3881
- */
3882
- export declare const WSEventTaskFailed = "task_failed";
3883
- export interface WsTaskStatusPayload {
3884
- task_id: string;
3885
- time: string;
3886
- status: TaskStatus;
3887
- }
3888
- export interface WsTaskLogPayload {
3889
- task_id: string;
3890
- log_type: TaskLogType;
3891
- logs: string;
3892
- }
3893
- export interface WsTaskOutputPayload {
3894
- task_id: string;
3895
- output: string;
3896
- }
3897
- export interface WsTaskFailedPayload {
3898
- task_id: string;
3899
- error: string;
3900
- }
3901
- export declare const WSEventTaskRun = "task_run";
3902
- export declare const WSEventTaskCancel = "task_cancel";
3903
- export declare const WSEventTaskForceCancel = "task_force_cancel";
3904
- export declare const WSEventEngineStop = "engine_stop";
3905
- export declare const WSEventEngineDeleteHFCacheRepo = "engine_delete_hfcache_repo";
3906
- export interface WsTaskRunPayload {
3907
- task: TaskDTO;
3908
- secrets: string;
3909
- }
3910
- export interface WsTaskCancelPayload {
3911
- task: TaskDTO;
3912
- }
3913
- export interface WsTaskForceCancelPayload {
3914
- task: TaskDTO;
3915
- }
3916
- /**
3917
- * Engine WebSocket
3918
- */
3919
- export declare const WSEventEngineHeartbeat = "engine_heartbeat";
3920
- /**
3921
- * Engine WebSocket
3922
- */
3923
- export declare const WSEventEngineTelemetry = "engine_telemetry";
3924
- export type WorkerStatusMap = {
3925
- [key: string]: WorkerStatus;
3926
- };
3927
- export interface WsEngineHeartbeatPayload {
3928
- engine_id: string;
3929
- engine_status: EngineStatus;
3930
- worker_statuses: WorkerStatusMap;
3931
- }
3932
- export interface WsEngineTelemetryPayload {
3933
- engine_id: string;
3934
- engine_state: EngineState;
3935
- }
3936
- export interface WsEngineDeleteHFCacheRepoPayload {
3937
- repo_id: string;
3938
- }
3939
- /**
3940
- * Worker WebSocket
3941
- */
3942
- export declare const WSEventWorkerUpdate = "worker_update";
3943
- export interface WsWorkerUpdatePayload {
3944
- engine_id: string;
3945
- worker_id: string;
3946
- worker_state: WorkerState;
3947
- }