@discomedia/utils 1.0.71 → 1.0.74

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/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import require$$0$3, { EventEmitter } from 'events';
2
2
  import require$$1 from 'https';
3
- import require$$2 from 'http';
3
+ import require$$2$1 from 'http';
4
4
  import require$$3$1 from 'net';
5
5
  import require$$4 from 'tls';
6
6
  import require$$3 from 'crypto';
@@ -8,9 +8,10 @@ import require$$0$2 from 'stream';
8
8
  import require$$7 from 'url';
9
9
  import require$$0 from 'zlib';
10
10
  import require$$0$1 from 'buffer';
11
+ import require$$2 from 'util';
11
12
  import require$$0$4 from 'fs';
12
13
  import require$$1$1 from 'path';
13
- import require$$2$1 from 'os';
14
+ import require$$2$2 from 'os';
14
15
 
15
16
  /**
16
17
  * Logs a message to the console.
@@ -1146,6 +1147,7 @@ const OPENAI_MODELS = [
1146
1147
  'gpt-5',
1147
1148
  'gpt-5-mini',
1148
1149
  'gpt-5.4-mini',
1150
+ 'gpt-5.4-nano',
1149
1151
  'gpt-5-nano',
1150
1152
  'gpt-5.1',
1151
1153
  'gpt-5.4',
@@ -1188,6 +1190,7 @@ const OPENROUTER_MODELS = [
1188
1190
  'openai/gpt-5',
1189
1191
  'openai/gpt-5-mini',
1190
1192
  'openai/gpt-5.4-mini',
1193
+ 'openai/gpt-5.4-nano',
1191
1194
  'openai/gpt-5-nano',
1192
1195
  'openai/gpt-5.1',
1193
1196
  'openai/gpt-5.4',
@@ -1698,7 +1701,7 @@ const safeJSON = (text) => {
1698
1701
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
1699
1702
  const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
1700
1703
 
1701
- const VERSION = '6.37.0'; // x-release-please-version
1704
+ const VERSION = '6.39.0'; // x-release-please-version
1702
1705
 
1703
1706
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
1704
1707
  const isRunningInBrowser = () => {
@@ -3147,19 +3150,22 @@ class WorkloadIdentityAuth {
3147
3150
  }
3148
3151
  async refreshToken() {
3149
3152
  const subjectToken = await this.config.provider.getToken();
3153
+ const body = {
3154
+ grant_type: TOKEN_EXCHANGE_GRANT_TYPE,
3155
+ subject_token: subjectToken,
3156
+ subject_token_type: SUBJECT_TOKEN_TYPES[this.config.provider.tokenType],
3157
+ identity_provider_id: this.config.identityProviderId,
3158
+ service_account_id: this.config.serviceAccountId,
3159
+ };
3160
+ if (this.config.clientId) {
3161
+ body['client_id'] = this.config.clientId;
3162
+ }
3150
3163
  const response = await this.fetch(this.tokenExchangeUrl, {
3151
3164
  method: 'POST',
3152
3165
  headers: {
3153
3166
  'Content-Type': 'application/json',
3154
3167
  },
3155
- body: JSON.stringify({
3156
- grant_type: TOKEN_EXCHANGE_GRANT_TYPE,
3157
- client_id: this.config.clientId,
3158
- subject_token: subjectToken,
3159
- subject_token_type: SUBJECT_TOKEN_TYPES[this.config.provider.tokenType],
3160
- identity_provider_id: this.config.identityProviderId,
3161
- service_account_id: this.config.serviceAccountId,
3162
- }),
3168
+ body: JSON.stringify(body),
3163
3169
  });
3164
3170
  if (!response.ok) {
3165
3171
  const errorText = await response.text();
@@ -5231,6 +5237,43 @@ let Certificates$1 = class Certificates extends APIResource {
5231
5237
  }
5232
5238
  };
5233
5239
 
5240
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
5241
+ let DataRetention$1 = class DataRetention extends APIResource {
5242
+ /**
5243
+ * Retrieves organization data retention controls.
5244
+ *
5245
+ * @example
5246
+ * ```ts
5247
+ * const organizationDataRetention =
5248
+ * await client.admin.organization.dataRetention.retrieve();
5249
+ * ```
5250
+ */
5251
+ retrieve(options) {
5252
+ return this._client.get('/organization/data_retention', {
5253
+ ...options,
5254
+ __security: { adminAPIKeyAuth: true },
5255
+ });
5256
+ }
5257
+ /**
5258
+ * Updates organization data retention controls.
5259
+ *
5260
+ * @example
5261
+ * ```ts
5262
+ * const organizationDataRetention =
5263
+ * await client.admin.organization.dataRetention.update({
5264
+ * retention_type: 'zero_data_retention',
5265
+ * });
5266
+ * ```
5267
+ */
5268
+ update(body, options) {
5269
+ return this._client.post('/organization/data_retention', {
5270
+ body,
5271
+ ...options,
5272
+ __security: { adminAPIKeyAuth: true },
5273
+ });
5274
+ }
5275
+ };
5276
+
5234
5277
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
5235
5278
  class Invites extends APIResource {
5236
5279
  /**
@@ -5327,6 +5370,22 @@ let Roles$5 = class Roles extends APIResource {
5327
5370
  __security: { adminAPIKeyAuth: true },
5328
5371
  });
5329
5372
  }
5373
+ /**
5374
+ * Retrieves an organization role.
5375
+ *
5376
+ * @example
5377
+ * ```ts
5378
+ * const role = await client.admin.organization.roles.retrieve(
5379
+ * 'role_id',
5380
+ * );
5381
+ * ```
5382
+ */
5383
+ retrieve(roleID, options) {
5384
+ return this._client.get(path `/organization/roles/${roleID}`, {
5385
+ ...options,
5386
+ __security: { adminAPIKeyAuth: true },
5387
+ });
5388
+ }
5330
5389
  /**
5331
5390
  * Updates an existing organization role.
5332
5391
  *
@@ -5380,6 +5439,92 @@ let Roles$5 = class Roles extends APIResource {
5380
5439
  }
5381
5440
  };
5382
5441
 
5442
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
5443
+ let SpendAlerts$1 = class SpendAlerts extends APIResource {
5444
+ /**
5445
+ * Creates an organization spend alert.
5446
+ *
5447
+ * @example
5448
+ * ```ts
5449
+ * const organizationSpendAlert =
5450
+ * await client.admin.organization.spendAlerts.create({
5451
+ * currency: 'USD',
5452
+ * interval: 'month',
5453
+ * notification_channel: {
5454
+ * recipients: ['string'],
5455
+ * type: 'email',
5456
+ * },
5457
+ * threshold_amount: 0,
5458
+ * });
5459
+ * ```
5460
+ */
5461
+ create(body, options) {
5462
+ return this._client.post('/organization/spend_alerts', {
5463
+ body,
5464
+ ...options,
5465
+ __security: { adminAPIKeyAuth: true },
5466
+ });
5467
+ }
5468
+ /**
5469
+ * Updates an organization spend alert.
5470
+ *
5471
+ * @example
5472
+ * ```ts
5473
+ * const organizationSpendAlert =
5474
+ * await client.admin.organization.spendAlerts.update(
5475
+ * 'alert_id',
5476
+ * {
5477
+ * currency: 'USD',
5478
+ * interval: 'month',
5479
+ * notification_channel: {
5480
+ * recipients: ['string'],
5481
+ * type: 'email',
5482
+ * },
5483
+ * threshold_amount: 0,
5484
+ * },
5485
+ * );
5486
+ * ```
5487
+ */
5488
+ update(alertID, body, options) {
5489
+ return this._client.post(path `/organization/spend_alerts/${alertID}`, {
5490
+ body,
5491
+ ...options,
5492
+ __security: { adminAPIKeyAuth: true },
5493
+ });
5494
+ }
5495
+ /**
5496
+ * Lists organization spend alerts.
5497
+ *
5498
+ * @example
5499
+ * ```ts
5500
+ * // Automatically fetches more pages as needed.
5501
+ * for await (const organizationSpendAlert of client.admin.organization.spendAlerts.list()) {
5502
+ * // ...
5503
+ * }
5504
+ * ```
5505
+ */
5506
+ list(query = {}, options) {
5507
+ return this._client.getAPIList('/organization/spend_alerts', (ConversationCursorPage), { query, ...options, __security: { adminAPIKeyAuth: true } });
5508
+ }
5509
+ /**
5510
+ * Deletes an organization spend alert.
5511
+ *
5512
+ * @example
5513
+ * ```ts
5514
+ * const organizationSpendAlertDeleted =
5515
+ * await client.admin.organization.spendAlerts.delete(
5516
+ * 'alert_id',
5517
+ * );
5518
+ * ```
5519
+ */
5520
+ delete(alertID, options) {
5521
+ return this._client.delete(path `/organization/spend_alerts/${alertID}`, {
5522
+ ...options,
5523
+ __security: { adminAPIKeyAuth: true },
5524
+ });
5525
+ }
5526
+ };
5527
+
5383
5528
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
5384
5529
  class Usage extends APIResource {
5385
5530
  /**
@@ -5490,6 +5635,24 @@ class Usage extends APIResource {
5490
5635
  __security: { adminAPIKeyAuth: true },
5491
5636
  });
5492
5637
  }
5638
+ /**
5639
+ * Get file search calls usage details for the organization.
5640
+ *
5641
+ * @example
5642
+ * ```ts
5643
+ * const response =
5644
+ * await client.admin.organization.usage.fileSearchCalls({
5645
+ * start_time: 0,
5646
+ * });
5647
+ * ```
5648
+ */
5649
+ fileSearchCalls(query, options) {
5650
+ return this._client.get('/organization/usage/file_search_calls', {
5651
+ query,
5652
+ ...options,
5653
+ __security: { adminAPIKeyAuth: true },
5654
+ });
5655
+ }
5493
5656
  /**
5494
5657
  * Get images usage details for the organization.
5495
5658
  *
@@ -5544,6 +5707,24 @@ class Usage extends APIResource {
5544
5707
  __security: { adminAPIKeyAuth: true },
5545
5708
  });
5546
5709
  }
5710
+ /**
5711
+ * Get web search calls usage details for the organization.
5712
+ *
5713
+ * @example
5714
+ * ```ts
5715
+ * const response =
5716
+ * await client.admin.organization.usage.webSearchCalls({
5717
+ * start_time: 0,
5718
+ * });
5719
+ * ```
5720
+ */
5721
+ webSearchCalls(query, options) {
5722
+ return this._client.get('/organization/usage/web_search_calls', {
5723
+ query,
5724
+ ...options,
5725
+ __security: { adminAPIKeyAuth: true },
5726
+ });
5727
+ }
5547
5728
  }
5548
5729
 
5549
5730
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
@@ -5567,6 +5748,25 @@ let Roles$4 = class Roles extends APIResource {
5567
5748
  __security: { adminAPIKeyAuth: true },
5568
5749
  });
5569
5750
  }
5751
+ /**
5752
+ * Retrieves an organization role assigned to a group.
5753
+ *
5754
+ * @example
5755
+ * ```ts
5756
+ * const role =
5757
+ * await client.admin.organization.groups.roles.retrieve(
5758
+ * 'role_id',
5759
+ * { group_id: 'group_id' },
5760
+ * );
5761
+ * ```
5762
+ */
5763
+ retrieve(roleID, params, options) {
5764
+ const { group_id } = params;
5765
+ return this._client.get(path `/organization/groups/${group_id}/roles/${roleID}`, {
5766
+ ...options,
5767
+ __security: { adminAPIKeyAuth: true },
5768
+ });
5769
+ }
5570
5770
  /**
5571
5771
  * Lists the organization roles assigned to a group within the organization.
5572
5772
  *
@@ -5625,6 +5825,25 @@ let Users$2 = class Users extends APIResource {
5625
5825
  __security: { adminAPIKeyAuth: true },
5626
5826
  });
5627
5827
  }
5828
+ /**
5829
+ * Retrieves a user in a group.
5830
+ *
5831
+ * @example
5832
+ * ```ts
5833
+ * const user =
5834
+ * await client.admin.organization.groups.users.retrieve(
5835
+ * 'user_id',
5836
+ * { group_id: 'group_id' },
5837
+ * );
5838
+ * ```
5839
+ */
5840
+ retrieve(userID, params, options) {
5841
+ const { group_id } = params;
5842
+ return this._client.get(path `/organization/groups/${group_id}/users/${userID}`, {
5843
+ ...options,
5844
+ __security: { adminAPIKeyAuth: true },
5845
+ });
5846
+ }
5628
5847
  /**
5629
5848
  * Lists the users assigned to a group.
5630
5849
  *
@@ -5686,6 +5905,23 @@ let Groups$1 = class Groups extends APIResource {
5686
5905
  __security: { adminAPIKeyAuth: true },
5687
5906
  });
5688
5907
  }
5908
+ /**
5909
+ * Retrieves a group.
5910
+ *
5911
+ * @example
5912
+ * ```ts
5913
+ * const group =
5914
+ * await client.admin.organization.groups.retrieve(
5915
+ * 'group_id',
5916
+ * );
5917
+ * ```
5918
+ */
5919
+ retrieve(groupID, options) {
5920
+ return this._client.get(path `/organization/groups/${groupID}`, {
5921
+ ...options,
5922
+ __security: { adminAPIKeyAuth: true },
5923
+ });
5924
+ }
5689
5925
  /**
5690
5926
  * Updates a group's information.
5691
5927
  *
@@ -5860,6 +6096,142 @@ class Certificates extends APIResource {
5860
6096
  }
5861
6097
  }
5862
6098
 
6099
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
6100
+ class DataRetention extends APIResource {
6101
+ /**
6102
+ * Retrieves project data retention controls.
6103
+ *
6104
+ * @example
6105
+ * ```ts
6106
+ * const projectDataRetention =
6107
+ * await client.admin.organization.projects.dataRetention.retrieve(
6108
+ * 'project_id',
6109
+ * );
6110
+ * ```
6111
+ */
6112
+ retrieve(projectID, options) {
6113
+ return this._client.get(path `/organization/projects/${projectID}/data_retention`, {
6114
+ ...options,
6115
+ __security: { adminAPIKeyAuth: true },
6116
+ });
6117
+ }
6118
+ /**
6119
+ * Updates project data retention controls.
6120
+ *
6121
+ * @example
6122
+ * ```ts
6123
+ * const projectDataRetention =
6124
+ * await client.admin.organization.projects.dataRetention.update(
6125
+ * 'project_id',
6126
+ * { retention_type: 'organization_default' },
6127
+ * );
6128
+ * ```
6129
+ */
6130
+ update(projectID, body, options) {
6131
+ return this._client.post(path `/organization/projects/${projectID}/data_retention`, {
6132
+ body,
6133
+ ...options,
6134
+ __security: { adminAPIKeyAuth: true },
6135
+ });
6136
+ }
6137
+ }
6138
+
6139
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
6140
+ class HostedToolPermissions extends APIResource {
6141
+ /**
6142
+ * Returns hosted tool permissions for a project.
6143
+ *
6144
+ * @example
6145
+ * ```ts
6146
+ * const projectHostedToolPermissions =
6147
+ * await client.admin.organization.projects.hostedToolPermissions.retrieve(
6148
+ * 'project_id',
6149
+ * );
6150
+ * ```
6151
+ */
6152
+ retrieve(projectID, options) {
6153
+ return this._client.get(path `/organization/projects/${projectID}/hosted_tool_permissions`, {
6154
+ ...options,
6155
+ __security: { adminAPIKeyAuth: true },
6156
+ });
6157
+ }
6158
+ /**
6159
+ * Updates hosted tool permissions for a project.
6160
+ *
6161
+ * @example
6162
+ * ```ts
6163
+ * const projectHostedToolPermissions =
6164
+ * await client.admin.organization.projects.hostedToolPermissions.update(
6165
+ * 'project_id',
6166
+ * );
6167
+ * ```
6168
+ */
6169
+ update(projectID, body, options) {
6170
+ return this._client.post(path `/organization/projects/${projectID}/hosted_tool_permissions`, {
6171
+ body,
6172
+ ...options,
6173
+ __security: { adminAPIKeyAuth: true },
6174
+ });
6175
+ }
6176
+ }
6177
+
6178
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
6179
+ class ModelPermissions extends APIResource {
6180
+ /**
6181
+ * Returns model permissions for a project.
6182
+ *
6183
+ * @example
6184
+ * ```ts
6185
+ * const projectModelPermissions =
6186
+ * await client.admin.organization.projects.modelPermissions.retrieve(
6187
+ * 'project_id',
6188
+ * );
6189
+ * ```
6190
+ */
6191
+ retrieve(projectID, options) {
6192
+ return this._client.get(path `/organization/projects/${projectID}/model_permissions`, {
6193
+ ...options,
6194
+ __security: { adminAPIKeyAuth: true },
6195
+ });
6196
+ }
6197
+ /**
6198
+ * Updates model permissions for a project.
6199
+ *
6200
+ * @example
6201
+ * ```ts
6202
+ * const projectModelPermissions =
6203
+ * await client.admin.organization.projects.modelPermissions.update(
6204
+ * 'project_id',
6205
+ * { mode: 'allow_list', model_ids: ['string'] },
6206
+ * );
6207
+ * ```
6208
+ */
6209
+ update(projectID, body, options) {
6210
+ return this._client.post(path `/organization/projects/${projectID}/model_permissions`, {
6211
+ body,
6212
+ ...options,
6213
+ __security: { adminAPIKeyAuth: true },
6214
+ });
6215
+ }
6216
+ /**
6217
+ * Deletes model permissions for a project.
6218
+ *
6219
+ * @example
6220
+ * ```ts
6221
+ * const projectModelPermissionsDeleted =
6222
+ * await client.admin.organization.projects.modelPermissions.delete(
6223
+ * 'project_id',
6224
+ * );
6225
+ * ```
6226
+ */
6227
+ delete(projectID, options) {
6228
+ return this._client.delete(path `/organization/projects/${projectID}/model_permissions`, {
6229
+ ...options,
6230
+ __security: { adminAPIKeyAuth: true },
6231
+ });
6232
+ }
6233
+ }
6234
+
5863
6235
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
5864
6236
  class RateLimits extends APIResource {
5865
6237
  /**
@@ -5921,6 +6293,25 @@ let Roles$3 = class Roles extends APIResource {
5921
6293
  __security: { adminAPIKeyAuth: true },
5922
6294
  });
5923
6295
  }
6296
+ /**
6297
+ * Retrieves a project role.
6298
+ *
6299
+ * @example
6300
+ * ```ts
6301
+ * const role =
6302
+ * await client.admin.organization.projects.roles.retrieve(
6303
+ * 'role_id',
6304
+ * { project_id: 'project_id' },
6305
+ * );
6306
+ * ```
6307
+ */
6308
+ retrieve(roleID, params, options) {
6309
+ const { project_id } = params;
6310
+ return this._client.get(path `/projects/${project_id}/roles/${roleID}`, {
6311
+ ...options,
6312
+ __security: { adminAPIKeyAuth: true },
6313
+ });
6314
+ }
5924
6315
  /**
5925
6316
  * Updates an existing project role.
5926
6317
  *
@@ -6023,6 +6414,22 @@ class ServiceAccounts extends APIResource {
6023
6414
  __security: { adminAPIKeyAuth: true },
6024
6415
  });
6025
6416
  }
6417
+ /**
6418
+ * Updates a service account in the project.
6419
+ *
6420
+ * @example
6421
+ * ```ts
6422
+ * const projectServiceAccount =
6423
+ * await client.admin.organization.projects.serviceAccounts.update(
6424
+ * 'service_account_id',
6425
+ * { project_id: 'project_id' },
6426
+ * );
6427
+ * ```
6428
+ */
6429
+ update(serviceAccountID, params, options) {
6430
+ const { project_id, ...body } = params;
6431
+ return this._client.post(path `/organization/projects/${project_id}/service_accounts/${serviceAccountID}`, { body, ...options, __security: { adminAPIKeyAuth: true } });
6432
+ }
6026
6433
  /**
6027
6434
  * Returns a list of service accounts in the project.
6028
6435
  *
@@ -6060,6 +6467,101 @@ class ServiceAccounts extends APIResource {
6060
6467
  }
6061
6468
  }
6062
6469
 
6470
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
6471
+ class SpendAlerts extends APIResource {
6472
+ /**
6473
+ * Creates a project spend alert.
6474
+ *
6475
+ * @example
6476
+ * ```ts
6477
+ * const projectSpendAlert =
6478
+ * await client.admin.organization.projects.spendAlerts.create(
6479
+ * 'project_id',
6480
+ * {
6481
+ * currency: 'USD',
6482
+ * interval: 'month',
6483
+ * notification_channel: {
6484
+ * recipients: ['string'],
6485
+ * type: 'email',
6486
+ * },
6487
+ * threshold_amount: 0,
6488
+ * },
6489
+ * );
6490
+ * ```
6491
+ */
6492
+ create(projectID, body, options) {
6493
+ return this._client.post(path `/organization/projects/${projectID}/spend_alerts`, {
6494
+ body,
6495
+ ...options,
6496
+ __security: { adminAPIKeyAuth: true },
6497
+ });
6498
+ }
6499
+ /**
6500
+ * Updates a project spend alert.
6501
+ *
6502
+ * @example
6503
+ * ```ts
6504
+ * const projectSpendAlert =
6505
+ * await client.admin.organization.projects.spendAlerts.update(
6506
+ * 'alert_id',
6507
+ * {
6508
+ * project_id: 'project_id',
6509
+ * currency: 'USD',
6510
+ * interval: 'month',
6511
+ * notification_channel: {
6512
+ * recipients: ['string'],
6513
+ * type: 'email',
6514
+ * },
6515
+ * threshold_amount: 0,
6516
+ * },
6517
+ * );
6518
+ * ```
6519
+ */
6520
+ update(alertID, params, options) {
6521
+ const { project_id, ...body } = params;
6522
+ return this._client.post(path `/organization/projects/${project_id}/spend_alerts/${alertID}`, {
6523
+ body,
6524
+ ...options,
6525
+ __security: { adminAPIKeyAuth: true },
6526
+ });
6527
+ }
6528
+ /**
6529
+ * Lists project spend alerts.
6530
+ *
6531
+ * @example
6532
+ * ```ts
6533
+ * // Automatically fetches more pages as needed.
6534
+ * for await (const projectSpendAlert of client.admin.organization.projects.spendAlerts.list(
6535
+ * 'project_id',
6536
+ * )) {
6537
+ * // ...
6538
+ * }
6539
+ * ```
6540
+ */
6541
+ list(projectID, query = {}, options) {
6542
+ return this._client.getAPIList(path `/organization/projects/${projectID}/spend_alerts`, (ConversationCursorPage), { query, ...options, __security: { adminAPIKeyAuth: true } });
6543
+ }
6544
+ /**
6545
+ * Deletes a project spend alert.
6546
+ *
6547
+ * @example
6548
+ * ```ts
6549
+ * const projectSpendAlertDeleted =
6550
+ * await client.admin.organization.projects.spendAlerts.delete(
6551
+ * 'alert_id',
6552
+ * { project_id: 'project_id' },
6553
+ * );
6554
+ * ```
6555
+ */
6556
+ delete(alertID, params, options) {
6557
+ const { project_id } = params;
6558
+ return this._client.delete(path `/organization/projects/${project_id}/spend_alerts/${alertID}`, {
6559
+ ...options,
6560
+ __security: { adminAPIKeyAuth: true },
6561
+ });
6562
+ }
6563
+ }
6564
+
6063
6565
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
6064
6566
  let Roles$2 = class Roles extends APIResource {
6065
6567
  /**
@@ -6082,6 +6584,25 @@ let Roles$2 = class Roles extends APIResource {
6082
6584
  __security: { adminAPIKeyAuth: true },
6083
6585
  });
6084
6586
  }
6587
+ /**
6588
+ * Retrieves a project role assigned to a group.
6589
+ *
6590
+ * @example
6591
+ * ```ts
6592
+ * const role =
6593
+ * await client.admin.organization.projects.groups.roles.retrieve(
6594
+ * 'role_id',
6595
+ * { project_id: 'project_id', group_id: 'group_id' },
6596
+ * );
6597
+ * ```
6598
+ */
6599
+ retrieve(roleID, params, options) {
6600
+ const { project_id, group_id } = params;
6601
+ return this._client.get(path `/projects/${project_id}/groups/${group_id}/roles/${roleID}`, {
6602
+ ...options,
6603
+ __security: { adminAPIKeyAuth: true },
6604
+ });
6605
+ }
6085
6606
  /**
6086
6607
  * Lists the project roles assigned to a group within a project.
6087
6608
  *
@@ -6146,6 +6667,26 @@ class Groups extends APIResource {
6146
6667
  __security: { adminAPIKeyAuth: true },
6147
6668
  });
6148
6669
  }
6670
+ /**
6671
+ * Retrieves a project's group.
6672
+ *
6673
+ * @example
6674
+ * ```ts
6675
+ * const projectGroup =
6676
+ * await client.admin.organization.projects.groups.retrieve(
6677
+ * 'group_id',
6678
+ * { project_id: 'project_id' },
6679
+ * );
6680
+ * ```
6681
+ */
6682
+ retrieve(groupID, params, options) {
6683
+ const { project_id, ...query } = params;
6684
+ return this._client.get(path `/organization/projects/${project_id}/groups/${groupID}`, {
6685
+ query,
6686
+ ...options,
6687
+ __security: { adminAPIKeyAuth: true },
6688
+ });
6689
+ }
6149
6690
  /**
6150
6691
  * Lists the groups that have access to a project.
6151
6692
  *
@@ -6206,6 +6747,25 @@ let Roles$1 = class Roles extends APIResource {
6206
6747
  __security: { adminAPIKeyAuth: true },
6207
6748
  });
6208
6749
  }
6750
+ /**
6751
+ * Retrieves a project role assigned to a user.
6752
+ *
6753
+ * @example
6754
+ * ```ts
6755
+ * const role =
6756
+ * await client.admin.organization.projects.users.roles.retrieve(
6757
+ * 'role_id',
6758
+ * { project_id: 'project_id', user_id: 'user_id' },
6759
+ * );
6760
+ * ```
6761
+ */
6762
+ retrieve(roleID, params, options) {
6763
+ const { project_id, user_id } = params;
6764
+ return this._client.get(path `/projects/${project_id}/users/${user_id}/roles/${roleID}`, {
6765
+ ...options,
6766
+ __security: { adminAPIKeyAuth: true },
6767
+ });
6768
+ }
6209
6769
  /**
6210
6770
  * Lists the project roles assigned to a user within a project.
6211
6771
  *
@@ -6359,8 +6919,12 @@ class Projects extends APIResource {
6359
6919
  this.serviceAccounts = new ServiceAccounts(this._client);
6360
6920
  this.apiKeys = new APIKeys(this._client);
6361
6921
  this.rateLimits = new RateLimits(this._client);
6922
+ this.modelPermissions = new ModelPermissions(this._client);
6923
+ this.hostedToolPermissions = new HostedToolPermissions(this._client);
6362
6924
  this.groups = new Groups(this._client);
6363
6925
  this.roles = new Roles$3(this._client);
6926
+ this.dataRetention = new DataRetention(this._client);
6927
+ this.spendAlerts = new SpendAlerts(this._client);
6364
6928
  this.certificates = new Certificates(this._client);
6365
6929
  }
6366
6930
  /**
@@ -6458,8 +7022,12 @@ Projects.Users = Users$1;
6458
7022
  Projects.ServiceAccounts = ServiceAccounts;
6459
7023
  Projects.APIKeys = APIKeys;
6460
7024
  Projects.RateLimits = RateLimits;
7025
+ Projects.ModelPermissions = ModelPermissions;
7026
+ Projects.HostedToolPermissions = HostedToolPermissions;
6461
7027
  Projects.Groups = Groups;
6462
7028
  Projects.Roles = Roles$3;
7029
+ Projects.DataRetention = DataRetention;
7030
+ Projects.SpendAlerts = SpendAlerts;
6463
7031
  Projects.Certificates = Certificates;
6464
7032
 
6465
7033
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
@@ -6483,6 +7051,25 @@ class Roles extends APIResource {
6483
7051
  __security: { adminAPIKeyAuth: true },
6484
7052
  });
6485
7053
  }
7054
+ /**
7055
+ * Retrieves an organization role assigned to a user.
7056
+ *
7057
+ * @example
7058
+ * ```ts
7059
+ * const role =
7060
+ * await client.admin.organization.users.roles.retrieve(
7061
+ * 'role_id',
7062
+ * { user_id: 'user_id' },
7063
+ * );
7064
+ * ```
7065
+ */
7066
+ retrieve(roleID, params, options) {
7067
+ const { user_id } = params;
7068
+ return this._client.get(path `/organization/users/${user_id}/roles/${roleID}`, {
7069
+ ...options,
7070
+ __security: { adminAPIKeyAuth: true },
7071
+ });
7072
+ }
6486
7073
  /**
6487
7074
  * Lists the organization roles assigned to a user within the organization.
6488
7075
  *
@@ -6605,6 +7192,8 @@ class Organization extends APIResource {
6605
7192
  this.users = new Users(this._client);
6606
7193
  this.groups = new Groups$1(this._client);
6607
7194
  this.roles = new Roles$5(this._client);
7195
+ this.dataRetention = new DataRetention$1(this._client);
7196
+ this.spendAlerts = new SpendAlerts$1(this._client);
6608
7197
  this.certificates = new Certificates$1(this._client);
6609
7198
  this.projects = new Projects(this._client);
6610
7199
  }
@@ -6616,6 +7205,8 @@ Organization.Invites = Invites;
6616
7205
  Organization.Users = Users;
6617
7206
  Organization.Groups = Groups$1;
6618
7207
  Organization.Roles = Roles$5;
7208
+ Organization.DataRetention = DataRetention$1;
7209
+ Organization.SpendAlerts = SpendAlerts$1;
6619
7210
  Organization.Certificates = Certificates$1;
6620
7211
  Organization.Projects = Projects;
6621
7212
 
@@ -13606,11 +14197,11 @@ function zodTextFormat(zodObject, name, props) {
13606
14197
  }, (content) => zodObject.parse(JSON.parse(content)));
13607
14198
  }
13608
14199
 
13609
- const DEFAULT_MODEL = 'gpt-5-mini';
14200
+ const DEFAULT_MODEL = 'gpt-5.4-mini';
13610
14201
  const GPT_5_HIGH_CONTEXT_THRESHOLD_TOKENS = 272_000;
13611
14202
  const GPT_5_HIGH_CONTEXT_INPUT_MULTIPLIER = 2;
13612
14203
  const GPT_5_HIGH_CONTEXT_OUTPUT_MULTIPLIER = 1.5;
13613
- /** Token costs in USD per 1M tokens. Last updated May 2026. */
14204
+ /** Token costs in USD per 1M tokens. Last updated May 2026 from the OpenAI API pricing page. */
13614
14205
  const openAiModelCosts = {
13615
14206
  'gpt-5': {
13616
14207
  inputCost: 1.25 / 1_000_000,
@@ -13623,9 +14214,14 @@ const openAiModelCosts = {
13623
14214
  outputCost: 2 / 1_000_000,
13624
14215
  },
13625
14216
  'gpt-5.4-mini': {
13626
- inputCost: 0.25 / 1_000_000,
13627
- cacheHitCost: 0.025 / 1_000_000,
13628
- outputCost: 2 / 1_000_000,
14217
+ inputCost: 0.75 / 1_000_000,
14218
+ cacheHitCost: 0.075 / 1_000_000,
14219
+ outputCost: 4.5 / 1_000_000,
14220
+ },
14221
+ 'gpt-5.4-nano': {
14222
+ inputCost: 0.2 / 1_000_000,
14223
+ cacheHitCost: 0.02 / 1_000_000,
14224
+ outputCost: 1.25 / 1_000_000,
13629
14225
  },
13630
14226
  'gpt-5-nano': {
13631
14227
  inputCost: 0.05 / 1_000_000,
@@ -14244,6 +14840,7 @@ async function parseResponse(content, responseFormat) {
14244
14840
  }
14245
14841
 
14246
14842
  // llm-openai.ts
14843
+ const DEFAULT_IMAGE_MIME_TYPE = 'image/webp';
14247
14844
  /**
14248
14845
  * Checks if the given direct OpenAI model supports the temperature parameter.
14249
14846
  * @param model The model to check.
@@ -14278,6 +14875,135 @@ function buildJsonSchemaFormat(schema, schemaName, schemaDescription, schemaStri
14278
14875
  ...(schemaStrict !== undefined ? { strict: schemaStrict } : {}),
14279
14876
  };
14280
14877
  }
14878
+ function resolveOpenAIApiKey(apiKey) {
14879
+ const resolvedApiKey = apiKey || process.env.OPENAI_API_KEY;
14880
+ if (!resolvedApiKey) {
14881
+ throw new Error('OpenAI API key is not provided and OPENAI_API_KEY environment variable is not set');
14882
+ }
14883
+ return resolvedApiKey;
14884
+ }
14885
+ function createOpenAIClient(apiKey) {
14886
+ return new OpenAI({
14887
+ apiKey,
14888
+ });
14889
+ }
14890
+ function normalizeImageDataUrl(imageData, mimeType = DEFAULT_IMAGE_MIME_TYPE) {
14891
+ return imageData.startsWith('data:') ? imageData : `data:${mimeType};base64,${imageData}`;
14892
+ }
14893
+ function getFilenameFromPath(filePath) {
14894
+ const normalizedPath = filePath.replace(/\\/g, '/');
14895
+ const pathSegments = normalizedPath.split('/');
14896
+ const filename = pathSegments[pathSegments.length - 1];
14897
+ if (!filename) {
14898
+ throw new Error(`Could not determine a filename from file path: ${filePath}`);
14899
+ }
14900
+ return filename;
14901
+ }
14902
+ function inferImageMimeType(filePath) {
14903
+ const normalizedPath = filePath.toLowerCase();
14904
+ if (normalizedPath.endsWith('.png')) {
14905
+ return 'image/png';
14906
+ }
14907
+ if (normalizedPath.endsWith('.jpg') || normalizedPath.endsWith('.jpeg')) {
14908
+ return 'image/jpeg';
14909
+ }
14910
+ if (normalizedPath.endsWith('.webp')) {
14911
+ return 'image/webp';
14912
+ }
14913
+ if (normalizedPath.endsWith('.gif')) {
14914
+ return 'image/gif';
14915
+ }
14916
+ return undefined;
14917
+ }
14918
+ async function readLocalFileBytes(filePath) {
14919
+ try {
14920
+ const dynamicImport = new Function('specifier', 'return import(specifier);');
14921
+ const { readFile } = await dynamicImport('node:fs/promises');
14922
+ return await readFile(filePath);
14923
+ }
14924
+ catch {
14925
+ throw new Error('Local image file uploads require a Node.js runtime with access to node:fs/promises');
14926
+ }
14927
+ }
14928
+ async function uploadVisionFileFromPath(openai, filePath, filename, mimeType) {
14929
+ const fileBytes = await readLocalFileBytes(filePath);
14930
+ const resolvedFilename = filename || getFilenameFromPath(filePath);
14931
+ const resolvedMimeType = mimeType || inferImageMimeType(filePath);
14932
+ const uploadableFile = await OpenAI.toFile(fileBytes, resolvedFilename, resolvedMimeType ? { type: resolvedMimeType } : undefined);
14933
+ const uploadedFile = await openai.files.create({
14934
+ file: uploadableFile,
14935
+ purpose: 'vision',
14936
+ });
14937
+ return uploadedFile.id;
14938
+ }
14939
+ function collectImageInputs(image, images, imageBase64) {
14940
+ const collectedImages = [];
14941
+ if (image) {
14942
+ collectedImages.push(image);
14943
+ }
14944
+ if (images && images.length > 0) {
14945
+ collectedImages.push(...images);
14946
+ }
14947
+ if (imageBase64) {
14948
+ collectedImages.push({ base64: imageBase64 });
14949
+ }
14950
+ return collectedImages;
14951
+ }
14952
+ function hasLocalFileImage(images) {
14953
+ return images.some((image) => 'filePath' in image);
14954
+ }
14955
+ async function buildImageContentPart(image, defaultDetail, openai) {
14956
+ const detail = image.detail ?? defaultDetail;
14957
+ if ('url' in image) {
14958
+ return {
14959
+ type: 'input_image',
14960
+ detail,
14961
+ image_url: image.url,
14962
+ };
14963
+ }
14964
+ if ('dataUrl' in image) {
14965
+ return {
14966
+ type: 'input_image',
14967
+ detail,
14968
+ image_url: image.dataUrl,
14969
+ };
14970
+ }
14971
+ if ('base64' in image) {
14972
+ return {
14973
+ type: 'input_image',
14974
+ detail,
14975
+ image_url: normalizeImageDataUrl(image.base64, image.mimeType),
14976
+ };
14977
+ }
14978
+ if ('fileId' in image) {
14979
+ return {
14980
+ type: 'input_image',
14981
+ detail,
14982
+ file_id: image.fileId,
14983
+ };
14984
+ }
14985
+ if (!openai) {
14986
+ throw new Error('A local image file path was provided, but no OpenAI client is available to upload it');
14987
+ }
14988
+ const fileId = await uploadVisionFileFromPath(openai, image.filePath, image.filename, image.mimeType);
14989
+ return {
14990
+ type: 'input_image',
14991
+ detail,
14992
+ file_id: fileId,
14993
+ };
14994
+ }
14995
+ async function buildPromptContent(input, imageInputs, imageDetail, openai) {
14996
+ if (imageInputs.length === 0) {
14997
+ return input;
14998
+ }
14999
+ const imageContent = await Promise.all(imageInputs.map((image) => buildImageContentPart(image, imageDetail, openai)));
15000
+ return [{ type: 'input_text', text: input }, ...imageContent];
15001
+ }
15002
+ async function uploadVisionFile(filePath, options = {}) {
15003
+ const resolvedApiKey = resolveOpenAIApiKey(options.apiKey);
15004
+ const openai = createOpenAIClient(resolvedApiKey);
15005
+ return await uploadVisionFileFromPath(openai, filePath, options.filename, options.mimeType);
15006
+ }
14281
15007
  /**
14282
15008
  * Makes a call to OpenAI's Responses API for more advanced use cases with built-in tools.
14283
15009
  *
@@ -14309,13 +15035,8 @@ const makeResponsesAPICall = async (input, options = {}) => {
14309
15035
  if (!isOpenAIModel(normalizedModel)) {
14310
15036
  throw new Error(`Unsupported OpenAI model: ${normalizedModel}. Please use a supported GPT-5 model.`);
14311
15037
  }
14312
- const apiKey = options.apiKey || process.env.OPENAI_API_KEY;
14313
- if (!apiKey) {
14314
- throw new Error('OpenAI API key is not provided and OPENAI_API_KEY environment variable is not set');
14315
- }
14316
- const openai = new OpenAI({
14317
- apiKey: apiKey,
14318
- });
15038
+ const apiKey = resolveOpenAIApiKey(options.apiKey);
15039
+ const openai = createOpenAIClient(apiKey);
14319
15040
  // Remove apiKey from options before creating request body
14320
15041
  const { apiKey: _, model: __, ...cleanOptions } = options;
14321
15042
  const requestBody = {
@@ -14426,12 +15147,16 @@ const makeResponsesAPICall = async (input, options = {}) => {
14426
15147
  * });
14427
15148
  */
14428
15149
  async function makeLLMCall(input, options = {}) {
14429
- const { apiKey, model = DEFAULT_MODEL, responseFormat = 'text', schema, schemaName = 'response', schemaDescription, schemaStrict, tools, useCodeInterpreter = false, useWebSearch = false, imageBase64, imageDetail = 'high', context, } = options;
15150
+ const { apiKey, model = DEFAULT_MODEL, responseFormat = 'text', schema, schemaName = 'response', schemaDescription, schemaStrict, tools, useCodeInterpreter = false, useWebSearch = false, image, images, imageBase64, imageDetail = 'high', context, } = options;
14430
15151
  // Validate model
14431
15152
  const normalizedModel = normalizeModelName(model);
14432
15153
  if (!isOpenAIModel(normalizedModel)) {
14433
15154
  throw new Error(`Unsupported OpenAI model: ${normalizedModel}. Please use a supported GPT-5 model.`);
14434
15155
  }
15156
+ const resolvedApiKey = resolveOpenAIApiKey(apiKey);
15157
+ const imageInputs = collectImageInputs(image, images, imageBase64);
15158
+ const openai = hasLocalFileImage(imageInputs) ? createOpenAIClient(resolvedApiKey) : undefined;
15159
+ const promptContent = await buildPromptContent(input, imageInputs, imageDetail, openai);
14435
15160
  // Process input for conversation context and image analysis
14436
15161
  let processedInput;
14437
15162
  if (context && context.length > 0) {
@@ -14446,18 +15171,11 @@ async function makeLLMCall(input, options = {}) {
14446
15171
  });
14447
15172
  }
14448
15173
  // Add current input message
14449
- if (imageBase64) {
14450
- // Current message includes both text and image
15174
+ if (imageInputs.length > 0) {
15175
+ // Current message includes text and one or more images
14451
15176
  conversationMessages.push({
14452
15177
  role: 'user',
14453
- content: [
14454
- { type: 'input_text', text: input },
14455
- {
14456
- type: 'input_image',
14457
- detail: imageDetail,
14458
- image_url: imageBase64.startsWith('data:') ? imageBase64 : `data:image/webp;base64,${imageBase64}`,
14459
- },
14460
- ],
15178
+ content: promptContent,
14461
15179
  type: 'message',
14462
15180
  });
14463
15181
  }
@@ -14471,19 +15189,12 @@ async function makeLLMCall(input, options = {}) {
14471
15189
  }
14472
15190
  processedInput = conversationMessages;
14473
15191
  }
14474
- else if (imageBase64) {
14475
- // No context, but has image - use the original image logic
15192
+ else if (imageInputs.length > 0) {
15193
+ // No context, but has image(s)
14476
15194
  processedInput = [
14477
15195
  {
14478
15196
  role: 'user',
14479
- content: [
14480
- { type: 'input_text', text: input },
14481
- {
14482
- type: 'input_image',
14483
- detail: imageDetail,
14484
- image_url: imageBase64.startsWith('data:') ? imageBase64 : `data:image/webp;base64,${imageBase64}`,
14485
- },
14486
- ],
15197
+ content: promptContent,
14487
15198
  type: 'message',
14488
15199
  },
14489
15200
  ];
@@ -14494,7 +15205,7 @@ async function makeLLMCall(input, options = {}) {
14494
15205
  }
14495
15206
  // Build the options object for makeResponsesAPICall
14496
15207
  let responsesOptions = {
14497
- apiKey,
15208
+ apiKey: resolvedApiKey,
14498
15209
  model: normalizedModel,
14499
15210
  parallel_tool_calls: false,
14500
15211
  tools,
@@ -16137,6 +16848,10 @@ function requireReceiver () {
16137
16848
  * extensions
16138
16849
  * @param {Boolean} [options.isServer=false] Specifies whether to operate in
16139
16850
  * client or server mode
16851
+ * @param {Number} [options.maxBufferedChunks=0] The maximum number of
16852
+ * buffered data chunks
16853
+ * @param {Number} [options.maxFragments=0] The maximum number of message
16854
+ * fragments
16140
16855
  * @param {Number} [options.maxPayload=0] The maximum allowed message length
16141
16856
  * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
16142
16857
  * not to skip UTF-8 validation for text and close messages
@@ -16151,6 +16866,8 @@ function requireReceiver () {
16151
16866
  this._binaryType = options.binaryType || BINARY_TYPES[0];
16152
16867
  this._extensions = options.extensions || {};
16153
16868
  this._isServer = !!options.isServer;
16869
+ this._maxBufferedChunks = options.maxBufferedChunks | 0;
16870
+ this._maxFragments = options.maxFragments | 0;
16154
16871
  this._maxPayload = options.maxPayload | 0;
16155
16872
  this._skipUTF8Validation = !!options.skipUTF8Validation;
16156
16873
  this[kWebSocket] = undefined;
@@ -16186,6 +16903,22 @@ function requireReceiver () {
16186
16903
  _write(chunk, encoding, cb) {
16187
16904
  if (this._opcode === 0x08 && this._state == GET_INFO) return cb();
16188
16905
 
16906
+ if (
16907
+ this._maxBufferedChunks > 0 &&
16908
+ this._buffers.length >= this._maxBufferedChunks
16909
+ ) {
16910
+ cb(
16911
+ this.createError(
16912
+ RangeError,
16913
+ 'Too many buffered chunks',
16914
+ false,
16915
+ 1008,
16916
+ 'WS_ERR_TOO_MANY_BUFFERED_PARTS'
16917
+ )
16918
+ );
16919
+ return;
16920
+ }
16921
+
16189
16922
  this._bufferedBytes += chunk.length;
16190
16923
  this._buffers.push(chunk);
16191
16924
  this.startLoop(cb);
@@ -16582,6 +17315,22 @@ function requireReceiver () {
16582
17315
  }
16583
17316
 
16584
17317
  if (data.length) {
17318
+ if (
17319
+ this._maxFragments > 0 &&
17320
+ this._fragments.length >= this._maxFragments
17321
+ ) {
17322
+ const error = this.createError(
17323
+ RangeError,
17324
+ 'Too many message fragments',
17325
+ false,
17326
+ 1008,
17327
+ 'WS_ERR_TOO_MANY_BUFFERED_PARTS'
17328
+ );
17329
+
17330
+ cb(error);
17331
+ return;
17332
+ }
17333
+
16585
17334
  //
16586
17335
  // This message is not compressed so its length is the sum of the payload
16587
17336
  // length of all fragments.
@@ -16621,6 +17370,22 @@ function requireReceiver () {
16621
17370
  return;
16622
17371
  }
16623
17372
 
17373
+ if (
17374
+ this._maxFragments > 0 &&
17375
+ this._fragments.length >= this._maxFragments
17376
+ ) {
17377
+ const error = this.createError(
17378
+ RangeError,
17379
+ 'Too many message fragments',
17380
+ false,
17381
+ 1008,
17382
+ 'WS_ERR_TOO_MANY_BUFFERED_PARTS'
17383
+ );
17384
+
17385
+ cb(error);
17386
+ return;
17387
+ }
17388
+
16624
17389
  this._fragments.push(buf);
16625
17390
  }
16626
17391
 
@@ -16815,6 +17580,9 @@ function requireSender () {
16815
17580
 
16816
17581
  const { Duplex } = require$$0$2;
16817
17582
  const { randomFillSync } = require$$3;
17583
+ const {
17584
+ types: { isUint8Array }
17585
+ } = require$$2;
16818
17586
 
16819
17587
  const PerMessageDeflate = requirePermessageDeflate();
16820
17588
  const { EMPTY_BUFFER, kWebSocket, NOOP } = requireConstants();
@@ -17011,8 +17779,10 @@ function requireSender () {
17011
17779
 
17012
17780
  if (typeof data === 'string') {
17013
17781
  buf.write(data, 2);
17014
- } else {
17782
+ } else if (isUint8Array(data)) {
17015
17783
  buf.set(data, 2);
17784
+ } else {
17785
+ throw new TypeError('Second argument must be a string or a Uint8Array');
17016
17786
  }
17017
17787
  }
17018
17788
 
@@ -17936,7 +18706,7 @@ function requireWebsocket () {
17936
18706
 
17937
18707
  const EventEmitter = require$$0$3;
17938
18708
  const https = require$$1;
17939
- const http = require$$2;
18709
+ const http = require$$2$1;
17940
18710
  const net = require$$3$1;
17941
18711
  const tls = require$$4;
17942
18712
  const { randomBytes, createHash } = require$$3;
@@ -18133,6 +18903,10 @@ function requireWebsocket () {
18133
18903
  * multiple times in the same tick
18134
18904
  * @param {Function} [options.generateMask] The function used to generate the
18135
18905
  * masking key
18906
+ * @param {Number} [options.maxBufferedChunks=0] The maximum number of
18907
+ * buffered data chunks
18908
+ * @param {Number} [options.maxFragments=0] The maximum number of message
18909
+ * fragments
18136
18910
  * @param {Number} [options.maxPayload=0] The maximum allowed message size
18137
18911
  * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
18138
18912
  * not to skip UTF-8 validation for text and close messages
@@ -18144,6 +18918,8 @@ function requireWebsocket () {
18144
18918
  binaryType: this.binaryType,
18145
18919
  extensions: this._extensions,
18146
18920
  isServer: this._isServer,
18921
+ maxBufferedChunks: options.maxBufferedChunks,
18922
+ maxFragments: options.maxFragments,
18147
18923
  maxPayload: options.maxPayload,
18148
18924
  skipUTF8Validation: options.skipUTF8Validation
18149
18925
  });
@@ -18572,6 +19348,10 @@ function requireWebsocket () {
18572
19348
  * masking key
18573
19349
  * @param {Number} [options.handshakeTimeout] Timeout in milliseconds for the
18574
19350
  * handshake request
19351
+ * @param {Number} [options.maxBufferedChunks=1048576] The maximum number of
19352
+ * buffered data chunks
19353
+ * @param {Number} [options.maxFragments=131072] The maximum number of message
19354
+ * fragments
18575
19355
  * @param {Number} [options.maxPayload=104857600] The maximum allowed message
18576
19356
  * size
18577
19357
  * @param {Number} [options.maxRedirects=10] The maximum number of redirects
@@ -18592,6 +19372,8 @@ function requireWebsocket () {
18592
19372
  autoPong: true,
18593
19373
  closeTimeout: CLOSE_TIMEOUT,
18594
19374
  protocolVersion: protocolVersions[1],
19375
+ maxBufferedChunks: 1024 * 1024,
19376
+ maxFragments: 128 * 1024,
18595
19377
  maxPayload: 100 * 1024 * 1024,
18596
19378
  skipUTF8Validation: false,
18597
19379
  perMessageDeflate: true,
@@ -18949,6 +19731,8 @@ function requireWebsocket () {
18949
19731
  websocket.setSocket(socket, head, {
18950
19732
  allowSynchronousEvents: opts.allowSynchronousEvents,
18951
19733
  generateMask: opts.generateMask,
19734
+ maxBufferedChunks: opts.maxBufferedChunks,
19735
+ maxFragments: opts.maxFragments,
18952
19736
  maxPayload: opts.maxPayload,
18953
19737
  skipUTF8Validation: opts.skipUTF8Validation
18954
19738
  });
@@ -19591,7 +20375,7 @@ function requireWebsocketServer () {
19591
20375
  hasRequiredWebsocketServer = 1;
19592
20376
 
19593
20377
  const EventEmitter = require$$0$3;
19594
- const http = require$$2;
20378
+ const http = require$$2$1;
19595
20379
  const { Duplex } = require$$0$2;
19596
20380
  const { createHash } = require$$3;
19597
20381
 
@@ -19631,6 +20415,10 @@ function requireWebsocketServer () {
19631
20415
  * called
19632
20416
  * @param {Function} [options.handleProtocols] A hook to handle protocols
19633
20417
  * @param {String} [options.host] The hostname where to bind the server
20418
+ * @param {Number} [options.maxBufferedChunks=1048576] The maximum number of
20419
+ * buffered data chunks
20420
+ * @param {Number} [options.maxFragments=131072] The maximum number of message
20421
+ * fragments
19634
20422
  * @param {Number} [options.maxPayload=104857600] The maximum allowed message
19635
20423
  * size
19636
20424
  * @param {Boolean} [options.noServer=false] Enable no server mode
@@ -19653,6 +20441,8 @@ function requireWebsocketServer () {
19653
20441
  options = {
19654
20442
  allowSynchronousEvents: true,
19655
20443
  autoPong: true,
20444
+ maxBufferedChunks: 1024 * 1024,
20445
+ maxFragments: 128 * 1024,
19656
20446
  maxPayload: 100 * 1024 * 1024,
19657
20447
  skipUTF8Validation: false,
19658
20448
  perMessageDeflate: false,
@@ -20012,6 +20802,8 @@ function requireWebsocketServer () {
20012
20802
 
20013
20803
  ws.setSocket(socket, head, {
20014
20804
  allowSynchronousEvents: this.options.allowSynchronousEvents,
20805
+ maxBufferedChunks: this.options.maxBufferedChunks,
20806
+ maxFragments: this.options.maxFragments,
20015
20807
  maxPayload: this.options.maxPayload,
20016
20808
  skipUTF8Validation: this.options.skipUTF8Validation
20017
20809
  });
@@ -20156,7 +20948,7 @@ function requireMain () {
20156
20948
  hasRequiredMain = 1;
20157
20949
  const fs = require$$0$4;
20158
20950
  const path = require$$1$1;
20159
- const os = require$$2$1;
20951
+ const os = require$$2$2;
20160
20952
  const crypto = require$$3;
20161
20953
 
20162
20954
  // Array of tips to display randomly
@@ -23636,6 +24428,7 @@ const disco = {
23636
24428
  },
23637
24429
  llm: {
23638
24430
  call: makeLLMCall,
24431
+ uploadVisionFile: uploadVisionFile,
23639
24432
  seek: makeDeepseekCall,
23640
24433
  images: makeImagesCall,
23641
24434
  open: makeOpenRouterCall,
@@ -23666,5 +24459,5 @@ const disco = {
23666
24459
  },
23667
24460
  };
23668
24461
 
23669
- export { AlpacaMarketDataAPI, AlpacaTradingAPI, OPENAI_IMAGE_MODELS, OPENAI_MODELS, OPENROUTER_MODELS, disco, isOpenAIImageModel, isOpenAIModel, isOpenRouterModel, supportsTemperature };
24462
+ export { AlpacaMarketDataAPI, AlpacaTradingAPI, OPENAI_IMAGE_MODELS, OPENAI_MODELS, OPENROUTER_MODELS, disco, isOpenAIImageModel, isOpenAIModel, isOpenRouterModel, supportsTemperature, uploadVisionFile };
23670
24463
  //# sourceMappingURL=index.mjs.map