@inferencesh/sdk 0.1.1 → 0.1.3

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
@@ -5,13 +5,13 @@ export interface ACL {
5
5
  deleted_at?: string;
6
6
  resource_id: string;
7
7
  owner_id: string;
8
- group_id?: string;
8
+ team_id: string;
9
9
  owner_read: boolean;
10
10
  owner_write: boolean;
11
11
  owner_exec: boolean;
12
- group_read: boolean;
13
- group_write: boolean;
14
- group_exec: boolean;
12
+ team_read: boolean;
13
+ team_write: boolean;
14
+ team_exec: boolean;
15
15
  other_read: boolean;
16
16
  other_write: boolean;
17
17
  other_exec: boolean;
@@ -45,6 +45,26 @@ export interface SubAgentDTO {
45
45
  agent?: AgentDTO;
46
46
  description: string;
47
47
  }
48
+ /**
49
+ * AgentHook represents a webhook that can be called as a tool
50
+ */
51
+ export interface AgentHook {
52
+ name: string;
53
+ description: string;
54
+ url: string;
55
+ secret?: string;
56
+ input_schema?: any;
57
+ }
58
+ /**
59
+ * AgentHookDTO for API responses
60
+ */
61
+ export interface AgentHookDTO {
62
+ name: string;
63
+ description: string;
64
+ url: string;
65
+ secret?: string;
66
+ input_schema?: any;
67
+ }
48
68
  export interface Agent {
49
69
  BaseModel: BaseModel;
50
70
  PermissionModel: PermissionModel;
@@ -61,14 +81,7 @@ export interface Agent {
61
81
  /**
62
82
  * AgentDTO for API responses
63
83
  */
64
- export interface AgentDTO {
65
- id: string;
66
- created_at: string;
67
- updated_at: string;
68
- deleted_at?: string;
69
- user_id: string;
70
- user?: UserRelationDTO;
71
- acl?: ACL;
84
+ export interface AgentDTO extends BaseModel, PermissionModelDTO {
72
85
  name: string;
73
86
  project_id?: string;
74
87
  project?: ProjectDTO;
@@ -86,16 +99,10 @@ export interface AgentVersion {
86
99
  core_app?: AgentApp;
87
100
  core_app_input?: any;
88
101
  sub_agents: (SubAgent | undefined)[];
89
- tool_apps: (AgentApp | undefined)[];
102
+ apps: (AgentApp | undefined)[];
103
+ hooks: (AgentHook | undefined)[];
90
104
  }
91
- export interface AgentVersionDTO {
92
- id: string;
93
- created_at: string;
94
- updated_at: string;
95
- deleted_at?: string;
96
- user_id: string;
97
- user?: UserRelationDTO;
98
- acl?: ACL;
105
+ export interface AgentVersionDTO extends BaseModel, PermissionModelDTO {
99
106
  description: string;
100
107
  system_prompt: string;
101
108
  prompt_template: string;
@@ -103,7 +110,8 @@ export interface AgentVersionDTO {
103
110
  core_app?: AgentApp;
104
111
  core_app_input?: any;
105
112
  sub_agents: (SubAgentDTO | undefined)[];
106
- tool_apps: (AgentAppDTO | undefined)[];
113
+ apps: (AgentAppDTO | undefined)[];
114
+ hooks: (AgentHookDTO | undefined)[];
107
115
  }
108
116
  /**
109
117
  * TimeWindow represents a single analytics time window
@@ -122,9 +130,9 @@ export interface TaskStatusWindow {
122
130
  count: number;
123
131
  }
124
132
  /**
125
- * AppUsage represents usage statistics for an app
133
+ * AppAnalytics represents usage statistics for an app
126
134
  */
127
- export interface AppUsage {
135
+ export interface AppAnalytics {
128
136
  app_id: string;
129
137
  app_username: string;
130
138
  app_name: string;
@@ -161,7 +169,7 @@ export interface TotalMetrics {
161
169
  * Cloud running engines (acl_other_exec = true)
162
170
  */
163
171
  cloud_running_engines: number;
164
- top_apps: AppUsage[];
172
+ top_apps: AppAnalytics[];
165
173
  }
166
174
  /**
167
175
  * RealtimeMetrics contains current system state
@@ -258,14 +266,19 @@ export interface RemoteEngineCreateRequest {
258
266
  start_time: string;
259
267
  end_time: string;
260
268
  }
261
- export interface StripeCheckoutCreateRequest {
269
+ export interface CheckoutCreateRequest {
262
270
  amount: number;
263
271
  success_url: string;
264
272
  cancel_url: string;
265
273
  }
266
- export interface StripeCheckoutCompleteRequest {
274
+ export interface CheckoutCompleteRequest {
267
275
  session_id: string;
268
276
  }
277
+ /**
278
+ * Legacy aliases for backward compatibility
279
+ */
280
+ export type StripeCheckoutCreateRequest = CheckoutCreateRequest;
281
+ export type StripeCheckoutCompleteRequest = CheckoutCompleteRequest;
269
282
  export interface EngineCreateResponse {
270
283
  engine_state?: EngineState;
271
284
  }
@@ -282,6 +295,7 @@ export interface CreateApiKeyRequest {
282
295
  name: string;
283
296
  }
284
297
  export interface CreateTaskRequest {
298
+ id?: string;
285
299
  app_id: string;
286
300
  version_id?: string;
287
301
  variant?: string;
@@ -295,6 +309,7 @@ export interface CreateTaskRequest {
295
309
  agent_id?: string;
296
310
  agent_version_id?: string;
297
311
  tool_call_id?: string;
312
+ graph_id?: string;
298
313
  }
299
314
  export interface CreateAgentMessageRequest {
300
315
  chat_id?: string;
@@ -312,6 +327,53 @@ export interface WidgetActionRequest {
312
327
  action: WidgetAction;
313
328
  form_data?: WidgetFormData;
314
329
  }
330
+ /**
331
+ * ToolResultRequest represents a generic tool result callback
332
+ * Used by hooks and other tools that expect an async callback
333
+ */
334
+ export interface ToolResultRequest {
335
+ result: string;
336
+ }
337
+ /**
338
+ * HookPayload represents the request body sent to a webhook when a hook tool is invoked
339
+ */
340
+ export interface HookPayload {
341
+ /**
342
+ * Identification
343
+ */
344
+ tool_invocation_id: string;
345
+ hook_name: string;
346
+ /**
347
+ * Context
348
+ */
349
+ chat_id: string;
350
+ agent_id?: string;
351
+ agent_version_id?: string;
352
+ /**
353
+ * Callback - use this to submit the result back
354
+ */
355
+ callback_url: string;
356
+ callback_method: string;
357
+ /**
358
+ * Timestamp in RFC3339 format
359
+ */
360
+ timestamp: string;
361
+ /**
362
+ * The actual tool arguments from the LLM
363
+ */
364
+ arguments: {
365
+ [key: string]: any;
366
+ };
367
+ }
368
+ /**
369
+ * HookResponse represents the expected response from the hook URL
370
+ * The hook should return 200 with success:true to acknowledge receipt
371
+ * The actual result should be sent via the callback URL
372
+ */
373
+ export interface HookResponse {
374
+ success: boolean;
375
+ message?: string;
376
+ }
315
377
  export interface ApiTaskRequest {
316
378
  app: string;
317
379
  version?: string;
@@ -398,29 +460,32 @@ export interface QueueMetrics {
398
460
  dlq: number;
399
461
  in_flight: number;
400
462
  }
401
- export interface BlogPostCreateRequest {
463
+ export interface PageCreateRequest {
402
464
  title: string;
403
465
  content: string;
404
466
  excerpt: string;
405
- status: BlogPostStatus;
406
- metadata: BlogPostMetadata;
467
+ status: PageStatus;
468
+ metadata: PageMetadata;
407
469
  slug: string;
408
- category_title?: string;
409
- category_slug?: string;
410
- sub_category_title?: string;
411
- sub_category_slug?: string;
412
- acl?: ACL;
470
+ visibility: Visibility;
413
471
  is_featured: boolean;
414
472
  }
415
- export type BlogPostUpdateRequest = BlogPostCreateRequest;
416
- export interface BlogPostCommentCreateRequest {
417
- blog_post_id: string;
473
+ export type PageUpdateRequest = PageCreateRequest;
474
+ export interface CommentCreateRequest {
475
+ page_id: string;
418
476
  content: string;
419
477
  }
420
- export type BlogPostCommentUpdateRequest = BlogPostCommentCreateRequest;
478
+ export type CommentUpdateRequest = CommentCreateRequest;
479
+ export interface MenuCreateRequest {
480
+ name: string;
481
+ slug: string;
482
+ description: string;
483
+ items: MenuItem[];
484
+ }
485
+ export type MenuUpdateRequest = MenuCreateRequest;
421
486
  export interface TransactionCreateRequest {
422
487
  user_id: string;
423
- group_id?: string;
488
+ team_id: string;
424
489
  type: TransactionType;
425
490
  amount: number;
426
491
  reference: string;
@@ -456,6 +521,8 @@ export interface EnginesForResourcesResponse {
456
521
  }
457
522
  export interface TeamCreateRequest {
458
523
  name: string;
524
+ username: string;
525
+ email: string;
459
526
  }
460
527
  export interface FeatureTaskRequest {
461
528
  is_featured: boolean;
@@ -545,6 +612,135 @@ export interface MoveAgentToProjectRequest {
545
612
  agent_id: string;
546
613
  project_id: string;
547
614
  }
615
+ /**
616
+ * CELEvalRequest is the request for evaluating CEL expressions
617
+ */
618
+ export interface CELEvalRequest {
619
+ pricing: AppPricing;
620
+ output_meta?: OutputMeta;
621
+ resource_cost: number;
622
+ resource_ms: number;
623
+ }
624
+ /**
625
+ * CELEvalResult is the result of a single expression evaluation
626
+ */
627
+ export interface CELEvalResult {
628
+ value: number;
629
+ error?: string;
630
+ }
631
+ /**
632
+ * CELEvalResponse is the response from evaluating CEL expressions
633
+ */
634
+ export interface CELEvalResponse {
635
+ inference_fee: CELEvalResult;
636
+ royalty_fee: CELEvalResult;
637
+ partner_fee: CELEvalResult;
638
+ total: CELEvalResult;
639
+ description: string;
640
+ }
641
+ /**
642
+ * DeviceAuthResponse is returned when a device initiates auth
643
+ */
644
+ export interface DeviceAuthResponse {
645
+ user_code: string;
646
+ device_code: string;
647
+ poll_url: string;
648
+ approve_url: string;
649
+ expires_in: number;
650
+ interval: number;
651
+ }
652
+ /**
653
+ * DeviceAuthPollResponse is returned when polling for auth status
654
+ */
655
+ export interface DeviceAuthPollResponse {
656
+ status: DeviceAuthStatus;
657
+ api_key?: string;
658
+ team_id?: string;
659
+ }
660
+ /**
661
+ * DeviceAuthApproveRequest is sent when user approves the auth request
662
+ */
663
+ export interface DeviceAuthApproveRequest {
664
+ code: string;
665
+ team_id: string;
666
+ }
667
+ /**
668
+ * DeviceAuthApproveResponse is returned after approval
669
+ */
670
+ export interface DeviceAuthApproveResponse {
671
+ success: boolean;
672
+ message?: string;
673
+ }
674
+ /**
675
+ * DeviceAuthCodeInfo contains info about a pending auth code (for display on approve page)
676
+ */
677
+ export interface DeviceAuthCodeInfo {
678
+ user_code: string;
679
+ expires_at: string;
680
+ valid: boolean;
681
+ status: DeviceAuthStatus;
682
+ }
683
+ /**
684
+ * MeResponse is returned from GET /me with user and current team info
685
+ */
686
+ export interface MeResponse {
687
+ user?: UserDTO;
688
+ team?: TeamDTO;
689
+ }
690
+ /**
691
+ * SecretCreateRequest for creating a new secret
692
+ */
693
+ export interface SecretCreateRequest {
694
+ key: string;
695
+ value: string;
696
+ description?: string;
697
+ }
698
+ /**
699
+ * SecretUpdateRequest for updating a secret value
700
+ */
701
+ export interface SecretUpdateRequest {
702
+ value: string;
703
+ description?: string;
704
+ }
705
+ /**
706
+ * IntegrationConnectRequest for initiating an integration connection
707
+ */
708
+ export interface IntegrationConnectRequest {
709
+ provider: string;
710
+ type: string;
711
+ scopes?: string[];
712
+ /**
713
+ * For API Key type
714
+ */
715
+ api_key?: string;
716
+ }
717
+ /**
718
+ * IntegrationCompleteOAuthRequest for completing an OAuth flow
719
+ */
720
+ export interface IntegrationCompleteOAuthRequest {
721
+ provider: string;
722
+ type: string;
723
+ code: string;
724
+ state: string;
725
+ }
726
+ /**
727
+ * IntegrationConnectResponse after connecting
728
+ */
729
+ export interface IntegrationConnectResponse {
730
+ integration?: IntegrationDTO;
731
+ /**
732
+ * For OAuth - redirect URL to start the flow
733
+ */
734
+ auth_url?: string;
735
+ /**
736
+ * For OAuth - state to be returned with the callback (frontend stores this)
737
+ */
738
+ state?: string;
739
+ /**
740
+ * For service accounts - instructions
741
+ */
742
+ instructions?: string;
743
+ }
548
744
  export interface ApiKey {
549
745
  BaseModel: BaseModel;
550
746
  PermissionModel: PermissionModel;
@@ -552,12 +748,7 @@ export interface ApiKey {
552
748
  key: string;
553
749
  last_used_at: string;
554
750
  }
555
- export interface ApiKeyDTO {
556
- id: string;
557
- created_at: string;
558
- updated_at: string;
559
- user_id: string;
560
- user: UserRelationDTO;
751
+ export interface ApiKeyDTO extends BaseModel, PermissionModelDTO {
561
752
  name: string;
562
753
  key: string;
563
754
  last_used_at: string;
@@ -597,7 +788,7 @@ export interface App {
597
788
  description: string;
598
789
  agent_description: string;
599
790
  category: AppCategory;
600
- blog_post_id?: string;
791
+ page_id?: string;
601
792
  license: string;
602
793
  license_mandatory: boolean;
603
794
  needs_hf_token: boolean;
@@ -614,13 +805,35 @@ export interface App {
614
805
  allows_cloud_workers: boolean;
615
806
  fees: AppFees;
616
807
  }
617
- export type PartnerFeeType = string;
618
- export declare const PartnerFeeTypeFixed: PartnerFeeType;
619
- export declare const PartnerFeeTypePerSecond: PartnerFeeType;
808
+ /**
809
+ * AppPricing configures all pricing using CEL expressions
810
+ * CEL context includes: inputs, outputs, prices, resource_cost
811
+ * Empty expressions are skipped (evaluate to 0)
812
+ */
813
+ export interface AppPricing {
814
+ prices: {
815
+ [key: string]: number;
816
+ };
817
+ /**
818
+ * CEL expressions for each fee type (result in microcents)
819
+ * Available variables: inputs, outputs, prices, resource_cost
820
+ */
821
+ inference_expression: string;
822
+ royalty_expression: string;
823
+ partner_expression: string;
824
+ /**
825
+ * Total expression combines all fees (can apply weights/discounts)
826
+ * Available variables: inputs, outputs, prices, resource_cost, inference_fee, royalty_fee, partner_fee
827
+ * If empty, defaults to: resource_cost + inference_fee + royalty_fee + partner_fee
828
+ */
829
+ total_expression: string;
830
+ description: string;
831
+ }
832
+ /**
833
+ * AppFees contains pricing configuration for an app
834
+ */
620
835
  export interface AppFees {
621
- royalty_fee: number;
622
- partner_fee: number;
623
- partner_fee_type: PartnerFeeType;
836
+ app_pricing: AppPricing;
624
837
  }
625
838
  export interface AppGPUResource {
626
839
  count: number;
@@ -654,6 +867,11 @@ export interface AppVersion {
654
867
  metadata: {
655
868
  [key: string]: any;
656
869
  };
870
+ /**
871
+ * App requirements - secrets and integrations needed to run this app
872
+ */
873
+ required_secrets?: SecretRequirement[];
874
+ required_integrations?: IntegrationRequirement[];
657
875
  }
658
876
  export interface AppConfig {
659
877
  name: string;
@@ -669,6 +887,11 @@ export interface AppConfig {
669
887
  variants: {
670
888
  [key: string]: AppVariant;
671
889
  };
890
+ /**
891
+ * App requirements - parsed from YAML
892
+ */
893
+ required_secrets?: SecretRequirement[];
894
+ required_integrations?: IntegrationRequirement[];
672
895
  }
673
896
  export interface LicenseRecord {
674
897
  id: string;
@@ -679,25 +902,18 @@ export interface LicenseRecord {
679
902
  app_id: string;
680
903
  license: string;
681
904
  }
682
- export interface AppDTO {
683
- id: string;
684
- created_at: string;
685
- updated_at: string;
686
- deleted_at?: string;
687
- user_id: string;
688
- user?: UserRelationDTO;
905
+ export interface AppDTO extends BaseModel, PermissionModelDTO {
689
906
  name: string;
690
907
  description: string;
691
908
  agent_description: string;
692
909
  category: AppCategory;
693
- blog_post_id?: string;
910
+ page_id?: string;
694
911
  license: string;
695
912
  license_mandatory: boolean;
696
913
  needs_hf_token: boolean;
697
914
  hf_model_url: string;
698
915
  commercial: boolean;
699
916
  status: AppStatus;
700
- acl?: ACL;
701
917
  is_featured: boolean;
702
918
  is_verified: boolean;
703
919
  rank: number;
@@ -711,10 +927,7 @@ export interface AppDTO {
711
927
  allows_private_workers: boolean;
712
928
  allows_cloud_workers: boolean;
713
929
  }
714
- export interface AppVersionDTO {
715
- id: string;
716
- created_at: string;
717
- updated_at: string;
930
+ export interface AppVersionDTO extends BaseModel {
718
931
  variants: {
719
932
  [key: string]: AppVariant;
720
933
  };
@@ -725,6 +938,11 @@ export interface AppVersionDTO {
725
938
  metadata: {
726
939
  [key: string]: any;
727
940
  };
941
+ /**
942
+ * App requirements
943
+ */
944
+ required_secrets?: SecretRequirement[];
945
+ required_integrations?: IntegrationRequirement[];
728
946
  }
729
947
  export interface ChatModelCapabilities {
730
948
  Image: boolean;
@@ -739,20 +957,34 @@ export interface BaseModel {
739
957
  updated_at: string;
740
958
  deleted_at?: string;
741
959
  }
960
+ /**
961
+ * Visibility represents the visibility level of a resource
962
+ */
963
+ export type Visibility = string;
964
+ export declare const VisibilityPrivate: Visibility;
965
+ export declare const VisibilityPublic: Visibility;
966
+ export declare const VisibilityUnlisted: Visibility;
742
967
  export type Permissioned = any;
743
968
  export interface PermissionModel {
744
969
  user_id: string;
745
970
  user?: User;
746
- group_id?: string;
747
- acl?: ACL;
971
+ team_id: string;
972
+ team?: Team;
973
+ visibility: Visibility;
974
+ }
975
+ export interface PermissionModelDTO {
976
+ user_id: string;
977
+ user?: UserRelationDTO;
978
+ team_id: string;
979
+ team?: TeamRelationDTO;
980
+ visibility: Visibility;
748
981
  }
749
982
  export declare const PermRead = "read";
750
983
  export declare const PermWrite = "write";
751
- export declare const PermExec = "exec";
752
984
  export interface AuthContext {
753
- IsAnonymous: boolean;
985
+ Role: Role;
754
986
  UserID: string;
755
- GroupID?: string;
987
+ TeamID: string;
756
988
  }
757
989
  /**
758
990
  * Versioned interface for optimistic locking
@@ -773,6 +1005,27 @@ export interface EncryptedModel {
773
1005
  user_pre_key: string;
774
1006
  engine_public_key: string;
775
1007
  }
1008
+ /**
1009
+ * StripePaymentMetadata holds Stripe-specific payment method details
1010
+ */
1011
+ export interface StripePaymentMetadata {
1012
+ payment_method_id?: string;
1013
+ last4?: string;
1014
+ brand?: string;
1015
+ exp_month?: number;
1016
+ exp_year?: number;
1017
+ }
1018
+ /**
1019
+ * PaymentProvider represents the payment provider being used
1020
+ */
1021
+ export type PaymentProvider = string;
1022
+ export declare const PaymentProviderNone: PaymentProvider;
1023
+ export declare const PaymentProviderStripe: PaymentProvider;
1024
+ export type BillingStatus = string;
1025
+ export declare const BillingStatusActive: BillingStatus;
1026
+ export declare const BillingStatusSpendLocked: BillingStatus;
1027
+ export declare const BillingStatusManualHold: BillingStatus;
1028
+ export declare const BillingStatusSuspended: BillingStatus;
776
1029
  /**
777
1030
  * Billing holds billing information that can be owned by a user or team
778
1031
  * OwnerID is the user ID if no group, or the team/group ID if a group exists
@@ -780,6 +1033,7 @@ export interface EncryptedModel {
780
1033
  export interface Billing {
781
1034
  BaseModel: BaseModel;
782
1035
  PermissionModel: PermissionModel;
1036
+ status: BillingStatus;
783
1037
  /**
784
1038
  * Balance in micro-cents (1 cent = 1,000,000)
785
1039
  */
@@ -792,108 +1046,179 @@ export interface Billing {
792
1046
  /**
793
1047
  * BillingDTO is the data transfer object for Billing
794
1048
  */
795
- export interface BillingDTO {
796
- id: string;
797
- user_id: string;
798
- group_id?: string;
799
- created_at: string;
800
- updated_at: string;
801
- deleted_at?: string;
1049
+ export interface BillingDTO extends BaseModel, PermissionModelDTO {
802
1050
  balance: number;
803
1051
  currency: string;
1052
+ status: BillingStatus;
804
1053
  }
805
- export type BlogPostStatus = number;
806
- export declare const BlogPostStatusUnknown: BlogPostStatus;
807
- export declare const BlogPostStatusDraft: BlogPostStatus;
808
- export declare const BlogPostStatusPublished: BlogPostStatus;
809
- export declare const BlogPostStatusArchived: BlogPostStatus;
810
- export interface BlogPostMetadata {
811
- title: string;
812
- description: string;
813
- image: string;
814
- tags: string[];
1054
+ /**
1055
+ * BillingStatusUpdateRequest is the request to update billing status (admin only)
1056
+ */
1057
+ export interface BillingStatusUpdateRequest {
1058
+ status: BillingStatus;
815
1059
  }
816
- export interface BlogPost {
817
- BaseModel: BaseModel;
818
- PermissionModel: PermissionModel;
819
- is_featured: boolean;
820
- title: string;
821
- content: string;
822
- excerpt: string;
823
- status: BlogPostStatus;
824
- slug: string;
825
- category_title?: string;
826
- category_slug?: string;
827
- sub_category_title?: string;
828
- sub_category_slug?: string;
829
- metadata: BlogPostMetadata;
1060
+ /**
1061
+ * Address represents a structured postal address for billing/invoicing
1062
+ * Fields align with Stripe's address format for easy integration
1063
+ */
1064
+ export interface Address {
1065
+ line1: string;
1066
+ line2: string;
1067
+ city: string;
1068
+ state: string;
1069
+ postal_code: string;
1070
+ country: string;
830
1071
  }
831
- export interface BlogPostDTO {
832
- id: string;
833
- created_at: string;
834
- updated_at: string;
835
- deleted_at?: string;
836
- acl?: ACL;
837
- is_featured: boolean;
838
- user_id: string;
839
- user?: UserRelationDTO;
840
- title: string;
841
- content: string;
842
- excerpt: string;
843
- status: BlogPostStatus;
844
- metadata: BlogPostMetadata;
845
- slug: string;
846
- category_title?: string;
847
- category_slug?: string;
848
- sub_category_title?: string;
849
- sub_category_slug?: string;
850
- }
851
- export type BlogPostCommentStatus = number;
852
- export declare const BlogPostCommentStatusUnknown: BlogPostCommentStatus;
853
- export declare const BlogPostCommentStatusDraft: BlogPostCommentStatus;
854
- export declare const BlogPostCommentStatusPublished: BlogPostCommentStatus;
855
- export declare const BlogPostCommentStatusArchived: BlogPostCommentStatus;
856
- export interface BlogPostComment {
1072
+ /**
1073
+ * BillingSettings holds user-editable billing preferences and configuration
1074
+ * Linked to a Billing account via BillingID
1075
+ */
1076
+ export interface BillingSettings {
857
1077
  BaseModel: BaseModel;
858
1078
  PermissionModel: PermissionModel;
859
- blog_post_id: string;
860
- content: string;
861
- status: BlogPostCommentStatus;
862
1079
  /**
863
- * Relationships
1080
+ * Spending Controls
1081
+ * SpendingLimit is the maximum amount allowed to spend per billing period (in micro-cents, 0 = unlimited)
864
1082
  */
865
- parent_comment_id?: string;
866
- children: BlogPostComment[];
1083
+ spending_limit: number;
1084
+ /**
1085
+ * LowBalanceThreshold triggers alerts when balance drops below this amount (in micro-cents) default to 1 USD
1086
+ */
1087
+ low_balance_threshold: number;
1088
+ /**
1089
+ * Auto-Recharge Settings
1090
+ */
1091
+ auto_recharge_enabled: boolean;
1092
+ auto_recharge_amount: number;
1093
+ auto_recharge_threshold: number;
1094
+ /**
1095
+ * Notification Settings
1096
+ */
1097
+ billing_email: string;
1098
+ low_balance_alerts: boolean;
1099
+ usage_summary_enabled: boolean;
1100
+ usage_summary_interval: string;
1101
+ /**
1102
+ * Business Information (for invoicing)
1103
+ */
1104
+ company_name: string;
1105
+ tax_id: string;
1106
+ /**
1107
+ * Payment Integration (provider-agnostic)
1108
+ */
1109
+ payment_provider: PaymentProvider;
1110
+ provider_customer_id: string;
1111
+ payment_method_id?: string;
1112
+ payment_method_label?: string;
1113
+ provider_metadata: {
1114
+ [key: string]: any;
1115
+ };
867
1116
  }
868
- export interface BlogPostCommentDTO {
869
- id: string;
870
- created_at: string;
871
- updated_at: string;
872
- deleted_at?: string;
873
- user_id: string;
874
- user?: UserRelationDTO;
875
- blog_post_id: string;
876
- content: string;
877
- parent_comment_id?: string;
878
- children: BlogPostCommentDTO[];
879
- status: BlogPostCommentStatus;
1117
+ /**
1118
+ * BillingSettingsDTO is the data transfer object for BillingSettings
1119
+ */
1120
+ export interface BillingSettingsDTO extends BaseModel, PermissionModelDTO {
1121
+ /**
1122
+ * Spending Controls
1123
+ */
1124
+ spending_limit: number;
1125
+ low_balance_threshold: number;
1126
+ /**
1127
+ * Auto-Recharge Settings
1128
+ */
1129
+ auto_recharge_enabled: boolean;
1130
+ auto_recharge_amount: number;
1131
+ auto_recharge_threshold: number;
1132
+ /**
1133
+ * Notification Settings
1134
+ */
1135
+ billing_email: string;
1136
+ low_balance_alerts: boolean;
1137
+ usage_summary_enabled: boolean;
1138
+ usage_summary_interval: string;
1139
+ /**
1140
+ * Business Information
1141
+ */
1142
+ company_name: string;
1143
+ tax_id: string;
1144
+ address: Address;
1145
+ /**
1146
+ * Payment Integration (read-only for user, provider-agnostic)
1147
+ */
1148
+ payment_provider: PaymentProvider;
1149
+ has_payment_method: boolean;
1150
+ payment_method_label?: string;
880
1151
  }
881
- export type ChatType = string;
882
- export type ChatStatus = string;
883
- export declare const ChatStatusPending: ChatStatus;
884
- export declare const ChatStatusInProgress: ChatStatus;
885
- export declare const ChatStatusCompleted: ChatStatus;
886
- export declare const ChatStatusCancelled: ChatStatus;
887
- export interface Chat {
888
- BaseModel: BaseModel;
889
- PermissionModel: PermissionModel;
890
- agent_id?: string;
891
- agent_version_id?: string;
892
- agent?: Agent;
893
- tool_call_id?: string;
894
- parent_id?: string;
895
- parent?: Chat;
896
- children: (Chat | undefined)[];
1152
+ /**
1153
+ * BillingSettingsUpdateRequest represents the fields a user can update
1154
+ */
1155
+ export interface BillingSettingsUpdateRequest {
1156
+ /**
1157
+ * Spending Controls
1158
+ */
1159
+ spending_limit?: number;
1160
+ low_balance_threshold?: number;
1161
+ /**
1162
+ * Auto-Recharge Settings
1163
+ */
1164
+ auto_recharge_enabled?: boolean;
1165
+ auto_recharge_amount?: number;
1166
+ auto_recharge_threshold?: number;
1167
+ /**
1168
+ * Notification Settings
1169
+ */
1170
+ billing_email?: string;
1171
+ low_balance_alerts?: boolean;
1172
+ usage_summary_enabled?: boolean;
1173
+ usage_summary_interval?: string;
1174
+ /**
1175
+ * Business Information
1176
+ */
1177
+ company_name?: string;
1178
+ tax_id?: string;
1179
+ address?: Address;
1180
+ }
1181
+ /**
1182
+ * SetupCheckoutRequest is the request to create a Stripe Checkout session for saving payment methods
1183
+ */
1184
+ export interface SetupCheckoutRequest {
1185
+ success_url: string;
1186
+ cancel_url: string;
1187
+ }
1188
+ /**
1189
+ * SetupCheckoutResponse is returned when creating a Stripe Checkout session for setup
1190
+ */
1191
+ export interface SetupCheckoutResponse {
1192
+ session_id: string;
1193
+ session_url: string;
1194
+ }
1195
+ /**
1196
+ * SetupCheckoutCompleteRequest is the request to complete the setup after returning from Stripe
1197
+ */
1198
+ export interface SetupCheckoutCompleteRequest {
1199
+ session_id: string;
1200
+ }
1201
+ /**
1202
+ * PaymentMethodResponse is the response after successfully saving a payment method
1203
+ */
1204
+ export interface PaymentMethodResponse {
1205
+ last4: string;
1206
+ brand: string;
1207
+ }
1208
+ export type ChatType = string;
1209
+ export type ChatStatus = string;
1210
+ export declare const ChatStatusBusy: ChatStatus;
1211
+ export declare const ChatStatusIdle: ChatStatus;
1212
+ export interface Chat {
1213
+ BaseModel: BaseModel;
1214
+ PermissionModel: PermissionModel;
1215
+ agent_id?: string;
1216
+ agent_version_id?: string;
1217
+ agent?: Agent;
1218
+ tool_call_id?: string;
1219
+ parent_id?: string;
1220
+ parent?: Chat;
1221
+ children: (Chat | undefined)[];
897
1222
  name: string;
898
1223
  description: string;
899
1224
  chat_messages: ChatMessage[];
@@ -945,9 +1270,6 @@ export interface ChatMessageContent {
945
1270
  file?: string;
946
1271
  tool_calls?: ToolInvocation[];
947
1272
  }
948
- export type StringEncodedMap = {
949
- [key: string]: any;
950
- };
951
1273
  export interface ToolInvocationFunction {
952
1274
  name: string;
953
1275
  arguments: StringEncodedMap;
@@ -964,6 +1286,8 @@ export declare const ToolInvocationTypeInternal: ToolInvocationType;
964
1286
  export declare const ToolInvocationTypeApp: ToolInvocationType;
965
1287
  export declare const ToolInvocationTypeAgent: ToolInvocationType;
966
1288
  export declare const ToolInvocationTypeWidget: ToolInvocationType;
1289
+ export declare const ToolInvocationTypePlan: ToolInvocationType;
1290
+ export declare const ToolInvocationTypeHook: ToolInvocationType;
967
1291
  export declare const ToolInvocationTypeUnknown: ToolInvocationType;
968
1292
  export type ToolInvocationStatus = string;
969
1293
  export declare const ToolInvocationStatusPending: ToolInvocationStatus;
@@ -978,28 +1302,23 @@ export interface AgentToolInvocation {
978
1302
  chat_message_id: string;
979
1303
  tool_invocation_id: string;
980
1304
  type: ToolInvocationType;
1305
+ execution_id?: string;
981
1306
  function: ToolInvocationFunction;
982
1307
  status: ToolInvocationStatus;
983
1308
  result?: string;
984
- widget: Widget;
985
- task_id?: string;
986
- chat_id?: string;
1309
+ widget?: Widget;
1310
+ plan_steps?: AgentPlanStep[];
987
1311
  }
988
- export interface AgentToolInvocationDTO {
989
- id: string;
990
- created_at: string;
991
- updated_at: string;
992
- deleted_at?: string;
993
- user_id: string;
1312
+ export interface AgentToolInvocationDTO extends BaseModel, PermissionModelDTO {
994
1313
  chat_message_id: string;
995
1314
  tool_invocation_id: string;
996
1315
  type: ToolInvocationType;
1316
+ execution_id?: string;
997
1317
  function: ToolInvocationFunction;
998
1318
  status: ToolInvocationStatus;
999
1319
  result?: string;
1000
- widget: Widget;
1001
- task_id?: string;
1002
- chat_id?: string;
1320
+ widget?: Widget;
1321
+ plan_steps?: AgentPlanStep[];
1003
1322
  }
1004
1323
  /**
1005
1324
  * This is a transport object, not a database model
@@ -1041,6 +1360,7 @@ export interface ChatTaskOutput {
1041
1360
  usage?: LLMUsage;
1042
1361
  }
1043
1362
  export interface ChatTaskInput {
1363
+ model?: string;
1044
1364
  context_size: number;
1045
1365
  temperature?: number;
1046
1366
  top_p?: number;
@@ -1061,6 +1381,7 @@ export interface BaseLLMInput {
1061
1381
  app_id: string;
1062
1382
  app_version_id?: string;
1063
1383
  app_variant?: string;
1384
+ model?: string;
1064
1385
  system_prompt: string;
1065
1386
  tools?: Tool[];
1066
1387
  context_size: number;
@@ -1081,17 +1402,11 @@ export interface ChatTaskContextMessage {
1081
1402
  tool_calls?: ToolInvocation[];
1082
1403
  tool_call_id?: string;
1083
1404
  }
1084
- export interface ChatDTO {
1085
- id: string;
1086
- created_at: string;
1087
- updated_at: string;
1088
- deleted_at?: string;
1089
- user_id: string;
1090
- user: UserRelationDTO;
1091
- acl?: ACL;
1405
+ export interface ChatDTO extends BaseModel, PermissionModelDTO {
1092
1406
  parent_id?: string;
1093
1407
  parent?: ChatDTO;
1094
1408
  children: (ChatDTO | undefined)[];
1409
+ status: ChatStatus;
1095
1410
  agent_id?: string;
1096
1411
  agent_version_id?: string;
1097
1412
  agent?: AgentDTO;
@@ -1100,13 +1415,7 @@ export interface ChatDTO {
1100
1415
  chat_messages: ChatMessageDTO[];
1101
1416
  agent_data: AgentData;
1102
1417
  }
1103
- export interface ChatMessageDTO {
1104
- id: string;
1105
- created_at: string;
1106
- updated_at: string;
1107
- deleted_at?: string;
1108
- user_id: string;
1109
- user?: UserRelationDTO;
1418
+ export interface ChatMessageDTO extends BaseModel, PermissionModelDTO {
1110
1419
  chat_id: string;
1111
1420
  chat?: ChatDTO;
1112
1421
  order: number;
@@ -1118,6 +1427,9 @@ export interface ChatMessageDTO {
1118
1427
  tool_call_id?: string;
1119
1428
  tool_invocations?: AgentToolInvocationDTO[];
1120
1429
  }
1430
+ export type StringEncodedMap = {
1431
+ [key: string]: any;
1432
+ };
1121
1433
  /**
1122
1434
  * SearchRequest represents a search request
1123
1435
  */
@@ -1231,6 +1543,29 @@ export interface CursorConfig {
1231
1543
  direction: string;
1232
1544
  value: any;
1233
1545
  }
1546
+ export type DeviceAuthStatus = string;
1547
+ export declare const DeviceAuthStatusPending: DeviceAuthStatus;
1548
+ export declare const DeviceAuthStatusApproved: DeviceAuthStatus;
1549
+ export declare const DeviceAuthStatusExpired: DeviceAuthStatus;
1550
+ export declare const DeviceAuthStatusDenied: DeviceAuthStatus;
1551
+ export declare const DeviceAuthStatusValid: DeviceAuthStatus;
1552
+ export declare const DeviceAuthStatusInvalid: DeviceAuthStatus;
1553
+ export declare const DeviceAuthStatusLoading: DeviceAuthStatus;
1554
+ /**
1555
+ * DeviceAuthCode represents a device authorization code for device/CLI authentication
1556
+ */
1557
+ export interface DeviceAuthCode {
1558
+ id: string;
1559
+ user_code: string;
1560
+ device_code: string;
1561
+ status: DeviceAuthStatus;
1562
+ user_id: string;
1563
+ team_id: string;
1564
+ api_key: string;
1565
+ expires_at: string;
1566
+ created_at: string;
1567
+ updated_at: string;
1568
+ }
1234
1569
  /**
1235
1570
  * Engine-related types
1236
1571
  */
@@ -1258,14 +1593,7 @@ export interface LocalEngineState {
1258
1593
  config: EngineConfig;
1259
1594
  public_key: string;
1260
1595
  }
1261
- export interface EngineStateDTO {
1262
- id: string;
1263
- created_at: string;
1264
- updated_at: string;
1265
- user_id: string;
1266
- user?: UserRelationDTO;
1267
- group_id?: string;
1268
- acl?: ACL;
1596
+ export interface EngineStateDTO extends BaseModel, PermissionModelDTO {
1269
1597
  instance?: Instance;
1270
1598
  config: EngineConfig;
1271
1599
  name: string;
@@ -1274,14 +1602,7 @@ export interface EngineStateDTO {
1274
1602
  system_info?: SystemInfo;
1275
1603
  workers: (WorkerStateDTO | undefined)[];
1276
1604
  }
1277
- export interface EngineStateSummary {
1278
- id: string;
1279
- created_at: string;
1280
- updated_at: string;
1281
- user_id: string;
1282
- user?: UserRelationDTO;
1283
- group_id?: string;
1284
- acl?: ACL;
1605
+ export interface EngineStateSummary extends BaseModel, PermissionModelDTO {
1285
1606
  instance?: Instance;
1286
1607
  name: string;
1287
1608
  status: EngineStatus;
@@ -1330,9 +1651,9 @@ export interface WorkerRAM {
1330
1651
  worker_id: string;
1331
1652
  total: number;
1332
1653
  }
1333
- export interface WorkerStateDTO {
1334
- id: string;
1654
+ export interface WorkerStateDTO extends BaseModel {
1335
1655
  user_id: string;
1656
+ team_id: string;
1336
1657
  index: number;
1337
1658
  status: WorkerStatus;
1338
1659
  engine_id: string;
@@ -1371,12 +1692,7 @@ export interface File {
1371
1692
  size: number;
1372
1693
  filename: string;
1373
1694
  }
1374
- export interface FileDTO {
1375
- id: string;
1376
- created_at: string;
1377
- updated_at: string;
1378
- user_id: string;
1379
- user: UserRelationDTO;
1695
+ export interface FileDTO extends BaseModel, PermissionModelDTO {
1380
1696
  path: string;
1381
1697
  remote_path: string;
1382
1698
  upload_url: string;
@@ -1454,13 +1770,7 @@ export interface OutputFieldMapping {
1454
1770
  export type OutputMappings = {
1455
1771
  [key: string]: OutputFieldMapping;
1456
1772
  };
1457
- export interface FlowDTO {
1458
- id: string;
1459
- created_at: string;
1460
- updated_at: string;
1461
- deleted_at?: string;
1462
- user_id: string;
1463
- user?: UserRelationDTO;
1773
+ export interface FlowDTO extends BaseModel, PermissionModelDTO {
1464
1774
  name: string;
1465
1775
  description: string;
1466
1776
  card_image: string;
@@ -1509,13 +1819,7 @@ export interface FlowRun {
1509
1819
  [key: string]: NodeTask;
1510
1820
  };
1511
1821
  }
1512
- export interface FlowRunDTO {
1513
- id: string;
1514
- created_at: string;
1515
- updated_at: string;
1516
- acl?: ACL;
1517
- user_id: string;
1518
- user?: UserRelationDTO;
1822
+ export interface FlowRunDTO extends BaseModel, PermissionModelDTO {
1519
1823
  flow_id: string;
1520
1824
  flow?: FlowDTO;
1521
1825
  task_id?: string;
@@ -1574,111 +1878,45 @@ export interface NodeHandle {
1574
1878
  type: string;
1575
1879
  name: string;
1576
1880
  }
1577
- export interface GraphModel {
1578
- graph_id?: string;
1579
- }
1580
- /**
1581
- * Graph represents a persistent directed acyclic graph for tracking execution dependencies
1582
- */
1583
- export interface Graph {
1584
- BaseModel: BaseModel;
1585
- PermissionModel: PermissionModel;
1586
- /**
1587
- * Source reference - what created this graph
1588
- */
1589
- source_id: string;
1590
- source_type: string;
1591
- /**
1592
- * Status
1593
- */
1594
- status: GraphStatus;
1595
- /**
1596
- * Metadata
1597
- */
1598
- started_at?: string;
1599
- completed_at?: string;
1600
- error?: string;
1601
- /**
1602
- * Relationships - loaded via GORM joins
1603
- */
1604
- nodes?: (GraphNode | undefined)[];
1605
- edges?: (GraphEdge | undefined)[];
1606
- node_states?: (GraphNodeState | undefined)[];
1607
- }
1881
+ export type GraphNodeType = string;
1882
+ export declare const GraphNodeTypeUnknown: GraphNodeType;
1883
+ export declare const GraphNodeTypeJoin: GraphNodeType;
1884
+ export declare const GraphNodeTypeSplit: GraphNodeType;
1885
+ export declare const GraphNodeTypeTask: GraphNodeType;
1886
+ export declare const GraphNodeTypeResource: GraphNodeType;
1887
+ export declare const GraphNodeTypeConditional: GraphNodeType;
1608
1888
  /**
1609
1889
  * GraphNode represents a node in the execution graph
1610
1890
  */
1611
1891
  export interface GraphNode {
1612
- id: string;
1613
- graph_id: string;
1614
- type: string;
1615
- /**
1616
- * Optional metadata for the node
1617
- */
1618
- name?: string;
1619
- description?: string;
1620
- metadata?: {
1621
- [key: string]: any;
1622
- };
1623
- created_at: string;
1624
- updated_at: string;
1625
- }
1626
- /**
1627
- * GraphEdge represents a dependency between nodes
1628
- */
1629
- export interface GraphEdge {
1630
- id: string;
1631
- graph_id: string;
1632
- from: string;
1633
- to: string;
1634
- /**
1635
- * Edge properties
1636
- */
1637
- type: GraphEdgeType;
1638
- required: boolean;
1639
- completed: boolean;
1640
- metadata?: {
1641
- [key: string]: any;
1642
- };
1643
- created_at: string;
1644
- updated_at: string;
1645
- }
1646
- /**
1647
- * GraphNodeState tracks the execution state of a node
1648
- */
1649
- export interface GraphNodeState {
1650
- node_id: string;
1892
+ BaseModel: BaseModel;
1651
1893
  graph_id: string;
1894
+ type: GraphNodeType;
1895
+ resource_id: string;
1896
+ resource_type: string;
1652
1897
  status: GraphNodeStatus;
1653
1898
  /**
1654
1899
  * Dependency barrier counters
1655
1900
  */
1656
1901
  required_deps: number;
1657
1902
  completed_deps: number;
1658
- /**
1659
- * Link to the actual execution entity (TaskID, ChatMessageID, etc.)
1660
- */
1661
- execution_id?: string;
1662
- execution_type?: string;
1903
+ metadata: StringEncodedMap;
1663
1904
  /**
1664
1905
  * Timing
1665
1906
  */
1666
1907
  ready_at?: string;
1667
1908
  started_at?: string;
1668
1909
  completed_at?: string;
1669
- /**
1670
- * Error tracking
1671
- */
1672
- error?: string;
1673
1910
  retry_count?: number;
1674
- /**
1675
- * Optional: Store outputs if needed for input resolution
1676
- */
1677
- outputs?: {
1678
- [key: string]: any;
1679
- };
1680
- created_at: string;
1681
- updated_at: string;
1911
+ }
1912
+ /**
1913
+ * GraphEdge represents a dependency between nodes
1914
+ */
1915
+ export interface GraphEdge {
1916
+ BaseModel: BaseModel;
1917
+ type: GraphEdgeType;
1918
+ from: string;
1919
+ to: string;
1682
1920
  }
1683
1921
  /**
1684
1922
  * GraphStatus represents the overall status of the graph
@@ -1708,40 +1946,139 @@ export type GraphEdgeType = string;
1708
1946
  export declare const GraphEdgeTypeDependency: GraphEdgeType;
1709
1947
  export declare const GraphEdgeTypeFlow: GraphEdgeType;
1710
1948
  export declare const GraphEdgeTypeConditional: GraphEdgeType;
1711
- export declare const GraphEdgeTypeError: GraphEdgeType;
1712
1949
  /**
1713
- * GraphSpec is used to create a new execution graph
1950
+ * EdgeBuilder is the fluent API for creating graph edges
1951
+ * Usage: service.Wire(ctx, authCtx).Resource(x).FlowsTo().Resource(y)
1714
1952
  */
1715
- export interface GraphSpec {
1716
- SourceID: string;
1717
- SourceType: string;
1718
- Nodes: GraphNodeSpec[];
1719
- Edges: GraphEdgeSpec[];
1720
- }
1953
+ export type GraphEdgeBuilder = any;
1721
1954
  /**
1722
- * GraphNodeSpec specifies a node to be created
1955
+ * GraphEdgeTarget completes the edge to a target
1723
1956
  */
1724
- export interface GraphNodeSpec {
1725
- ID: string;
1726
- Type: string;
1727
- Name: string;
1728
- Description: string;
1729
- Metadata: {
1957
+ export type GraphEdgeTarget = any;
1958
+ /**
1959
+ * Integration providers
1960
+ */
1961
+ export declare const IntegrationProviderGoogle = "google";
1962
+ /**
1963
+ * Integration providers
1964
+ */
1965
+ export declare const IntegrationProviderSlack = "slack";
1966
+ /**
1967
+ * Integration providers
1968
+ */
1969
+ export declare const IntegrationProviderNotion = "notion";
1970
+ /**
1971
+ * Integration providers
1972
+ */
1973
+ export declare const IntegrationProviderGitHub = "github";
1974
+ /**
1975
+ * Integration types
1976
+ */
1977
+ export declare const IntegrationTypeServiceAccount = "service_account";
1978
+ /**
1979
+ * Integration types
1980
+ */
1981
+ export declare const IntegrationTypeOAuth = "oauth";
1982
+ /**
1983
+ * Integration types
1984
+ */
1985
+ export declare const IntegrationTypeAPIKey = "api_key";
1986
+ /**
1987
+ * Integration statuses
1988
+ */
1989
+ export declare const IntegrationStatusConnected = "connected";
1990
+ /**
1991
+ * Integration statuses
1992
+ */
1993
+ export declare const IntegrationStatusDisconnected = "disconnected";
1994
+ /**
1995
+ * Integration statuses
1996
+ */
1997
+ export declare const IntegrationStatusExpired = "expired";
1998
+ /**
1999
+ * Integration statuses
2000
+ */
2001
+ export declare const IntegrationStatusError = "error";
2002
+ /**
2003
+ * StringSlice is a custom type for storing string slices in the database
2004
+ */
2005
+ export type StringSlice = string[];
2006
+ /**
2007
+ * Integration represents a connected external service integration
2008
+ */
2009
+ export interface Integration {
2010
+ BaseModel: BaseModel;
2011
+ PermissionModel: PermissionModel;
2012
+ /**
2013
+ * Provider identifies the service (google, slack, notion, etc.)
2014
+ */
2015
+ provider: string;
2016
+ /**
2017
+ * Type identifies the integration type (service_account, oauth, api_key)
2018
+ */
2019
+ type: string;
2020
+ /**
2021
+ * Status of the integration
2022
+ */
2023
+ status: string;
2024
+ /**
2025
+ * Display name for the integration (user-friendly)
2026
+ */
2027
+ display_name: string;
2028
+ /**
2029
+ * OAuth fields - tokens stored in secrets table for centralized encryption/rotation
2030
+ */
2031
+ scopes: StringSlice;
2032
+ expires_at?: string;
2033
+ /**
2034
+ * Service Account fields
2035
+ */
2036
+ service_account_email: string;
2037
+ /**
2038
+ * Generic metadata for provider-specific data
2039
+ */
2040
+ metadata: {
1730
2041
  [key: string]: any;
1731
2042
  };
2043
+ /**
2044
+ * Error message if status is "error"
2045
+ */
2046
+ error_message?: string;
1732
2047
  }
1733
2048
  /**
1734
- * GraphEdgeSpec specifies an edge to be created
2049
+ * IntegrationDTO for API responses (never exposes tokens)
1735
2050
  */
1736
- export interface GraphEdgeSpec {
1737
- ID: string;
1738
- From: string;
1739
- To: string;
1740
- Type: GraphEdgeType;
1741
- Required: boolean;
1742
- Metadata: {
2051
+ export interface IntegrationDTO extends BaseModel, PermissionModelDTO {
2052
+ provider: string;
2053
+ type: string;
2054
+ status: string;
2055
+ display_name: string;
2056
+ scopes: StringSlice;
2057
+ expires_at?: string;
2058
+ service_account_email?: string;
2059
+ metadata?: {
1743
2060
  [key: string]: any;
1744
2061
  };
2062
+ error_message?: string;
2063
+ }
2064
+ /**
2065
+ * OAuthConfig for OAuth providers
2066
+ */
2067
+ export interface OAuthConfig {
2068
+ ClientID: string;
2069
+ ClientSecret: string;
2070
+ RedirectURL: string;
2071
+ Scopes: string[];
2072
+ }
2073
+ /**
2074
+ * IntegrationCredentials returned by GetCredentials for runtime injection
2075
+ */
2076
+ export interface IntegrationCredentials {
2077
+ Provider: string;
2078
+ Type: string;
2079
+ Secrets: {
2080
+ [key: string]: string;
2081
+ };
1745
2082
  }
1746
2083
  /**
1747
2084
  * ServerCapabilities represents the server's supported features
@@ -1968,36 +2305,353 @@ export interface JSONRPCError {
1968
2305
  message: string;
1969
2306
  data?: any;
1970
2307
  }
1971
- /**
1972
- * NotificationMessage represents a notification message
1973
- */
1974
- export interface NotificationMessage {
1975
- jsonrpc: string;
1976
- method: string;
1977
- params?: any;
2308
+ /**
2309
+ * NotificationMessage represents a notification message
2310
+ */
2311
+ export interface NotificationMessage {
2312
+ jsonrpc: string;
2313
+ method: string;
2314
+ params?: any;
2315
+ }
2316
+ /**
2317
+ * ConnectedEvent represents a connected event
2318
+ */
2319
+ export interface ConnectedEvent {
2320
+ event: string;
2321
+ timestamp: string;
2322
+ }
2323
+ /**
2324
+ * ResourceTemplate represents a resource template
2325
+ */
2326
+ export interface ResourceTemplate {
2327
+ uriTemplate: string;
2328
+ name: string;
2329
+ title?: string;
2330
+ description?: string;
2331
+ mimeType?: string;
2332
+ }
2333
+ /**
2334
+ * ResourceTemplateResponse represents a response for resource template operations
2335
+ */
2336
+ export interface ResourceTemplateResponse {
2337
+ resourceTemplates: ResourceTemplate[];
2338
+ }
2339
+ /**
2340
+ * NotificationChannel represents a delivery channel
2341
+ */
2342
+ export type NotificationChannel = string;
2343
+ export declare const NotificationChannelEmail: NotificationChannel;
2344
+ export declare const NotificationChannelSMS: NotificationChannel;
2345
+ export declare const NotificationChannelPush: NotificationChannel;
2346
+ export declare const NotificationChannelSlack: NotificationChannel;
2347
+ /**
2348
+ * NotificationPriority represents notification priority
2349
+ */
2350
+ export type NotificationPriority = string;
2351
+ export declare const NotificationPriorityLow: NotificationPriority;
2352
+ export declare const NotificationPriorityNormal: NotificationPriority;
2353
+ export declare const NotificationPriorityHigh: NotificationPriority;
2354
+ export declare const NotificationPriorityCritical: NotificationPriority;
2355
+ /**
2356
+ * NotificationType represents the type/category of notification
2357
+ */
2358
+ export type NotificationType = string;
2359
+ /**
2360
+ * Billing notifications
2361
+ */
2362
+ export declare const NotificationTypeLowBalance: NotificationType;
2363
+ export declare const NotificationTypeAutoRecharge: NotificationType;
2364
+ export declare const NotificationTypePaymentSuccess: NotificationType;
2365
+ export declare const NotificationTypePaymentFailed: NotificationType;
2366
+ export declare const NotificationTypeUsageSummary: NotificationType;
2367
+ export declare const NotificationTypeSpendingLimit: NotificationType;
2368
+ /**
2369
+ * Account notifications
2370
+ */
2371
+ export declare const NotificationTypeWelcome: NotificationType;
2372
+ export declare const NotificationTypePasswordReset: NotificationType;
2373
+ export declare const NotificationTypeEmailVerify: NotificationType;
2374
+ export declare const NotificationTypeSecurityAlert: NotificationType;
2375
+ /**
2376
+ * Task notifications
2377
+ */
2378
+ export declare const NotificationTypeTaskComplete: NotificationType;
2379
+ export declare const NotificationTypeTaskFailed: NotificationType;
2380
+ /**
2381
+ * System notifications
2382
+ */
2383
+ export declare const NotificationTypeSystemAlert: NotificationType;
2384
+ export declare const NotificationTypeMaintenance: NotificationType;
2385
+ /**
2386
+ * NotificationStatus represents the status of a notification
2387
+ */
2388
+ export type NotificationStatus = string;
2389
+ export declare const NotificationStatusPending: NotificationStatus;
2390
+ export declare const NotificationStatusSent: NotificationStatus;
2391
+ export declare const NotificationStatusDelivered: NotificationStatus;
2392
+ export declare const NotificationStatusFailed: NotificationStatus;
2393
+ export declare const NotificationStatusBounced: NotificationStatus;
2394
+ export declare const NotificationStatusCancelled: NotificationStatus;
2395
+ /**
2396
+ * Notification represents a notification stored in the database
2397
+ */
2398
+ export interface Notification {
2399
+ BaseModel: BaseModel;
2400
+ PermissionModel: PermissionModel;
2401
+ /**
2402
+ * Notification details
2403
+ */
2404
+ type: NotificationType;
2405
+ channel: NotificationChannel;
2406
+ priority: NotificationPriority;
2407
+ status: NotificationStatus;
2408
+ /**
2409
+ * Recipient info
2410
+ */
2411
+ recipient_email: string;
2412
+ recipient_phone: string;
2413
+ /**
2414
+ * Content
2415
+ */
2416
+ subject: string;
2417
+ body: string;
2418
+ html_body: string;
2419
+ /**
2420
+ * Template support
2421
+ */
2422
+ template_id: string;
2423
+ template_data: {
2424
+ [key: string]: any;
2425
+ };
2426
+ /**
2427
+ * Metadata for extensibility
2428
+ */
2429
+ metadata: {
2430
+ [key: string]: any;
2431
+ };
2432
+ /**
2433
+ * Scheduling
2434
+ */
2435
+ scheduled_at?: string;
2436
+ expires_at?: string;
2437
+ /**
2438
+ * Delivery tracking
2439
+ */
2440
+ sent_at?: string;
2441
+ delivered_at?: string;
2442
+ failed_at?: string;
2443
+ /**
2444
+ * Provider info
2445
+ */
2446
+ provider_name: string;
2447
+ provider_id: string;
2448
+ /**
2449
+ * Error tracking
2450
+ */
2451
+ error_message: string;
2452
+ retry_count: number;
2453
+ max_retries: number;
2454
+ /**
2455
+ * Reference to related entity (e.g., task_id, transaction_id)
2456
+ */
2457
+ reference_type: string;
2458
+ reference_id: string;
2459
+ }
2460
+ /**
2461
+ * NotificationDTO is the data transfer object
2462
+ */
2463
+ export interface NotificationDTO extends BaseModel, PermissionModelDTO {
2464
+ type: NotificationType;
2465
+ channel: NotificationChannel;
2466
+ priority: NotificationPriority;
2467
+ status: NotificationStatus;
2468
+ recipient_email?: string;
2469
+ subject: string;
2470
+ body?: string;
2471
+ scheduled_at?: string;
2472
+ sent_at?: string;
2473
+ delivered_at?: string;
2474
+ failed_at?: string;
2475
+ error_message?: string;
2476
+ retry_count: number;
2477
+ reference_type?: string;
2478
+ reference_id?: string;
2479
+ }
2480
+ export interface NotificationPreferences {
2481
+ BaseModel: BaseModel;
2482
+ PermissionModel: PermissionModel;
2483
+ /**
2484
+ * Channel preferences
2485
+ */
2486
+ email_enabled: boolean;
2487
+ sms_enabled: boolean;
2488
+ push_enabled: boolean;
2489
+ slack_enabled: boolean;
2490
+ /**
2491
+ * Type preferences (which notification types to receive)
2492
+ */
2493
+ billing_notifications: boolean;
2494
+ task_notifications: boolean;
2495
+ system_notifications: boolean;
2496
+ marketing_emails: boolean;
2497
+ /**
2498
+ * Quiet hours (don't send non-critical notifications during these hours)
2499
+ */
2500
+ quiet_hours_enabled: boolean;
2501
+ quiet_hours_start: string;
2502
+ quiet_hours_end: string;
2503
+ timezone: string;
2504
+ }
2505
+ /**
2506
+ * NotificationPreferencesDTO is the data transfer object
2507
+ */
2508
+ export interface NotificationPreferencesDTO extends BaseModel, PermissionModelDTO {
2509
+ email_enabled: boolean;
2510
+ sms_enabled: boolean;
2511
+ push_enabled: boolean;
2512
+ slack_enabled: boolean;
2513
+ billing_notifications: boolean;
2514
+ task_notifications: boolean;
2515
+ system_notifications: boolean;
2516
+ marketing_emails: boolean;
2517
+ quiet_hours_enabled: boolean;
2518
+ quiet_hours_start?: string;
2519
+ quiet_hours_end?: string;
2520
+ timezone: string;
2521
+ }
2522
+ /**
2523
+ * CreateNotificationRequest is the request to create a notification
2524
+ */
2525
+ export interface CreateNotificationRequest {
2526
+ type: NotificationType;
2527
+ channel: NotificationChannel;
2528
+ priority?: NotificationPriority;
2529
+ recipient_email?: string;
2530
+ recipient_phone?: string;
2531
+ subject: string;
2532
+ body: string;
2533
+ html_body?: string;
2534
+ template_id?: string;
2535
+ template_data?: {
2536
+ [key: string]: any;
2537
+ };
2538
+ metadata?: {
2539
+ [key: string]: any;
2540
+ };
2541
+ scheduled_at?: string;
2542
+ reference_type?: string;
2543
+ reference_id?: string;
2544
+ }
2545
+ /**
2546
+ * UpdateNotificationPreferencesRequest is the request to update preferences
2547
+ */
2548
+ export interface UpdateNotificationPreferencesRequest {
2549
+ email_enabled?: boolean;
2550
+ sms_enabled?: boolean;
2551
+ push_enabled?: boolean;
2552
+ slack_enabled?: boolean;
2553
+ billing_notifications?: boolean;
2554
+ task_notifications?: boolean;
2555
+ system_notifications?: boolean;
2556
+ marketing_emails?: boolean;
2557
+ quiet_hours_enabled?: boolean;
2558
+ quiet_hours_start?: string;
2559
+ quiet_hours_end?: string;
2560
+ timezone?: string;
2561
+ }
2562
+ export type PageStatus = number;
2563
+ export declare const PageStatusUnknown: PageStatus;
2564
+ export declare const PageStatusDraft: PageStatus;
2565
+ export declare const PageStatusPublished: PageStatus;
2566
+ export declare const PageStatusArchived: PageStatus;
2567
+ export interface PageMetadata {
2568
+ title: string;
2569
+ description: string;
2570
+ image: string;
2571
+ tags: string[];
2572
+ /**
2573
+ * Docs-specific fields
2574
+ */
2575
+ order?: number;
2576
+ type?: string;
2577
+ icon?: string;
2578
+ hide_from_nav?: boolean;
2579
+ }
2580
+ export interface Page {
2581
+ BaseModel: BaseModel;
2582
+ PermissionModel: PermissionModel;
2583
+ is_featured: boolean;
2584
+ title: string;
2585
+ content: string;
2586
+ excerpt: string;
2587
+ status: PageStatus;
2588
+ slug: string;
2589
+ metadata: PageMetadata;
2590
+ }
2591
+ export interface PageDTO extends BaseModel, PermissionModelDTO {
2592
+ is_featured: boolean;
2593
+ title: string;
2594
+ content: string;
2595
+ excerpt: string;
2596
+ status: PageStatus;
2597
+ metadata: PageMetadata;
2598
+ slug: string;
1978
2599
  }
1979
- /**
1980
- * ConnectedEvent represents a connected event
1981
- */
1982
- export interface ConnectedEvent {
1983
- event: string;
1984
- timestamp: string;
2600
+ export type CommentStatus = number;
2601
+ export declare const CommentStatusUnknown: CommentStatus;
2602
+ export declare const CommentStatusDraft: CommentStatus;
2603
+ export declare const CommentStatusPublished: CommentStatus;
2604
+ export declare const CommentStatusArchived: CommentStatus;
2605
+ export interface Comment {
2606
+ BaseModel: BaseModel;
2607
+ PermissionModel: PermissionModel;
2608
+ page_id: string;
2609
+ content: string;
2610
+ status: CommentStatus;
2611
+ /**
2612
+ * Relationships
2613
+ */
2614
+ parent_comment_id?: string;
2615
+ children: Comment[];
1985
2616
  }
1986
- /**
1987
- * ResourceTemplate represents a resource template
1988
- */
1989
- export interface ResourceTemplate {
1990
- uriTemplate: string;
2617
+ export interface CommentDTO extends BaseModel, PermissionModelDTO {
2618
+ page_id: string;
2619
+ content: string;
2620
+ parent_comment_id?: string;
2621
+ children: CommentDTO[];
2622
+ status: CommentStatus;
2623
+ }
2624
+ export interface Menu {
2625
+ BaseModel: BaseModel;
2626
+ PermissionModel: PermissionModel;
1991
2627
  name: string;
1992
- title?: string;
1993
- description?: string;
1994
- mimeType?: string;
2628
+ slug: string;
2629
+ description: string;
2630
+ /**
2631
+ * Nested items stored as JSON for flexibility
2632
+ */
2633
+ items: MenuItem[];
1995
2634
  }
1996
2635
  /**
1997
- * ResourceTemplateResponse represents a response for resource template operations
2636
+ * MenuItem represents an item in a menu (can be nested)
1998
2637
  */
1999
- export interface ResourceTemplateResponse {
2000
- resourceTemplates: ResourceTemplate[];
2638
+ export interface MenuItem {
2639
+ id: string;
2640
+ label: string;
2641
+ slug?: string;
2642
+ page_id?: string;
2643
+ url?: string;
2644
+ icon?: string;
2645
+ order: number;
2646
+ is_group?: boolean;
2647
+ expanded?: boolean;
2648
+ children?: MenuItem[];
2649
+ }
2650
+ export interface MenuDTO extends BaseModel, PermissionModelDTO {
2651
+ name: string;
2652
+ slug: string;
2653
+ description: string;
2654
+ items: MenuItem[];
2001
2655
  }
2002
2656
  /**
2003
2657
  * ProjectType represents different types of projects
@@ -2028,14 +2682,7 @@ export interface Project {
2028
2682
  /**
2029
2683
  * ProjectDTO for API responses
2030
2684
  */
2031
- export interface ProjectDTO {
2032
- id: string;
2033
- created_at: string;
2034
- updated_at: string;
2035
- deleted_at?: string;
2036
- user_id: string;
2037
- user?: UserRelationDTO;
2038
- acl?: ACL;
2685
+ export interface ProjectDTO extends BaseModel, PermissionModelDTO {
2039
2686
  name: string;
2040
2687
  description: string;
2041
2688
  type: ProjectType;
@@ -2045,6 +2692,79 @@ export interface ProjectDTO {
2045
2692
  parent?: ProjectDTO;
2046
2693
  children: (ProjectDTO | undefined)[];
2047
2694
  }
2695
+ /**
2696
+ * SecretRequirement defines a secret that an app requires to run
2697
+ */
2698
+ export interface SecretRequirement {
2699
+ key: string;
2700
+ description?: string;
2701
+ optional?: boolean;
2702
+ }
2703
+ /**
2704
+ * IntegrationRequirement defines an integration capability that an app requires
2705
+ */
2706
+ export interface IntegrationRequirement {
2707
+ key: string;
2708
+ description?: string;
2709
+ optional?: boolean;
2710
+ }
2711
+ /**
2712
+ * RequirementError represents a single missing requirement with actionable info
2713
+ */
2714
+ export interface RequirementError {
2715
+ type: string;
2716
+ key: string;
2717
+ message: string;
2718
+ action?: SetupAction;
2719
+ }
2720
+ /**
2721
+ * SetupAction provides actionable info for resolving a missing requirement
2722
+ */
2723
+ export interface SetupAction {
2724
+ type: string;
2725
+ provider?: string;
2726
+ scopes?: string[];
2727
+ }
2728
+ /**
2729
+ * Capability represents an integration capability that can be requested by apps
2730
+ */
2731
+ export interface Capability {
2732
+ key: string;
2733
+ provider: string;
2734
+ type: string;
2735
+ scopes?: string[];
2736
+ satisfies?: string[];
2737
+ display_name: string;
2738
+ description?: string;
2739
+ available: boolean;
2740
+ }
2741
+ /**
2742
+ * CapabilitiesResponse is the API response for listing available capabilities
2743
+ */
2744
+ export interface CapabilitiesResponse {
2745
+ capabilities: Capability[];
2746
+ }
2747
+ /**
2748
+ * CheckRequirementsRequest is the request body for checking requirements
2749
+ */
2750
+ export interface CheckRequirementsRequest {
2751
+ secrets?: SecretRequirement[];
2752
+ integrations?: IntegrationRequirement[];
2753
+ }
2754
+ /**
2755
+ * CheckRequirementsResponse is the API response for checking requirements
2756
+ */
2757
+ export interface CheckRequirementsResponse {
2758
+ satisfied: boolean;
2759
+ errors?: RequirementError[];
2760
+ }
2761
+ /**
2762
+ * RequirementsNotMetError is a specific error type for missing requirements
2763
+ * This allows API handlers to detect this case and return structured errors
2764
+ */
2765
+ export interface RequirementsNotMetError {
2766
+ Errors: RequirementError[];
2767
+ }
2048
2768
  export interface ResourcePrice {
2049
2769
  CentsPerHour: number;
2050
2770
  NanosPerSecond: number;
@@ -2061,6 +2781,132 @@ export interface SchemaField {
2061
2781
  Name: string;
2062
2782
  Description: string;
2063
2783
  }
2784
+ /**
2785
+ * Secret represents a single key-value secret for a team (one row per key)
2786
+ */
2787
+ export interface Secret {
2788
+ BaseModel: BaseModel;
2789
+ PermissionModel: PermissionModel;
2790
+ /**
2791
+ * Key is the environment variable name (e.g., "API_KEY", "DATABASE_URL")
2792
+ */
2793
+ key: string;
2794
+ /**
2795
+ * Value is the secret value - uses SensitiveString to prevent accidental exposure
2796
+ */
2797
+ value: SensitiveString;
2798
+ /**
2799
+ * Description is optional metadata about the secret
2800
+ */
2801
+ description?: string;
2802
+ /**
2803
+ * Internal marks this secret as system-managed (e.g., integration tokens)
2804
+ * Internal secrets are hidden from user-facing lists but can still be used
2805
+ */
2806
+ internal: boolean;
2807
+ }
2808
+ /**
2809
+ * SecretDTO for API responses - VALUE IS NEVER EXPOSED
2810
+ */
2811
+ export interface SecretDTO extends BaseModel, PermissionModelDTO {
2812
+ key: string;
2813
+ masked_value: string;
2814
+ description?: string;
2815
+ internal?: boolean;
2816
+ }
2817
+ /**
2818
+ * SecretMap represents a map of secret key-value pairs (used for transport to workers)
2819
+ */
2820
+ export type SecretMap = {
2821
+ [key: string]: string;
2822
+ };
2823
+ /**
2824
+ * SecretsLegacy stores encrypted key-value pairs as a blob (DEPRECATED)
2825
+ * Use Secret (individual rows) instead
2826
+ */
2827
+ export interface SecretsLegacy {
2828
+ BaseModel: BaseModel;
2829
+ PermissionModel: PermissionModel;
2830
+ /**
2831
+ * base64 encoded JSON of key-value pairs
2832
+ */
2833
+ data: SensitiveString;
2834
+ }
2835
+ /**
2836
+ * GoogleIntegration represents the Google Cloud integration state for a team
2837
+ */
2838
+ export interface GoogleIntegration {
2839
+ enabled: boolean;
2840
+ service_account_email: string;
2841
+ created_at?: string;
2842
+ }
2843
+ /**
2844
+ * GoogleIntegrationDTO for API responses (doesn't expose the key)
2845
+ */
2846
+ export interface GoogleIntegrationDTO {
2847
+ enabled: boolean;
2848
+ service_account_email: string;
2849
+ created_at?: string;
2850
+ }
2851
+ /**
2852
+ * GoogleIntegrationCreateRequest is the request to enable Google integration
2853
+ */
2854
+ export interface GoogleIntegrationCreateRequest {
2855
+ }
2856
+ /**
2857
+ * GoogleIntegrationCreateResponse is the response after enabling Google integration
2858
+ */
2859
+ export interface GoogleIntegrationCreateResponse {
2860
+ service_account_email: string;
2861
+ instructions: string;
2862
+ }
2863
+ /**
2864
+ * Secret keys for Google integration
2865
+ */
2866
+ export declare const SecretGoogleServiceAccountEmail = "GOOGLE_SERVICE_ACCOUNT_EMAIL";
2867
+ /**
2868
+ * Secret keys for Google integration
2869
+ */
2870
+ export declare const SecretGoogleServiceAccountJSON = "GOOGLE_SERVICE_ACCOUNT_JSON";
2871
+ /**
2872
+ * Secret keys for Google integration
2873
+ */
2874
+ export declare const SecretGoogleAccessToken = "GOOGLE_ACCESS_TOKEN";
2875
+ /**
2876
+ * GoogleAccessToken represents a temporary access token for a service account
2877
+ */
2878
+ export interface GoogleAccessToken {
2879
+ access_token: string;
2880
+ token_type: string;
2881
+ expires_in: number;
2882
+ service_account_email: string;
2883
+ }
2884
+ /**
2885
+ * SystemMetadata stores system-level configuration that needs to persist
2886
+ */
2887
+ export interface SystemMetadata {
2888
+ key: string;
2889
+ value: string;
2890
+ }
2891
+ /**
2892
+ * SystemMetadataKeyFingerprint stores the current encryption key fingerprint
2893
+ */
2894
+ export declare const SystemMetadataKeyFingerprint = "encryption_key_fingerprint";
2895
+ /**
2896
+ * SensitiveString is a string type that prevents accidental exposure of secrets.
2897
+ * It implements custom JSON marshaling, SQL scanning, and fmt.Stringer to always
2898
+ * redact the value unless explicitly accessed via .Expose().
2899
+ * Security features:
2900
+ * - Envelope encryption at rest: DEK encrypted with KEK, data encrypted with DEK
2901
+ * - JSON serialization: always returns "" (empty string)
2902
+ * - fmt.Sprintf with %s, %v, %#v: always returns "[REDACTED]"
2903
+ * - Only .Expose() returns the actual value - audit all call sites!
2904
+ * Encryption is enabled when SECRETS_ENCRYPTION_KEY env var is set.
2905
+ * Values are stored as "enc:v2:<encrypted_dek>:<encrypted_data>" in the database.
2906
+ * Key rotation only re-encrypts the DEK, not the data.
2907
+ */
2908
+ export interface SensitiveString {
2909
+ }
2064
2910
  export interface Session {
2065
2911
  id: string;
2066
2912
  hash: string;
@@ -2097,7 +2943,7 @@ export declare const InstanceStatusPending: InstanceStatus;
2097
2943
  export declare const InstanceStatusActive: InstanceStatus;
2098
2944
  export declare const InstanceStatusDeleted: InstanceStatus;
2099
2945
  export interface Instance {
2100
- id: string;
2946
+ BaseModel: BaseModel;
2101
2947
  PermissionModel: PermissionModel;
2102
2948
  cloud: InstanceCloudProvider;
2103
2949
  name: string;
@@ -2190,9 +3036,7 @@ export type InstanceTypeDeploymentType = string;
2190
3036
  export declare const InstanceTypeDeploymentTypeVM: InstanceTypeDeploymentType;
2191
3037
  export declare const InstanceTypeDeploymentTypeContainer: InstanceTypeDeploymentType;
2192
3038
  export declare const InstanceTypeDeploymentTypeBaremetal: InstanceTypeDeploymentType;
2193
- export interface InstanceType {
2194
- id: string;
2195
- PermissionModel: PermissionModel;
3039
+ export interface InstanceType extends BaseModel, PermissionModel {
2196
3040
  cloud: InstanceCloudProvider;
2197
3041
  region: string;
2198
3042
  shade_instance_type: string;
@@ -2478,7 +3322,6 @@ export interface Task {
2478
3322
  PermissionModel: PermissionModel;
2479
3323
  VersionedStruct: VersionedStruct;
2480
3324
  EncryptedModel: EncryptedModel;
2481
- GraphModel: GraphModel;
2482
3325
  is_featured: boolean;
2483
3326
  status: TaskStatus;
2484
3327
  /**
@@ -2542,15 +3385,8 @@ export interface TaskLog {
2542
3385
  log_type: TaskLogType;
2543
3386
  content: string;
2544
3387
  }
2545
- export interface TaskDTO {
2546
- id: string;
3388
+ export interface TaskDTO extends BaseModel, PermissionModelDTO {
2547
3389
  graph_id?: string;
2548
- created_at: string;
2549
- updated_at: string;
2550
- deleted_at?: string;
2551
- acl?: ACL;
2552
- user_id: string;
2553
- user?: UserRelationDTO;
2554
3390
  user_public_key: string;
2555
3391
  engine_public_key: string;
2556
3392
  is_featured: boolean;
@@ -2598,15 +3434,24 @@ export interface TimescaleTask {
2598
3434
  worker_id: string;
2599
3435
  system_info: TelemetrySystemInfo;
2600
3436
  }
3437
+ export type TeamType = string;
3438
+ export declare const TeamTypePersonal: TeamType;
3439
+ export declare const TeamTypeTeam: TeamType;
3440
+ export declare const TeamTypeSystem: TeamType;
2601
3441
  export interface Team {
2602
3442
  BaseModel: BaseModel;
3443
+ type: TeamType;
3444
+ username: string;
3445
+ email: string;
3446
+ name: string;
3447
+ avatar_url: string;
2603
3448
  }
2604
- export interface TeamDTO {
2605
- id: string;
3449
+ export interface TeamDTO extends BaseModel {
3450
+ type: TeamType;
2606
3451
  name: string;
2607
- logo: string;
2608
- balance: number;
2609
- env: string;
3452
+ username: string;
3453
+ avatar_url: string;
3454
+ email: string;
2610
3455
  }
2611
3456
  export type TeamRole = string;
2612
3457
  export declare const TeamRoleOwner: TeamRole;
@@ -2621,7 +3466,17 @@ export interface TeamMemberDTO {
2621
3466
  team_id: string;
2622
3467
  role: TeamRole;
2623
3468
  user?: UserRelationDTO;
2624
- team?: TeamDTO;
3469
+ }
3470
+ /**
3471
+ * Team-related types
3472
+ */
3473
+ export interface TeamRelationDTO {
3474
+ id: string;
3475
+ created_at: string;
3476
+ updated_at: string;
3477
+ type: TeamType;
3478
+ username: string;
3479
+ avatar_url: string;
2625
3480
  }
2626
3481
  /**
2627
3482
  * Tool types and parameter types
@@ -2662,13 +3517,13 @@ export interface Tool {
2662
3517
  export interface ToolFunction {
2663
3518
  name: string;
2664
3519
  description: string;
2665
- parameters: ToolParameters;
3520
+ parameters?: ToolParameters;
2666
3521
  required?: string[];
2667
3522
  }
2668
3523
  export interface ToolParameters {
2669
3524
  type: string;
2670
3525
  title: string;
2671
- properties: ToolParameterProperties;
3526
+ properties?: ToolParameterProperties;
2672
3527
  required?: string[];
2673
3528
  }
2674
3529
  export type ToolParameterProperties = {
@@ -2705,17 +3560,13 @@ export interface Transaction {
2705
3560
  [key: string]: any;
2706
3561
  };
2707
3562
  }
2708
- export interface TransactionDTO {
2709
- id: string;
2710
- created_at: string;
2711
- updated_at: string;
2712
- deleted_at?: string;
2713
- user_id: string;
2714
- user?: UserRelationDTO;
3563
+ export interface TransactionDTO extends BaseModel, PermissionModelDTO {
2715
3564
  type: TransactionType;
2716
3565
  amount: number;
2717
3566
  reference: string;
2718
3567
  notes: string;
3568
+ payment_record_id?: string;
3569
+ payment_record?: PaymentRecord;
2719
3570
  usage_billing_record_id?: string;
2720
3571
  usage_billing_record?: UsageBillingRecord;
2721
3572
  usage_billing_refund_id?: string;
@@ -2724,28 +3575,119 @@ export interface TransactionDTO {
2724
3575
  [key: string]: any;
2725
3576
  };
2726
3577
  }
2727
- export type StripeTransactionStatus = number;
2728
- export declare const StripeTransactionStatusOpen: StripeTransactionStatus;
2729
- export declare const StripeTransactionStatusComplete: StripeTransactionStatus;
2730
- export declare const StripeTransactionStatusExpired: StripeTransactionStatus;
2731
- export interface StripeTransaction {
3578
+ /**
3579
+ * PaymentRecordStatus represents the status of a payment
3580
+ */
3581
+ export type PaymentRecordStatus = number;
3582
+ export declare const PaymentRecordStatusPending: PaymentRecordStatus;
3583
+ export declare const PaymentRecordStatusComplete: PaymentRecordStatus;
3584
+ export declare const PaymentRecordStatusFailed: PaymentRecordStatus;
3585
+ export declare const PaymentRecordStatusExpired: PaymentRecordStatus;
3586
+ /**
3587
+ * PaymentRecordType represents the type of payment
3588
+ */
3589
+ export type PaymentRecordType = string;
3590
+ export declare const PaymentRecordTypeCheckout: PaymentRecordType;
3591
+ export declare const PaymentRecordTypeAutoRecharge: PaymentRecordType;
3592
+ /**
3593
+ * PaymentRecord stores Stripe payment details for both checkout sessions and direct charges
3594
+ */
3595
+ export interface PaymentRecord {
2732
3596
  BaseModel: BaseModel;
2733
3597
  PermissionModel: PermissionModel;
3598
+ type: PaymentRecordType;
3599
+ status: PaymentRecordStatus;
3600
+ amount: number;
3601
+ stripe_customer_id: string;
3602
+ payment_intent_id: string;
3603
+ receipt_url: string;
3604
+ /**
3605
+ * Checkout-specific fields (only set for checkout type)
3606
+ */
2734
3607
  session_id: string;
2735
3608
  session_url: string;
2736
- status: StripeTransactionStatus;
2737
3609
  }
3610
+ /**
3611
+ * Legacy aliases for backward compatibility
3612
+ */
3613
+ export type CheckoutSessionStatus = PaymentRecordStatus;
3614
+ export type CheckoutSession = PaymentRecord;
3615
+ export type StripeTransactionStatus = PaymentRecordStatus;
3616
+ export type StripeTransaction = PaymentRecord;
3617
+ export declare const CheckoutSessionStatusOpen: number;
3618
+ export declare const CheckoutSessionStatusComplete: number;
3619
+ export declare const CheckoutSessionStatusExpired: number;
3620
+ export declare const StripeTransactionStatusOpen: number;
3621
+ export declare const StripeTransactionStatusComplete: number;
3622
+ export declare const StripeTransactionStatusExpired: number;
2738
3623
  export type UsageEventResourceTier = string;
2739
3624
  export declare const UsageEventResourceTierPrivate: UsageEventResourceTier;
2740
3625
  export declare const UsageEventResourceTierCloud: UsageEventResourceTier;
3626
+ /**
3627
+ * MetaItemType is the type discriminator for MetaItem
3628
+ */
3629
+ export type MetaItemType = string;
3630
+ export declare const MetaItemTypeText: MetaItemType;
3631
+ export declare const MetaItemTypeImage: MetaItemType;
3632
+ export declare const MetaItemTypeVideo: MetaItemType;
3633
+ export declare const MetaItemTypeAudio: MetaItemType;
3634
+ /**
3635
+ * VideoResolution represents standard video resolution presets
3636
+ */
3637
+ export type VideoResolution = string;
3638
+ export declare const VideoRes480P: VideoResolution;
3639
+ export declare const VideoRes720P: VideoResolution;
3640
+ export declare const VideoRes1080P: VideoResolution;
3641
+ export declare const VideoRes1440P: VideoResolution;
3642
+ export declare const VideoRes4K: VideoResolution;
3643
+ /**
3644
+ * MetaItem represents metadata about an input or output item
3645
+ */
3646
+ export interface MetaItem {
3647
+ type: MetaItemType;
3648
+ /**
3649
+ * Text fields
3650
+ */
3651
+ tokens?: number;
3652
+ /**
3653
+ * Image/Video shared fields
3654
+ */
3655
+ width?: number;
3656
+ height?: number;
3657
+ resolution_mp?: number;
3658
+ /**
3659
+ * Image specific fields
3660
+ */
3661
+ steps?: number;
3662
+ count?: number;
3663
+ /**
3664
+ * Video specific fields
3665
+ */
3666
+ resolution?: VideoResolution;
3667
+ seconds?: number;
3668
+ fps?: number;
3669
+ /**
3670
+ * Audio specific fields
3671
+ */
3672
+ sample_rate?: number;
3673
+ /**
3674
+ * App-specific key-value pairs for custom pricing factors
3675
+ */
3676
+ extra?: {
3677
+ [key: string]: any;
3678
+ };
3679
+ }
3680
+ /**
3681
+ * OutputMeta contains structured metadata about task inputs and outputs for pricing calculation
3682
+ */
3683
+ export interface OutputMeta {
3684
+ inputs: MetaItem[];
3685
+ outputs: MetaItem[];
3686
+ }
2741
3687
  export interface UsageEvent {
2742
3688
  BaseModel: BaseModel;
3689
+ PermissionModel: PermissionModel;
2743
3690
  usage_billing_record_id: string;
2744
- /**
2745
- * Event owner
2746
- */
2747
- user_id: string;
2748
- group_id?: string;
2749
3691
  reference_id: string;
2750
3692
  resource_id: string;
2751
3693
  /**
@@ -2771,9 +3713,11 @@ export interface UsageEventSummary {
2771
3713
  }
2772
3714
  export interface UsageBillingRecord {
2773
3715
  BaseModel: BaseModel;
2774
- user_id: string;
2775
- group_id?: string;
3716
+ PermissionModel: PermissionModel;
2776
3717
  usage_events: (UsageEvent | undefined)[];
3718
+ /**
3719
+ * Fee breakdown (all in microcents)
3720
+ */
2777
3721
  total: number;
2778
3722
  user_debit_transaction_id: string;
2779
3723
  user_debit_transaction?: Transaction;
@@ -2782,8 +3726,7 @@ export interface UsageBillingRecord {
2782
3726
  }
2783
3727
  export interface UsageBillingRefund {
2784
3728
  BaseModel: BaseModel;
2785
- user_id: string;
2786
- group_id?: string;
3729
+ PermissionModel: PermissionModel;
2787
3730
  usage_billing_record_id: string;
2788
3731
  usage_billing_record?: UsageBillingRecord;
2789
3732
  user_debit_refund_transaction_id: string;
@@ -2796,38 +3739,28 @@ export interface UsageBillingRefund {
2796
3739
  */
2797
3740
  export interface User {
2798
3741
  BaseModel: BaseModel;
3742
+ default_team_id: string;
2799
3743
  role: Role;
2800
3744
  username: string;
2801
3745
  email: string;
2802
3746
  name: string;
2803
3747
  full_name: string;
2804
3748
  avatar_url: string;
2805
- email_verified: boolean;
2806
- phone_verified: boolean;
2807
- is_anonymous: boolean;
2808
- env: string;
2809
- balance: number;
2810
3749
  metadata: UserMetadata;
2811
3750
  }
2812
3751
  export type Role = string;
3752
+ export declare const RoleGuest: Role;
2813
3753
  export declare const RoleUser: Role;
2814
3754
  export declare const RoleAdmin: Role;
2815
3755
  export declare const RoleSystem: Role;
2816
- export interface UserDTO {
2817
- id: string;
2818
- created_at: string;
2819
- updated_at: string;
2820
- deleted_at?: string;
3756
+ export interface UserDTO extends BaseModel {
3757
+ default_team_id: string;
2821
3758
  role: Role;
2822
3759
  username: string;
2823
3760
  email: string;
2824
- email_verified: boolean;
2825
- is_anonymous: boolean;
2826
3761
  name: string;
2827
3762
  full_name: string;
2828
3763
  avatar_url: string;
2829
- env: string;
2830
- balance: number;
2831
3764
  metadata: UserMetadata;
2832
3765
  }
2833
3766
  /**
@@ -2848,12 +3781,6 @@ export interface UserMetadata {
2848
3781
  use_case_reason: string;
2849
3782
  use_case_privacy: string;
2850
3783
  }
2851
- /**
2852
- * Environment represents a map of environment variables
2853
- */
2854
- export type Environment = {
2855
- [key: string]: string;
2856
- };
2857
3784
  /**
2858
3785
  * WidgetAction represents an action triggered by a widget button
2859
3786
  */
@@ -2913,6 +3840,7 @@ export interface WidgetSelectOption {
2913
3840
  */
2914
3841
  export interface Widget {
2915
3842
  type: string;
3843
+ interactive?: boolean;
2916
3844
  title?: string;
2917
3845
  html?: string;
2918
3846
  json?: string;
@@ -2977,7 +3905,7 @@ export declare const WSEventEngineStop = "engine_stop";
2977
3905
  export declare const WSEventEngineDeleteHFCacheRepo = "engine_delete_hfcache_repo";
2978
3906
  export interface WsTaskRunPayload {
2979
3907
  task: TaskDTO;
2980
- user_env: string;
3908
+ secrets: string;
2981
3909
  }
2982
3910
  export interface WsTaskCancelPayload {
2983
3911
  task: TaskDTO;