windmill-client 1.850.0 → 1.852.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.
@@ -476,7 +476,7 @@ export type FlowModule = {
476
476
  expr: string;
477
477
  };
478
478
  /**
479
- * Delay before executing this step (in seconds or as expression)
479
+ * Delay after this step completes, before the next step starts (in seconds or as expression)
480
480
  */
481
481
  sleep?: InputTransform;
482
482
  /**
@@ -3038,11 +3038,10 @@ export type ExternalJwtToken = {
3038
3038
  last_used_at: string;
3039
3039
  };
3040
3040
  /**
3041
- * Guests are free up to `free_allowance` distinct emails over the trailing `window_days`. Past that an Enterprise plan meters them (`metered`, four guests to one seat: `billable_guests`, `guest_seats`); every other plan and build admits no new email until the count drops. `instance_enabled` is the superadmin switch (`guest_access_disabled` global setting) every workspace switch sits under. `available` is whether this deployment can have guests at all: false on the shared cloud, where guest access requires a self-hosted or dedicated deployment, and every other field and switch is then moot.
3041
+ * Guests are free up to `free_allowance` distinct emails over the trailing `window_days`. Past that an Enterprise plan meters them (`metered`, four guests to one seat: `billable_guests`, `guest_seats`); every other plan and build admits no new email until the count drops. `available` is whether this deployment can have guests at all: false on the shared cloud, where guest access requires a self-hosted or dedicated deployment, and every other field is then moot.
3042
3042
  */
3043
3043
  export type GuestUsage = {
3044
3044
  available: boolean;
3045
- instance_enabled: boolean;
3046
3045
  guest_count: number;
3047
3046
  window_days: number;
3048
3047
  free_allowance: number;
@@ -6391,7 +6390,7 @@ export type Policy = {
6391
6390
  resource?: string;
6392
6391
  }>;
6393
6392
  /**
6394
- * Who may open the app, and who its runnables execute as. Optional, and what omitting it means depends on the operation: creating an app defaults it to `publisher` (runs on behalf of the app's publisher and requires an authenticated viewer), while updating one keeps the mode the app is already deployed under. Neither `anonymous`, which makes the app publicly executable, nor `guest`, which opens it to anyone the identity provider authenticates, is ever assumed. A guest is only admitted where the workspace also has `guest_access_enabled`, which is checked when the session is minted and again on every guest request
6393
+ * Who may open the app, and who its runnables execute as. Optional, and what omitting it means depends on the operation: creating an app defaults it to `publisher` (runs on behalf of the app's publisher and requires an authenticated viewer), while updating one keeps the mode the app is already deployed under. Neither `anonymous`, which makes the app publicly executable, nor `guest`, which opens it to anyone the identity provider authenticates, is ever assumed. Widening an app to `guest` is gated by the `RestrictGuestAppDeployment` protection rule
6395
6394
  */
6396
6395
  execution_mode?: 'viewer' | 'publisher' | 'guest' | 'anonymous';
6397
6396
  /**
@@ -6919,6 +6918,10 @@ export type GitRepositorySettings = {
6919
6918
  auto_pull?: AutoPullSettings;
6920
6919
  promotion_open_prs?: boolean;
6921
6920
  fork_open_prs?: boolean;
6921
+ /**
6922
+ * review every pull request against the tracked branch with the workspace's AI
6923
+ */
6924
+ ai_review_prs?: boolean;
6922
6925
  /**
6923
6926
  * server-owned, last failure opening a PR for a deploy branch of this repo
6924
6927
  */
@@ -7221,6 +7224,10 @@ export type RoleCapabilities = {
7221
7224
  apps: AuthorLevel;
7222
7225
  manage_schedules: boolean;
7223
7226
  manage_triggers: boolean;
7227
+ /**
7228
+ * Fork the workspace.
7229
+ */
7230
+ fork: boolean;
7224
7231
  visibility: RoleVisibility;
7225
7232
  };
7226
7233
  /**
@@ -7232,6 +7239,7 @@ export type RoleCapabilitiesPatch = {
7232
7239
  apps?: AuthorLevel;
7233
7240
  manage_schedules?: boolean;
7234
7241
  manage_triggers?: boolean;
7242
+ fork?: boolean;
7235
7243
  visibility?: {
7236
7244
  [key: string]: (boolean);
7237
7245
  };
@@ -7639,6 +7647,13 @@ export type ProtectionRuleset = {
7639
7647
  rules: ProtectionRules;
7640
7648
  bypass_groups: RuleBypasserGroups;
7641
7649
  bypass_users: RuleBypasserUsers;
7650
+ fork_role_mapping?: ForkRoleMapping;
7651
+ };
7652
+ /**
7653
+ * Role a member of this workspace gets in a fork of it, keyed by the role it holds here. Unmapped roles carry over unchanged; where two rulesets map the same role, the first by name wins. On update, omitting it leaves the stored mapping unchanged.
7654
+ */
7655
+ export type ForkRoleMapping = {
7656
+ [key: string]: (string);
7642
7657
  };
7643
7658
  /**
7644
7659
  * Configuration of protection restrictions
@@ -9344,10 +9359,6 @@ export type GetPublicSettingsResponse = {
9344
9359
  datatable?: DataTableSettings;
9345
9360
  deploy_ui?: WorkspaceDeployUISettings;
9346
9361
  mute_critical_alerts?: boolean;
9347
- /**
9348
- * Whether this workspace admits guest sessions. An app's own `guest` execution mode is inert while this is false.
9349
- */
9350
- guest_access_enabled: boolean;
9351
9362
  /**
9352
9363
  * Whether every new fork of this workspace starts with its admins and developers as members, keeping their role.
9353
9364
  */
@@ -9394,10 +9405,6 @@ export type GetSettingsResponse = {
9394
9405
  * Report failed jobs to the instance critical alert channels when no workspace error handler is set.
9395
9406
  */
9396
9407
  error_handler_fallback_to_instance_alerts?: boolean;
9397
- /**
9398
- * Whether this workspace admits guest sessions. An app's own `guest` execution mode is inert while this is false.
9399
- */
9400
- guest_access_enabled?: boolean;
9401
9408
  /**
9402
9409
  * PEM public key a guest JWT (`jwt_guest_`) is verified against for this workspace. Mutually exclusive with `guest_jwt_jwks_url`.
9403
9410
  */
@@ -10252,16 +10259,6 @@ export type EditWorkspaceDefaultAppData = {
10252
10259
  workspace: string;
10253
10260
  };
10254
10261
  export type EditWorkspaceDefaultAppResponse = string;
10255
- export type EditGuestAccessData = {
10256
- /**
10257
- * Whether guest sessions are admitted
10258
- */
10259
- requestBody: {
10260
- guest_access_enabled: boolean;
10261
- };
10262
- workspace: string;
10263
- };
10264
- export type EditGuestAccessResponse = string;
10265
10262
  export type EditAddAdminsAndDevelopersToForksData = {
10266
10263
  /**
10267
10264
  * Whether new forks start with this workspace's admins and developers
@@ -10382,6 +10379,7 @@ export type CreateProtectionRuleData = {
10382
10379
  rules: ProtectionRules;
10383
10380
  bypass_groups: RuleBypasserGroups;
10384
10381
  bypass_users: RuleBypasserUsers;
10382
+ fork_role_mapping?: ForkRoleMapping;
10385
10383
  };
10386
10384
  workspace: string;
10387
10385
  };
@@ -10398,6 +10396,7 @@ export type UpdateProtectionRuleData = {
10398
10396
  rules: ProtectionRules;
10399
10397
  bypass_groups: RuleBypasserGroups;
10400
10398
  bypass_users: RuleBypasserUsers;
10399
+ fork_role_mapping?: ForkRoleMapping;
10401
10400
  };
10402
10401
  /**
10403
10402
  * Name of the protection rule to update
@@ -16320,6 +16319,201 @@ export type UnshareAgentFromSlackChannelData = {
16320
16319
  workspace: string;
16321
16320
  };
16322
16321
  export type UnshareAgentFromSlackChannelResponse = string;
16322
+ export type CompleteAiData = {
16323
+ requestBody: {
16324
+ system: string;
16325
+ user: string;
16326
+ /**
16327
+ * defaults to the AI config's default model
16328
+ */
16329
+ model?: AIProviderModel;
16330
+ max_tokens?: number;
16331
+ };
16332
+ workspace: string;
16333
+ };
16334
+ export type CompleteAiResponse = {
16335
+ text: string;
16336
+ model: AIProviderModel;
16337
+ };
16338
+ export type RecordAiUsageData = {
16339
+ requestBody: {
16340
+ events: Array<AITokenUsageEvent>;
16341
+ };
16342
+ workspace: string;
16343
+ };
16344
+ export type RecordAiUsageResponse = void;
16345
+ export type ListAiUsageData = {
16346
+ days?: number;
16347
+ groupBy?: 'day' | 'user' | 'model';
16348
+ /**
16349
+ * workspace-wide usage (admin only) or the calling user's own
16350
+ */
16351
+ scope?: 'workspace' | 'self';
16352
+ workspace: string;
16353
+ };
16354
+ export type ListAiUsageResponse = {
16355
+ buckets: Array<AITokenUsageBucket>;
16356
+ /**
16357
+ * more buckets matched than were returned, so summing them under-reports
16358
+ */
16359
+ truncated: boolean;
16360
+ };
16361
+ export type ListAiSessionBackupsData = {
16362
+ workspace: string;
16363
+ };
16364
+ export type ListAiSessionBackupsResponse = {
16365
+ enabled: boolean;
16366
+ /**
16367
+ * names the storage answered from; sync state recorded against another one is void
16368
+ */
16369
+ storage_id?: string;
16370
+ /**
16371
+ * bumped by every workspace key rotation; sync state recorded under another one is void
16372
+ */
16373
+ backup_generation?: number;
16374
+ /**
16375
+ * the storage answered from is the instance object store, standing in for a workspace without storage of its own; a removal owed to it is retired by any answer from the workspace's own storage
16376
+ */
16377
+ fallback?: boolean;
16378
+ /**
16379
+ * the newest 500 at most
16380
+ */
16381
+ sessions: Array<AISessionBackupListing>;
16382
+ /**
16383
+ * the user has more sessions than the answer names
16384
+ */
16385
+ truncated?: boolean;
16386
+ };
16387
+ export type PullAiSessionBackupsData = {
16388
+ requestBody: {
16389
+ ids: Array<(string)>;
16390
+ resume?: AISessionBackupCursor;
16391
+ };
16392
+ workspace: string;
16393
+ };
16394
+ export type PullAiSessionBackupsResponse = {
16395
+ enabled: boolean;
16396
+ storage_id?: string;
16397
+ backup_generation?: number;
16398
+ fallback?: boolean;
16399
+ sessions: Array<AISessionBackup>;
16400
+ deferred: Array<(string)>;
16401
+ };
16402
+ export type PushAiSessionBackupsData = {
16403
+ requestBody: {
16404
+ /**
16405
+ * the email the push was prepared for; refused with a 409 when it is not the caller's
16406
+ */
16407
+ owner: string;
16408
+ sessions?: Array<AISessionBackupPush>;
16409
+ removed?: Array<(string)>;
16410
+ };
16411
+ workspace: string;
16412
+ };
16413
+ export type PushAiSessionBackupsResponse = {
16414
+ enabled: boolean;
16415
+ storage_id?: string;
16416
+ backup_generation?: number;
16417
+ fallback?: boolean;
16418
+ results: Array<{
16419
+ id: string;
16420
+ error?: string;
16421
+ /**
16422
+ * nothing was written and the session must be pushed whole again; an incremental part found no listed session to ride on (the backup was removed, or a push split over parts is in progress or was abandoned), or a later part of a push split over parts found another push had superseded it
16423
+ */
16424
+ needs_whole?: boolean;
16425
+ }>;
16426
+ };
16427
+ export type ShareAiArtifactData = {
16428
+ requestBody: {
16429
+ /**
16430
+ * the artifact's id in the author's session
16431
+ */
16432
+ artifact_id: string;
16433
+ name: string;
16434
+ kind: 'md' | 'html';
16435
+ version: number;
16436
+ content: string;
16437
+ };
16438
+ workspace: string;
16439
+ };
16440
+ export type ShareAiArtifactResponse = SharedAiArtifactInfo;
16441
+ export type GetAiArtifactShareStatusData = {
16442
+ artifactId: string;
16443
+ workspace: string;
16444
+ };
16445
+ export type GetAiArtifactShareStatusResponse = {
16446
+ retention_secs: number;
16447
+ share?: SharedAiArtifactInfo;
16448
+ };
16449
+ export type GetSharedAiArtifactData = {
16450
+ id: string;
16451
+ workspace: string;
16452
+ };
16453
+ export type GetSharedAiArtifactResponse = SharedAiArtifactInfo & {
16454
+ content: string;
16455
+ /**
16456
+ * whether the caller authored the share or is a workspace admin
16457
+ */
16458
+ can_unshare: boolean;
16459
+ };
16460
+ export type UnshareAiArtifactData = {
16461
+ id: string;
16462
+ workspace: string;
16463
+ };
16464
+ export type UnshareAiArtifactResponse = string;
16465
+ export type ShareAiSessionData = {
16466
+ requestBody: {
16467
+ /**
16468
+ * the session's id in the author's browser
16469
+ */
16470
+ session_id: string;
16471
+ name: string;
16472
+ /**
16473
+ * left as it is on an existing share when absent; a new share starts private
16474
+ */
16475
+ is_public?: boolean;
16476
+ message_count: number;
16477
+ snapshot: {
16478
+ [key: string]: unknown;
16479
+ };
16480
+ };
16481
+ workspace: string;
16482
+ };
16483
+ export type ShareAiSessionResponse = SharedAiSessionInfo;
16484
+ export type GetAiSessionShareStatusData = {
16485
+ sessionId: string;
16486
+ workspace: string;
16487
+ };
16488
+ export type GetAiSessionShareStatusResponse = {
16489
+ share?: SharedAiSessionInfo;
16490
+ };
16491
+ export type SetAiSessionSharePublicData = {
16492
+ id: string;
16493
+ requestBody: {
16494
+ is_public: boolean;
16495
+ };
16496
+ workspace: string;
16497
+ };
16498
+ export type SetAiSessionSharePublicResponse = SharedAiSessionInfo;
16499
+ export type GetSharedAiSessionData = {
16500
+ id: string;
16501
+ workspace: string;
16502
+ };
16503
+ export type GetSharedAiSessionResponse = SharedAiSessionInfo & {
16504
+ snapshot: {
16505
+ [key: string]: unknown;
16506
+ };
16507
+ /**
16508
+ * whether the caller authored the share or is a workspace admin
16509
+ */
16510
+ can_unshare: boolean;
16511
+ };
16512
+ export type UnshareAiSessionData = {
16513
+ id: string;
16514
+ workspace: string;
16515
+ };
16516
+ export type UnshareAiSessionResponse = string;
16323
16517
  export type ListEvalDatasetsData = {
16324
16518
  workspace: string;
16325
16519
  };
@@ -16564,185 +16758,6 @@ export type ListRawAppsData = {
16564
16758
  workspace: string;
16565
16759
  };
16566
16760
  export type ListRawAppsResponse = Array<ListableRawApp>;
16567
- export type RecordAiUsageData = {
16568
- requestBody: {
16569
- events: Array<AITokenUsageEvent>;
16570
- };
16571
- workspace: string;
16572
- };
16573
- export type RecordAiUsageResponse = void;
16574
- export type ListAiUsageData = {
16575
- days?: number;
16576
- groupBy?: 'day' | 'user' | 'model';
16577
- /**
16578
- * workspace-wide usage (admin only) or the calling user's own
16579
- */
16580
- scope?: 'workspace' | 'self';
16581
- workspace: string;
16582
- };
16583
- export type ListAiUsageResponse = {
16584
- buckets: Array<AITokenUsageBucket>;
16585
- /**
16586
- * more buckets matched than were returned, so summing them under-reports
16587
- */
16588
- truncated: boolean;
16589
- };
16590
- export type ListAiSessionBackupsData = {
16591
- workspace: string;
16592
- };
16593
- export type ListAiSessionBackupsResponse = {
16594
- enabled: boolean;
16595
- /**
16596
- * names the storage answered from; sync state recorded against another one is void
16597
- */
16598
- storage_id?: string;
16599
- /**
16600
- * bumped by every workspace key rotation; sync state recorded under another one is void
16601
- */
16602
- backup_generation?: number;
16603
- /**
16604
- * the storage answered from is the instance object store, standing in for a workspace without storage of its own; a removal owed to it is retired by any answer from the workspace's own storage
16605
- */
16606
- fallback?: boolean;
16607
- /**
16608
- * the newest 500 at most
16609
- */
16610
- sessions: Array<AISessionBackupListing>;
16611
- /**
16612
- * the user has more sessions than the answer names
16613
- */
16614
- truncated?: boolean;
16615
- };
16616
- export type PullAiSessionBackupsData = {
16617
- requestBody: {
16618
- ids: Array<(string)>;
16619
- resume?: AISessionBackupCursor;
16620
- };
16621
- workspace: string;
16622
- };
16623
- export type PullAiSessionBackupsResponse = {
16624
- enabled: boolean;
16625
- storage_id?: string;
16626
- backup_generation?: number;
16627
- fallback?: boolean;
16628
- sessions: Array<AISessionBackup>;
16629
- deferred: Array<(string)>;
16630
- };
16631
- export type PushAiSessionBackupsData = {
16632
- requestBody: {
16633
- /**
16634
- * the email the push was prepared for; refused with a 409 when it is not the caller's
16635
- */
16636
- owner: string;
16637
- sessions?: Array<AISessionBackupPush>;
16638
- removed?: Array<(string)>;
16639
- };
16640
- workspace: string;
16641
- };
16642
- export type PushAiSessionBackupsResponse = {
16643
- enabled: boolean;
16644
- storage_id?: string;
16645
- backup_generation?: number;
16646
- fallback?: boolean;
16647
- results: Array<{
16648
- id: string;
16649
- error?: string;
16650
- /**
16651
- * nothing was written and the session must be pushed whole again; an incremental part found no listed session to ride on (the backup was removed, or a push split over parts is in progress or was abandoned), or a later part of a push split over parts found another push had superseded it
16652
- */
16653
- needs_whole?: boolean;
16654
- }>;
16655
- };
16656
- export type ShareAiArtifactData = {
16657
- requestBody: {
16658
- /**
16659
- * the artifact's id in the author's session
16660
- */
16661
- artifact_id: string;
16662
- name: string;
16663
- kind: 'md' | 'html';
16664
- version: number;
16665
- content: string;
16666
- };
16667
- workspace: string;
16668
- };
16669
- export type ShareAiArtifactResponse = SharedAiArtifactInfo;
16670
- export type GetAiArtifactShareStatusData = {
16671
- artifactId: string;
16672
- workspace: string;
16673
- };
16674
- export type GetAiArtifactShareStatusResponse = {
16675
- retention_secs: number;
16676
- share?: SharedAiArtifactInfo;
16677
- };
16678
- export type GetSharedAiArtifactData = {
16679
- id: string;
16680
- workspace: string;
16681
- };
16682
- export type GetSharedAiArtifactResponse = SharedAiArtifactInfo & {
16683
- content: string;
16684
- /**
16685
- * whether the caller authored the share or is a workspace admin
16686
- */
16687
- can_unshare: boolean;
16688
- };
16689
- export type UnshareAiArtifactData = {
16690
- id: string;
16691
- workspace: string;
16692
- };
16693
- export type UnshareAiArtifactResponse = string;
16694
- export type ShareAiSessionData = {
16695
- requestBody: {
16696
- /**
16697
- * the session's id in the author's browser
16698
- */
16699
- session_id: string;
16700
- name: string;
16701
- /**
16702
- * left as it is on an existing share when absent; a new share starts private
16703
- */
16704
- is_public?: boolean;
16705
- message_count: number;
16706
- snapshot: {
16707
- [key: string]: unknown;
16708
- };
16709
- };
16710
- workspace: string;
16711
- };
16712
- export type ShareAiSessionResponse = SharedAiSessionInfo;
16713
- export type GetAiSessionShareStatusData = {
16714
- sessionId: string;
16715
- workspace: string;
16716
- };
16717
- export type GetAiSessionShareStatusResponse = {
16718
- share?: SharedAiSessionInfo;
16719
- };
16720
- export type SetAiSessionSharePublicData = {
16721
- id: string;
16722
- requestBody: {
16723
- is_public: boolean;
16724
- };
16725
- workspace: string;
16726
- };
16727
- export type SetAiSessionSharePublicResponse = SharedAiSessionInfo;
16728
- export type GetSharedAiSessionData = {
16729
- id: string;
16730
- workspace: string;
16731
- };
16732
- export type GetSharedAiSessionResponse = SharedAiSessionInfo & {
16733
- snapshot: {
16734
- [key: string]: unknown;
16735
- };
16736
- /**
16737
- * whether the caller authored the share or is a workspace admin
16738
- */
16739
- can_unshare: boolean;
16740
- };
16741
- export type UnshareAiSessionData = {
16742
- id: string;
16743
- workspace: string;
16744
- };
16745
- export type UnshareAiSessionResponse = string;
16746
16761
  export type ResumeSuspendedTriggerJobsData = {
16747
16762
  /**
16748
16763
  * Optional list of job IDs to reassign
@@ -22364,10 +22379,6 @@ export type $OpenApiTs = {
22364
22379
  datatable?: DataTableSettings;
22365
22380
  deploy_ui?: WorkspaceDeployUISettings;
22366
22381
  mute_critical_alerts?: boolean;
22367
- /**
22368
- * Whether this workspace admits guest sessions. An app's own `guest` execution mode is inert while this is false.
22369
- */
22370
- guest_access_enabled: boolean;
22371
22382
  /**
22372
22383
  * Whether every new fork of this workspace starts with its admins and developers as members, keeping their role.
22373
22384
  */
@@ -22423,10 +22434,6 @@ export type $OpenApiTs = {
22423
22434
  * Report failed jobs to the instance critical alert channels when no workspace error handler is set.
22424
22435
  */
22425
22436
  error_handler_fallback_to_instance_alerts?: boolean;
22426
- /**
22427
- * Whether this workspace admits guest sessions. An app's own `guest` execution mode is inert while this is false.
22428
- */
22429
- guest_access_enabled?: boolean;
22430
22437
  /**
22431
22438
  * PEM public key a guest JWT (`jwt_guest_`) is verified against for this workspace. Mutually exclusive with `guest_jwt_jwks_url`.
22432
22439
  */
@@ -23965,25 +23972,6 @@ export type $OpenApiTs = {
23965
23972
  };
23966
23973
  };
23967
23974
  };
23968
- '/w/{workspace}/workspaces/edit_guest_access': {
23969
- post: {
23970
- req: {
23971
- /**
23972
- * Whether guest sessions are admitted
23973
- */
23974
- requestBody: {
23975
- guest_access_enabled: boolean;
23976
- };
23977
- workspace: string;
23978
- };
23979
- res: {
23980
- /**
23981
- * status
23982
- */
23983
- 200: string;
23984
- };
23985
- };
23986
- };
23987
23975
  '/w/{workspace}/workspaces/edit_add_admins_and_developers_to_forks': {
23988
23976
  post: {
23989
23977
  req: {
@@ -24208,6 +24196,7 @@ export type $OpenApiTs = {
24208
24196
  rules: ProtectionRules;
24209
24197
  bypass_groups: RuleBypasserGroups;
24210
24198
  bypass_users: RuleBypasserUsers;
24199
+ fork_role_mapping?: ForkRoleMapping;
24211
24200
  };
24212
24201
  workspace: string;
24213
24202
  };
@@ -24237,6 +24226,7 @@ export type $OpenApiTs = {
24237
24226
  rules: ProtectionRules;
24238
24227
  bypass_groups: RuleBypasserGroups;
24239
24228
  bypass_users: RuleBypasserUsers;
24229
+ fork_role_mapping?: ForkRoleMapping;
24240
24230
  };
24241
24231
  /**
24242
24232
  * Name of the protection rule to update
@@ -33738,6 +33728,334 @@ export type $OpenApiTs = {
33738
33728
  };
33739
33729
  };
33740
33730
  };
33731
+ '/w/{workspace}/ai/complete': {
33732
+ post: {
33733
+ req: {
33734
+ requestBody: {
33735
+ system: string;
33736
+ user: string;
33737
+ /**
33738
+ * defaults to the AI config's default model
33739
+ */
33740
+ model?: AIProviderModel;
33741
+ max_tokens?: number;
33742
+ };
33743
+ workspace: string;
33744
+ };
33745
+ res: {
33746
+ /**
33747
+ * the answer, and the model that wrote it
33748
+ */
33749
+ 200: {
33750
+ text: string;
33751
+ model: AIProviderModel;
33752
+ };
33753
+ };
33754
+ };
33755
+ };
33756
+ '/w/{workspace}/ai/usage': {
33757
+ post: {
33758
+ req: {
33759
+ requestBody: {
33760
+ events: Array<AITokenUsageEvent>;
33761
+ };
33762
+ workspace: string;
33763
+ };
33764
+ res: {
33765
+ /**
33766
+ * usage recorded
33767
+ */
33768
+ 204: void;
33769
+ };
33770
+ };
33771
+ get: {
33772
+ req: {
33773
+ days?: number;
33774
+ groupBy?: 'day' | 'user' | 'model';
33775
+ /**
33776
+ * workspace-wide usage (admin only) or the calling user's own
33777
+ */
33778
+ scope?: 'workspace' | 'self';
33779
+ workspace: string;
33780
+ };
33781
+ res: {
33782
+ /**
33783
+ * usage buckets
33784
+ */
33785
+ 200: {
33786
+ buckets: Array<AITokenUsageBucket>;
33787
+ /**
33788
+ * more buckets matched than were returned, so summing them under-reports
33789
+ */
33790
+ truncated: boolean;
33791
+ };
33792
+ };
33793
+ };
33794
+ };
33795
+ '/w/{workspace}/ai/sessions/list': {
33796
+ get: {
33797
+ req: {
33798
+ workspace: string;
33799
+ };
33800
+ res: {
33801
+ /**
33802
+ * backups, newest first; `enabled` is false when the workspace has no storage for them
33803
+ */
33804
+ 200: {
33805
+ enabled: boolean;
33806
+ /**
33807
+ * names the storage answered from; sync state recorded against another one is void
33808
+ */
33809
+ storage_id?: string;
33810
+ /**
33811
+ * bumped by every workspace key rotation; sync state recorded under another one is void
33812
+ */
33813
+ backup_generation?: number;
33814
+ /**
33815
+ * the storage answered from is the instance object store, standing in for a workspace without storage of its own; a removal owed to it is retired by any answer from the workspace's own storage
33816
+ */
33817
+ fallback?: boolean;
33818
+ /**
33819
+ * the newest 500 at most
33820
+ */
33821
+ sessions: Array<AISessionBackupListing>;
33822
+ /**
33823
+ * the user has more sessions than the answer names
33824
+ */
33825
+ truncated?: boolean;
33826
+ };
33827
+ };
33828
+ };
33829
+ };
33830
+ '/w/{workspace}/ai/sessions/pull': {
33831
+ post: {
33832
+ req: {
33833
+ requestBody: {
33834
+ ids: Array<(string)>;
33835
+ resume?: AISessionBackupCursor;
33836
+ };
33837
+ workspace: string;
33838
+ };
33839
+ res: {
33840
+ /**
33841
+ * the backups found; `deferred` lists ids that did not fit the response budget
33842
+ */
33843
+ 200: {
33844
+ enabled: boolean;
33845
+ storage_id?: string;
33846
+ backup_generation?: number;
33847
+ fallback?: boolean;
33848
+ sessions: Array<AISessionBackup>;
33849
+ deferred: Array<(string)>;
33850
+ };
33851
+ };
33852
+ };
33853
+ };
33854
+ '/w/{workspace}/ai/sessions/push': {
33855
+ post: {
33856
+ req: {
33857
+ requestBody: {
33858
+ /**
33859
+ * the email the push was prepared for; refused with a 409 when it is not the caller's
33860
+ */
33861
+ owner: string;
33862
+ sessions?: Array<AISessionBackupPush>;
33863
+ removed?: Array<(string)>;
33864
+ };
33865
+ workspace: string;
33866
+ };
33867
+ res: {
33868
+ /**
33869
+ * one result per session written or removed, in request order
33870
+ */
33871
+ 200: {
33872
+ enabled: boolean;
33873
+ storage_id?: string;
33874
+ backup_generation?: number;
33875
+ fallback?: boolean;
33876
+ results: Array<{
33877
+ id: string;
33878
+ error?: string;
33879
+ /**
33880
+ * nothing was written and the session must be pushed whole again; an incremental part found no listed session to ride on (the backup was removed, or a push split over parts is in progress or was abandoned), or a later part of a push split over parts found another push had superseded it
33881
+ */
33882
+ needs_whole?: boolean;
33883
+ }>;
33884
+ };
33885
+ };
33886
+ };
33887
+ };
33888
+ '/w/{workspace}/ai/shared_artifacts/share': {
33889
+ post: {
33890
+ req: {
33891
+ requestBody: {
33892
+ /**
33893
+ * the artifact's id in the author's session
33894
+ */
33895
+ artifact_id: string;
33896
+ name: string;
33897
+ kind: 'md' | 'html';
33898
+ version: number;
33899
+ content: string;
33900
+ };
33901
+ workspace: string;
33902
+ };
33903
+ res: {
33904
+ /**
33905
+ * the shared copy
33906
+ */
33907
+ 200: SharedAiArtifactInfo;
33908
+ };
33909
+ };
33910
+ };
33911
+ '/w/{workspace}/ai/shared_artifacts/status': {
33912
+ get: {
33913
+ req: {
33914
+ artifactId: string;
33915
+ workspace: string;
33916
+ };
33917
+ res: {
33918
+ /**
33919
+ * the live share, if any, and how long shares last
33920
+ */
33921
+ 200: {
33922
+ retention_secs: number;
33923
+ share?: SharedAiArtifactInfo;
33924
+ };
33925
+ };
33926
+ };
33927
+ };
33928
+ '/w/{workspace}/ai/shared_artifacts/get/{id}': {
33929
+ get: {
33930
+ req: {
33931
+ id: string;
33932
+ workspace: string;
33933
+ };
33934
+ res: {
33935
+ /**
33936
+ * the shared artifact
33937
+ */
33938
+ 200: SharedAiArtifactInfo & {
33939
+ content: string;
33940
+ /**
33941
+ * whether the caller authored the share or is a workspace admin
33942
+ */
33943
+ can_unshare: boolean;
33944
+ };
33945
+ };
33946
+ };
33947
+ };
33948
+ '/w/{workspace}/ai/shared_artifacts/delete/{id}': {
33949
+ delete: {
33950
+ req: {
33951
+ id: string;
33952
+ workspace: string;
33953
+ };
33954
+ res: {
33955
+ /**
33956
+ * share deleted
33957
+ */
33958
+ 200: string;
33959
+ };
33960
+ };
33961
+ };
33962
+ '/w/{workspace}/ai/shared_sessions/share': {
33963
+ post: {
33964
+ req: {
33965
+ requestBody: {
33966
+ /**
33967
+ * the session's id in the author's browser
33968
+ */
33969
+ session_id: string;
33970
+ name: string;
33971
+ /**
33972
+ * left as it is on an existing share when absent; a new share starts private
33973
+ */
33974
+ is_public?: boolean;
33975
+ message_count: number;
33976
+ snapshot: {
33977
+ [key: string]: unknown;
33978
+ };
33979
+ };
33980
+ workspace: string;
33981
+ };
33982
+ res: {
33983
+ /**
33984
+ * the shared snapshot
33985
+ */
33986
+ 200: SharedAiSessionInfo;
33987
+ };
33988
+ };
33989
+ };
33990
+ '/w/{workspace}/ai/shared_sessions/status': {
33991
+ get: {
33992
+ req: {
33993
+ sessionId: string;
33994
+ workspace: string;
33995
+ };
33996
+ res: {
33997
+ /**
33998
+ * the share, if any
33999
+ */
34000
+ 200: {
34001
+ share?: SharedAiSessionInfo;
34002
+ };
34003
+ };
34004
+ };
34005
+ };
34006
+ '/w/{workspace}/ai/shared_sessions/set_public/{id}': {
34007
+ post: {
34008
+ req: {
34009
+ id: string;
34010
+ requestBody: {
34011
+ is_public: boolean;
34012
+ };
34013
+ workspace: string;
34014
+ };
34015
+ res: {
34016
+ /**
34017
+ * the updated share
34018
+ */
34019
+ 200: SharedAiSessionInfo;
34020
+ };
34021
+ };
34022
+ };
34023
+ '/w/{workspace}/ai_u/shared_sessions/get/{id}': {
34024
+ get: {
34025
+ req: {
34026
+ id: string;
34027
+ workspace: string;
34028
+ };
34029
+ res: {
34030
+ /**
34031
+ * the shared session
34032
+ */
34033
+ 200: SharedAiSessionInfo & {
34034
+ snapshot: {
34035
+ [key: string]: unknown;
34036
+ };
34037
+ /**
34038
+ * whether the caller authored the share or is a workspace admin
34039
+ */
34040
+ can_unshare: boolean;
34041
+ };
34042
+ };
34043
+ };
34044
+ };
34045
+ '/w/{workspace}/ai/shared_sessions/delete/{id}': {
34046
+ delete: {
34047
+ req: {
34048
+ id: string;
34049
+ workspace: string;
34050
+ };
34051
+ res: {
34052
+ /**
34053
+ * share deleted
34054
+ */
34055
+ 200: string;
34056
+ };
34057
+ };
34058
+ };
33741
34059
  '/w/{workspace}/ai_evals/datasets/list': {
33742
34060
  get: {
33743
34061
  req: {
@@ -34127,309 +34445,6 @@ export type $OpenApiTs = {
34127
34445
  };
34128
34446
  };
34129
34447
  };
34130
- '/w/{workspace}/ai/usage': {
34131
- post: {
34132
- req: {
34133
- requestBody: {
34134
- events: Array<AITokenUsageEvent>;
34135
- };
34136
- workspace: string;
34137
- };
34138
- res: {
34139
- /**
34140
- * usage recorded
34141
- */
34142
- 204: void;
34143
- };
34144
- };
34145
- get: {
34146
- req: {
34147
- days?: number;
34148
- groupBy?: 'day' | 'user' | 'model';
34149
- /**
34150
- * workspace-wide usage (admin only) or the calling user's own
34151
- */
34152
- scope?: 'workspace' | 'self';
34153
- workspace: string;
34154
- };
34155
- res: {
34156
- /**
34157
- * usage buckets
34158
- */
34159
- 200: {
34160
- buckets: Array<AITokenUsageBucket>;
34161
- /**
34162
- * more buckets matched than were returned, so summing them under-reports
34163
- */
34164
- truncated: boolean;
34165
- };
34166
- };
34167
- };
34168
- };
34169
- '/w/{workspace}/ai/sessions/list': {
34170
- get: {
34171
- req: {
34172
- workspace: string;
34173
- };
34174
- res: {
34175
- /**
34176
- * backups, newest first; `enabled` is false when the workspace has no storage for them
34177
- */
34178
- 200: {
34179
- enabled: boolean;
34180
- /**
34181
- * names the storage answered from; sync state recorded against another one is void
34182
- */
34183
- storage_id?: string;
34184
- /**
34185
- * bumped by every workspace key rotation; sync state recorded under another one is void
34186
- */
34187
- backup_generation?: number;
34188
- /**
34189
- * the storage answered from is the instance object store, standing in for a workspace without storage of its own; a removal owed to it is retired by any answer from the workspace's own storage
34190
- */
34191
- fallback?: boolean;
34192
- /**
34193
- * the newest 500 at most
34194
- */
34195
- sessions: Array<AISessionBackupListing>;
34196
- /**
34197
- * the user has more sessions than the answer names
34198
- */
34199
- truncated?: boolean;
34200
- };
34201
- };
34202
- };
34203
- };
34204
- '/w/{workspace}/ai/sessions/pull': {
34205
- post: {
34206
- req: {
34207
- requestBody: {
34208
- ids: Array<(string)>;
34209
- resume?: AISessionBackupCursor;
34210
- };
34211
- workspace: string;
34212
- };
34213
- res: {
34214
- /**
34215
- * the backups found; `deferred` lists ids that did not fit the response budget
34216
- */
34217
- 200: {
34218
- enabled: boolean;
34219
- storage_id?: string;
34220
- backup_generation?: number;
34221
- fallback?: boolean;
34222
- sessions: Array<AISessionBackup>;
34223
- deferred: Array<(string)>;
34224
- };
34225
- };
34226
- };
34227
- };
34228
- '/w/{workspace}/ai/sessions/push': {
34229
- post: {
34230
- req: {
34231
- requestBody: {
34232
- /**
34233
- * the email the push was prepared for; refused with a 409 when it is not the caller's
34234
- */
34235
- owner: string;
34236
- sessions?: Array<AISessionBackupPush>;
34237
- removed?: Array<(string)>;
34238
- };
34239
- workspace: string;
34240
- };
34241
- res: {
34242
- /**
34243
- * one result per session written or removed, in request order
34244
- */
34245
- 200: {
34246
- enabled: boolean;
34247
- storage_id?: string;
34248
- backup_generation?: number;
34249
- fallback?: boolean;
34250
- results: Array<{
34251
- id: string;
34252
- error?: string;
34253
- /**
34254
- * nothing was written and the session must be pushed whole again; an incremental part found no listed session to ride on (the backup was removed, or a push split over parts is in progress or was abandoned), or a later part of a push split over parts found another push had superseded it
34255
- */
34256
- needs_whole?: boolean;
34257
- }>;
34258
- };
34259
- };
34260
- };
34261
- };
34262
- '/w/{workspace}/ai/shared_artifacts/share': {
34263
- post: {
34264
- req: {
34265
- requestBody: {
34266
- /**
34267
- * the artifact's id in the author's session
34268
- */
34269
- artifact_id: string;
34270
- name: string;
34271
- kind: 'md' | 'html';
34272
- version: number;
34273
- content: string;
34274
- };
34275
- workspace: string;
34276
- };
34277
- res: {
34278
- /**
34279
- * the shared copy
34280
- */
34281
- 200: SharedAiArtifactInfo;
34282
- };
34283
- };
34284
- };
34285
- '/w/{workspace}/ai/shared_artifacts/status': {
34286
- get: {
34287
- req: {
34288
- artifactId: string;
34289
- workspace: string;
34290
- };
34291
- res: {
34292
- /**
34293
- * the live share, if any, and how long shares last
34294
- */
34295
- 200: {
34296
- retention_secs: number;
34297
- share?: SharedAiArtifactInfo;
34298
- };
34299
- };
34300
- };
34301
- };
34302
- '/w/{workspace}/ai/shared_artifacts/get/{id}': {
34303
- get: {
34304
- req: {
34305
- id: string;
34306
- workspace: string;
34307
- };
34308
- res: {
34309
- /**
34310
- * the shared artifact
34311
- */
34312
- 200: SharedAiArtifactInfo & {
34313
- content: string;
34314
- /**
34315
- * whether the caller authored the share or is a workspace admin
34316
- */
34317
- can_unshare: boolean;
34318
- };
34319
- };
34320
- };
34321
- };
34322
- '/w/{workspace}/ai/shared_artifacts/delete/{id}': {
34323
- delete: {
34324
- req: {
34325
- id: string;
34326
- workspace: string;
34327
- };
34328
- res: {
34329
- /**
34330
- * share deleted
34331
- */
34332
- 200: string;
34333
- };
34334
- };
34335
- };
34336
- '/w/{workspace}/ai/shared_sessions/share': {
34337
- post: {
34338
- req: {
34339
- requestBody: {
34340
- /**
34341
- * the session's id in the author's browser
34342
- */
34343
- session_id: string;
34344
- name: string;
34345
- /**
34346
- * left as it is on an existing share when absent; a new share starts private
34347
- */
34348
- is_public?: boolean;
34349
- message_count: number;
34350
- snapshot: {
34351
- [key: string]: unknown;
34352
- };
34353
- };
34354
- workspace: string;
34355
- };
34356
- res: {
34357
- /**
34358
- * the shared snapshot
34359
- */
34360
- 200: SharedAiSessionInfo;
34361
- };
34362
- };
34363
- };
34364
- '/w/{workspace}/ai/shared_sessions/status': {
34365
- get: {
34366
- req: {
34367
- sessionId: string;
34368
- workspace: string;
34369
- };
34370
- res: {
34371
- /**
34372
- * the share, if any
34373
- */
34374
- 200: {
34375
- share?: SharedAiSessionInfo;
34376
- };
34377
- };
34378
- };
34379
- };
34380
- '/w/{workspace}/ai/shared_sessions/set_public/{id}': {
34381
- post: {
34382
- req: {
34383
- id: string;
34384
- requestBody: {
34385
- is_public: boolean;
34386
- };
34387
- workspace: string;
34388
- };
34389
- res: {
34390
- /**
34391
- * the updated share
34392
- */
34393
- 200: SharedAiSessionInfo;
34394
- };
34395
- };
34396
- };
34397
- '/w/{workspace}/ai_u/shared_sessions/get/{id}': {
34398
- get: {
34399
- req: {
34400
- id: string;
34401
- workspace: string;
34402
- };
34403
- res: {
34404
- /**
34405
- * the shared session
34406
- */
34407
- 200: SharedAiSessionInfo & {
34408
- snapshot: {
34409
- [key: string]: unknown;
34410
- };
34411
- /**
34412
- * whether the caller authored the share or is a workspace admin
34413
- */
34414
- can_unshare: boolean;
34415
- };
34416
- };
34417
- };
34418
- };
34419
- '/w/{workspace}/ai/shared_sessions/delete/{id}': {
34420
- delete: {
34421
- req: {
34422
- id: string;
34423
- workspace: string;
34424
- };
34425
- res: {
34426
- /**
34427
- * share deleted
34428
- */
34429
- 200: string;
34430
- };
34431
- };
34432
- };
34433
34448
  '/w/{workspace}/trigger/{trigger_kind}/resume_suspended_trigger_jobs/{trigger_path}': {
34434
34449
  post: {
34435
34450
  req: {