@lovable.dev/sdk 1.7.0 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -52,17 +52,23 @@ export const ErrorModelSchema = z.object({
52
52
  type: z.string().optional()
53
53
  });
54
54
 
55
- export const GetMeWorkspaceSchema = z.object({
55
+ export const CurrentUserWorkspaceSchema = z.object({
56
56
  id: z.string(),
57
57
  name: z.string(),
58
- role: z.string()
58
+ role: z.enum([
59
+ 'owner',
60
+ 'admin',
61
+ 'member',
62
+ 'viewer',
63
+ 'collaborator'
64
+ ])
59
65
  });
60
66
 
61
- export const GetMeOutputBodySchema = z.object({
67
+ export const CurrentUserSchema = z.object({
62
68
  email: z.string(),
63
69
  id: z.string(),
64
70
  name: z.string(),
65
- workspaces: z.array(GetMeWorkspaceSchema).nullable()
71
+ workspaces: z.array(CurrentUserWorkspaceSchema).nullable()
66
72
  });
67
73
 
68
74
  export const GitFileEntrySchema = z.object({
@@ -91,26 +97,26 @@ export const GetAvailableLibraryProjectsPublicV1OutputBodySchema = z.object({
91
97
  total: z.number()
92
98
  });
93
99
 
94
- export const ListDataPointSchema = z.object({
100
+ export const AnalyticsBreakdownPointSchema = z.object({
95
101
  label: z.string(),
96
102
  value: z.number()
97
103
  });
98
104
 
99
- export const ListDataSchema = z.object({
100
- data: z.array(ListDataPointSchema).nullable(),
105
+ export const AnalyticsBreakdownSchema = z.object({
106
+ data: z.array(AnalyticsBreakdownPointSchema).nullable(),
101
107
  label: z.string()
102
108
  });
103
109
 
104
110
  export const ChannelListsGroupSchema = z.object({
105
- page: ListDataSchema,
106
- source: ListDataSchema
111
+ page: AnalyticsBreakdownSchema,
112
+ source: AnalyticsBreakdownSchema
107
113
  });
108
114
 
109
- export const ListsGroupSchema = z.object({
110
- country: ListDataSchema,
111
- device: ListDataSchema,
112
- page: ListDataSchema,
113
- source: ListDataSchema
115
+ export const AnalyticsBreakdownGroupSchema = z.object({
116
+ country: AnalyticsBreakdownSchema,
117
+ device: AnalyticsBreakdownSchema,
118
+ page: AnalyticsBreakdownSchema,
119
+ source: AnalyticsBreakdownSchema
114
120
  });
115
121
 
116
122
  export const LovableCreatorSchema = z.object({
@@ -139,13 +145,34 @@ export const ProjectPiiFindingDtoSchema = z.object({
139
145
  found_at: z.iso.datetime(),
140
146
  id: z.string(),
141
147
  info_type: z.string().optional(),
142
- likelihood: z.string().optional(),
148
+ likelihood: z.enum([
149
+ 'LIKELIHOOD_UNSPECIFIED',
150
+ 'VERY_UNLIKELY',
151
+ 'UNLIKELY',
152
+ 'POSSIBLE',
153
+ 'LIKELY',
154
+ 'VERY_LIKELY'
155
+ ]).optional(),
143
156
  quote: z.string().optional(),
144
157
  scan_id: z.string().optional(),
145
- sensitivity: z.string().optional(),
146
- source: z.string(),
158
+ sensitivity: z.enum([
159
+ 'low',
160
+ 'mid',
161
+ 'high'
162
+ ]).optional(),
163
+ source: z.enum([
164
+ 'chat',
165
+ 'upload',
166
+ 'cloud_storage',
167
+ 'cloud_sql',
168
+ 'connector'
169
+ ]),
147
170
  sql_location: z.string().optional(),
148
- status: z.string(),
171
+ status: z.enum([
172
+ 'open',
173
+ 'ignored',
174
+ 'fixed'
175
+ ]),
149
176
  storage_path: z.string().optional()
150
177
  });
151
178
 
@@ -187,9 +214,18 @@ export const PublicV1CreateProjectResponseSchema = z.object({
187
214
  message_id: z.string().optional(),
188
215
  name: z.string().optional(),
189
216
  preview_url: z.string().optional(),
190
- status: z.string().optional(),
217
+ status: z.enum([
218
+ 'in_progress',
219
+ 'completed',
220
+ 'failed'
221
+ ]).optional(),
191
222
  url: z.string().optional(),
192
- visibility: z.string().optional(),
223
+ visibility: z.enum([
224
+ 'draft',
225
+ 'private',
226
+ 'workspace_view',
227
+ 'public'
228
+ ]).optional(),
193
229
  workspace_id: z.string().optional()
194
230
  });
195
231
 
@@ -208,7 +244,50 @@ export const PublicV1GitFilesResponseSchema = z.object({
208
244
  ref: z.string()
209
245
  });
210
246
 
211
- export const PublicV1PatchProjectBodySchema = z.object({
247
+ export const PiiLabelSchema = z.object({
248
+ chat_message_id: z.string().optional(),
249
+ chat_upload_id: z.string().optional(),
250
+ connector_id: z.string().optional(),
251
+ found_at: z.iso.datetime(),
252
+ id: z.string(),
253
+ info_type: z.string().optional(),
254
+ likelihood: z.enum([
255
+ 'likelihood_unspecified',
256
+ 'very_unlikely',
257
+ 'unlikely',
258
+ 'possible',
259
+ 'likely',
260
+ 'very_likely'
261
+ ]).optional(),
262
+ quote: z.string().optional(),
263
+ scan_id: z.string().optional(),
264
+ sensitivity: z.enum([
265
+ 'low',
266
+ 'mid',
267
+ 'high'
268
+ ]).optional(),
269
+ source: z.enum([
270
+ 'chat',
271
+ 'upload',
272
+ 'cloud_storage',
273
+ 'cloud_sql',
274
+ 'connector'
275
+ ]),
276
+ sql_location: z.string().optional(),
277
+ status: z.enum([
278
+ 'open',
279
+ 'ignored',
280
+ 'fixed'
281
+ ]),
282
+ storage_path: z.string().optional()
283
+ });
284
+
285
+ export const PiiLabelPageSchema = z.object({
286
+ data: z.array(PiiLabelSchema).nullable(),
287
+ pagination: PaginationSchema
288
+ });
289
+
290
+ export const UpdateProjectRequestSchema = z.object({
212
291
  description: z.string().max(100000).optional(),
213
292
  display_name: z.string().optional(),
214
293
  visibility: z.enum([
@@ -224,7 +303,7 @@ export const PublicV1ProjectFileUploadUrlInputBodySchema = z.object({
224
303
  project_id: z.string()
225
304
  });
226
305
 
227
- export const PublicV1ProjectListItemSchema = z.object({
306
+ export const ProjectSummarySchema = z.object({
228
307
  created_at: z.iso.datetime().optional(),
229
308
  description: z.string().optional(),
230
309
  display_name: z.string().optional(),
@@ -236,19 +315,32 @@ export const PublicV1ProjectListItemSchema = z.object({
236
315
  latest_screenshot_url: z.string().optional(),
237
316
  name: z.string().optional(),
238
317
  og_image_url: z.string().optional(),
239
- project_type: z.string().optional(),
240
- publish_visibility: z.string().optional(),
241
- status: z.string().optional(),
318
+ project_type: z.enum(['project', 'library']).optional(),
319
+ publish_visibility: z.enum([
320
+ 'public',
321
+ 'private',
322
+ 'workspace_only'
323
+ ]).optional(),
324
+ status: z.enum([
325
+ 'in_progress',
326
+ 'completed',
327
+ 'failed'
328
+ ]).optional(),
242
329
  tech_stack: z.string().optional(),
243
330
  updated_at: z.iso.datetime().optional(),
244
331
  url: z.string().optional(),
245
332
  user_id: z.string().optional(),
246
- visibility: z.string().optional(),
333
+ visibility: z.enum([
334
+ 'draft',
335
+ 'private',
336
+ 'workspace_view',
337
+ 'public'
338
+ ]).optional(),
247
339
  workspace_id: z.string()
248
340
  });
249
341
 
250
- export const CursorListResponsePublicV1ProjectListItemSchema = z.object({
251
- data: z.array(PublicV1ProjectListItemSchema).nullable(),
342
+ export const ProjectSummaryPageSchema = z.object({
343
+ data: z.array(ProjectSummarySchema).nullable(),
252
344
  pagination: PaginationSchema
253
345
  });
254
346
 
@@ -256,6 +348,7 @@ export const PublicV1ProjectRemixInputBodySchema = z.object({
256
348
  description: z.string().min(1).optional(),
257
349
  display_name: z.string().optional(),
258
350
  include_custom_knowledge: z.boolean().optional(),
351
+ include_files: z.boolean().optional(),
259
352
  include_history: z.boolean().optional(),
260
353
  initial_message: z.string().optional(),
261
354
  message_id: z.string().optional(),
@@ -266,13 +359,13 @@ export const PublicV1ProjectRemixInputBodySchema = z.object({
266
359
  workspace_id: z.string()
267
360
  });
268
361
 
269
- export const PublicV1PublishAudienceTargetSchema = z.object({
362
+ export const PublishAudienceTargetSchema = z.object({
270
363
  id: z.string().min(1),
271
364
  type: z.enum(['group', 'user'])
272
365
  });
273
366
 
274
- export const PublicV1PublishProjectInputBodySchema = z.object({
275
- audience: z.array(PublicV1PublishAudienceTargetSchema).max(100).nullish(),
367
+ export const PublishProjectRequestSchema = z.object({
368
+ audience: z.array(PublishAudienceTargetSchema).max(100).nullish(),
276
369
  name: z.string().optional(),
277
370
  visibility: z.enum([
278
371
  'public',
@@ -281,16 +374,29 @@ export const PublicV1PublishProjectInputBodySchema = z.object({
281
374
  ]).optional()
282
375
  });
283
376
 
284
- export const PublicV1PublishProjectResponseSchema = z.object({
377
+ export const PublishProjectResponseSchema = z.object({
285
378
  deployment_id: z.string().optional(),
286
- status: z.string(),
379
+ status: z.enum(['pending']),
287
380
  url: z.string().optional(),
288
- visibility: z.string()
381
+ visibility: z.enum([
382
+ 'public',
383
+ 'workspace',
384
+ 'custom'
385
+ ])
289
386
  });
290
387
 
291
- export const PublicV1PublishStatusResponseSchema = z.object({
388
+ export const DeploymentSchema = z.object({
292
389
  deployment_id: z.string(),
293
- error_class: z.string().optional(),
390
+ error_class: z.enum([
391
+ 'transient',
392
+ 'user_code',
393
+ 'user_config',
394
+ 'user_config_code',
395
+ 'user_config_external',
396
+ 'user_data',
397
+ 'blocked_by_policy',
398
+ 'internal'
399
+ ]).optional(),
294
400
  error_code: z.string().optional(),
295
401
  error_message: z.string().optional(),
296
402
  status: z.enum([
@@ -312,8 +418,8 @@ export const PublicV1SetProjectSkillEnabledInputBodySchema = z.object({
312
418
  project_id: z.string()
313
419
  });
314
420
 
315
- export const PublicV1UpdatePublishSettingsInputBodySchema = z.object({
316
- audience: z.array(PublicV1PublishAudienceTargetSchema).max(100).nullish(),
421
+ export const UpdatePublishSettingsRequestSchema = z.object({
422
+ audience: z.array(PublishAudienceTargetSchema).max(100).nullish(),
317
423
  is_published: z.boolean().optional(),
318
424
  visibility: z.enum([
319
425
  'public',
@@ -322,49 +428,80 @@ export const PublicV1UpdatePublishSettingsInputBodySchema = z.object({
322
428
  ]).optional()
323
429
  });
324
430
 
325
- export const PublicV1UpdatePublishSettingsResponseSchema = z.object({
431
+ export const PublishSettingsSchema = z.object({
326
432
  is_published: z.boolean(),
327
433
  url: z.string().optional(),
328
- visibility: z.string()
434
+ visibility: z.enum([
435
+ 'public',
436
+ 'workspace',
437
+ 'custom'
438
+ ])
329
439
  });
330
440
 
331
- export const PublicV1WorkspaceSchema = z.object({
441
+ export const WorkspaceSchema = z.object({
332
442
  created_at: z.iso.datetime().optional(),
333
443
  description: z.string().optional(),
334
444
  id: z.string(),
335
445
  image_url: z.string().optional(),
336
446
  name: z.string(),
337
447
  num_projects: z.number(),
338
- plan: z.string(),
448
+ plan: z.enum([
449
+ 'free',
450
+ 'pro',
451
+ 'business',
452
+ 'enterprise'
453
+ ]),
339
454
  updated_at: z.iso.datetime().optional()
340
455
  });
341
456
 
342
- export const PublicV1WorkspaceMemberSchema = z.object({
457
+ export const WorkspaceMembershipSchema = z.object({
343
458
  joined_at: z.iso.datetime().optional(),
344
- role: z.string(),
459
+ role: z.enum([
460
+ 'owner',
461
+ 'admin',
462
+ 'member',
463
+ 'viewer',
464
+ 'collaborator'
465
+ ]),
345
466
  user_id: z.string()
346
467
  });
347
468
 
348
- export const PublicV1GetWorkspaceBodySchema = z.object({
349
- current_member: PublicV1WorkspaceMemberSchema.optional(),
350
- workspace: PublicV1WorkspaceSchema
469
+ export const GetWorkspaceResponseSchema = z.object({
470
+ current_member: WorkspaceMembershipSchema.optional(),
471
+ workspace: WorkspaceSchema
351
472
  });
352
473
 
353
- export const PublicV1WorkspaceWithMembershipSchema = z.object({
474
+ export const WorkspaceWithMembershipSchema = z.object({
354
475
  created_at: z.iso.datetime().optional(),
355
476
  description: z.string().optional(),
356
477
  id: z.string(),
357
478
  image_url: z.string().optional(),
358
- membership: PublicV1WorkspaceMemberSchema.optional(),
479
+ membership: WorkspaceMembershipSchema.optional(),
359
480
  name: z.string(),
360
481
  num_projects: z.number(),
361
- plan: z.string(),
482
+ plan: z.enum([
483
+ 'free',
484
+ 'pro',
485
+ 'business',
486
+ 'enterprise'
487
+ ]),
362
488
  updated_at: z.iso.datetime().optional()
363
489
  });
364
490
 
365
491
  export const RemixJobFailureSchema = z.object({
366
492
  code: z.string().optional(),
367
- failed_step: z.string(),
493
+ failed_step: z.enum([
494
+ 'starting',
495
+ 'creating_new_project',
496
+ 'restoring_supabase',
497
+ 'copying_history',
498
+ 'preparing_repository',
499
+ 'remixing_integration',
500
+ 'pushing_repository',
501
+ 'finalizing',
502
+ 'completed',
503
+ 'failed'
504
+ ]),
368
505
  message: z.string()
369
506
  });
370
507
 
@@ -372,7 +509,18 @@ export const RemixJobStepInfoSchema = z.object({
372
509
  failure: RemixJobFailureSchema.optional(),
373
510
  integration_name: z.string().optional(),
374
511
  status: z.string().optional(),
375
- step: z.string()
512
+ step: z.enum([
513
+ 'starting',
514
+ 'creating_new_project',
515
+ 'restoring_supabase',
516
+ 'copying_history',
517
+ 'preparing_repository',
518
+ 'remixing_integration',
519
+ 'pushing_repository',
520
+ 'finalizing',
521
+ 'completed',
522
+ 'failed'
523
+ ])
376
524
  });
377
525
 
378
526
  export const RemixWarningSchema = z.object({
@@ -392,6 +540,7 @@ export const SearchProjectItemSchema = z.object({
392
540
  app_visitors_30d: z.number().optional(),
393
541
  app_visitors_7d: z.number().optional(),
394
542
  category: z.string().optional(),
543
+ commit_time: z.iso.datetime().optional(),
395
544
  created_at: z.iso.datetime().optional(),
396
545
  created_by: z.string().optional(),
397
546
  deleted_at: z.iso.datetime().optional(),
@@ -446,6 +595,7 @@ export const SearchProjectItemSchema = z.object({
446
595
  export const SearchWorkspaceProjectsResponseSchema = z.object({
447
596
  has_more: z.boolean(),
448
597
  projects: z.array(SearchProjectItemSchema).nullable(),
598
+ title_search: z.boolean().optional(),
449
599
  total: z.number()
450
600
  });
451
601
 
@@ -509,7 +659,7 @@ export const TimeSeriesGroupSchema = z.object({
509
659
  export const ProjectAnalyticsResponseSchema = z.object({
510
660
  channels: z.record(z.string(), ChannelAnalyticsSchema).optional(),
511
661
  channelsSource: z.enum(['legacy', 'user_app_events']).optional(),
512
- lists: ListsGroupSchema,
662
+ lists: AnalyticsBreakdownGroupSchema,
513
663
  timeSeries: TimeSeriesGroupSchema
514
664
  });
515
665
 
@@ -530,15 +680,15 @@ export const TrendDataPointSchema = z.object({
530
680
  visits: z.number()
531
681
  });
532
682
 
533
- export const ProjectTrendResponseSchema = z.object({
683
+ export const AnalyticsTrendSchema = z.object({
534
684
  currentVisitors: z.number(),
535
685
  data: z.array(TrendDataPointSchema).nullable()
536
686
  });
537
687
 
538
- export const PublicV1ProjectAnalyticsBodySchema = z.object({
539
- lists: ListsGroupSchema.optional(),
688
+ export const ProjectAnalyticsSchema = z.object({
689
+ lists: AnalyticsBreakdownGroupSchema.optional(),
540
690
  timeSeries: TimeSeriesGroupSchema.optional(),
541
- trend: ProjectTrendResponseSchema.optional()
691
+ trend: AnalyticsTrendSchema.optional()
542
692
  });
543
693
 
544
694
  export const UserCreatorSchema = z.object({
@@ -648,6 +798,7 @@ export const SeamlessConnectorApiSchema = z.object({
648
798
  });
649
799
 
650
800
  export const StandardConnectorApiSchema = z.object({
801
+ can_deploy_apps: z.boolean(),
651
802
  can_restrict_to_admins: z.boolean(),
652
803
  categories: z.array(z.enum([
653
804
  'ecommerce',
@@ -669,16 +820,17 @@ export const StandardConnectorApiSchema = z.object({
669
820
  display_name: z.string(),
670
821
  documentation_url: z.string(),
671
822
  has_connections: z.boolean(),
672
- has_metered_option: z.boolean().optional(),
673
823
  id: z.string(),
674
824
  is_enabled_for_workspace: z.boolean(),
675
825
  is_new: z.boolean().optional(),
676
826
  logo_url: z.string().optional(),
827
+ pricing_url: z.string().optional(),
677
828
  promotion: StandardConnectorPromotionSchema.optional(),
678
829
  searchTags: z.array(z.string()),
679
830
  short_description: z.string(),
680
831
  single_connection: z.boolean().optional(),
681
832
  source: z.enum(['native', 'user_defined']).optional(),
833
+ supports_inbound: z.boolean().optional(),
682
834
  terms_url: z.string().optional(),
683
835
  vendor: z.enum([
684
836
  'google',
@@ -699,7 +851,8 @@ export const V1AddConnectorInputBodySchema = z.object({
699
851
  relay_client_id: z.string().optional(),
700
852
  relay_service_name: z.string().optional(),
701
853
  token: z.string().optional(),
702
- url: z.string().optional()
854
+ url: z.string().optional(),
855
+ use_egress_proxy: z.boolean().optional()
703
856
  });
704
857
 
705
858
  export const V1AvailableConnectorEntrySchema = z.object({
@@ -714,68 +867,68 @@ export const V1AvailableConnectorEntrySchema = z.object({
714
867
  export const V1AwaitingInputSummarySchema = z.object({
715
868
  event_id: z.string(),
716
869
  input_schema: z.unknown().optional(),
717
- prev_session_id: z.string().optional()
870
+ params: z.unknown().optional(),
871
+ prev_session_id: z.string().optional(),
872
+ tool_id: z.string().optional()
718
873
  });
719
874
 
720
- export const V1AiResponseSummarySchema = z.object({
721
- awaiting_input: V1AwaitingInputSummarySchema.optional(),
722
- commit_sha: z.string().optional(),
723
- content: z.string(),
724
- cost_credits: z.number().optional(),
725
- edit_id: z.string().optional(),
726
- message_id: z.string(),
727
- status: z.string(),
728
- summary: z.string().optional()
729
- });
730
-
731
- export const V1BillingCreditLimitRowSchema = z.object({
875
+ export const MemberCreditLimitSchema = z.object({
732
876
  monthly_credit_limit: z.number().optional(),
877
+ temporary_limit_expires_at: z.iso.datetime().optional(),
878
+ temporary_monthly_credit_limit: z.number().optional(),
733
879
  user_id: z.string()
734
880
  });
735
881
 
736
- export const V1BillingCreditLimitsBodySchema = z.object({
737
- data: z.array(V1BillingCreditLimitRowSchema).nullable(),
882
+ export const CreditLimitPageSchema = z.object({
883
+ data: z.array(MemberCreditLimitSchema).nullable(),
738
884
  default_monthly_credit_limit: z.number().optional(),
739
885
  pagination: PaginationSchema
740
886
  });
741
887
 
742
- export const V1BillingPeriodSchema = z.object({
888
+ export const BillingPeriodSchema = z.object({
743
889
  end: z.iso.datetime(),
744
890
  start: z.iso.datetime()
745
891
  });
746
892
 
747
- export const V1BillingUsagePeriodSchema = z.object({
893
+ export const CreditUsagePeriodSchema = z.object({
748
894
  end: z.string(),
749
- group_by: z.string().optional(),
750
- interval: z.string().optional(),
895
+ group_by: z.enum(['member', 'project']).optional(),
896
+ interval: z.enum([
897
+ 'day',
898
+ 'week',
899
+ 'month'
900
+ ]).optional(),
751
901
  start: z.string()
752
902
  });
753
903
 
754
- export const V1BulkMemberCreditLimitItemSchema = z.object({
904
+ export const MemberCreditLimitUpdateSchema = z.object({
905
+ duration: z.enum(['permanent', 'current_period']).optional(),
755
906
  email: z.string().optional(),
756
907
  monthly_credit_limit: z.number().gte(0).nullable(),
757
908
  user_id: z.string().optional()
758
909
  });
759
910
 
760
- export const V1BillingBulkSetMemberCreditLimitInputBodySchema = z.object({
761
- members: z.array(V1BulkMemberCreditLimitItemSchema).min(1).max(1000)
911
+ export const SetMemberCreditLimitsRequestSchema = z.object({
912
+ members: z.array(MemberCreditLimitUpdateSchema).min(1).max(1000)
762
913
  });
763
914
 
764
- export const V1BulkMemberCreditLimitResultSchema = z.object({
915
+ export const MemberCreditLimitResultSchema = z.object({
916
+ approved_until: z.iso.datetime().optional(),
917
+ duration: z.enum(['current_period']).optional(),
765
918
  email: z.string().optional(),
766
919
  error: z.string().optional(),
767
- status: z.string(),
920
+ status: z.enum(['success', 'error']),
768
921
  user_id: z.string().optional()
769
922
  });
770
923
 
771
924
  export const V1BulkSetMemberCreditLimitInputBodySchema = z.object({
772
- members: z.array(V1BulkMemberCreditLimitItemSchema).min(1).max(50),
925
+ members: z.array(MemberCreditLimitUpdateSchema).min(1).max(50),
773
926
  workspace_id: z.string()
774
927
  });
775
928
 
776
- export const V1BulkSetMemberCreditLimitOutputBodySchema = z.object({
929
+ export const SetMemberCreditLimitsResponseSchema = z.object({
777
930
  failed: z.number(),
778
- results: z.array(V1BulkMemberCreditLimitResultSchema).nullable(),
931
+ results: z.array(MemberCreditLimitResultSchema).nullable(),
779
932
  successful: z.number(),
780
933
  total: z.number()
781
934
  });
@@ -799,11 +952,11 @@ export const V1ConnectorResponseSchema = z.object({
799
952
  url: z.string().optional()
800
953
  });
801
954
 
802
- export const V1CreateEmbedUrlInputBodySchema = z.object({
955
+ export const CreateEmbedUrlRequestSchema = z.object({
803
956
  parent_origin: z.string()
804
957
  });
805
958
 
806
- export const V1CreateEmbedUrlOutputBodySchema = z.object({
959
+ export const CreateEmbedUrlResponseSchema = z.object({
807
960
  embed_url: z.string(),
808
961
  expires_at: z.iso.datetime()
809
962
  });
@@ -823,14 +976,27 @@ export const V1CreateProjectResponseSchema = z.object({
823
976
  name: z.string().optional(),
824
977
  og_image_url: z.string().optional(),
825
978
  preview_url: z.string().optional(),
826
- project_type: z.string().optional(),
827
- publish_visibility: z.string().optional(),
828
- status: z.string().optional(),
979
+ project_type: z.enum(['project', 'library']).optional(),
980
+ publish_visibility: z.enum([
981
+ 'public',
982
+ 'private',
983
+ 'workspace_only'
984
+ ]).optional(),
985
+ status: z.enum([
986
+ 'in_progress',
987
+ 'completed',
988
+ 'failed'
989
+ ]).optional(),
829
990
  tech_stack: z.string().optional(),
830
991
  updated_at: z.iso.datetime().optional(),
831
992
  url: z.string().optional(),
832
993
  user_id: z.string().optional(),
833
- visibility: z.string().optional(),
994
+ visibility: z.enum([
995
+ 'draft',
996
+ 'private',
997
+ 'workspace_view',
998
+ 'public'
999
+ ]).optional(),
834
1000
  workspace_id: z.string()
835
1001
  });
836
1002
 
@@ -846,7 +1012,8 @@ export const V1CreateVariantOutputBodySchema = z.object({
846
1012
  variant_id: z.string()
847
1013
  });
848
1014
 
849
- export const V1CreditHistoryEntrySchema = z.object({
1015
+ export const CreditHistoryEntrySchema = z.object({
1016
+ credit_grant_id: z.string(),
850
1017
  credits_change: z.number(),
851
1018
  event_type: z.enum([
852
1019
  'granted',
@@ -985,26 +1152,33 @@ export const V1ListStandardConnectorsResponseSchema = z.object({
985
1152
  total: z.number()
986
1153
  });
987
1154
 
988
- export const V1ListWorkspacesBodySchema = z.object({
989
- data: z.array(PublicV1WorkspaceWithMembershipSchema).nullable(),
1155
+ export const WorkspacePageSchema = z.object({
1156
+ data: z.array(WorkspaceWithMembershipSchema).nullable(),
990
1157
  pagination: PaginationSchema
991
1158
  });
992
1159
 
993
- export const V1MessageExportStatusSchema = z.object({
994
- archive_size_bytes: z.number().optional(),
995
- completed_at: z.iso.datetime().optional(),
996
- created_at: z.iso.datetime(),
997
- download_url: z.string().optional(),
998
- expires_at: z.iso.datetime().optional(),
999
- export_id: z.string(),
1000
- message_count: z.number().optional(),
1001
- project_count: z.number().optional(),
1002
- status: z.enum([
1003
- 'running',
1004
- 'completed',
1005
- 'failed',
1006
- 'expired'
1007
- ])
1160
+ export const V1MessageErrorSchema = z.object({
1161
+ code: z.string(),
1162
+ message: z.string()
1163
+ });
1164
+
1165
+ export const V1AiResponseSummarySchema = z.object({
1166
+ awaiting_input: V1AwaitingInputSummarySchema.optional(),
1167
+ commit_sha: z.string().optional(),
1168
+ completion_reason: z.enum([
1169
+ 'finished',
1170
+ 'stopped',
1171
+ 'error',
1172
+ 'policy_violation',
1173
+ 'max_iterations'
1174
+ ]).optional(),
1175
+ content: z.string(),
1176
+ cost_credits: z.number().optional(),
1177
+ edit_id: z.string().optional(),
1178
+ error: V1MessageErrorSchema.optional(),
1179
+ message_id: z.string(),
1180
+ status: z.string(),
1181
+ summary: z.string().optional()
1008
1182
  });
1009
1183
 
1010
1184
  export const V1MessageListItemSchema = z.object({
@@ -1029,10 +1203,18 @@ export const V1ListMessagesOutputBodySchema = z.object({
1029
1203
  export const V1MessageResponseSchema = z.object({
1030
1204
  awaiting_input: V1AwaitingInputSummarySchema.optional(),
1031
1205
  commit_sha: z.string().optional(),
1206
+ completion_reason: z.enum([
1207
+ 'finished',
1208
+ 'stopped',
1209
+ 'error',
1210
+ 'policy_violation',
1211
+ 'max_iterations'
1212
+ ]).optional(),
1032
1213
  content: z.string(),
1033
1214
  cost_credits: z.number().optional(),
1034
1215
  created_at: z.string(),
1035
1216
  edit_id: z.string().optional(),
1217
+ error: V1MessageErrorSchema.optional(),
1036
1218
  message_id: z.string(),
1037
1219
  queue_pause_reason: z.string().optional(),
1038
1220
  queue_paused: z.boolean().optional(),
@@ -1047,59 +1229,7 @@ export const V1MoveProjectsToFolderInputBodySchema = z.object({
1047
1229
  project_ids: z.array(z.string()).min(1).max(30).nullable()
1048
1230
  });
1049
1231
 
1050
- export const V1ProjectCloudDiskSchema = z.object({
1051
- size_bytes: z.number(),
1052
- timestamp: z.iso.datetime(),
1053
- used_bytes: z.number()
1054
- });
1055
-
1056
- export const V1ProjectCloudResourceSignalSchema = z.object({
1057
- alert_hours: z.number(),
1058
- label: z.string(),
1059
- latest_alert_at: z.iso.datetime().optional(),
1060
- latest_value: z.number().optional(),
1061
- resource_type: z.string()
1062
- });
1063
-
1064
- export const V1ProjectCloudResourcePressureSchema = z.object({
1065
- resources: z.array(V1ProjectCloudResourceSignalSchema).nullable(),
1066
- window_hours: z.number()
1067
- });
1068
-
1069
- export const V1ProjectCloudBodySchema = z.object({
1070
- disk: V1ProjectCloudDiskSchema.optional(),
1071
- environment: z.string(),
1072
- instance_tier: z.enum([
1073
- 'xs',
1074
- 's',
1075
- 'm',
1076
- 'ml',
1077
- 'l',
1078
- 'xl',
1079
- 'xxl'
1080
- ]),
1081
- instance_tier_label: z.string(),
1082
- pause_reason: z.string().optional(),
1083
- postgres_version: z.string().optional(),
1084
- region: z.string().optional(),
1085
- resource_pressure: V1ProjectCloudResourcePressureSchema.optional(),
1086
- status: z.enum([
1087
- 'OK',
1088
- 'RESIZING',
1089
- 'UPGRADING',
1090
- 'RESTARTING',
1091
- 'COMING_UP',
1092
- 'RESTORING',
1093
- 'UNHEALTHY',
1094
- 'INACTIVE',
1095
- 'PAUSING',
1096
- 'UNKNOWN',
1097
- ''
1098
- ]).optional(),
1099
- user_paused: z.boolean()
1100
- });
1101
-
1102
- export const V1ProjectCollaboratorSchema = z.object({
1232
+ export const ProjectCollaboratorSchema = z.object({
1103
1233
  accepted_at: z.iso.datetime().optional(),
1104
1234
  access_level: z.enum([
1105
1235
  'owner',
@@ -1114,11 +1244,12 @@ export const V1ProjectCollaboratorSchema = z.object({
1114
1244
  invited_by: z.string().optional(),
1115
1245
  is_internal: z.boolean(),
1116
1246
  is_workspace_member: z.boolean(),
1247
+ last_accessed_at: z.iso.datetime().nullable(),
1117
1248
  user_id: z.string()
1118
1249
  });
1119
1250
 
1120
- export const CursorListResponseV1ProjectCollaboratorSchema = z.object({
1121
- data: z.array(V1ProjectCollaboratorSchema).nullable(),
1251
+ export const ProjectCollaboratorPageSchema = z.object({
1252
+ data: z.array(ProjectCollaboratorSchema).nullable(),
1122
1253
  pagination: PaginationSchema
1123
1254
  });
1124
1255
 
@@ -1133,7 +1264,7 @@ export const V1ProjectGitFilesResponseSchema = z.object({
1133
1264
  total: z.number()
1134
1265
  });
1135
1266
 
1136
- export const V1ProjectResponseSchema = z.object({
1267
+ export const ProjectSchema = z.object({
1137
1268
  created_at: z.iso.datetime().optional(),
1138
1269
  description: z.string().optional(),
1139
1270
  display_name: z.string().optional(),
@@ -1147,14 +1278,27 @@ export const V1ProjectResponseSchema = z.object({
1147
1278
  name: z.string().optional(),
1148
1279
  og_image_url: z.string().optional(),
1149
1280
  preview_url: z.string().optional(),
1150
- project_type: z.string().optional(),
1151
- publish_visibility: z.string().optional(),
1152
- status: z.string().optional(),
1281
+ project_type: z.enum(['project', 'library']).optional(),
1282
+ publish_visibility: z.enum([
1283
+ 'public',
1284
+ 'private',
1285
+ 'workspace_only'
1286
+ ]).optional(),
1287
+ status: z.enum([
1288
+ 'in_progress',
1289
+ 'completed',
1290
+ 'failed'
1291
+ ]).optional(),
1153
1292
  tech_stack: z.string().optional(),
1154
1293
  updated_at: z.iso.datetime().optional(),
1155
1294
  url: z.string().optional(),
1156
1295
  user_id: z.string().optional(),
1157
- visibility: z.string().optional(),
1296
+ visibility: z.enum([
1297
+ 'draft',
1298
+ 'private',
1299
+ 'workspace_view',
1300
+ 'public'
1301
+ ]).optional(),
1158
1302
  workspace_id: z.string()
1159
1303
  });
1160
1304
 
@@ -1179,6 +1323,7 @@ export const V1ListProjectSkillsOutputBodySchema = z.object({
1179
1323
  export const V1RemixInitInputBodySchema = z.object({
1180
1324
  description: z.string().optional(),
1181
1325
  include_custom_knowledge: z.boolean().optional(),
1326
+ include_files: z.boolean().optional(),
1182
1327
  include_history: z.boolean().optional(),
1183
1328
  initial_message: z.string().optional(),
1184
1329
  message_id: z.string().optional(),
@@ -1193,15 +1338,29 @@ export const V1RemixInitOutputBodySchema = z.object({
1193
1338
  job_id: z.string()
1194
1339
  });
1195
1340
 
1196
- export const V1RemixProgressResultSchema = z.object({
1341
+ export const RemixResultSchema = z.object({
1197
1342
  project_id: z.string(),
1198
1343
  warnings: z.array(RemixWarningSchema).nullish()
1199
1344
  });
1200
1345
 
1346
+ export const RemixJobSchema = z.object({
1347
+ error_code: z.string().optional(),
1348
+ error_message: z.string().optional(),
1349
+ result: RemixResultSchema.optional(),
1350
+ status: z.enum([
1351
+ 'preparing',
1352
+ 'running',
1353
+ 'completed',
1354
+ 'error',
1355
+ 'unknown'
1356
+ ]),
1357
+ step: RemixJobStepInfoSchema.optional()
1358
+ });
1359
+
1201
1360
  export const V1RemixProgressOutputBodySchema = z.object({
1202
1361
  error_code: z.string().optional(),
1203
1362
  error_message: z.string().optional(),
1204
- result: V1RemixProgressResultSchema.optional(),
1363
+ result: RemixResultSchema.optional(),
1205
1364
  status: z.string(),
1206
1365
  step: RemixJobStepInfoSchema.optional()
1207
1366
  });
@@ -1210,61 +1369,88 @@ export const V1RemoveConnectorOutputBodySchema = z.object({
1210
1369
  success: z.boolean()
1211
1370
  });
1212
1371
 
1213
- export const V1SecurityFindingSchema = z.object({
1372
+ export const SecurityFindingSchema = z.object({
1214
1373
  category: z.string().optional(),
1215
1374
  created_at: z.iso.datetime(),
1216
1375
  description: z.string().optional(),
1217
1376
  details: z.string().optional(),
1218
1377
  finding_id: z.string(),
1219
1378
  first_seen_scan_id: z.string().optional(),
1220
- level: z.string(),
1379
+ level: z.enum([
1380
+ 'error',
1381
+ 'warn',
1382
+ 'info'
1383
+ ]),
1221
1384
  link: z.string().optional(),
1222
1385
  metadata: z.record(z.string(), z.unknown()).optional(),
1223
1386
  name: z.string(),
1224
1387
  recurrence: z.number(),
1225
1388
  remediation_difficulty: z.string().optional(),
1226
1389
  scanner_name: z.string(),
1227
- status: z.string(),
1390
+ status: z.enum([
1391
+ 'open',
1392
+ 'fixed',
1393
+ 'ignored'
1394
+ ]),
1228
1395
  updated_at: z.iso.datetime()
1229
1396
  });
1230
1397
 
1231
- export const V1SecurityScanActorSchema = z.object({
1398
+ export const SecurityScanActorSchema = z.object({
1232
1399
  email: z.string().optional(),
1233
1400
  id: z.string().optional(),
1234
1401
  name: z.string().optional(),
1235
- type: z.string()
1402
+ type: z.enum(['user', 'system'])
1236
1403
  });
1237
1404
 
1238
- export const V1SecurityScanSummarySchema = z.object({
1405
+ export const SecurityScanSchema = z.object({
1239
1406
  commit_sha: z.string().optional(),
1240
1407
  finished_at: z.iso.datetime().optional(),
1241
1408
  requested_scanners: z.array(z.string()).nullable(),
1242
1409
  scan_id: z.string(),
1243
1410
  started_at: z.iso.datetime(),
1244
- status: z.string(),
1245
- trigger_source: z.string(),
1246
- triggered_by: V1SecurityScanActorSchema
1411
+ status: z.enum([
1412
+ 'running',
1413
+ 'completed',
1414
+ 'failed'
1415
+ ]),
1416
+ trigger_source: z.enum([
1417
+ 'workflow',
1418
+ 'user',
1419
+ 'ui_auto',
1420
+ 'aikido_import',
1421
+ 'manage_findings',
1422
+ 'app_mcp_deep_auto',
1423
+ 'hvt_scheduled',
1424
+ 'workspace_scheduled',
1425
+ 'enterprise_batch',
1426
+ 'gitsync_pull'
1427
+ ]),
1428
+ triggered_by: SecurityScanActorSchema
1247
1429
  });
1248
1430
 
1249
- export const CursorListResponseV1SecurityScanSummarySchema = z.object({
1250
- data: z.array(V1SecurityScanSummarySchema).nullable(),
1431
+ export const SecurityScanPageSchema = z.object({
1432
+ data: z.array(SecurityScanSchema).nullable(),
1251
1433
  pagination: PaginationSchema
1252
1434
  });
1253
1435
 
1254
- export const V1SecurityScannerRunSchema = z.object({
1436
+ export const SecurityScannerRunSchema = z.object({
1255
1437
  commit_sha: z.string().optional(),
1256
1438
  error_message: z.string().optional(),
1257
1439
  finished_at: z.iso.datetime().optional(),
1258
1440
  scanner_name: z.string(),
1259
1441
  scanner_version: z.string().optional(),
1260
1442
  started_at: z.iso.datetime(),
1261
- status: z.string()
1443
+ status: z.enum([
1444
+ 'succeeded',
1445
+ 'failed',
1446
+ 'skipped'
1447
+ ])
1262
1448
  });
1263
1449
 
1264
- export const V1GetSecurityScanOutputBodySchema = z.object({
1265
- findings: z.array(V1SecurityFindingSchema).nullable(),
1266
- scan: V1SecurityScanSummarySchema,
1267
- scanner_runs: z.array(V1SecurityScannerRunSchema).nullable()
1450
+ export const SecurityScanDetailSchema = z.object({
1451
+ findings: z.array(SecurityFindingSchema).nullable(),
1452
+ scan: SecurityScanSchema,
1453
+ scanner_runs: z.array(SecurityScannerRunSchema).nullable()
1268
1454
  });
1269
1455
 
1270
1456
  export const V1SelectedLibrarySchema = z.object({
@@ -1315,26 +1501,18 @@ export const V1SetWorkspaceKnowledgeInputBodySchema = z.object({
1315
1501
  content: z.string()
1316
1502
  });
1317
1503
 
1318
- export const V1StartMessageExportInputBodySchema = z.object({
1319
- end_date: z.string().optional(),
1320
- project_id: z.string().optional(),
1321
- start_date: z.string().optional(),
1322
- user_id: z.string().optional()
1323
- });
1324
-
1325
- export const V1StartMessageExportOutputBodySchema = z.object({
1326
- export_id: z.string(),
1327
- status: z.enum(['running'])
1328
- });
1329
-
1330
1504
  export const V1TriggerSecurityScanInputBodySchema = z.object({
1331
1505
  project_id: z.string()
1332
1506
  });
1333
1507
 
1334
- export const V1TriggerSecurityScanResponseBodySchema = z.object({
1508
+ export const TriggerSecurityScanResponseSchema = z.object({
1335
1509
  message: z.string().optional(),
1336
1510
  scan_id: z.string(),
1337
- status: z.string()
1511
+ status: z.enum([
1512
+ 'started',
1513
+ 'running',
1514
+ 'completed'
1515
+ ])
1338
1516
  });
1339
1517
 
1340
1518
  export const V1UnscopedFileSchema = z.object({
@@ -1421,7 +1599,7 @@ export const V1UpdateWorkspaceSettingsInputBodySchema = z.object({
1421
1599
  workspace_id: z.string()
1422
1600
  });
1423
1601
 
1424
- export const V1UpdateWorkspaceSettingsNestedInputBodySchema = z.object({
1602
+ export const UpdateWorkspaceSettingsRequestSchema = z.object({
1425
1603
  default_monthly_member_credit_limit: z.number().gte(0).nullish()
1426
1604
  });
1427
1605
 
@@ -1456,60 +1634,114 @@ export const V1WorkspaceAuditLogsBodySchema = z.object({
1456
1634
  pagination: PaginationSchema
1457
1635
  });
1458
1636
 
1459
- export const V1WorkspaceCreditHistoryBodySchema = z.object({
1460
- data: z.array(V1CreditHistoryEntrySchema).nullable(),
1637
+ export const CreditHistoryPageSchema = z.object({
1638
+ data: z.array(CreditHistoryEntrySchema).nullable(),
1461
1639
  pagination: PaginationSchema,
1462
1640
  total: z.number().optional(),
1463
1641
  total_is_capped: z.boolean().optional()
1464
1642
  });
1465
1643
 
1466
- export const V1WorkspaceCreditsExpiringGrantSchema = z.object({
1467
- applicability: z.string().optional(),
1644
+ export const ExpiringCreditGrantSchema = z.object({
1645
+ applicability: z.enum([
1646
+ 'generic',
1647
+ 'build_time',
1648
+ 'build_mode',
1649
+ 'plan_mode'
1650
+ ]).optional(),
1468
1651
  credits: z.number(),
1469
1652
  expires_at: z.iso.datetime(),
1470
- grant_type: z.string()
1653
+ grant_type: z.enum([
1654
+ 'billing',
1655
+ 'rollover',
1656
+ 'topup',
1657
+ 'commitment',
1658
+ 'cashback',
1659
+ 'granted',
1660
+ 'overage',
1661
+ 'unlimited',
1662
+ 'allowance'
1663
+ ])
1471
1664
  });
1472
1665
 
1473
- export const V1WorkspaceCreditsGrantTypeBalanceSchema = z.object({
1474
- grant_type: z.string(),
1666
+ export const CreditGrantTypeBalanceSchema = z.object({
1667
+ grant_type: z.enum([
1668
+ 'billing',
1669
+ 'daily',
1670
+ 'rollover',
1671
+ 'topup',
1672
+ 'commitment',
1673
+ 'cashback',
1674
+ 'granted',
1675
+ 'overage',
1676
+ 'unlimited',
1677
+ 'allowance'
1678
+ ]),
1475
1679
  granted: z.number(),
1476
1680
  remaining: z.number()
1477
1681
  });
1478
1682
 
1479
- export const V1WorkspaceCreditsBodySchema = z.object({
1480
- billing_period: V1BillingPeriodSchema,
1683
+ export const CreditBalanceSchema = z.object({
1684
+ billing_period: BillingPeriodSchema,
1481
1685
  daily_limit: z.number(),
1482
1686
  daily_remaining: z.number(),
1483
- expiring_grants: z.array(V1WorkspaceCreditsExpiringGrantSchema).nullable(),
1484
- grant_type_balances: z.array(V1WorkspaceCreditsGrantTypeBalanceSchema).nullable(),
1687
+ expiring_grants: z.array(ExpiringCreditGrantSchema).nullable(),
1688
+ grant_type_balances: z.array(CreditGrantTypeBalanceSchema).nullable(),
1485
1689
  total_billing_period_used: z.number(),
1486
1690
  total_granted: z.number(),
1487
1691
  total_remaining: z.number()
1488
1692
  });
1489
1693
 
1490
- export const V1WorkspaceInsightsActivityFreshnessSchema = z.object({
1694
+ export const WorkspaceGroupSchema = z.object({
1695
+ created_at: z.iso.datetime(),
1696
+ description: z.string().optional(),
1697
+ id: z.string(),
1698
+ member_count: z.number(),
1699
+ name: z.string(),
1700
+ scim_external_id: z.string().optional(),
1701
+ updated_at: z.iso.datetime(),
1702
+ workspace_id: z.string()
1703
+ });
1704
+
1705
+ export const WorkspaceGroupPageSchema = z.object({
1706
+ data: z.array(WorkspaceGroupSchema).nullable(),
1707
+ pagination: PaginationSchema
1708
+ });
1709
+
1710
+ export const WorkspaceInsightsActivityFreshnessSchema = z.object({
1491
1711
  edits_as_of: z.iso.datetime().optional(),
1492
1712
  visitors_as_of: z.iso.datetime().optional()
1493
1713
  });
1494
1714
 
1495
- export const V1WorkspaceInsightsEdgeFunctionSchema = z.object({
1715
+ export const WorkspaceInsightsEdgeFunctionSchema = z.object({
1496
1716
  name: z.string()
1497
1717
  });
1498
1718
 
1499
- export const V1WorkspaceInsightsFindingSchema = z.object({
1500
- category: z.string(),
1719
+ export const WorkspaceInsightsFindingSchema = z.object({
1720
+ category: z.enum([
1721
+ 'security',
1722
+ 'data',
1723
+ 'exposure',
1724
+ 'credentials',
1725
+ 'access',
1726
+ 'integrations',
1727
+ 'runtime'
1728
+ ]),
1501
1729
  description: z.string(),
1502
1730
  id: z.string(),
1503
1731
  project_count: z.number(),
1504
- severity: z.string(),
1732
+ severity: z.enum([
1733
+ 'needs_review',
1734
+ 'review_recommended',
1735
+ 'no_review_needed'
1736
+ ]),
1505
1737
  title: z.string()
1506
1738
  });
1507
1739
 
1508
- export const V1WorkspaceInsightsOwnerSchema = z.object({
1740
+ export const WorkspaceInsightsOwnerSchema = z.object({
1509
1741
  display_name: z.string().optional()
1510
1742
  });
1511
1743
 
1512
- export const V1WorkspaceInsightsReasonValuesSchema = z.object({
1744
+ export const WorkspaceInsightsReasonValuesSchema = z.object({
1513
1745
  connector_count: z.number().optional(),
1514
1746
  edge_function_count: z.number().optional(),
1515
1747
  error_count: z.number().optional(),
@@ -1520,22 +1752,34 @@ export const V1WorkspaceInsightsReasonValuesSchema = z.object({
1520
1752
  warning_count: z.number().optional()
1521
1753
  });
1522
1754
 
1523
- export const V1WorkspaceInsightsReasonSchema = z.object({
1524
- category: z.string(),
1755
+ export const WorkspaceInsightsReasonSchema = z.object({
1756
+ category: z.enum([
1757
+ 'security',
1758
+ 'data',
1759
+ 'exposure',
1760
+ 'credentials',
1761
+ 'access',
1762
+ 'integrations',
1763
+ 'runtime'
1764
+ ]),
1525
1765
  detail: z.string(),
1526
1766
  id: z.string(),
1527
1767
  label: z.string(),
1528
- severity: z.string(),
1529
- values: V1WorkspaceInsightsReasonValuesSchema.optional()
1768
+ severity: z.enum([
1769
+ 'needs_review',
1770
+ 'review_recommended',
1771
+ 'no_review_needed'
1772
+ ]),
1773
+ values: WorkspaceInsightsReasonValuesSchema.optional()
1530
1774
  });
1531
1775
 
1532
- export const V1WorkspaceInsightsReviewPrioritySchema = z.object({
1776
+ export const WorkspaceInsightsReviewPrioritySchema = z.object({
1533
1777
  needs_review: z.number(),
1534
1778
  no_review_needed: z.number(),
1535
1779
  review_recommended: z.number()
1536
1780
  });
1537
1781
 
1538
- export const V1WorkspaceInsightsSignalsSchema = z.object({
1782
+ export const WorkspaceInsightsSignalsSchema = z.object({
1539
1783
  chat_attachment_count: z.number(),
1540
1784
  connector_count: z.number(),
1541
1785
  edge_function_count: z.number(),
@@ -1567,12 +1811,16 @@ export const V1WorkspaceInsightsSignalsSchema = z.object({
1567
1811
  warning_count: z.number()
1568
1812
  });
1569
1813
 
1570
- export const V1WorkspaceInsightsProjectSchema = z.object({
1571
- activity_group: z.string().optional(),
1814
+ export const WorkspaceInsightsProjectSchema = z.object({
1815
+ activity_group: z.enum([
1816
+ 'last_14_days',
1817
+ 'last_60_days',
1818
+ 'older'
1819
+ ]).optional(),
1572
1820
  connectors: z.array(z.string()).nullish(),
1573
1821
  description: z.string().optional(),
1574
1822
  display_name: z.string().optional(),
1575
- edge_functions: z.array(V1WorkspaceInsightsEdgeFunctionSchema).nullish(),
1823
+ edge_functions: z.array(WorkspaceInsightsEdgeFunctionSchema).nullish(),
1576
1824
  edit_count: z.number(),
1577
1825
  edits_24h: z.number(),
1578
1826
  edits_30d: z.number(),
@@ -1582,78 +1830,118 @@ export const V1WorkspaceInsightsProjectSchema = z.object({
1582
1830
  is_published: z.boolean().optional(),
1583
1831
  last_edited_at: z.iso.datetime().optional(),
1584
1832
  last_security_scan_at: z.iso.datetime().optional(),
1585
- matched_reason: V1WorkspaceInsightsReasonSchema.optional(),
1833
+ matched_reason: WorkspaceInsightsReasonSchema.optional(),
1586
1834
  message_count: z.number(),
1587
1835
  name: z.string().optional(),
1588
1836
  og_image_url: z.string().optional(),
1589
- owner: V1WorkspaceInsightsOwnerSchema.optional(),
1590
- publish_visibility: z.string().optional(),
1591
- review_priority: z.string().optional(),
1592
- review_priority_explanation: z.array(V1WorkspaceInsightsReasonSchema).nullable(),
1593
- signals: V1WorkspaceInsightsSignalsSchema,
1837
+ owner: WorkspaceInsightsOwnerSchema.optional(),
1838
+ publish_visibility: z.enum([
1839
+ 'public',
1840
+ 'private',
1841
+ 'workspace_only'
1842
+ ]).optional(),
1843
+ review_priority: z.enum([
1844
+ 'needs_review',
1845
+ 'review_recommended',
1846
+ 'no_review_needed',
1847
+ 'unscored'
1848
+ ]).optional(),
1849
+ review_priority_explanation: z.array(WorkspaceInsightsReasonSchema).nullable(),
1850
+ signals: WorkspaceInsightsSignalsSchema,
1594
1851
  url: z.string().optional(),
1595
- visibility: z.string().optional(),
1852
+ visibility: z.enum([
1853
+ 'draft',
1854
+ 'private',
1855
+ 'workspace_view',
1856
+ 'public'
1857
+ ]).optional(),
1596
1858
  visitors_24h: z.number(),
1597
1859
  visitors_30d: z.number(),
1598
1860
  visitors_7d: z.number()
1599
1861
  });
1600
1862
 
1601
- export const V1WorkspaceInsightsProjectsBodySchema = z.object({
1602
- activity_as_of: V1WorkspaceInsightsActivityFreshnessSchema.optional(),
1603
- applied_finding: V1WorkspaceInsightsFindingSchema.optional(),
1863
+ export const WorkspaceInsightsProjectPageSchema = z.object({
1864
+ activity_as_of: WorkspaceInsightsActivityFreshnessSchema.optional(),
1865
+ applied_finding: WorkspaceInsightsFindingSchema.optional(),
1604
1866
  as_of: z.iso.datetime().optional(),
1605
- data: z.array(V1WorkspaceInsightsProjectSchema).nullable(),
1867
+ data: z.array(WorkspaceInsightsProjectSchema).nullable(),
1606
1868
  pagination: PaginationSchema,
1607
1869
  total: z.number()
1608
1870
  });
1609
1871
 
1610
- export const V1WorkspaceInsightsStatSchema = z.object({
1872
+ export const WorkspaceInsightsStatSchema = z.object({
1611
1873
  delta_30d: z.number(),
1612
1874
  delta_window: z.string(),
1613
1875
  value: z.number()
1614
1876
  });
1615
1877
 
1616
- export const V1WorkspaceInsightsSummarySchema = z.object({
1617
- externally_published: V1WorkspaceInsightsStatSchema,
1618
- risk: V1WorkspaceInsightsReviewPrioritySchema,
1619
- total_projects: V1WorkspaceInsightsStatSchema,
1620
- workspace_members: V1WorkspaceInsightsStatSchema
1878
+ export const WorkspaceInsightsSummarySchema = z.object({
1879
+ externally_published: WorkspaceInsightsStatSchema,
1880
+ risk: WorkspaceInsightsReviewPrioritySchema,
1881
+ total_projects: WorkspaceInsightsStatSchema,
1882
+ workspace_members: WorkspaceInsightsStatSchema
1621
1883
  });
1622
1884
 
1623
- export const V1WorkspaceInsightsBodySchema = z.object({
1885
+ export const WorkspaceInsightsSchema = z.object({
1624
1886
  as_of: z.iso.datetime().optional(),
1625
- findings: z.array(V1WorkspaceInsightsFindingSchema).nullable(),
1626
- summary: V1WorkspaceInsightsSummarySchema
1887
+ findings: z.array(WorkspaceInsightsFindingSchema),
1888
+ summary: WorkspaceInsightsSummarySchema
1889
+ });
1890
+
1891
+ export const WorkspaceMemberGroupSchema = z.object({
1892
+ id: z.string(),
1893
+ name: z.string()
1627
1894
  });
1628
1895
 
1629
- export const V1WorkspaceMemberSchema = z.object({
1896
+ export const WorkspaceMemberSchema = z.object({
1630
1897
  display_name: z.string().optional(),
1631
1898
  email: z.string().optional(),
1899
+ groups: z.array(WorkspaceMemberGroupSchema).optional(),
1632
1900
  invited_at: z.iso.datetime().optional(),
1633
1901
  joined_at: z.iso.datetime().optional(),
1634
1902
  monthly_credit_limit: z.number().optional(),
1635
- role: z.string(),
1903
+ role: z.enum([
1904
+ 'owner',
1905
+ 'admin',
1906
+ 'member',
1907
+ 'viewer',
1908
+ 'collaborator'
1909
+ ]),
1636
1910
  user_id: z.string(),
1637
1911
  workspace_id: z.string()
1638
1912
  });
1639
1913
 
1640
- export const CursorListResponseV1WorkspaceMemberSchema = z.object({
1641
- data: z.array(V1WorkspaceMemberSchema).nullable(),
1914
+ export const WorkspaceMemberPageSchema = z.object({
1915
+ data: z.array(WorkspaceMemberSchema).nullable(),
1642
1916
  pagination: PaginationSchema
1643
1917
  });
1644
1918
 
1645
- export const V1WorkspaceSettingsBodySchema = z.object({
1919
+ export const WorkspaceSettingsSchema = z.object({
1646
1920
  billing_period_end_date: z.iso.datetime().optional(),
1647
1921
  billing_period_start_date: z.iso.datetime().optional(),
1648
1922
  default_monthly_member_credit_limit: z.number().optional(),
1649
- default_project_visibility: z.string().optional(),
1923
+ default_project_visibility: z.enum([
1924
+ 'draft',
1925
+ 'private',
1926
+ 'workspace_view',
1927
+ 'public'
1928
+ ]).optional(),
1650
1929
  enable_pii: z.boolean(),
1651
1930
  enforce_sso: z.boolean(),
1652
1931
  id: z.string(),
1653
1932
  name: z.string(),
1654
1933
  num_seats: z.number().optional(),
1655
- plan: z.string(),
1656
- publishing_policy: z.string().optional()
1934
+ plan: z.enum([
1935
+ 'free',
1936
+ 'pro',
1937
+ 'business',
1938
+ 'enterprise'
1939
+ ]),
1940
+ publishing_policy: z.enum([
1941
+ 'org_only',
1942
+ 'workspace_only',
1943
+ 'disabled'
1944
+ ]).optional()
1657
1945
  });
1658
1946
 
1659
1947
  export const V1WorkspaceSkillDtoSchema = z.object({
@@ -1685,41 +1973,41 @@ export const V1WorkspaceUsageBreakdownEntrySchema = z.object({
1685
1973
  });
1686
1974
 
1687
1975
  export const V1WorkspaceUsageBreakdownBodySchema = z.object({
1688
- billing_period: V1BillingPeriodSchema,
1976
+ billing_period: BillingPeriodSchema,
1689
1977
  data: z.array(V1WorkspaceUsageBreakdownEntrySchema).nullable(),
1690
1978
  member_count: z.number(),
1691
1979
  pagination: PaginationSchema
1692
1980
  });
1693
1981
 
1694
- export const V1WorkspaceUsageConnectorBreakdownSchema = z.object({
1982
+ export const ConnectorUsageSchema = z.object({
1695
1983
  credits: z.number(),
1696
1984
  key: z.string(),
1697
1985
  label: z.string()
1698
1986
  });
1699
1987
 
1700
- export const V1WorkspaceUsageDatabaseBreakdownSchema = z.object({
1988
+ export const DatabaseUsageSchema = z.object({
1701
1989
  credits: z.number(),
1702
1990
  key: z.enum(['database_server', 'database_storage']),
1703
1991
  label: z.string()
1704
1992
  });
1705
1993
 
1706
- export const V1WorkspaceUsageGatewayModelSchema = z.object({
1994
+ export const GatewayModelUsageSchema = z.object({
1707
1995
  credits: z.number(),
1708
1996
  name: z.string(),
1709
1997
  provider: z.string()
1710
1998
  });
1711
1999
 
1712
- export const V1BillingUsageRowSchema = z.object({
2000
+ export const CreditUsageEntrySchema = z.object({
1713
2001
  build: z.number(),
1714
2002
  connectors: z.number(),
1715
- connectors_breakdown: z.array(V1WorkspaceUsageConnectorBreakdownSchema).nullish(),
2003
+ connectors_breakdown: z.array(ConnectorUsageSchema).nullish(),
1716
2004
  database: z.number(),
1717
- database_breakdown: z.array(V1WorkspaceUsageDatabaseBreakdownSchema).nullish(),
2005
+ database_breakdown: z.array(DatabaseUsageSchema).nullish(),
1718
2006
  display_name: z.string().optional(),
1719
2007
  email: z.string().optional(),
1720
2008
  functions: z.number(),
1721
2009
  gateway: z.number(),
1722
- gateway_models: z.array(V1WorkspaceUsageGatewayModelSchema).nullish(),
2010
+ gateway_models: z.array(GatewayModelUsageSchema).nullish(),
1723
2011
  network: z.number(),
1724
2012
  period_end: z.string().optional(),
1725
2013
  period_start: z.string().optional(),
@@ -1731,11 +2019,11 @@ export const V1BillingUsageRowSchema = z.object({
1731
2019
  user_id: z.string().optional()
1732
2020
  });
1733
2021
 
1734
- export const V1BillingUsageBodySchema = z.object({
1735
- data: z.array(V1BillingUsageRowSchema).nullable(),
2022
+ export const CreditUsagePageSchema = z.object({
2023
+ data: z.array(CreditUsageEntrySchema).nullable(),
1736
2024
  entity_count: z.number().optional(),
1737
2025
  pagination: PaginationSchema,
1738
- period: V1BillingUsagePeriodSchema,
2026
+ period: CreditUsagePeriodSchema,
1739
2027
  workspace_total: z.number()
1740
2028
  });
1741
2029
 
@@ -1769,12 +2057,12 @@ export const V1WorkspaceUsageProjectsBodySchema = z.object({
1769
2057
  export const V1WorkspaceUsageTimeseriesBucketSchema = z.object({
1770
2058
  build: z.number(),
1771
2059
  connectors: z.number(),
1772
- connectors_breakdown: z.array(V1WorkspaceUsageConnectorBreakdownSchema).nullable(),
2060
+ connectors_breakdown: z.array(ConnectorUsageSchema).nullable(),
1773
2061
  database: z.number(),
1774
- database_breakdown: z.array(V1WorkspaceUsageDatabaseBreakdownSchema).nullable(),
2062
+ database_breakdown: z.array(DatabaseUsageSchema).nullable(),
1775
2063
  functions: z.number(),
1776
2064
  gateway: z.number(),
1777
- gateway_models: z.array(V1WorkspaceUsageGatewayModelSchema).nullable(),
2065
+ gateway_models: z.array(GatewayModelUsageSchema).nullable(),
1778
2066
  network: z.number(),
1779
2067
  period_end: z.string(),
1780
2068
  period_start: z.string(),
@@ -1801,6 +2089,7 @@ export const V1WriteWorkspaceSkillOutputBodySchema = z.object({
1801
2089
  });
1802
2090
 
1803
2091
  export const VisibilityChangeInfoSchema = z.object({
2092
+ commit_time: z.iso.datetime().optional(),
1804
2093
  new_visibility: z.enum([
1805
2094
  'public',
1806
2095
  'private',
@@ -1824,6 +2113,6 @@ export const AddProjectsToFolderResultSchema = z.object({
1824
2113
  visibility_updated: z.array(VisibilityChangeInfoSchema).nullable()
1825
2114
  });
1826
2115
 
1827
- export const WorkspaceAnalyticsResponseSchema = z.object({
2116
+ export const WorkspaceAnalyticsSchema = z.object({
1828
2117
  timeSeries: TimeSeriesGroupSchema
1829
2118
  });