@inferencesh/sdk 0.6.3 → 0.6.5

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
@@ -10,118 +10,102 @@ export interface InternalToolsConfig {
10
10
  host_context?: boolean;
11
11
  }
12
12
  /**
13
- * ToolType represents the type of tool (used in both AgentTool definition and ToolInvocation)
13
+ * AgentTool represents a unified tool that can be used by an agent
14
14
  */
15
- export type ToolType = string;
16
- export declare const ToolTypeApp: ToolType;
17
- export declare const ToolTypeAgent: ToolType;
18
- export declare const ToolTypeHook: ToolType;
19
- export declare const ToolTypeHTTP: ToolType;
20
- export declare const ToolTypeCall: ToolType;
21
- export declare const ToolTypeMCP: ToolType;
22
- export declare const ToolTypeClient: ToolType;
23
- export declare const ToolTypeInternal: ToolType;
15
+ export interface AgentTool {
16
+ name: string;
17
+ display_name?: string;
18
+ description: string;
19
+ type: ToolType;
20
+ require_approval?: boolean;
21
+ app?: AppToolConfig;
22
+ agent?: AgentToolConfig;
23
+ hook?: HookToolConfig;
24
+ http?: HTTPToolConfig;
25
+ call?: HTTPToolConfig;
26
+ mcp?: MCPToolConfig;
27
+ client?: ClientToolConfig;
28
+ internal?: InternalToolConfig;
29
+ }
30
+ /**
31
+ * InternalToolConfig contains configuration for internal/built-in tools
32
+ */
33
+ export interface InternalToolConfig {
34
+ category: string;
35
+ operation: string;
36
+ }
24
37
  /**
25
- * AppToolConfig contains configuration for an app tool
38
+ * SkillConfig defines a skill available to the agent.
39
+ */
40
+ export interface SkillConfig {
41
+ name: string;
42
+ description: string;
43
+ skill_id?: string;
44
+ version_id?: string;
45
+ url?: string;
46
+ content?: string;
47
+ preload?: boolean;
48
+ }
49
+ /**
50
+ * ContextField declares a context parameter expected by the agent.
51
+ */
52
+ export interface ContextField {
53
+ name: string;
54
+ description?: string;
55
+ required?: boolean;
56
+ default?: string;
57
+ }
58
+ /**
59
+ * AgentToolDTO for API responses
26
60
  */
61
+ export interface AgentToolDTO {
62
+ name: string;
63
+ display_name?: string;
64
+ description: string;
65
+ type: ToolType;
66
+ require_approval?: boolean;
67
+ app?: AppToolConfigDTO;
68
+ agent?: AgentToolConfigDTO;
69
+ hook?: HookToolConfigDTO;
70
+ http?: HTTPToolConfigDTO;
71
+ call?: HTTPToolConfigDTO;
72
+ mcp?: MCPToolConfigDTO;
73
+ client?: ClientToolConfigDTO;
74
+ }
27
75
  export interface AppToolConfig {
28
- /**
29
- * Ref is the human-readable reference: "namespace/name@shortVersionId"
30
- * This is what users specify in configs/SDKs
31
- */
32
76
  ref: string;
33
- /**
34
- * ID and VersionID are resolved full database UUIDs (populated at runtime)
35
- */
36
77
  id?: string;
37
78
  version_id?: string;
38
- /**
39
- * Resolved app object (populated at runtime)
40
- */
41
- app?: App;
42
- /**
43
- * Function to call on multi-function apps (empty = app's default function)
44
- */
45
79
  function?: string;
46
- /**
47
- * SessionEnabled allows the agent to control sessions for this tool
48
- * When true, agent can pass session parameter and sees session_id in output
49
- */
50
80
  session_enabled?: boolean;
51
- /**
52
- * Pre-configured values
53
- */
54
81
  setup?: any;
55
82
  input?: any;
56
83
  }
57
- /**
58
- * AgentToolConfig contains configuration for a sub-agent tool
59
- */
60
84
  export interface AgentToolConfig {
61
- /**
62
- * Ref is the human-readable reference: "namespace/name@shortVersionId"
63
- * This is what users specify in configs/SDKs
64
- */
65
85
  ref: string;
66
- /**
67
- * ID and VersionID are resolved full database UUIDs (populated at runtime)
68
- */
69
86
  id?: string;
70
87
  version_id?: string;
71
- /**
72
- * Resolved agent object (populated at runtime)
73
- */
74
- agent?: Agent;
75
88
  }
76
- /**
77
- * HookToolConfig contains configuration for a webhook tool
78
- */
79
89
  export interface HookToolConfig {
80
90
  url: string;
81
91
  secret?: string;
82
92
  input_schema?: any;
83
93
  output_schema?: any;
84
94
  }
85
- /**
86
- * ClientToolConfig contains configuration for a frontend-executed tool
87
- */
88
95
  export interface ClientToolConfig {
89
96
  input_schema?: any;
90
97
  output_schema?: any;
91
98
  }
92
99
  /**
93
- * ToolAuthConfig declares how a tool authenticates. Resolved at runtime — never contains actual credentials.
100
+ * ToolAuthConfig declares how a tool authenticates.
94
101
  */
95
102
  export interface ToolAuthConfig {
96
- /**
97
- * Type: "integration", "api_key", "bearer", "none"
98
- */
99
103
  type: string;
100
- /**
101
- * For type=integration: which provider to look up (e.g. "google", "mcp", "slack")
102
- */
103
104
  provider?: string;
104
- /**
105
- * For type=integration: specific integration ID (optional — if empty, uses team's primary for provider)
106
- */
107
105
  integration_id?: string;
108
- /**
109
- * For type=api_key or bearer: name of the secret in the team's secret store
110
- */
111
106
  secret?: string;
112
- /**
113
- * For type=api_key: which header to inject (default: "X-API-Key")
114
- */
115
107
  header?: string;
116
108
  }
117
- /**
118
- * CallToolConfig is the preferred name for HTTPToolConfig.
119
- * "call" is the user-facing type; "http" is kept for backward compatibility.
120
- */
121
- export type CallToolConfig = HTTPToolConfig;
122
- /**
123
- * HTTPToolConfig contains configuration for an authenticated HTTP tool
124
- */
125
109
  export interface HTTPToolConfig {
126
110
  url: string;
127
111
  method?: string;
@@ -132,86 +116,17 @@ export interface HTTPToolConfig {
132
116
  input_schema?: any;
133
117
  output_schema?: any;
134
118
  }
135
- /**
136
- * MCPToolConfig contains configuration for a remote MCP server tool
137
- */
138
119
  export interface MCPToolConfig {
139
- /**
140
- * IntegrationID references the MCP integration (has server_url, tokens, cached tools)
141
- */
142
120
  integration_id: string;
143
- /**
144
- * ToolName is the tool name on the remote MCP server
145
- */
146
121
  tool_name: string;
147
122
  }
148
- /**
149
- * AgentTool represents a unified tool that can be used by an agent
150
- */
151
- export interface AgentTool {
152
- name: string;
153
- display_name?: string;
154
- description: string;
155
- type: ToolType;
156
- /**
157
- * Human-in-the-Loop: if true, tool execution requires user approval
158
- */
159
- require_approval?: boolean;
160
- /**
161
- * Type-specific config (exactly one should be set based on Type)
162
- */
163
- app?: AppToolConfig;
164
- agent?: AgentToolConfig;
165
- hook?: HookToolConfig;
166
- http?: HTTPToolConfig;
167
- call?: CallToolConfig;
168
- mcp?: MCPToolConfig;
169
- client?: ClientToolConfig;
170
- internal?: InternalToolConfig;
171
- }
172
- /**
173
- * InternalToolConfig contains configuration for internal/built-in tools
174
- */
175
- export interface InternalToolConfig {
176
- category: string;
177
- operation: string;
178
- }
179
- /**
180
- * AgentToolDTO for API responses
181
- */
182
- export interface AgentToolDTO {
183
- name: string;
184
- display_name?: string;
185
- description: string;
186
- type: ToolType;
187
- /**
188
- * Human-in-the-Loop: if true, tool execution requires user approval
189
- */
190
- require_approval?: boolean;
191
- app?: AppToolConfigDTO;
192
- agent?: AgentToolConfigDTO;
193
- hook?: HookToolConfigDTO;
194
- http?: HTTPToolConfigDTO;
195
- call?: HTTPToolConfigDTO;
196
- mcp?: MCPToolConfigDTO;
197
- client?: ClientToolConfigDTO;
198
- }
199
123
  export interface AppToolConfigDTO {
200
124
  ref: string;
201
125
  id?: string;
202
126
  version_id?: string;
203
127
  app?: AppDTO;
204
- /**
205
- * Function to call on multi-function apps
206
- */
207
128
  function?: string;
208
- /**
209
- * SessionEnabled allows the agent to control sessions for this tool
210
- */
211
129
  session_enabled?: boolean;
212
- /**
213
- * Pre-configured values
214
- */
215
130
  setup?: any;
216
131
  input?: any;
217
132
  }
@@ -246,45 +161,23 @@ export interface MCPToolConfigDTO {
246
161
  tool_name: string;
247
162
  }
248
163
  /**
249
- * CoreAppConfig references an app used as the agent's core
250
- */
251
- export interface CoreAppConfig {
252
- id?: string;
253
- version_id?: string;
254
- /**
255
- * CoreAppRef is the user-facing ref (namespace/name@shortid) - used in ad-hoc configs, resolved at creation
256
- */
257
- ref?: string;
258
- /**
259
- * Setup values for the core app (one-time configuration)
260
- */
261
- setup?: any;
262
- /**
263
- * Input default values for the core app
264
- */
265
- input?: any;
266
- }
267
- /**
268
- * AgentImages contains display images for an agent (like AppImages)
164
+ * AgentImages contains display images for an agent
269
165
  */
270
166
  export interface AgentImages {
271
167
  card: string;
272
168
  thumbnail: string;
273
169
  banner: string;
274
170
  }
275
- export interface Agent extends BaseModel, PermissionModel {
276
- ProjectModel: ProjectModel;
277
- /**
278
- * Basic info
279
- */
280
- namespace: string;
281
- name: string;
282
- /**
283
- * Display images (like App)
284
- */
285
- images: AgentImages;
286
- version_id: string;
287
- version?: AgentVersion;
171
+ /**
172
+ * CoreAppConfigDTO references an app used as the agent's core
173
+ */
174
+ export interface CoreAppConfigDTO {
175
+ id?: string;
176
+ version_id?: string;
177
+ ref?: string;
178
+ app?: AppDTO;
179
+ setup?: any;
180
+ input?: any;
288
181
  }
289
182
  /**
290
183
  * AgentDTO for API responses
@@ -292,130 +185,66 @@ export interface Agent extends BaseModel, PermissionModel {
292
185
  export interface AgentDTO extends BaseModelDTO, PermissionModelDTO, ProjectModelDTO {
293
186
  namespace: string;
294
187
  name: string;
295
- /**
296
- * Display images (like AppDTO)
297
- */
298
188
  images: AgentImages;
299
189
  version_id: string;
300
190
  version?: AgentVersionDTO;
301
191
  }
302
- /**
303
- * SkillConfig defines a skill available to the agent.
304
- * Skills are loaded on-demand via the skill_get internal tool.
305
- */
306
- export interface SkillConfig {
307
- name: string;
192
+ export interface AgentVersionDTO extends BaseModelDTO, PermissionModelDTO {
308
193
  description: string;
309
- skill_id?: string;
310
- version_id?: string;
311
- url?: string;
312
- content?: string;
313
- preload?: boolean;
194
+ system_prompt: string;
195
+ example_prompts: string[];
196
+ core_app?: CoreAppConfigDTO;
197
+ tools: (AgentToolDTO | undefined)[];
198
+ skills: SkillConfig[];
199
+ context?: ContextField[];
200
+ internal_tools?: InternalToolsConfig;
201
+ output_schema?: any;
314
202
  }
315
203
  /**
316
- * ContextField declares a context parameter expected by the agent.
317
- * Context is caller-provided at chat creation, stored on Chat, and available in tool URL templates.
204
+ * CreateAgentRequest is the request body for POST /agents
205
+ * For new agents: omit ID, backend generates it
206
+ * For new version of existing agent: include ID
318
207
  */
319
- export interface ContextField {
208
+ export interface CreateAgentRequest {
209
+ id?: string;
320
210
  name: string;
321
- description?: string;
322
- required?: boolean;
323
- default?: string;
211
+ namespace?: string;
212
+ images?: AgentImages;
213
+ /**
214
+ * Version config (embedded - backend generates version ID, timestamps, etc)
215
+ */
216
+ version?: AgentConfigInput;
324
217
  }
325
218
  /**
326
- * AgentConfig contains the shared configuration fields for agent execution.
327
- * This is embedded by both AgentVersion (DB model) and API request structs.
328
- * Using Go embedding flattens these fields in JSON serialization.
219
+ * AgentConfigInput is the API input shape for agent version config.
220
+ * Mirrors AgentConfig's JSON contract without gorm tags or runtime pointers.
329
221
  */
330
- export interface AgentConfig {
331
- /**
332
- * Optional name for the agent (used for adhoc agent deduplication — reuses existing agent by name).
333
- * Not persisted as a DB column; only used in API requests.
334
- */
222
+ export interface AgentConfigInput {
335
223
  name?: string;
336
224
  description?: string;
337
225
  system_prompt?: string;
338
226
  example_prompts?: string[];
339
- /**
340
- * Core LLM configuration
341
- */
342
- core_app?: CoreAppConfig;
343
- /**
344
- * Tools (apps, agents, hooks, client tools)
345
- */
227
+ core_app?: CoreAppConfigInput;
346
228
  tools?: (AgentTool | undefined)[];
347
- /**
348
- * Skills available to this agent (loaded on-demand via skill_get tool)
349
- */
350
229
  skills?: SkillConfig[];
351
- /**
352
- * Context declares expected context parameters (resolved in tool URL templates via {{context.X}})
353
- */
354
230
  context?: ContextField[];
355
- /**
356
- * Internal tools configuration (plan, memory, widget, finish, skills)
357
- */
358
231
  internal_tools?: InternalToolsConfig;
359
- /**
360
- * Output schema for custom finish tool (sub-agents only)
361
- */
362
232
  output_schema?: any;
363
233
  }
364
- export interface AgentVersion extends BaseModel, PermissionModel {
365
- agent_id: string;
366
- /**
367
- * ConfigHash for deduplication - SHA256 of config content
368
- */
369
- config_hash: string;
370
- }
371
- export interface CoreAppConfigDTO {
234
+ /**
235
+ * CoreAppConfigInput is the API input shape for core app configuration.
236
+ */
237
+ export interface CoreAppConfigInput {
372
238
  id?: string;
373
239
  version_id?: string;
374
240
  ref?: string;
375
- app?: AppDTO;
376
- /**
377
- * Setup values for the core app (one-time configuration)
378
- */
379
241
  setup?: any;
380
- /**
381
- * Input default values for the core app
382
- */
383
242
  input?: any;
384
243
  }
385
- export interface AgentVersionDTO extends BaseModelDTO, PermissionModelDTO {
386
- description: string;
387
- system_prompt: string;
388
- example_prompts: string[];
389
- core_app?: CoreAppConfigDTO;
390
- /**
391
- * Unified tools array (apps, agents, hooks, client)
392
- */
393
- tools: (AgentToolDTO | undefined)[];
394
- /**
395
- * Skills available to this agent (loaded on-demand via skill_get tool)
396
- */
397
- skills: SkillConfig[];
398
- /**
399
- * Context declarations
400
- */
401
- context?: ContextField[];
402
- /**
403
- * Internal tools configuration (plan, memory, widget, finish, skills)
404
- */
405
- internal_tools?: InternalToolsConfig;
406
- /**
407
- * Output schema for custom finish tool (sub-agents only)
408
- */
409
- output_schema?: any;
410
- }
411
- export interface APIRequest<T extends any> {
412
- timestamp: string;
413
- data: T;
414
- }
415
244
  export interface APIResponse<T extends any> {
416
245
  success: boolean;
417
246
  status: number;
418
- data?: T;
247
+ data: T;
419
248
  error?: APIError;
420
249
  }
421
250
  export interface APIError {
@@ -428,20 +257,9 @@ export interface APIError {
428
257
  }
429
258
  /**
430
259
  * ApiAppRunRequest is the request body for /apps/run endpoint.
431
- * Supports two ways to specify the app:
432
- * 1. App ref (recommended): "namespace/name@shortid" in the App field
433
- * 2. Direct IDs: app_id + version_id fields (for internal platform use)
434
260
  */
435
261
  export interface ApiAppRunRequest {
436
- /**
437
- * App reference in format: namespace/name@shortid (version required)
438
- * Example: "okaris/flux@abc1"
439
- * The short ID ensures your code always runs the same version.
440
- */
441
262
  app?: string;
442
- /**
443
- * Deprecated: use App ref instead. Direct ID bypasses ref routing.
444
- */
445
263
  app_id?: string;
446
264
  version_id?: string;
447
265
  infra?: Infra;
@@ -449,165 +267,37 @@ export interface ApiAppRunRequest {
449
267
  webhook?: string;
450
268
  setup?: any;
451
269
  input: any;
452
- /**
453
- * If true, returns SSE stream instead of JSON response
454
- */
455
270
  stream?: boolean;
456
- /**
457
- * If true, holds the connection open until the task reaches a terminal state and returns the final result.
458
- * Mutually exclusive with Stream.
459
- */
460
271
  wait?: boolean;
461
- /**
462
- * Function to call on multi-function apps (defaults to "run" or app's default_function)
463
- */
464
272
  function?: string;
465
- /**
466
- * Session control: "new" to start a new session, "sess_xxx" to continue existing session
467
- * When using sessions, the worker is leased and state persists across calls
468
- */
469
273
  session?: string;
470
- /**
471
- * Session timeout in seconds (1-3600). Only valid when session="new"
472
- */
473
274
  session_timeout?: number;
474
- /**
475
- * Schedule execution for a specific time (ISO 8601 UTC, e.g. "2026-02-24T15:30:00Z").
476
- * Task stays queued until this time. Past timestamps run immediately.
477
- */
478
275
  run_at?: string;
479
- /**
480
- * Optional metadata (e.g., action to trigger on completion)
481
- */
482
276
  metadata?: TaskMetadata;
483
277
  }
484
278
  /**
485
279
  * ApiAgentRunRequest is the request body for /agents/run endpoint.
486
- * Supports both template agents and ad-hoc agents.
487
280
  */
488
281
  export interface ApiAgentRunRequest {
489
- /**
490
- * Existing chat ID to continue a conversation (optional)
491
- */
492
282
  chat_id?: string;
493
- /**
494
- * Template agent reference in format: namespace/name@shortid
495
- * Example: "my-org/assistant@abc123"
496
- * Use this OR AgentConfig, not both
497
- */
498
283
  agent?: string;
499
- /**
500
- * Ad-hoc agent configuration
501
- * For ad-hoc agents, set core_app.ref to the LLM app reference
502
- * Example: { "core_app": { "ref": "infsh/claude-sonnet-4@abc123" }, "system_prompt": "..." }
503
- */
504
- agent_config?: AgentConfig;
505
- /**
506
- * Optional name for the adhoc agent (used for deduplication and display)
507
- */
284
+ agent_config?: AgentConfigInput;
508
285
  agent_name?: string;
509
- /**
510
- * The message to send
511
- */
512
286
  input: ChatTaskInput;
513
- /**
514
- * Context values for this chat session (used in tool URL templates)
515
- */
516
287
  context?: {
517
288
  [key: string]: string;
518
289
  };
519
- /**
520
- * If true, returns SSE stream instead of JSON response
521
- */
522
- stream?: boolean;
523
- }
524
- /**
525
- * EmbedAgentRunRequest is the embed variant of ApiAgentRunRequest.
526
- * Only template agents are supported (no ad-hoc configs).
527
- */
528
- export interface EmbedAgentRunRequest {
529
- chat_id?: string;
530
- agent: string;
531
- input: ChatTaskInput;
532
290
  stream?: boolean;
533
291
  }
534
- export interface CreateAgentMessageRequest {
535
- chat_id?: string;
536
- agent_id?: string;
537
- agent_version_id?: string;
538
- agent?: string;
539
- tool_call_id?: string;
540
- input: ChatTaskInput;
541
- integration_context?: IntegrationContext;
542
- /**
543
- * Ad-hoc agent config - use this instead of Agent for embedded configs
544
- * If provided, creates a chat with this config directly (no agent reference)
545
- */
546
- agent_config?: AgentConfig;
547
- /**
548
- * Optional name for the adhoc agent (used for deduplication and display)
549
- */
550
- agent_name?: string;
551
- /**
552
- * Context values for this chat session (used in tool URL templates)
553
- */
554
- context?: {
555
- [key: string]: string;
556
- };
557
- }
558
- export interface CreateAgentMessageResponse {
559
- user_message?: ChatMessageDTO;
560
- assistant_message?: ChatMessageDTO;
561
- }
562
292
  /**
563
293
  * ToolResultRequest represents a tool result submission
564
- * For widget actions, clients should JSON-serialize { action, form_data } as the result string
565
294
  */
566
295
  export interface ToolResultRequest {
567
296
  result: string;
568
297
  }
569
298
  /**
570
- * WebhookPayload is the envelope for outbound webhook deliveries (e.g., task webhooks).
571
- */
572
- export interface WebhookPayload<T extends any> {
573
- event: string;
574
- timestamp: string;
575
- data: T;
576
- }
577
- /**
578
- * HookPayload represents the request body sent to a webhook when a hook tool is invoked
579
- */
580
- export interface HookPayload {
581
- /**
582
- * Identification
583
- */
584
- tool_invocation_id: string;
585
- hook_name: string;
586
- /**
587
- * Callback - use this to submit the result back
588
- */
589
- callback_url: string;
590
- callback_method: string;
591
- /**
592
- * Timestamp in RFC3339 format
593
- */
594
- timestamp: string;
595
- /**
596
- * The actual tool arguments from the LLM
597
- */
598
- arguments: {
599
- [key: string]: any;
600
- };
601
- }
602
- /**
603
- * HookResponse represents the expected response from the hook URL
604
- * The hook should return 200 with success:true to acknowledge receipt
605
- * The actual result should be sent via the callback URL
299
+ * PartialFile is the clean DTO version (no gorm tags).
606
300
  */
607
- export interface HookResponse {
608
- success: boolean;
609
- message?: string;
610
- }
611
301
  export interface PartialFile {
612
302
  uri: string;
613
303
  path?: string;
@@ -615,67 +305,6 @@ export interface PartialFile {
615
305
  size?: number;
616
306
  filename?: string;
617
307
  }
618
- export interface FileCreateRequest {
619
- /**
620
- * Category determines the storage path prefix: "uploads" (default), "inputs", "outputs", "repos"
621
- */
622
- category?: string;
623
- files: PartialFile[];
624
- }
625
- export interface CreateFlowRequest {
626
- name: string;
627
- }
628
- export interface CreateFlowRunRequest {
629
- flow: string;
630
- input: any;
631
- }
632
- /**
633
- * CreateAppRequest is the request body for POST /apps
634
- */
635
- export interface CreateAppRequest {
636
- id?: string;
637
- namespace?: string;
638
- name: string;
639
- description?: string;
640
- agent_description?: string;
641
- category?: AppCategory;
642
- images?: AppImages;
643
- version?: AppVersion;
644
- /**
645
- * PreserveCurrentVersion prevents auto-promoting the new version to current.
646
- * Default false = new versions become current (what most users expect).
647
- * Set true for admin deployments where you want to test before promoting.
648
- */
649
- preserve_current_version?: boolean;
650
- }
651
- /**
652
- * CreateAgentRequest is the request body for POST /agents
653
- * For new agents: omit ID, backend generates it
654
- * For new version of existing agent: include ID
655
- */
656
- export interface CreateAgentRequest {
657
- /**
658
- * Existing agent ID (if updating/versioning)
659
- */
660
- id?: string;
661
- /**
662
- * Agent metadata
663
- */
664
- name: string;
665
- namespace?: string;
666
- images?: AgentImages;
667
- /**
668
- * Version config (embedded - backend generates version ID, timestamps, etc)
669
- */
670
- version?: AgentConfig;
671
- }
672
- /**
673
- * SDKTypes is a phantom struct that references types needed by the SDK.
674
- * This ensures the typegen traces these types without creating aliases.
675
- * Frontend uses generics like CursorListResponse<FlowDTO> directly.
676
- */
677
- export interface SDKTypes {
678
- }
679
308
  export interface SkillPublishRequest {
680
309
  namespace?: string;
681
310
  name: string;
@@ -686,40 +315,18 @@ export interface SkillPublishRequest {
686
315
  allowed_tools: string;
687
316
  compatibility: string;
688
317
  instructions: string;
689
- files: SkillFile[];
318
+ files: KnowledgeFile[];
690
319
  metadata?: {
691
320
  [key: string]: string;
692
321
  };
693
- /**
694
- * Lineage — backend infers MutationType from context
695
- */
696
322
  parent_skill_id?: string;
697
323
  parent_version_id?: string;
698
324
  source_url?: string;
699
325
  version_notes?: string;
700
- /**
701
- * Spec fields for roundtrip fidelity
702
- */
703
326
  disable_model_invocation: boolean;
704
327
  user_invocable?: boolean;
705
328
  context: string;
706
329
  }
707
- export interface CheckoutCreateRequest {
708
- amount: number;
709
- success_url: string;
710
- cancel_url: string;
711
- }
712
- export interface CheckoutCompleteRequest {
713
- session_id: string;
714
- }
715
- /**
716
- * Legacy aliases for backward compatibility
717
- */
718
- export type StripeCheckoutCreateRequest = CheckoutCreateRequest;
719
- export type StripeCheckoutCompleteRequest = CheckoutCompleteRequest;
720
- /**
721
- * AuthResponse is returned after successful authentication (OAuth, magic link, SSO)
722
- */
723
330
  export interface AuthResponse {
724
331
  user?: UserDTO;
725
332
  session_id: string;
@@ -727,65 +334,11 @@ export interface AuthResponse {
727
334
  redirect_to?: string;
728
335
  provider?: string;
729
336
  }
730
- /**
731
- * DeviceAuthResponse is returned when a device initiates auth
732
- */
733
- export interface DeviceAuthResponse {
734
- user_code: string;
735
- device_code: string;
736
- poll_url: string;
737
- approve_url: string;
738
- expires_in: number;
739
- interval: number;
740
- }
741
- /**
742
- * DeviceAuthPollResponse is returned when polling for auth status
743
- */
744
- export interface DeviceAuthPollResponse {
745
- status: DeviceAuthStatus;
746
- api_key?: string;
747
- team_id?: string;
748
- }
749
- /**
750
- * DeviceAuthApproveRequest is sent when user approves the auth request
751
- */
752
- export interface DeviceAuthApproveRequest {
753
- code: string;
754
- team_id: string;
755
- scopes?: string[];
756
- }
757
- /**
758
- * DeviceAuthApproveResponse is returned after approval
759
- */
760
- export interface DeviceAuthApproveResponse {
761
- success: boolean;
762
- message?: string;
763
- }
764
- /**
765
- * DeviceAuthCodeInfo contains info about a pending auth code (for display on approve page)
766
- */
767
- export interface DeviceAuthCodeInfo {
768
- user_code: string;
769
- expires_at: string;
770
- valid: boolean;
771
- status: DeviceAuthStatus;
772
- }
773
- /**
774
- * MeResponse is returned from GET /me with user and current team info
775
- */
776
- export interface MeResponse {
777
- user?: UserDTO;
778
- team?: TeamDTO;
779
- }
780
337
  export interface TeamCreateRequest {
781
338
  name: string;
782
339
  username: string;
783
340
  email: string;
784
341
  }
785
- /**
786
- * TeamSetupRequest is used for completing team setup (choosing username)
787
- * This marks the team as setup_completed=true after validation
788
- */
789
342
  export interface TeamSetupRequest {
790
343
  username: string;
791
344
  }
@@ -796,135 +349,256 @@ export interface TeamMemberAddRequest {
796
349
  export interface TeamMemberUpdateRoleRequest {
797
350
  role: TeamRole;
798
351
  }
799
- /**
800
- * SecretCreateRequest for creating a new secret
801
- */
802
- export interface SecretCreateRequest {
803
- key: string;
804
- value: string;
805
- description?: string;
806
- }
807
- /**
808
- * SecretUpdateRequest for updating a secret value
809
- */
810
- export interface SecretUpdateRequest {
811
- value: string;
812
- description?: string;
813
- }
814
- /**
815
- * IntegrationConnectRequest for initiating an integration connection
816
- */
817
- export interface IntegrationConnectRequest {
818
- provider: string;
819
- type: string;
820
- scopes?: string[];
821
- /**
822
- * For API Key type
823
- */
824
- api_key?: string;
825
- /**
826
- * For BYOK integrations (e.g., X.com) - contains user-provided credentials
827
- */
828
- metadata?: {
829
- [key: string]: any;
830
- };
831
- }
832
- /**
833
- * IntegrationCompleteOAuthRequest for completing an OAuth flow
834
- */
835
352
  export interface IntegrationCompleteOAuthRequest {
836
353
  provider: string;
837
354
  type: string;
838
355
  code: string;
839
356
  state: string;
840
- /**
841
- * For PKCE - code_verifier to complete the exchange (required by some providers like X/Twitter)
842
- */
843
357
  code_verifier?: string;
844
358
  }
845
359
  /**
846
- * IntegrationConnectResponse after connecting
360
+ * Scope represents an API key permission scope string.
847
361
  */
848
- export interface IntegrationConnectResponse {
849
- integration?: IntegrationDTO;
850
- /**
851
- * For OAuth - redirect URL to start the flow
852
- */
853
- auth_url?: string;
854
- /**
855
- * For OAuth - state to be returned with the callback (frontend stores this)
856
- */
857
- state?: string;
858
- /**
859
- * For PKCE - code_verifier to be stored and sent back with CompleteOAuth (required by some providers like X/Twitter)
860
- */
861
- code_verifier?: string;
862
- /**
863
- * For service accounts - instructions
864
- */
865
- instructions?: string;
866
- /**
867
- * RequiresConfirmation — the connect was paused, user must acknowledge and retry with a flag.
868
- */
869
- requires_confirmation?: boolean;
870
- confirmation_type?: string;
871
- message?: string;
872
- }
873
- export interface ProjectCreateRequest {
874
- name: string;
875
- type: ProjectType;
876
- }
877
- export interface ProjectUpdateRequest {
878
- name: string;
879
- }
880
- export interface MoveAgentToProjectRequest {
881
- agent_id: string;
882
- project_id: string;
883
- }
362
+ export type Scope = string;
884
363
  /**
885
- * WorkerGPUConfig holds GPU identifiers for a worker.
886
- * GPUs accepts both integer indexes (legacy) and string GPU IDs.
887
- * Use GPUIndexes() and GPUIDs() to separate them after unmarshaling.
364
+ * API Key Scopes - hierarchical permission system.
365
+ * Resource-level scopes (e.g., "agents") imply all action-level scopes (e.g., "agents:read").
366
+ * Empty scopes = full access (for backwards compatibility with existing keys).
888
367
  */
889
- export interface WorkerGPUConfig {
890
- gpus: any[];
891
- }
892
- export interface WorkerCPUConfig {
893
- count: number;
894
- }
895
- export interface WorkerConfig {
896
- gpu: WorkerGPUConfig[];
897
- cpu: WorkerCPUConfig;
898
- }
899
- export interface EngineConfig {
900
- id: string;
901
- name: string;
902
- api_url: string;
903
- engine_port: string;
904
- workers: WorkerConfig;
905
- api_key: string;
906
- container_mode: boolean;
907
- network_name: string;
908
- cache_path: string;
909
- gpus: string[];
910
- /**
911
- * CallbackBasePort overrides the base port for engine↔worker callback APIs.
912
- * If 0, derived from EnginePort: 5000 + (enginePort - 8163) * 100.
913
- */
914
- callback_base_port: number;
915
- /**
916
- * EngineInternalAPIURL is the URL workers use to reach the engine's main API.
917
- * If empty, derived as http://host.docker.internal:{EnginePort}.
918
- */
919
- engine_internal_api_url: string;
920
- }
368
+ export declare const ScopeAll: Scope;
921
369
  /**
922
- * ScopeGroup identifies a category of scopes for UI grouping
370
+ * Resource-level scopes (implies all actions)
923
371
  */
924
- export type ScopeGroup = string;
925
- export declare const ScopeGroupAgents: ScopeGroup;
926
- export declare const ScopeGroupApps: ScopeGroup;
927
- export declare const ScopeGroupConversations: ScopeGroup;
372
+ export declare const ScopeAgents: Scope;
373
+ /**
374
+ * API Key Scopes - hierarchical permission system.
375
+ * Resource-level scopes (e.g., "agents") imply all action-level scopes (e.g., "agents:read").
376
+ * Empty scopes = full access (for backwards compatibility with existing keys).
377
+ */
378
+ export declare const ScopeApps: Scope;
379
+ /**
380
+ * API Key Scopes - hierarchical permission system.
381
+ * Resource-level scopes (e.g., "agents") imply all action-level scopes (e.g., "agents:read").
382
+ * Empty scopes = full access (for backwards compatibility with existing keys).
383
+ */
384
+ export declare const ScopeConversations: Scope;
385
+ /**
386
+ * API Key Scopes - hierarchical permission system.
387
+ * Resource-level scopes (e.g., "agents") imply all action-level scopes (e.g., "agents:read").
388
+ * Empty scopes = full access (for backwards compatibility with existing keys).
389
+ */
390
+ export declare const ScopeFiles: Scope;
391
+ /**
392
+ * API Key Scopes - hierarchical permission system.
393
+ * Resource-level scopes (e.g., "agents") imply all action-level scopes (e.g., "agents:read").
394
+ * Empty scopes = full access (for backwards compatibility with existing keys).
395
+ */
396
+ export declare const ScopeDatastores: Scope;
397
+ /**
398
+ * API Key Scopes - hierarchical permission system.
399
+ * Resource-level scopes (e.g., "agents") imply all action-level scopes (e.g., "agents:read").
400
+ * Empty scopes = full access (for backwards compatibility with existing keys).
401
+ */
402
+ export declare const ScopeTemplates: Scope;
403
+ /**
404
+ * API Key Scopes - hierarchical permission system.
405
+ * Resource-level scopes (e.g., "agents") imply all action-level scopes (e.g., "agents:read").
406
+ * Empty scopes = full access (for backwards compatibility with existing keys).
407
+ */
408
+ export declare const ScopeFlows: Scope;
409
+ /**
410
+ * API Key Scopes - hierarchical permission system.
411
+ * Resource-level scopes (e.g., "agents") imply all action-level scopes (e.g., "agents:read").
412
+ * Empty scopes = full access (for backwards compatibility with existing keys).
413
+ */
414
+ export declare const ScopeProjects: Scope;
415
+ /**
416
+ * API Key Scopes - hierarchical permission system.
417
+ * Resource-level scopes (e.g., "agents") imply all action-level scopes (e.g., "agents:read").
418
+ * Empty scopes = full access (for backwards compatibility with existing keys).
419
+ */
420
+ export declare const ScopeTeams: Scope;
421
+ /**
422
+ * API Key Scopes - hierarchical permission system.
423
+ * Resource-level scopes (e.g., "agents") imply all action-level scopes (e.g., "agents:read").
424
+ * Empty scopes = full access (for backwards compatibility with existing keys).
425
+ */
426
+ export declare const ScopeBilling: Scope;
427
+ /**
428
+ * Action-level scopes for Agents
429
+ */
430
+ export declare const ScopeAgentsRead: Scope;
431
+ /**
432
+ * API Key Scopes - hierarchical permission system.
433
+ * Resource-level scopes (e.g., "agents") imply all action-level scopes (e.g., "agents:read").
434
+ * Empty scopes = full access (for backwards compatibility with existing keys).
435
+ */
436
+ export declare const ScopeAgentsWrite: Scope;
437
+ /**
438
+ * API Key Scopes - hierarchical permission system.
439
+ * Resource-level scopes (e.g., "agents") imply all action-level scopes (e.g., "agents:read").
440
+ * Empty scopes = full access (for backwards compatibility with existing keys).
441
+ */
442
+ export declare const ScopeAgentsExecute: Scope;
443
+ /**
444
+ * Action-level scopes for Apps
445
+ */
446
+ export declare const ScopeAppsRead: Scope;
447
+ /**
448
+ * API Key Scopes - hierarchical permission system.
449
+ * Resource-level scopes (e.g., "agents") imply all action-level scopes (e.g., "agents:read").
450
+ * Empty scopes = full access (for backwards compatibility with existing keys).
451
+ */
452
+ export declare const ScopeAppsWrite: Scope;
453
+ /**
454
+ * API Key Scopes - hierarchical permission system.
455
+ * Resource-level scopes (e.g., "agents") imply all action-level scopes (e.g., "agents:read").
456
+ * Empty scopes = full access (for backwards compatibility with existing keys).
457
+ */
458
+ export declare const ScopeAppsExecute: Scope;
459
+ /**
460
+ * Action-level scopes for Conversations/Chats
461
+ */
462
+ export declare const ScopeConversationsRead: Scope;
463
+ /**
464
+ * API Key Scopes - hierarchical permission system.
465
+ * Resource-level scopes (e.g., "agents") imply all action-level scopes (e.g., "agents:read").
466
+ * Empty scopes = full access (for backwards compatibility with existing keys).
467
+ */
468
+ export declare const ScopeConversationsWrite: Scope;
469
+ /**
470
+ * Action-level scopes for Files
471
+ */
472
+ export declare const ScopeFilesRead: Scope;
473
+ /**
474
+ * API Key Scopes - hierarchical permission system.
475
+ * Resource-level scopes (e.g., "agents") imply all action-level scopes (e.g., "agents:read").
476
+ * Empty scopes = full access (for backwards compatibility with existing keys).
477
+ */
478
+ export declare const ScopeFilesWrite: Scope;
479
+ /**
480
+ * Action-level scopes for Datastores
481
+ */
482
+ export declare const ScopeDatastoresRead: Scope;
483
+ /**
484
+ * API Key Scopes - hierarchical permission system.
485
+ * Resource-level scopes (e.g., "agents") imply all action-level scopes (e.g., "agents:read").
486
+ * Empty scopes = full access (for backwards compatibility with existing keys).
487
+ */
488
+ export declare const ScopeDatastoresWrite: Scope;
489
+ /**
490
+ * Action-level scopes for Flows
491
+ */
492
+ export declare const ScopeFlowsRead: Scope;
493
+ /**
494
+ * API Key Scopes - hierarchical permission system.
495
+ * Resource-level scopes (e.g., "agents") imply all action-level scopes (e.g., "agents:read").
496
+ * Empty scopes = full access (for backwards compatibility with existing keys).
497
+ */
498
+ export declare const ScopeFlowsWrite: Scope;
499
+ /**
500
+ * API Key Scopes - hierarchical permission system.
501
+ * Resource-level scopes (e.g., "agents") imply all action-level scopes (e.g., "agents:read").
502
+ * Empty scopes = full access (for backwards compatibility with existing keys).
503
+ */
504
+ export declare const ScopeFlowsExecute: Scope;
505
+ /**
506
+ * Action-level scopes for Projects
507
+ */
508
+ export declare const ScopeProjectsRead: Scope;
509
+ /**
510
+ * API Key Scopes - hierarchical permission system.
511
+ * Resource-level scopes (e.g., "agents") imply all action-level scopes (e.g., "agents:read").
512
+ * Empty scopes = full access (for backwards compatibility with existing keys).
513
+ */
514
+ export declare const ScopeProjectsWrite: Scope;
515
+ /**
516
+ * Action-level scopes for Teams
517
+ */
518
+ export declare const ScopeTeamsRead: Scope;
519
+ /**
520
+ * API Key Scopes - hierarchical permission system.
521
+ * Resource-level scopes (e.g., "agents") imply all action-level scopes (e.g., "agents:read").
522
+ * Empty scopes = full access (for backwards compatibility with existing keys).
523
+ */
524
+ export declare const ScopeTeamsWrite: Scope;
525
+ /**
526
+ * Action-level scopes for Billing
527
+ */
528
+ export declare const ScopeBillingRead: Scope;
529
+ /**
530
+ * API Key Scopes - hierarchical permission system.
531
+ * Resource-level scopes (e.g., "agents") imply all action-level scopes (e.g., "agents:read").
532
+ * Empty scopes = full access (for backwards compatibility with existing keys).
533
+ */
534
+ export declare const ScopeBillingWrite: Scope;
535
+ /**
536
+ * Action-level scopes for Secrets (sensitive - not in read/run presets)
537
+ */
538
+ export declare const ScopeSecretsRead: Scope;
539
+ /**
540
+ * API Key Scopes - hierarchical permission system.
541
+ * Resource-level scopes (e.g., "agents") imply all action-level scopes (e.g., "agents:read").
542
+ * Empty scopes = full access (for backwards compatibility with existing keys).
543
+ */
544
+ export declare const ScopeSecretsWrite: Scope;
545
+ /**
546
+ * Action-level scopes for Integrations
547
+ */
548
+ export declare const ScopeIntegrationsRead: Scope;
549
+ /**
550
+ * API Key Scopes - hierarchical permission system.
551
+ * Resource-level scopes (e.g., "agents") imply all action-level scopes (e.g., "agents:read").
552
+ * Empty scopes = full access (for backwards compatibility with existing keys).
553
+ */
554
+ export declare const ScopeIntegrationsWrite: Scope;
555
+ /**
556
+ * Action-level scopes for Engines
557
+ */
558
+ export declare const ScopeEnginesRead: Scope;
559
+ /**
560
+ * API Key Scopes - hierarchical permission system.
561
+ * Resource-level scopes (e.g., "agents") imply all action-level scopes (e.g., "agents:read").
562
+ * Empty scopes = full access (for backwards compatibility with existing keys).
563
+ */
564
+ export declare const ScopeEnginesWrite: Scope;
565
+ /**
566
+ * Action-level scopes for API Keys
567
+ */
568
+ export declare const ScopeApiKeysRead: Scope;
569
+ /**
570
+ * API Key Scopes - hierarchical permission system.
571
+ * Resource-level scopes (e.g., "agents") imply all action-level scopes (e.g., "agents:read").
572
+ * Empty scopes = full access (for backwards compatibility with existing keys).
573
+ */
574
+ export declare const ScopeApiKeysWrite: Scope;
575
+ /**
576
+ * Action-level scopes for User profile
577
+ */
578
+ export declare const ScopeUserRead: Scope;
579
+ /**
580
+ * API Key Scopes - hierarchical permission system.
581
+ * Resource-level scopes (e.g., "agents") imply all action-level scopes (e.g., "agents:read").
582
+ * Empty scopes = full access (for backwards compatibility with existing keys).
583
+ */
584
+ export declare const ScopeUserWrite: Scope;
585
+ /**
586
+ * Action-level scopes for Settings/Notifications
587
+ */
588
+ export declare const ScopeSettingsRead: Scope;
589
+ /**
590
+ * API Key Scopes - hierarchical permission system.
591
+ * Resource-level scopes (e.g., "agents") imply all action-level scopes (e.g., "agents:read").
592
+ * Empty scopes = full access (for backwards compatibility with existing keys).
593
+ */
594
+ export declare const ScopeSettingsWrite: Scope;
595
+ /**
596
+ * ScopeGroup identifies a category of scopes for UI grouping
597
+ */
598
+ export type ScopeGroup = string;
599
+ export declare const ScopeGroupAgents: ScopeGroup;
600
+ export declare const ScopeGroupApps: ScopeGroup;
601
+ export declare const ScopeGroupConversations: ScopeGroup;
928
602
  export declare const ScopeGroupFiles: ScopeGroup;
929
603
  export declare const ScopeGroupDatastores: ScopeGroup;
930
604
  export declare const ScopeGroupFlows: ScopeGroup;
@@ -941,7 +615,7 @@ export declare const ScopeGroupSettings: ScopeGroup;
941
615
  * ScopeDefinition describes a single scope for UI rendering
942
616
  */
943
617
  export interface ScopeDefinition {
944
- value: string;
618
+ value: Scope;
945
619
  label: string;
946
620
  description: string;
947
621
  group: ScopeGroup;
@@ -954,6 +628,14 @@ export interface ScopeGroupDefinition {
954
628
  label: string;
955
629
  description: string;
956
630
  }
631
+ /**
632
+ * ScopesResponse is the API response for GET /scopes
633
+ */
634
+ export interface ScopesResponse {
635
+ scopes: ScopeDefinition[];
636
+ groups: ScopeGroupDefinition[];
637
+ presets: ScopePreset[];
638
+ }
957
639
  /**
958
640
  * ScopePreset represents a predefined bundle of scopes for common use cases
959
641
  */
@@ -961,102 +643,71 @@ export interface ScopePreset {
961
643
  id: string;
962
644
  label: string;
963
645
  description: string;
964
- scopes: string[];
965
- }
966
- export type AppCategory = string;
967
- export declare const AppCategoryImage: AppCategory;
968
- export declare const AppCategoryVideo: AppCategory;
969
- export declare const AppCategoryAudio: AppCategory;
970
- export declare const AppCategoryText: AppCategory;
971
- export declare const AppCategoryChat: AppCategory;
972
- export declare const AppCategory3D: AppCategory;
973
- export declare const AppCategoryOther: AppCategory;
974
- export declare const AppCategoryFlow: AppCategory;
975
- export type GPUType = string;
976
- export declare const GPUTypeAny: GPUType;
977
- export declare const GPUTypeNone: GPUType;
978
- export declare const GPUTypeIntel: GPUType;
979
- export declare const GPUTypeNvidia: GPUType;
980
- export declare const GPUTypeAMD: GPUType;
981
- export declare const GPUTypeApple: GPUType;
982
- export interface AppImages {
983
- card: string;
984
- thumbnail: string;
985
- banner: string;
646
+ scopes: Scope[];
986
647
  }
987
- export interface App extends BaseModel, PermissionModel {
988
- /**
989
- * Namespace is copied from team.username at creation time and is IMMUTABLE.
990
- * This ensures stable references like "namespace/name" even if team username changes.
991
- * Default empty string allows GORM migration to add column, then MigrateAppNamespaces populates it.
992
- */
993
- namespace: string;
994
- /**
995
- * Name is IMMUTABLE after creation. Combined with Namespace forms unique identifier.
996
- */
648
+ /**
649
+ * ApiKeyDTO for API responses
650
+ */
651
+ export interface ApiKeyDTO extends BaseModelDTO, PermissionModelDTO {
997
652
  name: string;
998
- description: string;
999
- agent_description: string;
1000
- /**
1001
- * Category is a fundamental classification of the app (image, video, audio, text, chat, 3d, other)
1002
- */
1003
- category: AppCategory;
1004
- /**
1005
- * Developer's images
1006
- */
1007
- images: AppImages;
1008
- /**
1009
- * Current version (developer's latest)
1010
- */
1011
- version_id: string;
1012
- version?: AppVersion;
653
+ key: string;
654
+ last_used_at: string;
655
+ expires_at?: string;
656
+ scopes: Scope[];
657
+ source?: string;
1013
658
  }
1014
659
  /**
1015
- * AppPricing configures all pricing using CEL expressions
1016
- * Empty expressions use defaults. All values in microcents (1 cent = 1,000,000; 1 dollar = 100,000,000)
660
+ * AppPricing configures all pricing using CEL expressions.
661
+ * Empty expressions use defaults. All values in microcents.
1017
662
  */
1018
663
  export interface AppPricing {
1019
664
  prices: {
1020
665
  [key: string]: number;
1021
666
  };
1022
667
  upstream_pricing?: string;
1023
- /**
1024
- * Resource fee expression (compute cost)
1025
- * Available variables: resources (list of {name, price_per_second}), usage_seconds, prices
1026
- * Default: sum(resources.map(r, r.price_per_second)) * usage_seconds
1027
- */
1028
668
  resource_expression: string;
1029
- /**
1030
- * CEL expressions for each fee type (result in microcents)
1031
- * Available variables: inputs, outputs, prices, resource_fee, usage_seconds
1032
- */
1033
669
  inference_expression: string;
1034
670
  royalty_expression: string;
1035
671
  partner_expression: string;
1036
- /**
1037
- * Total expression combines all fees (can apply weights/discounts)
1038
- * Available variables: inputs, outputs, prices, resource_fee, usage_seconds, inference_fee, royalty_fee, partner_fee
1039
- * Default: resource_fee + inference_fee + royalty_fee + partner_fee
1040
- */
1041
672
  total_expression: string;
1042
673
  description: string;
1043
- /**
1044
- * DescriptionRendered is the result of evaluating Description against the
1045
- * static prices map at save time. Frontends should display this rather than
1046
- * the raw CEL source. Empty string means the description failed to render
1047
- * (e.g. references variables outside `prices`).
1048
- */
1049
674
  description_rendered?: string;
1050
675
  }
676
+ /**
677
+ * AppFunction represents a callable entry point within an app version.
678
+ */
679
+ export interface AppFunction {
680
+ name: string;
681
+ description?: string;
682
+ input_schema: any;
683
+ output_schema: any;
684
+ }
685
+ /**
686
+ * AppImages holds developer-provided images for the app.
687
+ */
688
+ export interface AppImages {
689
+ card: string;
690
+ thumbnail: string;
691
+ banner: string;
692
+ }
693
+ /**
694
+ * AppGPUResource describes GPU requirements.
695
+ */
1051
696
  export interface AppGPUResource {
1052
697
  count: number;
1053
698
  vram: number;
1054
699
  type: GPUType;
1055
700
  }
701
+ /**
702
+ * AppResources describes resource requirements.
703
+ */
1056
704
  export interface AppResources {
1057
705
  gpu: AppGPUResource;
1058
706
  ram: number;
1059
707
  }
708
+ /**
709
+ * AppVariant is a named resource/env configuration variant.
710
+ */
1060
711
  export interface AppVariant {
1061
712
  name: string;
1062
713
  order: number;
@@ -1067,58 +718,24 @@ export interface AppVariant {
1067
718
  python: string;
1068
719
  }
1069
720
  /**
1070
- * AppFunction represents a callable entry point within an app version.
1071
- * Each function has its own input/output schema while sharing the app's setup.
721
+ * SecretRequirement defines a secret that an app requires to run.
1072
722
  */
1073
- export interface AppFunction {
1074
- name: string;
723
+ export interface SecretRequirement {
724
+ key: string;
1075
725
  description?: string;
1076
- input_schema: any;
1077
- output_schema: any;
1078
- }
1079
- export interface AppVersion extends BaseModel {
1080
- app_id: string;
1081
- metadata: {
1082
- [key: string]: any;
1083
- };
1084
- repository: string;
1085
- flow_version_id?: string;
1086
- flow_version?: FlowVersion;
1087
- setup_schema: any;
1088
- input_schema: any;
1089
- output_schema: any;
1090
- /**
1091
- * Functions contains the callable entry points for this app version.
1092
- * Each function has its own input/output schema. If nil/empty, the app uses legacy single-function mode
1093
- * with InputSchema/OutputSchema at the version level.
1094
- */
1095
- functions?: {
1096
- [key: string]: AppFunction;
1097
- };
1098
- default_function?: string;
1099
- variants: {
1100
- [key: string]: AppVariant;
1101
- };
1102
- env: {
1103
- [key: string]: string;
1104
- };
1105
- kernel: string;
1106
- /**
1107
- * App requirements - secrets and integrations needed to run this app
1108
- */
1109
- required_secrets?: SecretRequirement[];
1110
- required_integrations?: IntegrationRequirement[];
1111
- resources: AppResources;
1112
- /**
1113
- * Checksum is the SHA256 checksum of the uploaded zip file
1114
- */
1115
- checksum?: string;
726
+ optional?: boolean;
1116
727
  }
1117
- export interface LicenseRecordDTO extends BaseModelDTO {
1118
- user_id: string;
1119
- app_id: string;
1120
- license: string;
728
+ /**
729
+ * IntegrationRequirement defines an integration capability that an app requires.
730
+ */
731
+ export interface IntegrationRequirement {
732
+ key: string;
733
+ description?: string;
734
+ optional?: boolean;
1121
735
  }
736
+ /**
737
+ * AppDTO is the API response for a full app.
738
+ */
1122
739
  export interface AppDTO extends BaseModelDTO, PermissionModelDTO {
1123
740
  namespace: string;
1124
741
  name: string;
@@ -1129,6 +746,9 @@ export interface AppDTO extends BaseModelDTO, PermissionModelDTO {
1129
746
  version_id: string;
1130
747
  version?: AppVersionDTO;
1131
748
  }
749
+ /**
750
+ * AppVersionDTO is the API response for an app version.
751
+ */
1132
752
  export interface AppVersionDTO extends BaseModelDTO {
1133
753
  metadata: {
1134
754
  [key: string]: any;
@@ -1150,21 +770,19 @@ export interface AppVersionDTO extends BaseModelDTO {
1150
770
  [key: string]: string;
1151
771
  };
1152
772
  kernel: string;
1153
- /**
1154
- * App requirements
1155
- */
1156
773
  required_secrets?: SecretRequirement[];
1157
774
  required_integrations?: IntegrationRequirement[];
1158
775
  resources: AppResources;
1159
- /**
1160
- * Checksum is the SHA256 checksum of the uploaded zip file
1161
- */
1162
776
  checksum?: string;
1163
777
  }
1164
- export type AppSessionStatus = string;
1165
- export declare const AppSessionStatusActive: AppSessionStatus;
1166
- export declare const AppSessionStatusEnded: AppSessionStatus;
1167
- export declare const AppSessionStatusExpired: AppSessionStatus;
778
+ /**
779
+ * LicenseRecordDTO is the API response for a license record.
780
+ */
781
+ export interface LicenseRecordDTO extends BaseModelDTO {
782
+ user_id: string;
783
+ app_id: string;
784
+ license: string;
785
+ }
1168
786
  /**
1169
787
  * AppSessionDTO is the external representation
1170
788
  */
@@ -1180,6 +798,25 @@ export interface AppSessionDTO extends BaseModelDTO, PermissionModelDTO {
1180
798
  last_call_at?: string;
1181
799
  idle_timeout?: number;
1182
800
  }
801
+ /**
802
+ * AppStoreListingDTO for API responses
803
+ */
804
+ export interface AppStoreListingDTO {
805
+ id: string;
806
+ created_at: string;
807
+ updated_at: string;
808
+ deleted_at?: string;
809
+ category: string;
810
+ subcategory?: string;
811
+ page_id?: string;
812
+ is_featured: boolean;
813
+ rank: number;
814
+ allows_private_workers: boolean;
815
+ allows_cloud_workers: boolean;
816
+ max_concurrency: number;
817
+ max_concurrency_per_team: number;
818
+ tags?: string[];
819
+ }
1183
820
  /**
1184
821
  * PublicAppStoreDTO is a lean DTO for public app store display.
1185
822
  */
@@ -1197,13 +834,6 @@ export interface PublicAppStoreDTO {
1197
834
  has_approved_version: boolean;
1198
835
  page_id?: string;
1199
836
  }
1200
- export interface BaseModel {
1201
- id: string;
1202
- short_id: string;
1203
- created_at: string;
1204
- updated_at: string;
1205
- deleted_at?: string;
1206
- }
1207
837
  /**
1208
838
  * BaseModelDTO is the contract-layer base embed — same fields, no gorm tags.
1209
839
  * All DTOs should embed this instead of BaseModel.
@@ -1216,19 +846,8 @@ export interface BaseModelDTO {
1216
846
  deleted_at?: string;
1217
847
  }
1218
848
  /**
1219
- * Visibility represents the visibility level of a resource
849
+ * PermissionModelDTO is the contract-layer permission embed.
1220
850
  */
1221
- export type Visibility = string;
1222
- export declare const VisibilityPrivate: Visibility;
1223
- export declare const VisibilityPublic: Visibility;
1224
- export declare const VisibilityUnlisted: Visibility;
1225
- export interface PermissionModel {
1226
- user_id: string;
1227
- user?: User;
1228
- team_id: string;
1229
- team?: Team;
1230
- visibility: Visibility;
1231
- }
1232
851
  export interface PermissionModelDTO {
1233
852
  user_id: string;
1234
853
  user?: UserRelationDTO;
@@ -1244,134 +863,9 @@ export interface ResourceStatusDTO {
1244
863
  status: any;
1245
864
  updated_at: string;
1246
865
  }
1247
- export type ChatStatus = string;
1248
- export declare const ChatStatusBusy: ChatStatus;
1249
- export declare const ChatStatusIdle: ChatStatus;
1250
- export declare const ChatStatusAwaitingInput: ChatStatus;
1251
- export declare const ChatStatusCompleted: ChatStatus;
1252
- export interface IntegrationContext {
1253
- integration_type?: IntegrationType;
1254
- integration_metadata?: any;
1255
- }
1256
- /**
1257
- * ChatData contains agent-specific data for a chat session
1258
- */
1259
- export interface ChatData {
1260
- plan_steps: PlanStep[];
1261
- memory: StringEncodedMap;
1262
- always_allowed_tools: string[];
1263
- }
1264
- /**
1265
- * PlanStep represents a step in an agent's execution plan
1266
- */
1267
- export interface PlanStep {
1268
- index: number;
1269
- title: string;
1270
- description: string;
1271
- notes?: string;
1272
- status: PlanStepStatus;
1273
- }
1274
- /**
1275
- * PlanStepStatus represents the status of a plan step
1276
- */
1277
- export type PlanStepStatus = string;
1278
- export declare const PlanStepStatusPending: PlanStepStatus;
1279
- export declare const PlanStepStatusInProgress: PlanStepStatus;
1280
- export declare const PlanStepStatusCompleted: PlanStepStatus;
1281
- export declare const PlanStepStatusCancelled: PlanStepStatus;
1282
- export type ChatMessageRole = string;
1283
- export declare const ChatMessageRoleSystem: ChatMessageRole;
1284
- export declare const ChatMessageRoleUser: ChatMessageRole;
1285
- export declare const ChatMessageRoleAssistant: ChatMessageRole;
1286
- export declare const ChatMessageRoleTool: ChatMessageRole;
1287
- /**
1288
- * ChatMessageStatus represents the lifecycle status of a chat message
1289
- */
1290
- export type ChatMessageStatus = string;
1291
- export declare const ChatMessageStatusPending: ChatMessageStatus;
1292
- export declare const ChatMessageStatusReady: ChatMessageStatus;
1293
- export declare const ChatMessageStatusFailed: ChatMessageStatus;
1294
- export declare const ChatMessageStatusCancelled: ChatMessageStatus;
1295
- export type ChatMessageContentType = string;
1296
- export declare const ChatMessageContentTypeText: ChatMessageContentType;
1297
- export declare const ChatMessageContentTypeReasoning: ChatMessageContentType;
1298
- export declare const ChatMessageContentTypeImage: ChatMessageContentType;
1299
- export declare const ChatMessageContentTypeFile: ChatMessageContentType;
1300
- export declare const ChatMessageContentTypeTool: ChatMessageContentType;
1301
- export type IntegrationType = string;
1302
- export declare const IntegrationTypeSlack: IntegrationType;
1303
- export declare const IntegrationTypeDiscord: IntegrationType;
1304
- export declare const IntegrationTypeTeams: IntegrationType;
1305
- export declare const IntegrationTypeTelegram: IntegrationType;
1306
- /**
1307
- * FileRef is a lightweight reference to a file with essential metadata.
1308
- * Used in chat inputs/context instead of full File objects.
1309
- */
1310
- export interface FileRef {
1311
- id?: string;
1312
- uri: string;
1313
- filename: string;
1314
- content_type: string;
1315
- size?: number;
1316
- }
1317
- export interface ChatMessageContent {
1318
- type: ChatMessageContentType;
1319
- error?: string;
1320
- text?: string;
1321
- image?: string;
1322
- file?: string;
1323
- tool_calls?: ToolCall[];
1324
- }
1325
- /**
1326
- * ToolCall represents a tool call from an LLM response (wire format)
1327
- * This is a transport object for parsing LLM responses, not a database model
1328
- */
1329
- export interface ToolCall {
1330
- id: string;
1331
- type: string;
1332
- function: ToolCallFunction;
1333
- }
1334
866
  /**
1335
- * ToolCallFunction contains the function name and arguments from an LLM tool call
867
+ * ChatDTO for API responses
1336
868
  */
1337
- export interface ToolCallFunction {
1338
- name: string;
1339
- arguments: StringEncodedMap;
1340
- }
1341
- export interface ChatTaskInput {
1342
- model?: string;
1343
- context_size: number;
1344
- temperature?: number;
1345
- top_p?: number;
1346
- reasoning_effort?: string;
1347
- reasoning_max_tokens?: number;
1348
- system_prompt: string;
1349
- context: ChatTaskContextMessage[];
1350
- role?: ChatMessageRole;
1351
- text?: string;
1352
- reasoning?: string;
1353
- /**
1354
- * Attachments is the SDK input field with full file metadata
1355
- */
1356
- attachments?: FileRef[];
1357
- /**
1358
- * Images and Files are internal fields for task workers (filled from Attachments or context)
1359
- */
1360
- images?: string[];
1361
- files?: string[];
1362
- tools?: Tool[];
1363
- tool_call_id?: string;
1364
- }
1365
- export interface ChatTaskContextMessage {
1366
- role: ChatMessageRole;
1367
- text?: string;
1368
- reasoning?: string;
1369
- images?: string[];
1370
- files?: string[];
1371
- tools?: Tool[];
1372
- tool_calls?: ToolCall[];
1373
- tool_call_id?: string;
1374
- }
1375
869
  export interface ChatDTO extends BaseModelDTO, PermissionModelDTO {
1376
870
  parent_id?: string;
1377
871
  parent?: ChatDTO;
@@ -1381,9 +875,6 @@ export interface ChatDTO extends BaseModelDTO, PermissionModelDTO {
1381
875
  context?: {
1382
876
  [key: string]: string;
1383
877
  };
1384
- /**
1385
- * Agent version reference
1386
- */
1387
878
  agent_id?: string;
1388
879
  agent?: AgentDTO;
1389
880
  agent_version_id?: string;
@@ -1393,6 +884,9 @@ export interface ChatDTO extends BaseModelDTO, PermissionModelDTO {
1393
884
  chat_messages: ChatMessageDTO[];
1394
885
  agent_data: ChatData;
1395
886
  }
887
+ /**
888
+ * ChatMessageDTO for API responses
889
+ */
1396
890
  export interface ChatMessageDTO extends BaseModelDTO, PermissionModelDTO {
1397
891
  chat_id: string;
1398
892
  chat?: ChatDTO;
@@ -1405,9 +899,6 @@ export interface ChatMessageDTO extends BaseModelDTO, PermissionModelDTO {
1405
899
  tool_call_id?: string;
1406
900
  tool_invocations?: ToolInvocationDTO[];
1407
901
  }
1408
- export type StringEncodedMap = {
1409
- [key: string]: any;
1410
- };
1411
902
  /**
1412
903
  * SearchRequest represents a search request
1413
904
  */
@@ -1424,32 +915,6 @@ export interface Filter {
1424
915
  operator: FilterOperator;
1425
916
  value: any;
1426
917
  }
1427
- /**
1428
- * FilterOperator represents the type of filter operation
1429
- */
1430
- export type FilterOperator = string;
1431
- export declare const OpEqual: FilterOperator;
1432
- export declare const OpNotEqual: FilterOperator;
1433
- export declare const OpIn: FilterOperator;
1434
- export declare const OpNotIn: FilterOperator;
1435
- export declare const OpGreater: FilterOperator;
1436
- export declare const OpGreaterEqual: FilterOperator;
1437
- export declare const OpLess: FilterOperator;
1438
- export declare const OpLessEqual: FilterOperator;
1439
- export declare const OpLike: FilterOperator;
1440
- export declare const OpILike: FilterOperator;
1441
- export declare const OpContains: FilterOperator;
1442
- export declare const OpNotContains: FilterOperator;
1443
- /**
1444
- * Null checks
1445
- */
1446
- export declare const OpIsNull: FilterOperator;
1447
- export declare const OpIsNotNull: FilterOperator;
1448
- /**
1449
- * Empty checks (for strings)
1450
- */
1451
- export declare const OpIsEmpty: FilterOperator;
1452
- export declare const OpIsNotEmpty: FilterOperator;
1453
918
  /**
1454
919
  * SortOrder represents sorting configuration
1455
920
  */
@@ -1485,42 +950,103 @@ export interface CursorListResponse<T extends any> {
1485
950
  items_per_page: number;
1486
951
  total_items: number;
1487
952
  }
1488
- export type DeviceAuthStatus = string;
1489
- export declare const DeviceAuthStatusPending: DeviceAuthStatus;
1490
- export declare const DeviceAuthStatusApproved: DeviceAuthStatus;
1491
- export declare const DeviceAuthStatusExpired: DeviceAuthStatus;
1492
- export declare const DeviceAuthStatusDenied: DeviceAuthStatus;
1493
- export declare const DeviceAuthStatusValid: DeviceAuthStatus;
1494
- export declare const DeviceAuthStatusInvalid: DeviceAuthStatus;
1495
- export declare const DeviceAuthStatusLoading: DeviceAuthStatus;
1496
953
  /**
1497
- * Engine-related types
954
+ * EngineConfig holds engine configuration (no gorm tags).
1498
955
  */
1499
- export type EngineStatus = string;
1500
- export declare const EngineStatusRunning: EngineStatus;
1501
- export declare const EngineStatusPending: EngineStatus;
1502
- export declare const EngineStatusDraining: EngineStatus;
1503
- export declare const EngineStatusStopping: EngineStatus;
1504
- export declare const EngineStatusStopped: EngineStatus;
1505
- export interface EngineStateDTO extends BaseModelDTO, PermissionModelDTO {
1506
- instance?: Instance;
956
+ export interface EngineConfig {
957
+ id: string;
958
+ name: string;
959
+ api_url: string;
960
+ engine_port: string;
961
+ workers: WorkerConfig;
962
+ api_key: string;
963
+ container_mode: boolean;
964
+ network_name: string;
965
+ cache_path: string;
966
+ gpus: string[];
967
+ callback_base_port: number;
968
+ engine_internal_api_url: string;
969
+ }
970
+ /**
971
+ * WorkerGPUConfig defines GPU allocation for a worker.
972
+ */
973
+ export interface WorkerGPUConfig {
974
+ gpus: any[];
975
+ }
976
+ /**
977
+ * WorkerCPUConfig defines CPU allocation for a worker.
978
+ */
979
+ export interface WorkerCPUConfig {
980
+ count: number;
981
+ }
982
+ /**
983
+ * WorkerConfig defines how workers are allocated on an engine.
984
+ */
985
+ export interface WorkerConfig {
986
+ gpu: WorkerGPUConfig[];
987
+ cpu: WorkerCPUConfig;
988
+ }
989
+ /**
990
+ * EngineDTO is the full API response for an engine.
991
+ */
992
+ export interface EngineDTO extends BaseModelDTO, PermissionModelDTO {
993
+ instance?: InstanceDTO;
1507
994
  config: EngineConfig;
1508
995
  name: string;
1509
996
  api_url: string;
1510
997
  status: EngineStatus;
1511
998
  system_info?: SystemInfo;
1512
- workers: (WorkerStateDTO | undefined)[];
999
+ workers: (WorkerDTO | undefined)[];
1513
1000
  }
1514
- export interface EngineStateSummary extends BaseModelDTO, PermissionModelDTO {
1515
- instance?: Instance;
1001
+ /**
1002
+ * EngineSummary is a lightweight engine response embedded in tasks.
1003
+ */
1004
+ export interface EngineSummary extends BaseModelDTO, PermissionModelDTO {
1005
+ instance?: InstanceDTO;
1516
1006
  name: string;
1517
1007
  status: EngineStatus;
1518
- workers: (WorkerStateSummary | undefined)[];
1008
+ workers: (WorkerSummary | undefined)[];
1519
1009
  }
1520
1010
  /**
1521
- * Worker-related types
1011
+ * WorkerDTO is the full API response for a worker.
1012
+ */
1013
+ export interface WorkerDTO extends BaseModelDTO {
1014
+ user_id: string;
1015
+ team_id: string;
1016
+ index: number;
1017
+ status: WorkerStatus;
1018
+ engine_id: string;
1019
+ task_id?: string;
1020
+ app_id: string;
1021
+ app_version_id: string;
1022
+ active_session_id?: string;
1023
+ gpus?: WorkerGPU[];
1024
+ cpus?: WorkerCPU[];
1025
+ rams?: WorkerRAM[];
1026
+ system_info: SystemInfo;
1027
+ warm_apps?: string[];
1028
+ }
1029
+ /**
1030
+ * WorkerSummary is a lightweight worker response.
1031
+ */
1032
+ export interface WorkerSummary {
1033
+ id: string;
1034
+ user_id: string;
1035
+ index: number;
1036
+ status: WorkerStatus;
1037
+ engine_id: string;
1038
+ engine_name: string;
1039
+ task_id?: string;
1040
+ app_id: string;
1041
+ app_version_id: string;
1042
+ active_session_id?: string;
1043
+ gpus?: WorkerGPU[];
1044
+ cpus?: WorkerCPU[];
1045
+ rams?: WorkerRAM[];
1046
+ }
1047
+ /**
1048
+ * WorkerGPU describes a GPU attached to a worker (contract-only, no gorm).
1522
1049
  */
1523
- export type WorkerStatus = string;
1524
1050
  export interface WorkerGPU {
1525
1051
  id: string;
1526
1052
  worker_id: string;
@@ -1529,6 +1055,9 @@ export interface WorkerGPU {
1529
1055
  name: string;
1530
1056
  vram: number;
1531
1057
  }
1058
+ /**
1059
+ * WorkerCPU describes a CPU attached to a worker (contract-only, no gorm).
1060
+ */
1532
1061
  export interface WorkerCPU {
1533
1062
  id: string;
1534
1063
  worker_id: string;
@@ -1539,41 +1068,27 @@ export interface WorkerCPU {
1539
1068
  cores: number;
1540
1069
  frequency: string;
1541
1070
  }
1071
+ /**
1072
+ * WorkerRAM describes RAM attached to a worker (contract-only, no gorm).
1073
+ */
1542
1074
  export interface WorkerRAM {
1543
1075
  id: string;
1544
1076
  worker_id: string;
1545
1077
  total: number;
1546
1078
  }
1547
- export interface WorkerStateDTO extends BaseModelDTO {
1548
- user_id: string;
1079
+ /**
1080
+ * EntitlementDTO for API responses
1081
+ */
1082
+ export interface EntitlementDTO extends BaseModelDTO {
1549
1083
  team_id: string;
1550
- index: number;
1551
- status: WorkerStatus;
1552
- engine_id: string;
1553
- task_id?: string;
1554
- app_id: string;
1555
- app_version_id: string;
1556
- active_session_id?: string;
1557
- gpus: WorkerGPU[];
1558
- cpus: WorkerCPU[];
1559
- rams: WorkerRAM[];
1560
- system_info: SystemInfo;
1561
- warm_apps?: string[];
1562
- }
1563
- export interface WorkerStateSummary {
1564
- id: string;
1565
- user_id: string;
1566
- index: number;
1567
- status: WorkerStatus;
1568
- engine_id: string;
1569
- engine_name: string;
1570
- task_id?: string;
1571
- app_id: string;
1572
- app_version_id: string;
1573
- active_session_id?: string;
1574
- gpus: WorkerGPU[];
1575
- cpus: WorkerCPU[];
1576
- rams: WorkerRAM[];
1084
+ resource: EntitlementResource;
1085
+ type: EntitlementType;
1086
+ enabled: boolean;
1087
+ unlimited: boolean;
1088
+ limit: number;
1089
+ source: EntitlementSource;
1090
+ enforcement: EnforcementMode;
1091
+ expires_at?: string;
1577
1092
  }
1578
1093
  /**
1579
1094
  * FileMetadata holds probed media metadata cached on File records.
@@ -1588,6 +1103,9 @@ export interface FileMetadata {
1588
1103
  channels?: number;
1589
1104
  codec?: string;
1590
1105
  }
1106
+ /**
1107
+ * FileDTO for API responses
1108
+ */
1591
1109
  export interface FileDTO extends BaseModelDTO, PermissionModelDTO {
1592
1110
  path: string;
1593
1111
  remote_path: string;
@@ -1600,50 +1118,9 @@ export interface FileDTO extends BaseModelDTO, PermissionModelDTO {
1600
1118
  rating: ContentRating;
1601
1119
  metadata?: FileMetadata;
1602
1120
  }
1603
- export interface FlowVersion extends BaseModel {
1604
- /**
1605
- * Permission fields - nullable for migration from existing data
1606
- * After migration these will be populated from parent Flow
1607
- */
1608
- user_id: string;
1609
- user?: User;
1610
- team_id: string;
1611
- team?: Team;
1612
- flow_id: string;
1613
- /**
1614
- * ConfigHash for deduplication - SHA256 of config content
1615
- */
1616
- config_hash: string;
1617
- /**
1618
- * GraphVersion is an incrementing counter for optimistic locking on action-based edits
1619
- */
1620
- graph_version: number;
1621
- /**
1622
- * Flow graph configuration
1623
- */
1624
- input_schema: any;
1625
- input: FlowRunInputs;
1626
- output_schema: any;
1627
- output_mappings: OutputMappings;
1628
- node_data: FlowNodeDataMap;
1629
- nodes: FlowNode[];
1630
- edges: FlowEdge[];
1631
- viewport?: FlowViewport;
1632
- }
1633
- export interface FlowViewport {
1634
- x: number;
1635
- y: number;
1636
- zoom: number;
1637
- }
1638
- export interface FlowNode {
1639
- id: string;
1640
- type: string;
1641
- position: FlowNodePosition;
1642
- }
1643
- export interface FlowNodePosition {
1644
- x: number;
1645
- y: number;
1646
- }
1121
+ /**
1122
+ * FlowNodeData describes a node's data within a flow
1123
+ */
1647
1124
  export interface FlowNodeData {
1648
1125
  app?: AppDTO;
1649
1126
  app_id: string;
@@ -1656,50 +1133,25 @@ export interface FlowNodeData {
1656
1133
  task?: TaskDTO;
1657
1134
  task_id?: string;
1658
1135
  }
1136
+ /**
1137
+ * FlowNodeDataMap maps node IDs to their data
1138
+ */
1659
1139
  export type FlowNodeDataMap = {
1660
1140
  [key: string]: FlowNodeData;
1661
1141
  };
1662
- export interface FlowEdge {
1663
- id: string;
1664
- type: string;
1665
- source: string;
1666
- target: string;
1667
- source_handle?: string;
1668
- target_handle?: string;
1669
- }
1670
- /**
1671
- * OutputFieldMapping represents a mapping from a source node's field to an output field in the flow output schema.
1672
- */
1673
- export interface OutputFieldMapping {
1674
- sourceNodeId: string;
1675
- sourceFieldPath: string;
1676
- outputFieldName: string;
1677
- type: string;
1678
- schema: any;
1679
- }
1680
1142
  /**
1681
- * OutputMappings is a map of output field name to OutputFieldMapping.
1143
+ * FlowDTO for API responses
1682
1144
  */
1683
- export type OutputMappings = {
1684
- [key: string]: OutputFieldMapping;
1685
- };
1686
1145
  export interface FlowDTO extends BaseModelDTO, PermissionModelDTO {
1687
1146
  name: string;
1688
1147
  description: string;
1689
1148
  card_image: string;
1690
1149
  thumbnail: string;
1691
1150
  banner_image: string;
1692
- /**
1693
- * Version references
1694
- */
1695
1151
  draft_version_id: string;
1696
1152
  draft_version?: FlowVersionDTO;
1697
1153
  published_version_id: string;
1698
1154
  published_version?: FlowVersionDTO;
1699
- /**
1700
- * Flattened draft version fields for backward compatibility
1701
- * These come from the draft version (the editable one)
1702
- */
1703
1155
  input_schema: any;
1704
1156
  input: FlowRunInputs;
1705
1157
  output_schema: any;
@@ -1709,6 +1161,9 @@ export interface FlowDTO extends BaseModelDTO, PermissionModelDTO {
1709
1161
  edges: FlowEdge[];
1710
1162
  viewport?: FlowViewport;
1711
1163
  }
1164
+ /**
1165
+ * FlowVersionDTO for API responses
1166
+ */
1712
1167
  export interface FlowVersionDTO extends BaseModelDTO {
1713
1168
  graph_version: number;
1714
1169
  input_schema: any;
@@ -1720,17 +1175,16 @@ export interface FlowVersionDTO extends BaseModelDTO {
1720
1175
  edges: FlowEdge[];
1721
1176
  viewport?: FlowViewport;
1722
1177
  }
1178
+ /**
1179
+ * NodeTaskDTO represents a node task reference
1180
+ */
1723
1181
  export interface NodeTaskDTO {
1724
1182
  task_id: string;
1725
1183
  task?: TaskDTO;
1726
1184
  }
1727
- export type FlowRunStatus = number;
1728
- export declare const FlowRunStatusUnknown: FlowRunStatus;
1729
- export declare const FlowRunStatusPending: FlowRunStatus;
1730
- export declare const FlowRunStatusRunning: FlowRunStatus;
1731
- export declare const FlowRunStatusCompleted: FlowRunStatus;
1732
- export declare const FlowRunStatusFailed: FlowRunStatus;
1733
- export declare const FlowRunStatusCancelled: FlowRunStatus;
1185
+ /**
1186
+ * FlowRunDTO for API responses
1187
+ */
1734
1188
  export interface FlowRunDTO extends BaseModelDTO, PermissionModelDTO {
1735
1189
  flow_id: string;
1736
1190
  flow_version_id: string;
@@ -1748,56 +1202,6 @@ export interface FlowRunDTO extends BaseModelDTO, PermissionModelDTO {
1748
1202
  [key: string]: NodeTaskDTO | undefined;
1749
1203
  };
1750
1204
  }
1751
- /**
1752
- * Connection represents a connection between nodes in a flow
1753
- */
1754
- export interface FlowNodeConnection {
1755
- nodeId: string;
1756
- key: string;
1757
- type: string;
1758
- previousValue: any;
1759
- }
1760
- export type FlowRunInputs = {
1761
- [key: string]: {
1762
- [key: string]: FlowRunInput;
1763
- };
1764
- };
1765
- export interface FlowRunInput {
1766
- Connection?: FlowNodeConnection;
1767
- Value: any;
1768
- }
1769
- export type GraphNodeType = string;
1770
- export declare const GraphNodeTypeUnknown: GraphNodeType;
1771
- export declare const GraphNodeTypeJoin: GraphNodeType;
1772
- export declare const GraphNodeTypeSplit: GraphNodeType;
1773
- export declare const GraphNodeTypeExecution: GraphNodeType;
1774
- export declare const GraphNodeTypeResource: GraphNodeType;
1775
- export declare const GraphNodeTypeApproval: GraphNodeType;
1776
- export declare const GraphNodeTypeConditional: GraphNodeType;
1777
- export declare const GraphNodeTypeFlowNode: GraphNodeType;
1778
- /**
1779
- * GraphNodeStatus represents the status of a node
1780
- */
1781
- export type GraphNodeStatus = string;
1782
- export declare const GraphNodeStatusPending: GraphNodeStatus;
1783
- export declare const GraphNodeStatusReady: GraphNodeStatus;
1784
- export declare const GraphNodeStatusRunning: GraphNodeStatus;
1785
- export declare const GraphNodeStatusCompleted: GraphNodeStatus;
1786
- export declare const GraphNodeStatusFailed: GraphNodeStatus;
1787
- export declare const GraphNodeStatusCancelled: GraphNodeStatus;
1788
- export declare const GraphNodeStatusSkipped: GraphNodeStatus;
1789
- export declare const GraphNodeStatusBlocked: GraphNodeStatus;
1790
- /**
1791
- * GraphEdgeType defines the type of edge relationship
1792
- */
1793
- export type GraphEdgeType = string;
1794
- export declare const GraphEdgeTypeDependency: GraphEdgeType;
1795
- export declare const GraphEdgeTypeFlow: GraphEdgeType;
1796
- export declare const GraphEdgeTypeConditional: GraphEdgeType;
1797
- export declare const GraphEdgeTypeExecution: GraphEdgeType;
1798
- export declare const GraphEdgeTypeParent: GraphEdgeType;
1799
- export declare const GraphEdgeTypeAncestor: GraphEdgeType;
1800
- export declare const GraphEdgeTypeDuplicate: GraphEdgeType;
1801
1205
  /**
1802
1206
  * GraphNodeDTO is the API representation of a graph node
1803
1207
  */
@@ -1829,18 +1233,73 @@ export interface ChatTraceDTO {
1829
1233
  graph_id: string;
1830
1234
  nodes: (GraphNodeDTO | undefined)[];
1831
1235
  edges: (GraphEdgeDTO | undefined)[];
1832
- /**
1833
- * Summary stats
1834
- */
1835
1236
  total_steps: number;
1836
1237
  completed_steps: number;
1837
1238
  running_steps: number;
1838
1239
  failed_steps: number;
1839
1240
  }
1840
1241
  /**
1841
- * StringSlice is a custom type for storing string slices in the database
1242
+ * InstanceDTO is the API representation of a cloud instance.
1842
1243
  */
1843
- export type StringSlice = string[];
1244
+ export interface InstanceDTO extends BaseModelDTO, PermissionModelDTO {
1245
+ cloud: InstanceCloudProvider;
1246
+ name: string;
1247
+ region: string;
1248
+ shade_cloud: boolean;
1249
+ shade_instance_type: string;
1250
+ cloud_instance_type: string;
1251
+ cloud_assigned_id: string;
1252
+ os?: string;
1253
+ ssh_key_id?: string;
1254
+ ssh_user: string;
1255
+ ssh_port: number;
1256
+ ip: string;
1257
+ status: InstanceStatus;
1258
+ cost_estimate: string;
1259
+ hourly_price: number;
1260
+ template_id?: string;
1261
+ volume_ids?: string[];
1262
+ tags?: string[];
1263
+ configuration?: any;
1264
+ launch_configuration?: any;
1265
+ auto_delete?: any;
1266
+ alert?: any;
1267
+ volume_mount?: any;
1268
+ envs?: any;
1269
+ }
1270
+ /**
1271
+ * InstanceTypeDTO is the API representation of a cloud instance type.
1272
+ */
1273
+ export interface InstanceTypeDTO extends BaseModelDTO, PermissionModelDTO {
1274
+ cloud: InstanceCloudProvider;
1275
+ region: string;
1276
+ shade_instance_type: string;
1277
+ cloud_instance_type: string;
1278
+ deployment_type: InstanceTypeDeploymentType;
1279
+ hourly_price: number;
1280
+ configuration?: InstanceTypeConfiguration;
1281
+ availability: InstanceTypeAvailability[];
1282
+ boot_time?: InstanceTypeBootTime;
1283
+ }
1284
+ export interface InstanceTypeConfiguration {
1285
+ gpu_type: string;
1286
+ interconnect: string;
1287
+ memory_in_gb: number;
1288
+ num_gpus: number;
1289
+ os_options: string[];
1290
+ storage_in_gb: number;
1291
+ vcpus: number;
1292
+ vram_per_gpu_in_gb: number;
1293
+ }
1294
+ export interface InstanceTypeAvailability {
1295
+ available: boolean;
1296
+ region: string;
1297
+ }
1298
+ export interface InstanceTypeBootTime {
1299
+ average_seconds: number;
1300
+ updated_at: string;
1301
+ sample_size: number;
1302
+ }
1844
1303
  /**
1845
1304
  * IntegrationDTO for API responses (never exposes tokens)
1846
1305
  */
@@ -1863,7 +1322,36 @@ export interface IntegrationDTO extends BaseModelDTO, PermissionModelDTO {
1863
1322
  error_message?: string;
1864
1323
  }
1865
1324
  /**
1866
- * KnowledgeFile represents a file in a knowledge entry (stored as JSONB in knowledge_versions)
1325
+ * IntegrationConfigDTO is the API response for integration configuration
1326
+ */
1327
+ export interface IntegrationConfigDTO {
1328
+ provider: string;
1329
+ type: string;
1330
+ auth: string;
1331
+ name: string;
1332
+ short_name: string;
1333
+ description: string;
1334
+ icon_url?: string;
1335
+ how_it_works?: string[];
1336
+ docs_url?: string;
1337
+ secret_fields?: SecretFieldConfig[];
1338
+ allows_byok: boolean;
1339
+ available: boolean;
1340
+ has_managed: boolean;
1341
+ integration?: IntegrationDTO;
1342
+ }
1343
+ /**
1344
+ * SecretFieldConfig defines a secret field for the UI
1345
+ */
1346
+ export interface SecretFieldConfig {
1347
+ key: string;
1348
+ label: string;
1349
+ placeholder: string;
1350
+ sensitive: boolean;
1351
+ optional: boolean;
1352
+ }
1353
+ /**
1354
+ * KnowledgeFile represents a file in a knowledge entry
1867
1355
  */
1868
1356
  export interface KnowledgeFile {
1869
1357
  path: string;
@@ -1872,7 +1360,62 @@ export interface KnowledgeFile {
1872
1360
  hash: string;
1873
1361
  content?: string;
1874
1362
  }
1875
- export type SkillFile = KnowledgeFile;
1363
+ /**
1364
+ * SkillDTO for API responses (backward-compatible naming)
1365
+ */
1366
+ export interface SkillDTO extends BaseModelDTO, PermissionModelDTO {
1367
+ namespace: string;
1368
+ name: string;
1369
+ description: string;
1370
+ repo_url?: string;
1371
+ version_id: string;
1372
+ version?: SkillVersionDTO;
1373
+ }
1374
+ export interface SkillVersionDTO extends BaseModelDTO {
1375
+ skill_id: string;
1376
+ instructions: KnowledgeFile;
1377
+ files: KnowledgeFile[];
1378
+ content_hash: string;
1379
+ description: string;
1380
+ tags: string[];
1381
+ allowed_tools?: string;
1382
+ compatibility?: string;
1383
+ license?: string;
1384
+ source_url?: string;
1385
+ mutation_type?: string;
1386
+ version_notes?: string;
1387
+ disable_model_invocation?: boolean;
1388
+ user_invocable?: boolean;
1389
+ context?: string;
1390
+ metadata?: {
1391
+ [key: string]: string;
1392
+ };
1393
+ }
1394
+ /**
1395
+ * SkillLineageResponse is returned by the lineage endpoint.
1396
+ */
1397
+ export interface SkillLineageResponse {
1398
+ skill: SkillLineageSkillRef;
1399
+ parents: SkillLineageSkillRef[];
1400
+ siblings: SkillLineageSkillRef[];
1401
+ forks: SkillLineageSkillRef[];
1402
+ duplicates: SkillLineageSkillRef[];
1403
+ fork_depth: number;
1404
+ }
1405
+ /**
1406
+ * SkillLineageSkillRef is a compact skill reference for lineage responses.
1407
+ */
1408
+ export interface SkillLineageSkillRef {
1409
+ id: string;
1410
+ namespace: string;
1411
+ name: string;
1412
+ version_count?: number;
1413
+ parent_version_id?: string;
1414
+ versions_since_fork?: number;
1415
+ }
1416
+ /**
1417
+ * PublicSkillStoreDTO for public skill store display
1418
+ */
1876
1419
  export interface PublicSkillStoreDTO {
1877
1420
  id: string;
1878
1421
  category: string;
@@ -1884,41 +1427,72 @@ export interface PublicSkillStoreDTO {
1884
1427
  rank: number;
1885
1428
  has_approved_version: boolean;
1886
1429
  }
1887
- export type PageStatus = number;
1888
- export declare const PageStatusUnknown: PageStatus;
1889
- export declare const PageStatusDraft: PageStatus;
1890
- export declare const PageStatusPublished: PageStatus;
1891
- export declare const PageStatusArchived: PageStatus;
1430
+ /**
1431
+ * SkillStoreListingDTO for API responses
1432
+ */
1433
+ export interface SkillStoreListingDTO {
1434
+ id: string;
1435
+ created_at: string;
1436
+ updated_at: string;
1437
+ deleted_at?: string;
1438
+ category: string;
1439
+ is_featured: boolean;
1440
+ rank: number;
1441
+ installs: number;
1442
+ uses: number;
1443
+ tags?: string[];
1444
+ }
1445
+ /**
1446
+ * StringSlice is a custom type for storing string slices
1447
+ */
1448
+ export type StringSlice = string[];
1449
+ /**
1450
+ * NotificationPreferencesDTO is the data transfer object
1451
+ */
1452
+ export interface NotificationPreferencesDTO extends BaseModelDTO, PermissionModelDTO {
1453
+ email_enabled: boolean;
1454
+ sms_enabled: boolean;
1455
+ push_enabled: boolean;
1456
+ slack_enabled: boolean;
1457
+ billing_notifications: boolean;
1458
+ task_notifications: boolean;
1459
+ system_notifications: boolean;
1460
+ marketing_emails: boolean;
1461
+ quiet_hours_enabled: boolean;
1462
+ quiet_hours_start?: string;
1463
+ quiet_hours_end?: string;
1464
+ timezone: string;
1465
+ }
1466
+ /**
1467
+ * UpdateNotificationPreferencesRequest is the request to update preferences
1468
+ */
1469
+ export interface UpdateNotificationPreferencesRequest {
1470
+ email_enabled?: boolean;
1471
+ sms_enabled?: boolean;
1472
+ push_enabled?: boolean;
1473
+ slack_enabled?: boolean;
1474
+ billing_notifications?: boolean;
1475
+ task_notifications?: boolean;
1476
+ system_notifications?: boolean;
1477
+ marketing_emails?: boolean;
1478
+ quiet_hours_enabled?: boolean;
1479
+ quiet_hours_start?: string;
1480
+ quiet_hours_end?: string;
1481
+ timezone?: string;
1482
+ }
1483
+ /**
1484
+ * PageMetadata holds metadata for a page
1485
+ */
1892
1486
  export interface PageMetadata {
1893
1487
  title: string;
1894
1488
  description: string;
1895
1489
  image: string;
1896
1490
  tags: string[];
1897
- /**
1898
- * Docs-specific fields
1899
- */
1900
1491
  order?: number;
1901
1492
  type?: string;
1902
1493
  icon?: string;
1903
1494
  hide_from_nav?: boolean;
1904
1495
  }
1905
- /**
1906
- * PageType represents the type of page content
1907
- */
1908
- export type PageType = string;
1909
- export declare const PageTypeDoc: PageType;
1910
- export declare const PageTypeBlog: PageType;
1911
- export declare const PageTypePage: PageType;
1912
- export interface PageDTO extends BaseModelDTO, PermissionModelDTO {
1913
- is_featured: boolean;
1914
- title: string;
1915
- content: string;
1916
- excerpt: string;
1917
- status: PageStatus;
1918
- type: PageType;
1919
- metadata: PageMetadata;
1920
- slug: string;
1921
- }
1922
1496
  /**
1923
1497
  * MenuItem represents an item in a menu (can be nested)
1924
1498
  */
@@ -1934,47 +1508,35 @@ export interface MenuItem {
1934
1508
  expanded?: boolean;
1935
1509
  children?: MenuItem[];
1936
1510
  }
1937
- export interface MenuDTO extends BaseModelDTO, PermissionModelDTO {
1938
- name: string;
1939
- slug: string;
1940
- description: string;
1941
- items: MenuItem[];
1942
- }
1943
1511
  /**
1944
- * ProjectType represents different types of projects
1512
+ * PageDTO for API responses
1945
1513
  */
1946
- export type ProjectType = string;
1947
- export declare const ProjectTypeAgent: ProjectType;
1948
- export declare const ProjectTypeApp: ProjectType;
1949
- export declare const ProjectTypeFlow: ProjectType;
1950
- export declare const ProjectTypeOther: ProjectType;
1514
+ export interface PageDTO extends BaseModelDTO, PermissionModelDTO {
1515
+ is_featured: boolean;
1516
+ title: string;
1517
+ content: string;
1518
+ excerpt: string;
1519
+ status: PageStatus;
1520
+ type: PageType;
1521
+ metadata: PageMetadata;
1522
+ slug: string;
1523
+ }
1951
1524
  /**
1952
- * ProjectModel provides optional project association for models
1525
+ * MenuDTO for API responses
1953
1526
  */
1954
- export interface ProjectModel {
1955
- project_id?: string;
1956
- project?: Project;
1527
+ export interface MenuDTO extends BaseModelDTO, PermissionModelDTO {
1528
+ name: string;
1529
+ slug: string;
1530
+ description: string;
1531
+ items: MenuItem[];
1957
1532
  }
1533
+ /**
1534
+ * ProjectModelDTO provides optional project association for DTOs
1535
+ */
1958
1536
  export interface ProjectModelDTO {
1959
1537
  project_id?: string;
1960
1538
  project?: ProjectDTO;
1961
1539
  }
1962
- /**
1963
- * Project represents a container for organizing related resources
1964
- */
1965
- export interface Project extends BaseModel, PermissionModel {
1966
- name: string;
1967
- description: string;
1968
- type: ProjectType;
1969
- color?: string;
1970
- icon?: string;
1971
- /**
1972
- * For future: nested folders/projects
1973
- */
1974
- parent_id?: string;
1975
- parent?: Project;
1976
- children: (Project | undefined)[];
1977
- }
1978
1540
  /**
1979
1541
  * ProjectDTO for API responses
1980
1542
  */
@@ -1988,44 +1550,6 @@ export interface ProjectDTO extends BaseModelDTO, PermissionModelDTO {
1988
1550
  parent?: ProjectDTO;
1989
1551
  children: (ProjectDTO | undefined)[];
1990
1552
  }
1991
- export type ContentRating = string;
1992
- export declare const ContentSafe: ContentRating;
1993
- /**
1994
- * sexual content
1995
- */
1996
- export declare const ContentSexualSuggestive: ContentRating;
1997
- export declare const ContentSexualExplicit: ContentRating;
1998
- /**
1999
- * violence
2000
- */
2001
- export declare const ContentViolenceNonGraphic: ContentRating;
2002
- export declare const ContentViolenceGraphic: ContentRating;
2003
- /**
2004
- * gore
2005
- */
2006
- export declare const ContentGore: ContentRating;
2007
- /**
2008
- * other regulated content
2009
- */
2010
- export declare const ContentDrugs: ContentRating;
2011
- export declare const ContentSelfHarm: ContentRating;
2012
- export declare const ContentUnrated: ContentRating;
2013
- /**
2014
- * SecretRequirement defines a secret that an app requires to run
2015
- */
2016
- export interface SecretRequirement {
2017
- key: string;
2018
- description?: string;
2019
- optional?: boolean;
2020
- }
2021
- /**
2022
- * IntegrationRequirement defines an integration capability that an app requires
2023
- */
2024
- export interface IntegrationRequirement {
2025
- key: string;
2026
- description?: string;
2027
- optional?: boolean;
2028
- }
2029
1553
  /**
2030
1554
  * RequirementError represents a single missing requirement with actionable info
2031
1555
  */
@@ -2043,94 +1567,27 @@ export interface SetupAction {
2043
1567
  provider?: string;
2044
1568
  scopes?: string[];
2045
1569
  }
2046
- export type InstanceCloudProvider = string;
2047
- export declare const CloudAWS: InstanceCloudProvider;
2048
- export declare const CloudAzure: InstanceCloudProvider;
2049
- export declare const CloudLambdaLabs: InstanceCloudProvider;
2050
- export declare const CloudTensorDock: InstanceCloudProvider;
2051
- export declare const CloudRunPod: InstanceCloudProvider;
2052
- export declare const CloudLatitude: InstanceCloudProvider;
2053
- export declare const CloudJarvisLabs: InstanceCloudProvider;
2054
- export declare const CloudOblivus: InstanceCloudProvider;
2055
- export declare const CloudPaperspace: InstanceCloudProvider;
2056
- export declare const CloudDatacrunch: InstanceCloudProvider;
2057
- export declare const CloudMassedCompute: InstanceCloudProvider;
2058
- export declare const CloudVultr: InstanceCloudProvider;
2059
- export declare const CloudShade: InstanceCloudProvider;
2060
- export type InstanceStatus = string;
2061
- export declare const InstanceStatusPending: InstanceStatus;
2062
- export declare const InstanceStatusActive: InstanceStatus;
2063
- export declare const InstanceStatusDeleted: InstanceStatus;
2064
- export interface Instance extends BaseModel, PermissionModel {
2065
- cloud: InstanceCloudProvider;
2066
- name: string;
2067
- region: string;
2068
- shade_cloud: boolean;
2069
- shade_instance_type: string;
2070
- cloud_instance_type: string;
2071
- cloud_assigned_id: string;
2072
- os?: string;
2073
- ssh_key_id?: string;
2074
- ssh_user: string;
2075
- ssh_port: number;
2076
- ip: string;
2077
- status: InstanceStatus;
2078
- cost_estimate: string;
2079
- hourly_price: number;
2080
- template_id?: string;
2081
- volume_ids?: string[];
2082
- tags?: string[];
2083
- configuration?: InstanceConfiguration;
2084
- launch_configuration?: InstanceLaunchConfiguration;
2085
- auto_delete?: InstanceThresholdConfig;
2086
- alert?: InstanceThresholdConfig;
2087
- volume_mount?: InstanceVolumeMountConfig;
2088
- envs?: InstanceEnvVar[];
2089
- }
2090
- export interface InstanceConfiguration {
2091
- gpu_type: string;
2092
- interconnect: string;
2093
- memory_in_gb: number;
2094
- num_gpus: number;
2095
- os: string;
2096
- storage_in_gb: number;
2097
- vcpus: number;
2098
- vram_per_gpu_in_gb: number;
2099
- }
2100
- export interface InstanceLaunchConfiguration {
2101
- type: string;
2102
- docker_configuration?: InstanceDockerConfig;
2103
- script_configuration?: InstanceScriptConfig;
2104
- }
2105
- export interface InstanceDockerConfig {
2106
- image: string;
2107
- args?: string;
2108
- shared_memory_in_gb?: number;
2109
- envs?: InstanceEnvVar[];
2110
- port_mappings?: InstancePortMapping[];
2111
- volume_mounts?: InstanceVolumeMount[];
2112
- }
2113
- export interface InstanceScriptConfig {
2114
- base64_script: string;
2115
- }
2116
- export interface InstancePortMapping {
2117
- host_port: number;
2118
- container_port: number;
2119
- }
2120
- export interface InstanceVolumeMount {
2121
- host_path: string;
2122
- container_path: string;
2123
- }
2124
- export interface InstanceThresholdConfig {
2125
- date_threshold?: string;
2126
- spend_threshold?: string;
1570
+ /**
1571
+ * CheckRequirementsRequest is the request body for checking requirements
1572
+ */
1573
+ export interface CheckRequirementsRequest {
1574
+ secrets?: SecretRequirement[];
1575
+ integrations?: IntegrationRequirement[];
2127
1576
  }
2128
- export interface InstanceVolumeMountConfig {
2129
- auto: boolean;
1577
+ /**
1578
+ * CheckRequirementsResponse is the API response for checking requirements
1579
+ */
1580
+ export interface CheckRequirementsResponse {
1581
+ satisfied: boolean;
1582
+ errors?: RequirementError[];
2130
1583
  }
2131
- export interface InstanceEnvVar {
2132
- name: string;
2133
- value: string;
1584
+ /**
1585
+ * SDKTypes is a phantom type for gotypegen dependency tracing.
1586
+ * Types listed here (and their transitive dependencies) are included
1587
+ * in the generated SDK output (TypeScript, Python, Go).
1588
+ * To expose a type to SDK consumers: reference it in this struct.
1589
+ */
1590
+ export interface SDKTypes {
2134
1591
  }
2135
1592
  /**
2136
1593
  * Hardware/System related types
@@ -2229,7 +1686,7 @@ export interface CachedRepoInfo {
2229
1686
  size_on_disk_str: string;
2230
1687
  nb_files: number;
2231
1688
  refs: string[];
2232
- Revisions: CachedRevisionInfo[];
1689
+ revisions: CachedRevisionInfo[];
2233
1690
  }
2234
1691
  /**
2235
1692
  * HFCacheInfo represents information about the Huggingface cache
@@ -2241,47 +1698,9 @@ export interface HFCacheInfo {
2241
1698
  warnings: string[];
2242
1699
  }
2243
1700
  /**
2244
- * TaskStatus represents the state of a task in its lifecycle.
2245
- * DESIGN NOTES:
2246
- * - Stored as int in DB for compact storage. New statuses can be added with any int value.
2247
- * - Logical ordering is defined by statusOrder map, NOT by the int values.
2248
- * - To add a new status: add const with next available int, add to statusOrder at correct position.
2249
- * - SQL queries use explicit lists (IN, NOT IN) via helper functions, not range comparisons.
2250
- * - This design allows future migration to string-based storage without breaking changes.
2251
- */
2252
- export type TaskStatus = number;
2253
- export declare const TaskStatusUnknown: TaskStatus;
2254
- export declare const TaskStatusReceived: TaskStatus;
2255
- export declare const TaskStatusQueued: TaskStatus;
2256
- export declare const TaskStatusDispatched: TaskStatus;
2257
- export declare const TaskStatusPreparing: TaskStatus;
2258
- export declare const TaskStatusServing: TaskStatus;
2259
- export declare const TaskStatusSettingUp: TaskStatus;
2260
- export declare const TaskStatusRunning: TaskStatus;
2261
- export declare const TaskStatusCancelling: TaskStatus;
2262
- export declare const TaskStatusUploading: TaskStatus;
2263
- export declare const TaskStatusCompleted: TaskStatus;
2264
- export declare const TaskStatusFailed: TaskStatus;
2265
- export declare const TaskStatusCancelled: TaskStatus;
2266
- export type Infra = string;
2267
- export declare const InfraPrivate: Infra;
2268
- export declare const InfraCloud: Infra;
2269
- export declare const InfraPrivateFirst: Infra;
2270
- /**
2271
- * TaskAction defines an action to execute when a task reaches a specific status.
2272
- * Used by the action projector to trigger side effects (e.g., updating app covers).
2273
- */
2274
- export interface TaskAction {
2275
- key: string;
2276
- on: string;
2277
- params?: any;
2278
- }
2279
- /**
2280
- * TaskMetadata holds optional metadata attached to a task.
1701
+ * TaskEvent represents a single status transition event.
1702
+ * Duplicated here (no gorm tags) so DTOs can reference it without importing models.
2281
1703
  */
2282
- export interface TaskMetadata {
2283
- action?: TaskAction;
2284
- }
2285
1704
  export interface TaskEvent {
2286
1705
  id: string;
2287
1706
  created_at: string;
@@ -2289,12 +1708,9 @@ export interface TaskEvent {
2289
1708
  task_id: string;
2290
1709
  status: TaskStatus;
2291
1710
  }
2292
- export type TaskLogType = number;
2293
- export declare const TaskLogTypeBuild: TaskLogType;
2294
- export declare const TaskLogTypeRun: TaskLogType;
2295
- export declare const TaskLogTypeServe: TaskLogType;
2296
- export declare const TaskLogTypeSetup: TaskLogType;
2297
- export declare const TaskLogTypeTask: TaskLogType;
1711
+ /**
1712
+ * TaskLog represents a single log entry for a task.
1713
+ */
2298
1714
  export interface TaskLog {
2299
1715
  id: string;
2300
1716
  created_at: string;
@@ -2303,6 +1719,9 @@ export interface TaskLog {
2303
1719
  log_type: TaskLogType;
2304
1720
  content: string;
2305
1721
  }
1722
+ /**
1723
+ * TaskDTO is the full API response for a task.
1724
+ */
2306
1725
  export interface TaskDTO extends BaseModelDTO, PermissionModelDTO {
2307
1726
  graph_id?: string;
2308
1727
  user_public_key: string;
@@ -2324,9 +1743,9 @@ export interface TaskDTO extends BaseModelDTO, PermissionModelDTO {
2324
1743
  agent_version_id?: string;
2325
1744
  agent?: AgentDTO;
2326
1745
  engine_id?: string;
2327
- engine?: EngineStateSummary;
1746
+ engine?: EngineSummary;
2328
1747
  worker_id?: string;
2329
- worker?: WorkerStateSummary;
1748
+ worker?: WorkerSummary;
2330
1749
  run_at?: string;
2331
1750
  webhook?: string;
2332
1751
  setup?: any;
@@ -2336,51 +1755,32 @@ export interface TaskDTO extends BaseModelDTO, PermissionModelDTO {
2336
1755
  rating: ContentRating;
2337
1756
  events: TaskEvent[];
2338
1757
  logs: TaskLog[];
2339
- usage_events: (UsageEvent | undefined)[];
1758
+ usage_events: (UsageEventDTO | undefined)[];
2340
1759
  session_id?: string;
2341
1760
  session_timeout?: number;
2342
1761
  }
2343
- export type TeamType = string;
2344
- export declare const TeamTypePersonal: TeamType;
2345
- export declare const TeamTypeTeam: TeamType;
2346
- export declare const TeamTypeSystem: TeamType;
2347
- export type TeamStatus = string;
2348
- export declare const TeamStatusActive: TeamStatus;
2349
- export declare const TeamStatusSuspended: TeamStatus;
2350
- export declare const TeamStatusTerminated: TeamStatus;
2351
- export interface Team extends BaseModel {
2352
- type: TeamType;
2353
- username: string;
2354
- email: string;
2355
- name: string;
2356
- avatar_url: string;
2357
- /**
2358
- * SetupCompleted indicates whether the team has completed initial setup (chosen a username)
2359
- * Personal teams start with SetupCompleted=false and a generated temporary username
2360
- */
2361
- setup_completed: boolean;
2362
- /**
2363
- * MaxConcurrency limits total active tasks for this team (0 = use default)
2364
- */
2365
- max_concurrency: number;
2366
- status: TeamStatus;
1762
+ /**
1763
+ * TeamMemberDTO is the API response for a team member.
1764
+ */
1765
+ export interface TeamMemberDTO {
1766
+ id: string;
1767
+ user_id: string;
1768
+ team_id: string;
1769
+ role: TeamRole;
1770
+ user?: TeamMemberUserDTO;
2367
1771
  }
2368
- export interface TeamDTO extends BaseModelDTO {
2369
- type: TeamType;
1772
+ /**
1773
+ * TeamMemberUserDTO is a lightweight user view within team membership.
1774
+ */
1775
+ export interface TeamMemberUserDTO {
1776
+ id: string;
1777
+ email: string;
2370
1778
  name: string;
2371
- username: string;
1779
+ full_name: string;
2372
1780
  avatar_url: string;
2373
- email: string;
2374
- setup_completed: boolean;
2375
- max_concurrency: number;
2376
- status: TeamStatus;
2377
1781
  }
2378
- export type TeamRole = string;
2379
- export declare const TeamRoleOwner: TeamRole;
2380
- export declare const TeamRoleAdmin: TeamRole;
2381
- export declare const TeamRoleMember: TeamRole;
2382
1782
  /**
2383
- * Team-related types
1783
+ * TeamRelationDTO is a lightweight team reference embedded in other DTOs.
2384
1784
  */
2385
1785
  export interface TeamRelationDTO {
2386
1786
  id: string;
@@ -2391,6 +1791,27 @@ export interface TeamRelationDTO {
2391
1791
  avatar_url: string;
2392
1792
  setup_completed: boolean;
2393
1793
  }
1794
+ /**
1795
+ * TeamInviteDTO is the public representation of an invite
1796
+ */
1797
+ export interface TeamInviteDTO {
1798
+ id: string;
1799
+ team_id: string;
1800
+ email: string;
1801
+ role: TeamRole;
1802
+ status: TeamInviteStatus;
1803
+ expires_at: string;
1804
+ created_at: string;
1805
+ invited_by?: TeamMemberUserDTO;
1806
+ team?: TeamRelationDTO;
1807
+ }
1808
+ /**
1809
+ * TeamInviteCreateRequest is used when creating a team invite
1810
+ */
1811
+ export interface TeamInviteCreateRequest {
1812
+ email: string;
1813
+ role: TeamRole;
1814
+ }
2394
1815
  /**
2395
1816
  * ToolInvocationFunction contains the function details for a tool invocation
2396
1817
  */
@@ -2398,17 +1819,6 @@ export interface ToolInvocationFunction {
2398
1819
  name: string;
2399
1820
  arguments: StringEncodedMap;
2400
1821
  }
2401
- /**
2402
- * ToolInvocationStatus represents the execution status of a tool invocation
2403
- */
2404
- export type ToolInvocationStatus = string;
2405
- export declare const ToolInvocationStatusPending: ToolInvocationStatus;
2406
- export declare const ToolInvocationStatusInProgress: ToolInvocationStatus;
2407
- export declare const ToolInvocationStatusAwaitingInput: ToolInvocationStatus;
2408
- export declare const ToolInvocationStatusAwaitingApproval: ToolInvocationStatus;
2409
- export declare const ToolInvocationStatusCompleted: ToolInvocationStatus;
2410
- export declare const ToolInvocationStatusFailed: ToolInvocationStatus;
2411
- export declare const ToolInvocationStatusCancelled: ToolInvocationStatus;
2412
1822
  /**
2413
1823
  * ToolInvocationDTO for API responses
2414
1824
  */
@@ -2421,49 +1831,43 @@ export interface ToolInvocationDTO extends BaseModelDTO, PermissionModelDTO {
2421
1831
  function: ToolInvocationFunction;
2422
1832
  status: ToolInvocationStatus;
2423
1833
  result?: string;
2424
- /**
2425
- * Unified fields
2426
- */
2427
1834
  data?: any;
2428
1835
  widget?: Widget;
2429
1836
  }
2430
- export interface Tool {
2431
- type: string;
2432
- function: ToolFunction;
1837
+ /**
1838
+ * MetaItem represents metadata about an input or output item
1839
+ */
1840
+ export interface MetaItem {
1841
+ type: MetaItemType;
1842
+ tokens?: number;
1843
+ width?: number;
1844
+ height?: number;
1845
+ resolution_mp?: number;
1846
+ steps?: number;
1847
+ count?: number;
1848
+ resolution?: VideoResolution;
1849
+ seconds?: number;
1850
+ fps?: number;
1851
+ sample_rate?: number;
1852
+ cost?: number;
1853
+ extra?: {
1854
+ [key: string]: any;
1855
+ };
2433
1856
  }
2434
- export interface ToolFunction {
2435
- name: string;
2436
- description: string;
2437
- parameters?: ToolParameters;
2438
- required?: string[];
1857
+ /**
1858
+ * OutputMeta contains structured metadata about task inputs and outputs for pricing calculation
1859
+ */
1860
+ export interface OutputMeta {
1861
+ inputs: MetaItem[];
1862
+ outputs: MetaItem[];
2439
1863
  }
2440
- export interface ToolParameters {
2441
- type: string;
2442
- title: string;
2443
- properties?: ToolParameterProperties;
2444
- required?: string[];
2445
- }
2446
- export type ToolParameterProperties = {
2447
- [key: string]: ToolParameterProperty;
2448
- };
2449
- export interface ToolParameterProperty {
2450
- type: string;
2451
- title: string;
2452
- description: string;
2453
- properties?: ToolParameterProperties;
2454
- items?: ToolParameterProperty;
2455
- required?: string[];
2456
- }
2457
- export type UsageEventResourceTier = string;
2458
- export declare const UsageEventResourceTierPrivate: UsageEventResourceTier;
2459
- export declare const UsageEventResourceTierCloud: UsageEventResourceTier;
2460
- export interface UsageEvent extends BaseModel, PermissionModel {
1864
+ /**
1865
+ * UsageEventDTO is the API representation of a usage event.
1866
+ */
1867
+ export interface UsageEventDTO extends BaseModelDTO, PermissionModelDTO {
2461
1868
  usage_billing_record_id: string;
2462
1869
  reference_id: string;
2463
1870
  resource_id: string;
2464
- /**
2465
- * Resource tier
2466
- */
2467
1871
  tier: UsageEventResourceTier;
2468
1872
  type: string;
2469
1873
  model: string;
@@ -2471,24 +1875,8 @@ export interface UsageEvent extends BaseModel, PermissionModel {
2471
1875
  unit: string;
2472
1876
  }
2473
1877
  /**
2474
- * User-related types
1878
+ * UserDTO is the API response for a full user.
2475
1879
  */
2476
- export interface User {
2477
- BaseModel: BaseModel;
2478
- default_team_id: string;
2479
- role: Role;
2480
- email: string;
2481
- email_verified: boolean;
2482
- name: string;
2483
- full_name: string;
2484
- avatar_url: string;
2485
- metadata: UserMetadata;
2486
- }
2487
- export type Role = string;
2488
- export declare const RoleGuest: Role;
2489
- export declare const RoleUser: Role;
2490
- export declare const RoleAdmin: Role;
2491
- export declare const RoleSystem: Role;
2492
1880
  export interface UserDTO extends BaseModelDTO {
2493
1881
  default_team_id: string;
2494
1882
  role: Role;
@@ -2496,10 +1884,10 @@ export interface UserDTO extends BaseModelDTO {
2496
1884
  name: string;
2497
1885
  full_name: string;
2498
1886
  avatar_url: string;
2499
- metadata: UserMetadata;
1887
+ metadata?: UserMetadataDTO;
2500
1888
  }
2501
1889
  /**
2502
- * User-related types
1890
+ * UserRelationDTO is a lightweight user reference embedded in other DTOs.
2503
1891
  */
2504
1892
  export interface UserRelationDTO {
2505
1893
  id: string;
@@ -2508,7 +1896,10 @@ export interface UserRelationDTO {
2508
1896
  role: Role;
2509
1897
  avatar_url: string;
2510
1898
  }
2511
- export interface UserMetadata {
1899
+ /**
1900
+ * UserMetadataDTO is the API representation of user metadata.
1901
+ */
1902
+ export interface UserMetadataDTO {
2512
1903
  user_id: string;
2513
1904
  completed_onboarding: boolean;
2514
1905
  use_case: string;
@@ -2533,56 +1924,6 @@ export interface WidgetActionButton {
2533
1924
  action: WidgetAction;
2534
1925
  variant?: string;
2535
1926
  }
2536
- /**
2537
- * WidgetNodeType constants
2538
- * Primitives (literal values): text, markdown, image, badge, button, input, select, checkbox, row, col
2539
- * Data-bound (read from ToolInvocation.Data): plan-list, key-value, status-badge
2540
- */
2541
- export type WidgetNodeType = string;
2542
- /**
2543
- * Primitive node types (render literal values)
2544
- */
2545
- export declare const WidgetNodeTypeText: WidgetNodeType;
2546
- export declare const WidgetNodeTypeMarkdown: WidgetNodeType;
2547
- export declare const WidgetNodeTypeImage: WidgetNodeType;
2548
- export declare const WidgetNodeTypeBadge: WidgetNodeType;
2549
- export declare const WidgetNodeTypeButton: WidgetNodeType;
2550
- export declare const WidgetNodeTypeInput: WidgetNodeType;
2551
- export declare const WidgetNodeTypeSelect: WidgetNodeType;
2552
- export declare const WidgetNodeTypeCheckbox: WidgetNodeType;
2553
- export declare const WidgetNodeTypeRow: WidgetNodeType;
2554
- export declare const WidgetNodeTypeCol: WidgetNodeType;
2555
- /**
2556
- * Layout node types
2557
- */
2558
- export declare const WidgetNodeTypeBox: WidgetNodeType;
2559
- export declare const WidgetNodeTypeSpacer: WidgetNodeType;
2560
- export declare const WidgetNodeTypeDivider: WidgetNodeType;
2561
- export declare const WidgetNodeTypeForm: WidgetNodeType;
2562
- /**
2563
- * Typography node types
2564
- */
2565
- export declare const WidgetNodeTypeTitle: WidgetNodeType;
2566
- export declare const WidgetNodeTypeCaption: WidgetNodeType;
2567
- export declare const WidgetNodeTypeLabel: WidgetNodeType;
2568
- /**
2569
- * Control node types
2570
- */
2571
- export declare const WidgetNodeTypeTextarea: WidgetNodeType;
2572
- export declare const WidgetNodeTypeRadioGroup: WidgetNodeType;
2573
- export declare const WidgetNodeTypeDatePicker: WidgetNodeType;
2574
- /**
2575
- * Content node types
2576
- */
2577
- export declare const WidgetNodeTypeIcon: WidgetNodeType;
2578
- export declare const WidgetNodeTypeChart: WidgetNodeType;
2579
- export declare const WidgetNodeTypeTransition: WidgetNodeType;
2580
- /**
2581
- * Data-bound node types (deprecated - use templates instead)
2582
- */
2583
- export declare const WidgetNodeTypePlanList: WidgetNodeType;
2584
- export declare const WidgetNodeTypeKeyValue: WidgetNodeType;
2585
- export declare const WidgetNodeTypeStatusBadge: WidgetNodeType;
2586
1927
  /**
2587
1928
  * WidgetNode represents a UI element in a widget (text, input, select, etc.)
2588
1929
  */
@@ -2684,3 +2025,597 @@ export interface Widget {
2684
2025
  children?: WidgetNode[];
2685
2026
  actions?: WidgetActionButton[];
2686
2027
  }
2028
+ export type AppCategory = string;
2029
+ export declare const AppCategoryImage: AppCategory;
2030
+ export declare const AppCategoryVideo: AppCategory;
2031
+ export declare const AppCategoryAudio: AppCategory;
2032
+ export declare const AppCategoryText: AppCategory;
2033
+ export declare const AppCategoryChat: AppCategory;
2034
+ export declare const AppCategory3D: AppCategory;
2035
+ export declare const AppCategoryOther: AppCategory;
2036
+ export declare const AppCategoryFlow: AppCategory;
2037
+ export type GPUType = string;
2038
+ export declare const GPUTypeAny: GPUType;
2039
+ export declare const GPUTypeNone: GPUType;
2040
+ export declare const GPUTypeIntel: GPUType;
2041
+ export declare const GPUTypeNvidia: GPUType;
2042
+ export declare const GPUTypeAMD: GPUType;
2043
+ export declare const GPUTypeApple: GPUType;
2044
+ /**
2045
+ * Visibility represents the visibility level of a resource
2046
+ */
2047
+ export type Visibility = string;
2048
+ export declare const VisibilityPrivate: Visibility;
2049
+ export declare const VisibilityPublic: Visibility;
2050
+ export declare const VisibilityUnlisted: Visibility;
2051
+ export type ChatStatus = string;
2052
+ export declare const ChatStatusBusy: ChatStatus;
2053
+ export declare const ChatStatusIdle: ChatStatus;
2054
+ export declare const ChatStatusAwaitingInput: ChatStatus;
2055
+ export declare const ChatStatusCompleted: ChatStatus;
2056
+ export type PlanStepStatus = string;
2057
+ export declare const PlanStepStatusPending: PlanStepStatus;
2058
+ export declare const PlanStepStatusInProgress: PlanStepStatus;
2059
+ export declare const PlanStepStatusCompleted: PlanStepStatus;
2060
+ export declare const PlanStepStatusCancelled: PlanStepStatus;
2061
+ export type ChatMessageRole = string;
2062
+ export declare const ChatMessageRoleSystem: ChatMessageRole;
2063
+ export declare const ChatMessageRoleUser: ChatMessageRole;
2064
+ export declare const ChatMessageRoleAssistant: ChatMessageRole;
2065
+ export declare const ChatMessageRoleTool: ChatMessageRole;
2066
+ export type ChatMessageStatus = string;
2067
+ export declare const ChatMessageStatusPending: ChatMessageStatus;
2068
+ export declare const ChatMessageStatusReady: ChatMessageStatus;
2069
+ export declare const ChatMessageStatusFailed: ChatMessageStatus;
2070
+ export declare const ChatMessageStatusCancelled: ChatMessageStatus;
2071
+ export type ChatMessageContentType = string;
2072
+ export declare const ChatMessageContentTypeText: ChatMessageContentType;
2073
+ export declare const ChatMessageContentTypeReasoning: ChatMessageContentType;
2074
+ export declare const ChatMessageContentTypeImage: ChatMessageContentType;
2075
+ export declare const ChatMessageContentTypeFile: ChatMessageContentType;
2076
+ export declare const ChatMessageContentTypeTool: ChatMessageContentType;
2077
+ /**
2078
+ * ChatData contains agent-specific data for a chat session
2079
+ */
2080
+ export interface ChatData {
2081
+ plan_steps: PlanStep[];
2082
+ memory: StringEncodedMap;
2083
+ always_allowed_tools: string[];
2084
+ }
2085
+ /**
2086
+ * PlanStep represents a step in an agent's execution plan
2087
+ */
2088
+ export interface PlanStep {
2089
+ index: number;
2090
+ title: string;
2091
+ description: string;
2092
+ notes?: string;
2093
+ status: PlanStepStatus;
2094
+ }
2095
+ /**
2096
+ * ChatMessageContent represents the content of a chat message
2097
+ */
2098
+ export interface ChatMessageContent {
2099
+ type: ChatMessageContentType;
2100
+ error?: string;
2101
+ text?: string;
2102
+ image?: string;
2103
+ file?: string;
2104
+ tool_calls?: ToolCall[];
2105
+ }
2106
+ /**
2107
+ * ChatTaskInput is the input envelope for a chat LLM task
2108
+ */
2109
+ export interface ChatTaskInput {
2110
+ model?: string;
2111
+ context_size: number;
2112
+ temperature?: number;
2113
+ top_p?: number;
2114
+ reasoning_effort?: string;
2115
+ reasoning_max_tokens?: number;
2116
+ system_prompt: string;
2117
+ context: ChatTaskContextMessage[];
2118
+ role?: ChatMessageRole;
2119
+ text?: string;
2120
+ reasoning?: string;
2121
+ /**
2122
+ * Attachments is the SDK input field with full file metadata
2123
+ */
2124
+ attachments?: FileRef[];
2125
+ /**
2126
+ * Images and Files are internal fields for task workers (filled from Attachments or context)
2127
+ */
2128
+ images?: string[];
2129
+ files?: string[];
2130
+ tools?: Tool[];
2131
+ tool_call_id?: string;
2132
+ }
2133
+ /**
2134
+ * ChatTaskContextMessage represents a message in the chat context for LLM tasks
2135
+ */
2136
+ export interface ChatTaskContextMessage {
2137
+ role: ChatMessageRole;
2138
+ text?: string;
2139
+ reasoning?: string;
2140
+ images?: string[];
2141
+ files?: string[];
2142
+ tools?: Tool[];
2143
+ tool_calls?: ToolCall[];
2144
+ tool_call_id?: string;
2145
+ }
2146
+ export type StringEncodedMap = {
2147
+ [key: string]: any;
2148
+ };
2149
+ /**
2150
+ * EngineStatus represents the status of an engine.
2151
+ */
2152
+ export type EngineStatus = string;
2153
+ export declare const EngineStatusRunning: EngineStatus;
2154
+ export declare const EngineStatusPending: EngineStatus;
2155
+ export declare const EngineStatusDraining: EngineStatus;
2156
+ export declare const EngineStatusStopping: EngineStatus;
2157
+ export declare const EngineStatusStopped: EngineStatus;
2158
+ /**
2159
+ * WorkerStatus represents the status of a worker.
2160
+ */
2161
+ export type WorkerStatus = string;
2162
+ export declare const WorkerStatusReserved: WorkerStatus;
2163
+ export declare const WorkerStatusBusy: WorkerStatus;
2164
+ export declare const WorkerStatusIdle: WorkerStatus;
2165
+ export declare const WorkerStatusInactive: WorkerStatus;
2166
+ export type FlowRunStatus = number;
2167
+ export declare const FlowRunStatusUnknown: FlowRunStatus;
2168
+ export declare const FlowRunStatusPending: FlowRunStatus;
2169
+ export declare const FlowRunStatusRunning: FlowRunStatus;
2170
+ export declare const FlowRunStatusCompleted: FlowRunStatus;
2171
+ export declare const FlowRunStatusFailed: FlowRunStatus;
2172
+ export declare const FlowRunStatusCancelled: FlowRunStatus;
2173
+ /**
2174
+ * FlowViewport represents the viewport state of a flow canvas
2175
+ */
2176
+ export interface FlowViewport {
2177
+ x: number;
2178
+ y: number;
2179
+ zoom: number;
2180
+ }
2181
+ /**
2182
+ * FlowNode represents a node in a flow graph
2183
+ */
2184
+ export interface FlowNode {
2185
+ id: string;
2186
+ type: string;
2187
+ position: FlowNodePosition;
2188
+ }
2189
+ /**
2190
+ * FlowNodePosition represents the position of a node
2191
+ */
2192
+ export interface FlowNodePosition {
2193
+ x: number;
2194
+ y: number;
2195
+ }
2196
+ /**
2197
+ * FlowEdge represents an edge between nodes in a flow graph
2198
+ */
2199
+ export interface FlowEdge {
2200
+ id: string;
2201
+ type: string;
2202
+ source: string;
2203
+ target: string;
2204
+ source_handle?: string;
2205
+ target_handle?: string;
2206
+ }
2207
+ /**
2208
+ * FlowNodeConnection represents a connection between nodes in a flow
2209
+ */
2210
+ export interface FlowNodeConnection {
2211
+ nodeId: string;
2212
+ key: string;
2213
+ type: string;
2214
+ previousValue: any;
2215
+ }
2216
+ /**
2217
+ * FlowRunInputs maps node IDs to their input key-value pairs
2218
+ */
2219
+ export type FlowRunInputs = {
2220
+ [key: string]: {
2221
+ [key: string]: FlowRunInput;
2222
+ };
2223
+ };
2224
+ /**
2225
+ * FlowRunInput represents a single input value or connection for a flow node
2226
+ */
2227
+ export interface FlowRunInput {
2228
+ Connection?: FlowNodeConnection;
2229
+ Value: any;
2230
+ }
2231
+ /**
2232
+ * OutputFieldMapping represents a mapping from a source node's field to an output field
2233
+ */
2234
+ export interface OutputFieldMapping {
2235
+ sourceNodeId: string;
2236
+ sourceFieldPath: string;
2237
+ outputFieldName: string;
2238
+ type: string;
2239
+ schema: any;
2240
+ }
2241
+ /**
2242
+ * OutputMappings is a map of output field name to OutputFieldMapping
2243
+ */
2244
+ export type OutputMappings = {
2245
+ [key: string]: OutputFieldMapping;
2246
+ };
2247
+ export type GraphNodeType = string;
2248
+ export declare const GraphNodeTypeUnknown: GraphNodeType;
2249
+ export declare const GraphNodeTypeJoin: GraphNodeType;
2250
+ export declare const GraphNodeTypeSplit: GraphNodeType;
2251
+ export declare const GraphNodeTypeExecution: GraphNodeType;
2252
+ export declare const GraphNodeTypeResource: GraphNodeType;
2253
+ export declare const GraphNodeTypeApproval: GraphNodeType;
2254
+ export declare const GraphNodeTypeConditional: GraphNodeType;
2255
+ export declare const GraphNodeTypeFlowNode: GraphNodeType;
2256
+ /**
2257
+ * GraphNodeStatus represents the status of a node
2258
+ */
2259
+ export type GraphNodeStatus = string;
2260
+ export declare const GraphNodeStatusPending: GraphNodeStatus;
2261
+ export declare const GraphNodeStatusReady: GraphNodeStatus;
2262
+ export declare const GraphNodeStatusRunning: GraphNodeStatus;
2263
+ export declare const GraphNodeStatusCompleted: GraphNodeStatus;
2264
+ export declare const GraphNodeStatusFailed: GraphNodeStatus;
2265
+ export declare const GraphNodeStatusCancelled: GraphNodeStatus;
2266
+ export declare const GraphNodeStatusSkipped: GraphNodeStatus;
2267
+ export declare const GraphNodeStatusBlocked: GraphNodeStatus;
2268
+ /**
2269
+ * GraphEdgeType defines the type of edge relationship
2270
+ */
2271
+ export type GraphEdgeType = string;
2272
+ export declare const GraphEdgeTypeDependency: GraphEdgeType;
2273
+ export declare const GraphEdgeTypeFlow: GraphEdgeType;
2274
+ export declare const GraphEdgeTypeConditional: GraphEdgeType;
2275
+ export declare const GraphEdgeTypeExecution: GraphEdgeType;
2276
+ export declare const GraphEdgeTypeParent: GraphEdgeType;
2277
+ export declare const GraphEdgeTypeAncestor: GraphEdgeType;
2278
+ export declare const GraphEdgeTypeDuplicate: GraphEdgeType;
2279
+ export type EntitlementSource = string;
2280
+ export declare const EntitlementSourceTier: EntitlementSource;
2281
+ export declare const EntitlementSourceOverride: EntitlementSource;
2282
+ export declare const EntitlementSourceWhitelist: EntitlementSource;
2283
+ export declare const EntitlementSourceTrial: EntitlementSource;
2284
+ export type EntitlementType = string;
2285
+ export declare const EntitlementTypeBoolean: EntitlementType;
2286
+ export declare const EntitlementTypeLimit: EntitlementType;
2287
+ /**
2288
+ * EnforcementMode controls how limit violations are handled.
2289
+ */
2290
+ export type EnforcementMode = string;
2291
+ export declare const EnforcementBlock: EnforcementMode;
2292
+ export declare const EnforcementWarn: EnforcementMode;
2293
+ export type PageStatus = number;
2294
+ export declare const PageStatusUnknown: PageStatus;
2295
+ export declare const PageStatusDraft: PageStatus;
2296
+ export declare const PageStatusPublished: PageStatus;
2297
+ export declare const PageStatusArchived: PageStatus;
2298
+ /**
2299
+ * PageType represents the type of page content
2300
+ */
2301
+ export type PageType = string;
2302
+ export declare const PageTypeDoc: PageType;
2303
+ export declare const PageTypeBlog: PageType;
2304
+ export declare const PageTypePage: PageType;
2305
+ /**
2306
+ * ToolInvocationStatus represents the execution status of a tool invocation
2307
+ */
2308
+ export type ToolInvocationStatus = string;
2309
+ export declare const ToolInvocationStatusPending: ToolInvocationStatus;
2310
+ export declare const ToolInvocationStatusInProgress: ToolInvocationStatus;
2311
+ export declare const ToolInvocationStatusAwaitingInput: ToolInvocationStatus;
2312
+ export declare const ToolInvocationStatusAwaitingApproval: ToolInvocationStatus;
2313
+ export declare const ToolInvocationStatusCompleted: ToolInvocationStatus;
2314
+ export declare const ToolInvocationStatusFailed: ToolInvocationStatus;
2315
+ export declare const ToolInvocationStatusCancelled: ToolInvocationStatus;
2316
+ /**
2317
+ * ToolType represents the type of tool (used in both AgentTool definition and ToolInvocation)
2318
+ */
2319
+ export type ToolType = string;
2320
+ export declare const ToolTypeApp: ToolType;
2321
+ export declare const ToolTypeAgent: ToolType;
2322
+ export declare const ToolTypeHook: ToolType;
2323
+ export declare const ToolTypeHTTP: ToolType;
2324
+ export declare const ToolTypeCall: ToolType;
2325
+ export declare const ToolTypeMCP: ToolType;
2326
+ export declare const ToolTypeClient: ToolType;
2327
+ export declare const ToolTypeInternal: ToolType;
2328
+ export type InstanceCloudProvider = string;
2329
+ export declare const CloudAWS: InstanceCloudProvider;
2330
+ export declare const CloudAzure: InstanceCloudProvider;
2331
+ export declare const CloudLambdaLabs: InstanceCloudProvider;
2332
+ export declare const CloudTensorDock: InstanceCloudProvider;
2333
+ export declare const CloudRunPod: InstanceCloudProvider;
2334
+ export declare const CloudLatitude: InstanceCloudProvider;
2335
+ export declare const CloudJarvisLabs: InstanceCloudProvider;
2336
+ export declare const CloudOblivus: InstanceCloudProvider;
2337
+ export declare const CloudPaperspace: InstanceCloudProvider;
2338
+ export declare const CloudDatacrunch: InstanceCloudProvider;
2339
+ export declare const CloudMassedCompute: InstanceCloudProvider;
2340
+ export declare const CloudVultr: InstanceCloudProvider;
2341
+ export declare const CloudShade: InstanceCloudProvider;
2342
+ export type InstanceStatus = string;
2343
+ export declare const InstanceStatusPending: InstanceStatus;
2344
+ export declare const InstanceStatusActive: InstanceStatus;
2345
+ export declare const InstanceStatusDeleted: InstanceStatus;
2346
+ export type InstanceTypeDeploymentType = string;
2347
+ export declare const InstanceTypeDeploymentTypeVM: InstanceTypeDeploymentType;
2348
+ export declare const InstanceTypeDeploymentTypeContainer: InstanceTypeDeploymentType;
2349
+ export declare const InstanceTypeDeploymentTypeBaremetal: InstanceTypeDeploymentType;
2350
+ export type AppSessionStatus = string;
2351
+ export declare const AppSessionStatusActive: AppSessionStatus;
2352
+ export declare const AppSessionStatusEnded: AppSessionStatus;
2353
+ export declare const AppSessionStatusExpired: AppSessionStatus;
2354
+ /**
2355
+ * ProjectType represents different types of projects
2356
+ */
2357
+ export type ProjectType = string;
2358
+ export declare const ProjectTypeAgent: ProjectType;
2359
+ export declare const ProjectTypeApp: ProjectType;
2360
+ export declare const ProjectTypeFlow: ProjectType;
2361
+ export declare const ProjectTypeOther: ProjectType;
2362
+ export type UsageEventResourceTier = string;
2363
+ export declare const UsageEventResourceTierPrivate: UsageEventResourceTier;
2364
+ export declare const UsageEventResourceTierCloud: UsageEventResourceTier;
2365
+ /**
2366
+ * MetaItemType is the type discriminator for MetaItem
2367
+ */
2368
+ export type MetaItemType = string;
2369
+ export declare const MetaItemTypeText: MetaItemType;
2370
+ export declare const MetaItemTypeImage: MetaItemType;
2371
+ export declare const MetaItemTypeVideo: MetaItemType;
2372
+ export declare const MetaItemTypeAudio: MetaItemType;
2373
+ export declare const MetaItemTypeRaw: MetaItemType;
2374
+ /**
2375
+ * VideoResolution represents standard video resolution presets
2376
+ */
2377
+ export type VideoResolution = string;
2378
+ export declare const VideoRes480P: VideoResolution;
2379
+ export declare const VideoRes720P: VideoResolution;
2380
+ export declare const VideoRes1080P: VideoResolution;
2381
+ export declare const VideoRes1440P: VideoResolution;
2382
+ export declare const VideoRes4K: VideoResolution;
2383
+ /**
2384
+ * TeamInviteStatus represents the status of a team invitation
2385
+ */
2386
+ export type TeamInviteStatus = string;
2387
+ export declare const TeamInviteStatusPending: TeamInviteStatus;
2388
+ export declare const TeamInviteStatusAccepted: TeamInviteStatus;
2389
+ export declare const TeamInviteStatusDeclined: TeamInviteStatus;
2390
+ export declare const TeamInviteStatusExpired: TeamInviteStatus;
2391
+ export declare const TeamInviteStatusRevoked: TeamInviteStatus;
2392
+ export type FilterOperator = string;
2393
+ export declare const OpEqual: FilterOperator;
2394
+ export declare const OpNotEqual: FilterOperator;
2395
+ export declare const OpIn: FilterOperator;
2396
+ export declare const OpNotIn: FilterOperator;
2397
+ export declare const OpGreater: FilterOperator;
2398
+ export declare const OpGreaterEqual: FilterOperator;
2399
+ export declare const OpLess: FilterOperator;
2400
+ export declare const OpLessEqual: FilterOperator;
2401
+ export declare const OpLike: FilterOperator;
2402
+ export declare const OpILike: FilterOperator;
2403
+ export declare const OpContains: FilterOperator;
2404
+ export declare const OpNotContains: FilterOperator;
2405
+ export declare const OpIsNull: FilterOperator;
2406
+ export declare const OpIsNotNull: FilterOperator;
2407
+ export declare const OpIsEmpty: FilterOperator;
2408
+ export declare const OpIsNotEmpty: FilterOperator;
2409
+ export type EntitlementResource = string;
2410
+ export declare const ResourceAPIKeys: EntitlementResource;
2411
+ export declare const ResourceConnectors: EntitlementResource;
2412
+ export declare const ResourceKnowledgeBases: EntitlementResource;
2413
+ export declare const ResourcePrivateApps: EntitlementResource;
2414
+ export declare const ResourceStorageMB: EntitlementResource;
2415
+ export declare const ResourceConcurrency: EntitlementResource;
2416
+ export declare const ResourceRatePerMin: EntitlementResource;
2417
+ export declare const ResourceSeats: EntitlementResource;
2418
+ export declare const ResourceTaskExecutions: EntitlementResource;
2419
+ export declare const ResourceFeatureScopes: EntitlementResource;
2420
+ export declare const ResourceFeatureWebhooks: EntitlementResource;
2421
+ export declare const ResourceFeatureBYOK: EntitlementResource;
2422
+ export declare const ResourceFeatureTeamBilling: EntitlementResource;
2423
+ export declare const ResourceFeatureAutoRecharge: EntitlementResource;
2424
+ export declare const ResourceFeatureInvoices: EntitlementResource;
2425
+ export declare const ResourceFeaturePublishApps: EntitlementResource;
2426
+ export type ContentRating = string;
2427
+ export declare const ContentSafe: ContentRating;
2428
+ export declare const ContentSexualSuggestive: ContentRating;
2429
+ export declare const ContentSexualExplicit: ContentRating;
2430
+ export declare const ContentViolenceNonGraphic: ContentRating;
2431
+ export declare const ContentViolenceGraphic: ContentRating;
2432
+ export declare const ContentGore: ContentRating;
2433
+ export declare const ContentUnrated: ContentRating;
2434
+ export type WidgetNodeType = string;
2435
+ export declare const WidgetNodeTypeText: WidgetNodeType;
2436
+ export declare const WidgetNodeTypeMarkdown: WidgetNodeType;
2437
+ export declare const WidgetNodeTypeImage: WidgetNodeType;
2438
+ export declare const WidgetNodeTypeBadge: WidgetNodeType;
2439
+ export declare const WidgetNodeTypeButton: WidgetNodeType;
2440
+ export declare const WidgetNodeTypeInput: WidgetNodeType;
2441
+ export declare const WidgetNodeTypeSelect: WidgetNodeType;
2442
+ export declare const WidgetNodeTypeCheckbox: WidgetNodeType;
2443
+ export declare const WidgetNodeTypeRow: WidgetNodeType;
2444
+ export declare const WidgetNodeTypeCol: WidgetNodeType;
2445
+ export declare const WidgetNodeTypeBox: WidgetNodeType;
2446
+ export declare const WidgetNodeTypeSpacer: WidgetNodeType;
2447
+ export declare const WidgetNodeTypeDivider: WidgetNodeType;
2448
+ export declare const WidgetNodeTypeForm: WidgetNodeType;
2449
+ export declare const WidgetNodeTypeTitle: WidgetNodeType;
2450
+ export declare const WidgetNodeTypeCaption: WidgetNodeType;
2451
+ export declare const WidgetNodeTypeLabel: WidgetNodeType;
2452
+ export declare const WidgetNodeTypeTextarea: WidgetNodeType;
2453
+ export declare const WidgetNodeTypeRadioGroup: WidgetNodeType;
2454
+ export declare const WidgetNodeTypeDatePicker: WidgetNodeType;
2455
+ export declare const WidgetNodeTypeIcon: WidgetNodeType;
2456
+ export declare const WidgetNodeTypeChart: WidgetNodeType;
2457
+ export declare const WidgetNodeTypeTransition: WidgetNodeType;
2458
+ export declare const WidgetNodeTypePlanList: WidgetNodeType;
2459
+ export declare const WidgetNodeTypeKeyValue: WidgetNodeType;
2460
+ export declare const WidgetNodeTypeStatusBadge: WidgetNodeType;
2461
+ /**
2462
+ * TaskStatus represents the state of a task in its lifecycle.
2463
+ */
2464
+ export type TaskStatus = number;
2465
+ export declare const TaskStatusUnknown: TaskStatus;
2466
+ export declare const TaskStatusReceived: TaskStatus;
2467
+ export declare const TaskStatusQueued: TaskStatus;
2468
+ export declare const TaskStatusDispatched: TaskStatus;
2469
+ export declare const TaskStatusPreparing: TaskStatus;
2470
+ export declare const TaskStatusServing: TaskStatus;
2471
+ export declare const TaskStatusSettingUp: TaskStatus;
2472
+ export declare const TaskStatusRunning: TaskStatus;
2473
+ export declare const TaskStatusCancelling: TaskStatus;
2474
+ export declare const TaskStatusUploading: TaskStatus;
2475
+ export declare const TaskStatusCompleted: TaskStatus;
2476
+ export declare const TaskStatusFailed: TaskStatus;
2477
+ export declare const TaskStatusCancelled: TaskStatus;
2478
+ /**
2479
+ * Infra defines where a task should run.
2480
+ */
2481
+ export type Infra = string;
2482
+ export declare const InfraPrivate: Infra;
2483
+ export declare const InfraCloud: Infra;
2484
+ export declare const InfraPrivateFirst: Infra;
2485
+ /**
2486
+ * TaskLogType defines the type of task log.
2487
+ */
2488
+ export type TaskLogType = number;
2489
+ export declare const TaskLogTypeBuild: TaskLogType;
2490
+ export declare const TaskLogTypeRun: TaskLogType;
2491
+ export declare const TaskLogTypeServe: TaskLogType;
2492
+ export declare const TaskLogTypeSetup: TaskLogType;
2493
+ export declare const TaskLogTypeTask: TaskLogType;
2494
+ /**
2495
+ * TaskAction defines an action to execute when a task reaches a specific status.
2496
+ */
2497
+ export interface TaskAction {
2498
+ key: string;
2499
+ on: string;
2500
+ params?: any;
2501
+ }
2502
+ /**
2503
+ * TaskMetadata holds optional metadata attached to a task.
2504
+ */
2505
+ export interface TaskMetadata {
2506
+ action?: TaskAction;
2507
+ }
2508
+ export type TeamType = string;
2509
+ export declare const TeamTypePersonal: TeamType;
2510
+ export declare const TeamTypeTeam: TeamType;
2511
+ export declare const TeamTypeSystem: TeamType;
2512
+ export type TeamStatus = string;
2513
+ export declare const TeamStatusActive: TeamStatus;
2514
+ export declare const TeamStatusSuspended: TeamStatus;
2515
+ export declare const TeamStatusTerminated: TeamStatus;
2516
+ export type TeamRole = string;
2517
+ export declare const TeamRoleOwner: TeamRole;
2518
+ export declare const TeamRoleAdmin: TeamRole;
2519
+ export declare const TeamRoleMember: TeamRole;
2520
+ /**
2521
+ * ToolCallType represents the type field on a tool call (wire format).
2522
+ */
2523
+ export type ToolCallType = string;
2524
+ /**
2525
+ * ToolParamType represents a JSON Schema parameter type for tool definitions.
2526
+ */
2527
+ export type ToolParamType = string;
2528
+ /**
2529
+ * Tool types and parameter types
2530
+ */
2531
+ export declare const ToolTypeFunction: ToolCallType;
2532
+ /**
2533
+ * Tool types and parameter types
2534
+ */
2535
+ export declare const ToolParamTypeObject: ToolParamType;
2536
+ /**
2537
+ * Tool types and parameter types
2538
+ */
2539
+ export declare const ToolParamTypeString: ToolParamType;
2540
+ /**
2541
+ * Tool types and parameter types
2542
+ */
2543
+ export declare const ToolParamTypeInteger: ToolParamType;
2544
+ /**
2545
+ * Tool types and parameter types
2546
+ */
2547
+ export declare const ToolParamTypeNumber: ToolParamType;
2548
+ /**
2549
+ * Tool types and parameter types
2550
+ */
2551
+ export declare const ToolParamTypeBoolean: ToolParamType;
2552
+ /**
2553
+ * Tool types and parameter types
2554
+ */
2555
+ export declare const ToolParamTypeArray: ToolParamType;
2556
+ /**
2557
+ * Tool types and parameter types
2558
+ */
2559
+ export declare const ToolParamTypeNull: ToolParamType;
2560
+ /**
2561
+ * ToolCall represents a tool call from an LLM response (wire format)
2562
+ * This is a transport object for parsing LLM responses, not a database model
2563
+ */
2564
+ export interface ToolCall {
2565
+ id: string;
2566
+ type: ToolCallType;
2567
+ function: ToolCallFunction;
2568
+ }
2569
+ /**
2570
+ * ToolCallFunction contains the function name and arguments from an LLM tool call
2571
+ */
2572
+ export interface ToolCallFunction {
2573
+ name: string;
2574
+ arguments: StringEncodedMap;
2575
+ }
2576
+ /**
2577
+ * FileRef is a lightweight reference to a file with essential metadata.
2578
+ * Used in chat inputs/context instead of full File objects.
2579
+ */
2580
+ export interface FileRef {
2581
+ id?: string;
2582
+ uri: string;
2583
+ filename: string;
2584
+ content_type: string;
2585
+ size?: number;
2586
+ }
2587
+ /**
2588
+ * Tool represents a tool definition for LLM function calling
2589
+ */
2590
+ export interface Tool {
2591
+ type: ToolCallType;
2592
+ function: ToolFunction;
2593
+ }
2594
+ export interface ToolFunction {
2595
+ name: string;
2596
+ description: string;
2597
+ parameters?: ToolParameters;
2598
+ required?: string[];
2599
+ }
2600
+ export interface ToolParameters {
2601
+ type: ToolParamType;
2602
+ title: string;
2603
+ properties?: ToolParameterProperties;
2604
+ required?: string[];
2605
+ }
2606
+ export type ToolParameterProperties = {
2607
+ [key: string]: ToolParameterProperty;
2608
+ };
2609
+ export interface ToolParameterProperty {
2610
+ type: ToolParamType;
2611
+ title: string;
2612
+ description: string;
2613
+ properties?: ToolParameterProperties;
2614
+ items?: ToolParameterProperty;
2615
+ required?: string[];
2616
+ }
2617
+ export type Role = string;
2618
+ export declare const RoleGuest: Role;
2619
+ export declare const RoleUser: Role;
2620
+ export declare const RoleAdmin: Role;
2621
+ export declare const RoleSystem: Role;