@soat/sdk 0.43.0 → 0.44.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.
package/dist/index.cjs CHANGED
@@ -960,7 +960,14 @@ var AiProviders = class {
960
960
  /**
961
961
  * Create an AI provider
962
962
  *
963
- * Creates a new LLM provider configuration
963
+ * Creates a new LLM provider configuration.
964
+ *
965
+ * A `bedrock` or `vertex` record must carry a credential of its own — a
966
+ * linked `secret_id`, or an `apiKey` in `config`. Without one the provider
967
+ * SDK signs with the server's own credentials (the AWS default credential
968
+ * chain, Google Application Default Credentials), which is refused with
969
+ * `400 VALIDATION_FAILED` unless the deployment allows it.
970
+ *
964
971
  */
965
972
  static createAiProvider(options) {
966
973
  return (options.client ?? client).post({
@@ -1018,7 +1025,7 @@ var AiProviders = class {
1018
1025
  * Asks the provider which models it can run, using this provider record's own credentials and configuration, and returns provider-native model ids — the same strings `default_model` and an agent's `model` carry.
1019
1026
  * Which models are reachable is a property of the credential, not of the provider type: a Vertex provider sees only the publisher models its Google Cloud project and location serve, and a Bedrock provider only the foundation models enabled in its region. Reading the list is how a caller avoids pinning a model that fails at generation time.
1020
1027
  * Not every provider type can answer. `azure` lists deployments an operator named rather than models, and `ollama` lists whatever was pulled onto that host, so both return `400 MODEL_LISTING_UNSUPPORTED`.
1021
- * Listing resolves credentials the same way generation does, so a record that can generate can list. The API-key types (`openai`, `groq`, `xai`, `gateway`, `custom`, `anthropic`, `google`) use the record's linked secret and cannot list without one. `bedrock` and `vertex` use the linked secret when there is one — IAM keys or a Bedrock API key, a Google service-account key and otherwise fall back to the server environment (the AWS default credential chain, Google Application Default Credentials), so a record with no `secret_id` can still list.
1028
+ * Listing resolves credentials the same way generation does, so a record that can generate can list. The API-key types (`openai`, `groq`, `xai`, `gateway`, `custom`, `anthropic`, `google`) use the record's linked secret and cannot list without one. `bedrock` and `vertex` use the linked secret — IAM keys or a Bedrock API key, a Google service-account key. A record with no `secret_id` would fall back to the server's own credentials (the AWS default credential chain, Google Application Default Credentials); it can list only on a deployment that allows a record to use them, and returns `400 AI_PROVIDER_MISCONFIGURED` otherwise.
1022
1029
  * A Vertex record needs no `config.project` when its secret is a service-account key, since the key file names its own project. A Vertex record in express mode (API key) cannot list at all: the publisher-model listing rejects API keys and needs a credential that asserts a principal, so it returns `400 MODEL_LISTING_UNSUPPORTED`.
1023
1030
  * The Vertex answer is the publisher catalogue the record's `config.location` region serves. The project behind the credential is billed and quota'd for the call but does not filter the result, so a listed model may still be unavailable to that project at generation time.
1024
1031
  *
@@ -3244,7 +3251,9 @@ var Quotas = class {
3244
3251
  /**
3245
3252
  * Create a quota
3246
3253
  *
3247
- * Creates a project-scoped quota. `requests` is valid for `scope: project`/`api_key`; `tokens` and `cost_usd` are valid for `scope: project`/`agent`/`actor`. Any other scope/metric pair is rejected with 400 (no attribution exists to enforce it). An `actor` quota caps one end user's spend, matched from the generation's session; a null `scope_ref` means one budget *per* actor rather than a pooled project total. A `cost_usd` quota may name one `meter_type` to cap; omitting it caps every priced meter. A duplicate quota (same project, scope, scope_ref, metric, window, meter_type) is rejected with 409.
3254
+ * Creates a project-scoped quota. `requests` is valid for `scope: project`/`api_key`; `tokens` and `cost_usd` are valid for `scope: project`/`agent`/`actor`; `storage_bytes` is valid for `scope: project` only. Any other scope/metric pair is rejected with 400 (no attribution exists to enforce it). An `actor` quota caps one end user's spend, matched from the generation's session; a null `scope_ref` means one budget *per* actor rather than a pooled project total. A `cost_usd` quota may name one `meter_type` to cap; omitting it caps every priced meter. A duplicate quota (same project, scope, scope_ref, metric, window, meter_type) is rejected with 409.
3255
+ *
3256
+ * `storage_bytes` caps a stored total rather than a windowed one, so it takes `window: current` and every other metric refuses that value (400 either way). It is enforced at the corpus write paths — file upload and create, document create, document ingest and re-ingest, memory-entry create — with `409 QUOTA_STORAGE_EXCEEDED` and no `Retry-After`, since no window reset clears a footprint.
3248
3257
  */
3249
3258
  static createQuota(options) {
3250
3259
  return (options.client ?? client).post({
package/dist/index.d.cts CHANGED
@@ -3113,13 +3113,13 @@ type QuotaResourceProperties = {
3113
3113
  /**
3114
3114
  * The metric being capped
3115
3115
  */
3116
- metric: 'requests' | 'tokens' | 'cost_usd';
3116
+ metric: 'requests' | 'tokens' | 'cost_usd' | 'storage_bytes';
3117
3117
  /**
3118
- * The window over which the metric is aggregated
3118
+ * The window over which the metric is aggregated. storage_bytes caps a stored total rather than a windowed one, so it takes current and refuses every other value; current is refused for every other metric.
3119
3119
  */
3120
- window: 'rolling_1m' | 'rolling_1h' | 'rolling_24h' | 'calendar_month';
3120
+ window: 'rolling_1m' | 'rolling_1h' | 'rolling_24h' | 'calendar_month' | 'current';
3121
3121
  /**
3122
- * The cap. Positive integer for requests/tokens; fractional allowed for cost_usd.
3122
+ * The cap. Positive integer for requests/tokens/storage_bytes (bytes); fractional allowed for cost_usd.
3123
3123
  */
3124
3124
  limit: number;
3125
3125
  /**
@@ -5045,8 +5045,11 @@ type Quota = {
5045
5045
  * Public id of the api key / agent / actor the quota applies to. For `api_key` and `agent` scope, NULL means all entities of that scope type in the project. For `actor` scope, NULL means one budget *per* actor rather than a pooled total across all actors.
5046
5046
  */
5047
5047
  scope_ref?: string | null;
5048
- metric?: 'requests' | 'tokens' | 'cost_usd';
5049
- window?: 'rolling_1m' | 'rolling_1h' | 'rolling_24h' | 'calendar_month';
5048
+ metric?: 'requests' | 'tokens' | 'cost_usd' | 'storage_bytes';
5049
+ /**
5050
+ * The window the metric is aggregated over; `current` on storage_bytes, which caps a stored total and never resets.
5051
+ */
5052
+ window?: 'rolling_1m' | 'rolling_1h' | 'rolling_24h' | 'calendar_month' | 'current';
5050
5053
  limit?: number;
5051
5054
  mode?: 'enforce' | 'monitor';
5052
5055
  /**
@@ -5058,7 +5061,7 @@ type Quota = {
5058
5061
  */
5059
5062
  on_unpriced?: 'block' | 'allow' | null;
5060
5063
  /**
5061
- * Current fixed-window usage for the requests metric. Null for token/cost quotas (which aggregate the usage meter at check time rather than keeping a counter) and in list responses.
5064
+ * Current fixed-window usage for the requests metric. Null for token/cost quotas (which aggregate the usage meter at check time rather than keeping a counter), null for storage_bytes (a stored total has no window and no counter — read the footprint from the storage meter), and null in list responses.
5062
5065
  */
5063
5066
  current_usage?: {
5064
5067
  window_key?: string;
@@ -7643,7 +7646,7 @@ type CreateAiProviderData = {
7643
7646
  */
7644
7647
  default_model: string;
7645
7648
  /**
7646
- * Secret ID containing API credentials
7649
+ * Secret ID containing API credentials. Required for `bedrock` and `vertex` unless `config.apiKey` carries one.
7647
7650
  */
7648
7651
  secret_id?: string;
7649
7652
  /**
@@ -9403,6 +9406,10 @@ type CreateDocumentErrors = {
9403
9406
  * Forbidden
9404
9407
  */
9405
9408
  403: ErrorResponse;
9409
+ /**
9410
+ * The project's `storage_bytes` quota is exceeded (`QUOTA_STORAGE_EXCEEDED`). Delete stored content, or raise the quota — no window reset clears a stored total, so no `Retry-After` is sent.
9411
+ */
9412
+ 409: ErrorResponse;
9406
9413
  };
9407
9414
  type CreateDocumentError = CreateDocumentErrors[keyof CreateDocumentErrors];
9408
9415
  type CreateDocumentResponses = {
@@ -9468,7 +9475,7 @@ type IngestDocumentErrors = {
9468
9475
  */
9469
9476
  403: ErrorResponse;
9470
9477
  /**
9471
- * The file already backs a Document (a file can only be ingested once). Use `POST /documents/{document_id}/ingest` to re-process the existing document, or upload a new copy of the file to ingest it separately.
9478
+ * The file already backs a Document (a file can only be ingested once use `POST /documents/{document_id}/ingest` to re-process the existing document, or upload a new copy of the file to ingest it separately), or the project's `storage_bytes` quota is exceeded (`QUOTA_STORAGE_EXCEEDED`; delete stored content or raise the quota — no `Retry-After` is sent, since no window reset clears a stored total).
9472
9479
  */
9473
9480
  409: ErrorResponse;
9474
9481
  /**
@@ -9687,6 +9694,10 @@ type ReingestDocumentErrors = {
9687
9694
  * Document not found
9688
9695
  */
9689
9696
  404: ErrorResponse;
9697
+ /**
9698
+ * The project's `storage_bytes` quota is exceeded (`QUOTA_STORAGE_EXCEEDED`). Delete stored content, or raise the quota — no window reset clears a stored total, so no `Retry-After` is sent.
9699
+ */
9700
+ 409: ErrorResponse;
9690
9701
  /**
9691
9702
  * The file is too large to re-ingest synchronously (`?wait=true`). Retry in background mode.
9692
9703
  */
@@ -10196,6 +10207,10 @@ type CreateDatasetItemErrors = {
10196
10207
  * Dataset not found
10197
10208
  */
10198
10209
  404: unknown;
10210
+ /**
10211
+ * The project's `storage_bytes` quota is exceeded (`QUOTA_STORAGE_EXCEEDED`). A fixture is a corpus write like a document, so it is bounded by the same cap; delete stored content or raise the quota — no `Retry-After` is sent, since no window reset clears a stored total.
10212
+ */
10213
+ 409: unknown;
10199
10214
  };
10200
10215
  type CreateDatasetItemResponses = {
10201
10216
  /**
@@ -10248,7 +10263,7 @@ type CreateDatasetItemFromGenerationErrors = {
10248
10263
  */
10249
10264
  404: unknown;
10250
10265
  /**
10251
- * The generation has not completed, or its content was never stored or has been purged
10266
+ * The generation has not completed, its content was never stored or has been purged, or the project's `storage_bytes` quota is exceeded (`QUOTA_STORAGE_EXCEEDED`; delete stored content or raise the quota — no `Retry-After` is sent, since no window reset clears a stored total)
10252
10267
  */
10253
10268
  409: unknown;
10254
10269
  };
@@ -11036,6 +11051,10 @@ type CreateFileData = {
11036
11051
  url: '/api/v1/files';
11037
11052
  };
11038
11053
  type CreateFileErrors = {
11054
+ /**
11055
+ * The project's `storage_bytes` quota is exceeded (`QUOTA_STORAGE_EXCEEDED`). Delete stored content, or raise the quota — no window reset clears a stored total, so no `Retry-After` is sent.
11056
+ */
11057
+ 409: ErrorResponse;
11039
11058
  /**
11040
11059
  * Internal server error
11041
11060
  */
@@ -11089,6 +11108,10 @@ type UploadFileErrors = {
11089
11108
  * Insufficient permissions
11090
11109
  */
11091
11110
  403: ErrorResponse;
11111
+ /**
11112
+ * The project's `storage_bytes` quota is exceeded (`QUOTA_STORAGE_EXCEEDED`). Delete stored content, or raise the quota — no window reset clears a stored total, so no `Retry-After` is sent.
11113
+ */
11114
+ 409: ErrorResponse;
11092
11115
  };
11093
11116
  type UploadFileError = UploadFileErrors[keyof UploadFileErrors];
11094
11117
  type UploadFileResponses = {
@@ -11117,6 +11140,10 @@ type UploadFileBase64Errors = {
11117
11140
  * Insufficient permissions
11118
11141
  */
11119
11142
  403: ErrorResponse;
11143
+ /**
11144
+ * The project's `storage_bytes` quota is exceeded (`QUOTA_STORAGE_EXCEEDED`). Delete stored content, or raise the quota — no window reset clears a stored total, so no `Retry-After` is sent.
11145
+ */
11146
+ 409: ErrorResponse;
11120
11147
  };
11121
11148
  type UploadFileBase64Error = UploadFileBase64Errors[keyof UploadFileBase64Errors];
11122
11149
  type UploadFileBase64Responses = {
@@ -11175,7 +11202,7 @@ type UploadFileWithTokenErrors = {
11175
11202
  */
11176
11203
  404: ErrorResponse;
11177
11204
  /**
11178
- * Upload token already used
11205
+ * Upload token already used, or the project's `storage_bytes` quota is exceeded (`QUOTA_STORAGE_EXCEEDED`)
11179
11206
  */
11180
11207
  409: ErrorResponse;
11181
11208
  /**
@@ -12974,6 +13001,10 @@ type CreateMemoryEntryErrors = {
12974
13001
  * Memory not found
12975
13002
  */
12976
13003
  404: unknown;
13004
+ /**
13005
+ * The project's `storage_bytes` quota is exceeded (`QUOTA_STORAGE_EXCEEDED`). Delete stored content, or raise the quota — no window reset clears a stored total, so no `Retry-After` is sent.
13006
+ */
13007
+ 409: unknown;
12977
13008
  /**
12978
13009
  * Internal server error
12979
13010
  */
@@ -14456,13 +14487,13 @@ type CreateQuotaData = {
14456
14487
  /**
14457
14488
  * The metric being capped
14458
14489
  */
14459
- metric: 'requests' | 'tokens' | 'cost_usd';
14490
+ metric: 'requests' | 'tokens' | 'cost_usd' | 'storage_bytes';
14460
14491
  /**
14461
- * The window over which the metric is aggregated
14492
+ * The window over which the metric is aggregated. `current` is the only accepted value for storage_bytes (a stored total is not aggregated over time) and is refused for every other metric.
14462
14493
  */
14463
- window: 'rolling_1m' | 'rolling_1h' | 'rolling_24h' | 'calendar_month';
14494
+ window: 'rolling_1m' | 'rolling_1h' | 'rolling_24h' | 'calendar_month' | 'current';
14464
14495
  /**
14465
- * The cap. Must be a positive integer for requests/tokens; fractional values are allowed for cost_usd.
14496
+ * The cap. Must be a positive integer for requests/tokens/storage_bytes (bytes); fractional values are allowed for cost_usd.
14466
14497
  */
14467
14498
  limit: number;
14468
14499
  /**
@@ -17659,7 +17690,14 @@ declare class AiProviders {
17659
17690
  /**
17660
17691
  * Create an AI provider
17661
17692
  *
17662
- * Creates a new LLM provider configuration
17693
+ * Creates a new LLM provider configuration.
17694
+ *
17695
+ * A `bedrock` or `vertex` record must carry a credential of its own — a
17696
+ * linked `secret_id`, or an `apiKey` in `config`. Without one the provider
17697
+ * SDK signs with the server's own credentials (the AWS default credential
17698
+ * chain, Google Application Default Credentials), which is refused with
17699
+ * `400 VALIDATION_FAILED` unless the deployment allows it.
17700
+ *
17663
17701
  */
17664
17702
  static createAiProvider<ThrowOnError extends boolean = false>(options: Options<CreateAiProviderData, ThrowOnError>): RequestResult<CreateAiProviderResponses, CreateAiProviderErrors, ThrowOnError>;
17665
17703
  /**
@@ -17689,7 +17727,7 @@ declare class AiProviders {
17689
17727
  * Asks the provider which models it can run, using this provider record's own credentials and configuration, and returns provider-native model ids — the same strings `default_model` and an agent's `model` carry.
17690
17728
  * Which models are reachable is a property of the credential, not of the provider type: a Vertex provider sees only the publisher models its Google Cloud project and location serve, and a Bedrock provider only the foundation models enabled in its region. Reading the list is how a caller avoids pinning a model that fails at generation time.
17691
17729
  * Not every provider type can answer. `azure` lists deployments an operator named rather than models, and `ollama` lists whatever was pulled onto that host, so both return `400 MODEL_LISTING_UNSUPPORTED`.
17692
- * Listing resolves credentials the same way generation does, so a record that can generate can list. The API-key types (`openai`, `groq`, `xai`, `gateway`, `custom`, `anthropic`, `google`) use the record's linked secret and cannot list without one. `bedrock` and `vertex` use the linked secret when there is one — IAM keys or a Bedrock API key, a Google service-account key and otherwise fall back to the server environment (the AWS default credential chain, Google Application Default Credentials), so a record with no `secret_id` can still list.
17730
+ * Listing resolves credentials the same way generation does, so a record that can generate can list. The API-key types (`openai`, `groq`, `xai`, `gateway`, `custom`, `anthropic`, `google`) use the record's linked secret and cannot list without one. `bedrock` and `vertex` use the linked secret — IAM keys or a Bedrock API key, a Google service-account key. A record with no `secret_id` would fall back to the server's own credentials (the AWS default credential chain, Google Application Default Credentials); it can list only on a deployment that allows a record to use them, and returns `400 AI_PROVIDER_MISCONFIGURED` otherwise.
17693
17731
  * A Vertex record needs no `config.project` when its secret is a service-account key, since the key file names its own project. A Vertex record in express mode (API key) cannot list at all: the publisher-model listing rejects API keys and needs a credential that asserts a principal, so it returns `400 MODEL_LISTING_UNSUPPORTED`.
17694
17732
  * The Vertex answer is the publisher catalogue the record's `config.location` region serves. The project behind the credential is billed and quota'd for the call but does not filter the result, so a listed model may still be unavailable to that project at generation time.
17695
17733
  *
@@ -18835,7 +18873,9 @@ declare class Quotas {
18835
18873
  /**
18836
18874
  * Create a quota
18837
18875
  *
18838
- * Creates a project-scoped quota. `requests` is valid for `scope: project`/`api_key`; `tokens` and `cost_usd` are valid for `scope: project`/`agent`/`actor`. Any other scope/metric pair is rejected with 400 (no attribution exists to enforce it). An `actor` quota caps one end user's spend, matched from the generation's session; a null `scope_ref` means one budget *per* actor rather than a pooled project total. A `cost_usd` quota may name one `meter_type` to cap; omitting it caps every priced meter. A duplicate quota (same project, scope, scope_ref, metric, window, meter_type) is rejected with 409.
18876
+ * Creates a project-scoped quota. `requests` is valid for `scope: project`/`api_key`; `tokens` and `cost_usd` are valid for `scope: project`/`agent`/`actor`; `storage_bytes` is valid for `scope: project` only. Any other scope/metric pair is rejected with 400 (no attribution exists to enforce it). An `actor` quota caps one end user's spend, matched from the generation's session; a null `scope_ref` means one budget *per* actor rather than a pooled project total. A `cost_usd` quota may name one `meter_type` to cap; omitting it caps every priced meter. A duplicate quota (same project, scope, scope_ref, metric, window, meter_type) is rejected with 409.
18877
+ *
18878
+ * `storage_bytes` caps a stored total rather than a windowed one, so it takes `window: current` and every other metric refuses that value (400 either way). It is enforced at the corpus write paths — file upload and create, document create, document ingest and re-ingest, memory-entry create — with `409 QUOTA_STORAGE_EXCEEDED` and no `Retry-After`, since no window reset clears a footprint.
18839
18879
  */
18840
18880
  static createQuota<ThrowOnError extends boolean = false>(options: Options<CreateQuotaData, ThrowOnError>): RequestResult<CreateQuotaResponses, CreateQuotaErrors, ThrowOnError>;
18841
18881
  /**
package/dist/index.d.mts CHANGED
@@ -3113,13 +3113,13 @@ type QuotaResourceProperties = {
3113
3113
  /**
3114
3114
  * The metric being capped
3115
3115
  */
3116
- metric: 'requests' | 'tokens' | 'cost_usd';
3116
+ metric: 'requests' | 'tokens' | 'cost_usd' | 'storage_bytes';
3117
3117
  /**
3118
- * The window over which the metric is aggregated
3118
+ * The window over which the metric is aggregated. storage_bytes caps a stored total rather than a windowed one, so it takes current and refuses every other value; current is refused for every other metric.
3119
3119
  */
3120
- window: 'rolling_1m' | 'rolling_1h' | 'rolling_24h' | 'calendar_month';
3120
+ window: 'rolling_1m' | 'rolling_1h' | 'rolling_24h' | 'calendar_month' | 'current';
3121
3121
  /**
3122
- * The cap. Positive integer for requests/tokens; fractional allowed for cost_usd.
3122
+ * The cap. Positive integer for requests/tokens/storage_bytes (bytes); fractional allowed for cost_usd.
3123
3123
  */
3124
3124
  limit: number;
3125
3125
  /**
@@ -5045,8 +5045,11 @@ type Quota = {
5045
5045
  * Public id of the api key / agent / actor the quota applies to. For `api_key` and `agent` scope, NULL means all entities of that scope type in the project. For `actor` scope, NULL means one budget *per* actor rather than a pooled total across all actors.
5046
5046
  */
5047
5047
  scope_ref?: string | null;
5048
- metric?: 'requests' | 'tokens' | 'cost_usd';
5049
- window?: 'rolling_1m' | 'rolling_1h' | 'rolling_24h' | 'calendar_month';
5048
+ metric?: 'requests' | 'tokens' | 'cost_usd' | 'storage_bytes';
5049
+ /**
5050
+ * The window the metric is aggregated over; `current` on storage_bytes, which caps a stored total and never resets.
5051
+ */
5052
+ window?: 'rolling_1m' | 'rolling_1h' | 'rolling_24h' | 'calendar_month' | 'current';
5050
5053
  limit?: number;
5051
5054
  mode?: 'enforce' | 'monitor';
5052
5055
  /**
@@ -5058,7 +5061,7 @@ type Quota = {
5058
5061
  */
5059
5062
  on_unpriced?: 'block' | 'allow' | null;
5060
5063
  /**
5061
- * Current fixed-window usage for the requests metric. Null for token/cost quotas (which aggregate the usage meter at check time rather than keeping a counter) and in list responses.
5064
+ * Current fixed-window usage for the requests metric. Null for token/cost quotas (which aggregate the usage meter at check time rather than keeping a counter), null for storage_bytes (a stored total has no window and no counter — read the footprint from the storage meter), and null in list responses.
5062
5065
  */
5063
5066
  current_usage?: {
5064
5067
  window_key?: string;
@@ -7643,7 +7646,7 @@ type CreateAiProviderData = {
7643
7646
  */
7644
7647
  default_model: string;
7645
7648
  /**
7646
- * Secret ID containing API credentials
7649
+ * Secret ID containing API credentials. Required for `bedrock` and `vertex` unless `config.apiKey` carries one.
7647
7650
  */
7648
7651
  secret_id?: string;
7649
7652
  /**
@@ -9403,6 +9406,10 @@ type CreateDocumentErrors = {
9403
9406
  * Forbidden
9404
9407
  */
9405
9408
  403: ErrorResponse;
9409
+ /**
9410
+ * The project's `storage_bytes` quota is exceeded (`QUOTA_STORAGE_EXCEEDED`). Delete stored content, or raise the quota — no window reset clears a stored total, so no `Retry-After` is sent.
9411
+ */
9412
+ 409: ErrorResponse;
9406
9413
  };
9407
9414
  type CreateDocumentError = CreateDocumentErrors[keyof CreateDocumentErrors];
9408
9415
  type CreateDocumentResponses = {
@@ -9468,7 +9475,7 @@ type IngestDocumentErrors = {
9468
9475
  */
9469
9476
  403: ErrorResponse;
9470
9477
  /**
9471
- * The file already backs a Document (a file can only be ingested once). Use `POST /documents/{document_id}/ingest` to re-process the existing document, or upload a new copy of the file to ingest it separately.
9478
+ * The file already backs a Document (a file can only be ingested once use `POST /documents/{document_id}/ingest` to re-process the existing document, or upload a new copy of the file to ingest it separately), or the project's `storage_bytes` quota is exceeded (`QUOTA_STORAGE_EXCEEDED`; delete stored content or raise the quota — no `Retry-After` is sent, since no window reset clears a stored total).
9472
9479
  */
9473
9480
  409: ErrorResponse;
9474
9481
  /**
@@ -9687,6 +9694,10 @@ type ReingestDocumentErrors = {
9687
9694
  * Document not found
9688
9695
  */
9689
9696
  404: ErrorResponse;
9697
+ /**
9698
+ * The project's `storage_bytes` quota is exceeded (`QUOTA_STORAGE_EXCEEDED`). Delete stored content, or raise the quota — no window reset clears a stored total, so no `Retry-After` is sent.
9699
+ */
9700
+ 409: ErrorResponse;
9690
9701
  /**
9691
9702
  * The file is too large to re-ingest synchronously (`?wait=true`). Retry in background mode.
9692
9703
  */
@@ -10196,6 +10207,10 @@ type CreateDatasetItemErrors = {
10196
10207
  * Dataset not found
10197
10208
  */
10198
10209
  404: unknown;
10210
+ /**
10211
+ * The project's `storage_bytes` quota is exceeded (`QUOTA_STORAGE_EXCEEDED`). A fixture is a corpus write like a document, so it is bounded by the same cap; delete stored content or raise the quota — no `Retry-After` is sent, since no window reset clears a stored total.
10212
+ */
10213
+ 409: unknown;
10199
10214
  };
10200
10215
  type CreateDatasetItemResponses = {
10201
10216
  /**
@@ -10248,7 +10263,7 @@ type CreateDatasetItemFromGenerationErrors = {
10248
10263
  */
10249
10264
  404: unknown;
10250
10265
  /**
10251
- * The generation has not completed, or its content was never stored or has been purged
10266
+ * The generation has not completed, its content was never stored or has been purged, or the project's `storage_bytes` quota is exceeded (`QUOTA_STORAGE_EXCEEDED`; delete stored content or raise the quota — no `Retry-After` is sent, since no window reset clears a stored total)
10252
10267
  */
10253
10268
  409: unknown;
10254
10269
  };
@@ -11036,6 +11051,10 @@ type CreateFileData = {
11036
11051
  url: '/api/v1/files';
11037
11052
  };
11038
11053
  type CreateFileErrors = {
11054
+ /**
11055
+ * The project's `storage_bytes` quota is exceeded (`QUOTA_STORAGE_EXCEEDED`). Delete stored content, or raise the quota — no window reset clears a stored total, so no `Retry-After` is sent.
11056
+ */
11057
+ 409: ErrorResponse;
11039
11058
  /**
11040
11059
  * Internal server error
11041
11060
  */
@@ -11089,6 +11108,10 @@ type UploadFileErrors = {
11089
11108
  * Insufficient permissions
11090
11109
  */
11091
11110
  403: ErrorResponse;
11111
+ /**
11112
+ * The project's `storage_bytes` quota is exceeded (`QUOTA_STORAGE_EXCEEDED`). Delete stored content, or raise the quota — no window reset clears a stored total, so no `Retry-After` is sent.
11113
+ */
11114
+ 409: ErrorResponse;
11092
11115
  };
11093
11116
  type UploadFileError = UploadFileErrors[keyof UploadFileErrors];
11094
11117
  type UploadFileResponses = {
@@ -11117,6 +11140,10 @@ type UploadFileBase64Errors = {
11117
11140
  * Insufficient permissions
11118
11141
  */
11119
11142
  403: ErrorResponse;
11143
+ /**
11144
+ * The project's `storage_bytes` quota is exceeded (`QUOTA_STORAGE_EXCEEDED`). Delete stored content, or raise the quota — no window reset clears a stored total, so no `Retry-After` is sent.
11145
+ */
11146
+ 409: ErrorResponse;
11120
11147
  };
11121
11148
  type UploadFileBase64Error = UploadFileBase64Errors[keyof UploadFileBase64Errors];
11122
11149
  type UploadFileBase64Responses = {
@@ -11175,7 +11202,7 @@ type UploadFileWithTokenErrors = {
11175
11202
  */
11176
11203
  404: ErrorResponse;
11177
11204
  /**
11178
- * Upload token already used
11205
+ * Upload token already used, or the project's `storage_bytes` quota is exceeded (`QUOTA_STORAGE_EXCEEDED`)
11179
11206
  */
11180
11207
  409: ErrorResponse;
11181
11208
  /**
@@ -12974,6 +13001,10 @@ type CreateMemoryEntryErrors = {
12974
13001
  * Memory not found
12975
13002
  */
12976
13003
  404: unknown;
13004
+ /**
13005
+ * The project's `storage_bytes` quota is exceeded (`QUOTA_STORAGE_EXCEEDED`). Delete stored content, or raise the quota — no window reset clears a stored total, so no `Retry-After` is sent.
13006
+ */
13007
+ 409: unknown;
12977
13008
  /**
12978
13009
  * Internal server error
12979
13010
  */
@@ -14456,13 +14487,13 @@ type CreateQuotaData = {
14456
14487
  /**
14457
14488
  * The metric being capped
14458
14489
  */
14459
- metric: 'requests' | 'tokens' | 'cost_usd';
14490
+ metric: 'requests' | 'tokens' | 'cost_usd' | 'storage_bytes';
14460
14491
  /**
14461
- * The window over which the metric is aggregated
14492
+ * The window over which the metric is aggregated. `current` is the only accepted value for storage_bytes (a stored total is not aggregated over time) and is refused for every other metric.
14462
14493
  */
14463
- window: 'rolling_1m' | 'rolling_1h' | 'rolling_24h' | 'calendar_month';
14494
+ window: 'rolling_1m' | 'rolling_1h' | 'rolling_24h' | 'calendar_month' | 'current';
14464
14495
  /**
14465
- * The cap. Must be a positive integer for requests/tokens; fractional values are allowed for cost_usd.
14496
+ * The cap. Must be a positive integer for requests/tokens/storage_bytes (bytes); fractional values are allowed for cost_usd.
14466
14497
  */
14467
14498
  limit: number;
14468
14499
  /**
@@ -17659,7 +17690,14 @@ declare class AiProviders {
17659
17690
  /**
17660
17691
  * Create an AI provider
17661
17692
  *
17662
- * Creates a new LLM provider configuration
17693
+ * Creates a new LLM provider configuration.
17694
+ *
17695
+ * A `bedrock` or `vertex` record must carry a credential of its own — a
17696
+ * linked `secret_id`, or an `apiKey` in `config`. Without one the provider
17697
+ * SDK signs with the server's own credentials (the AWS default credential
17698
+ * chain, Google Application Default Credentials), which is refused with
17699
+ * `400 VALIDATION_FAILED` unless the deployment allows it.
17700
+ *
17663
17701
  */
17664
17702
  static createAiProvider<ThrowOnError extends boolean = false>(options: Options<CreateAiProviderData, ThrowOnError>): RequestResult<CreateAiProviderResponses, CreateAiProviderErrors, ThrowOnError>;
17665
17703
  /**
@@ -17689,7 +17727,7 @@ declare class AiProviders {
17689
17727
  * Asks the provider which models it can run, using this provider record's own credentials and configuration, and returns provider-native model ids — the same strings `default_model` and an agent's `model` carry.
17690
17728
  * Which models are reachable is a property of the credential, not of the provider type: a Vertex provider sees only the publisher models its Google Cloud project and location serve, and a Bedrock provider only the foundation models enabled in its region. Reading the list is how a caller avoids pinning a model that fails at generation time.
17691
17729
  * Not every provider type can answer. `azure` lists deployments an operator named rather than models, and `ollama` lists whatever was pulled onto that host, so both return `400 MODEL_LISTING_UNSUPPORTED`.
17692
- * Listing resolves credentials the same way generation does, so a record that can generate can list. The API-key types (`openai`, `groq`, `xai`, `gateway`, `custom`, `anthropic`, `google`) use the record's linked secret and cannot list without one. `bedrock` and `vertex` use the linked secret when there is one — IAM keys or a Bedrock API key, a Google service-account key and otherwise fall back to the server environment (the AWS default credential chain, Google Application Default Credentials), so a record with no `secret_id` can still list.
17730
+ * Listing resolves credentials the same way generation does, so a record that can generate can list. The API-key types (`openai`, `groq`, `xai`, `gateway`, `custom`, `anthropic`, `google`) use the record's linked secret and cannot list without one. `bedrock` and `vertex` use the linked secret — IAM keys or a Bedrock API key, a Google service-account key. A record with no `secret_id` would fall back to the server's own credentials (the AWS default credential chain, Google Application Default Credentials); it can list only on a deployment that allows a record to use them, and returns `400 AI_PROVIDER_MISCONFIGURED` otherwise.
17693
17731
  * A Vertex record needs no `config.project` when its secret is a service-account key, since the key file names its own project. A Vertex record in express mode (API key) cannot list at all: the publisher-model listing rejects API keys and needs a credential that asserts a principal, so it returns `400 MODEL_LISTING_UNSUPPORTED`.
17694
17732
  * The Vertex answer is the publisher catalogue the record's `config.location` region serves. The project behind the credential is billed and quota'd for the call but does not filter the result, so a listed model may still be unavailable to that project at generation time.
17695
17733
  *
@@ -18835,7 +18873,9 @@ declare class Quotas {
18835
18873
  /**
18836
18874
  * Create a quota
18837
18875
  *
18838
- * Creates a project-scoped quota. `requests` is valid for `scope: project`/`api_key`; `tokens` and `cost_usd` are valid for `scope: project`/`agent`/`actor`. Any other scope/metric pair is rejected with 400 (no attribution exists to enforce it). An `actor` quota caps one end user's spend, matched from the generation's session; a null `scope_ref` means one budget *per* actor rather than a pooled project total. A `cost_usd` quota may name one `meter_type` to cap; omitting it caps every priced meter. A duplicate quota (same project, scope, scope_ref, metric, window, meter_type) is rejected with 409.
18876
+ * Creates a project-scoped quota. `requests` is valid for `scope: project`/`api_key`; `tokens` and `cost_usd` are valid for `scope: project`/`agent`/`actor`; `storage_bytes` is valid for `scope: project` only. Any other scope/metric pair is rejected with 400 (no attribution exists to enforce it). An `actor` quota caps one end user's spend, matched from the generation's session; a null `scope_ref` means one budget *per* actor rather than a pooled project total. A `cost_usd` quota may name one `meter_type` to cap; omitting it caps every priced meter. A duplicate quota (same project, scope, scope_ref, metric, window, meter_type) is rejected with 409.
18877
+ *
18878
+ * `storage_bytes` caps a stored total rather than a windowed one, so it takes `window: current` and every other metric refuses that value (400 either way). It is enforced at the corpus write paths — file upload and create, document create, document ingest and re-ingest, memory-entry create — with `409 QUOTA_STORAGE_EXCEEDED` and no `Retry-After`, since no window reset clears a footprint.
18839
18879
  */
18840
18880
  static createQuota<ThrowOnError extends boolean = false>(options: Options<CreateQuotaData, ThrowOnError>): RequestResult<CreateQuotaResponses, CreateQuotaErrors, ThrowOnError>;
18841
18881
  /**
package/dist/index.mjs CHANGED
@@ -959,7 +959,14 @@ var AiProviders = class {
959
959
  /**
960
960
  * Create an AI provider
961
961
  *
962
- * Creates a new LLM provider configuration
962
+ * Creates a new LLM provider configuration.
963
+ *
964
+ * A `bedrock` or `vertex` record must carry a credential of its own — a
965
+ * linked `secret_id`, or an `apiKey` in `config`. Without one the provider
966
+ * SDK signs with the server's own credentials (the AWS default credential
967
+ * chain, Google Application Default Credentials), which is refused with
968
+ * `400 VALIDATION_FAILED` unless the deployment allows it.
969
+ *
963
970
  */
964
971
  static createAiProvider(options) {
965
972
  return (options.client ?? client).post({
@@ -1017,7 +1024,7 @@ var AiProviders = class {
1017
1024
  * Asks the provider which models it can run, using this provider record's own credentials and configuration, and returns provider-native model ids — the same strings `default_model` and an agent's `model` carry.
1018
1025
  * Which models are reachable is a property of the credential, not of the provider type: a Vertex provider sees only the publisher models its Google Cloud project and location serve, and a Bedrock provider only the foundation models enabled in its region. Reading the list is how a caller avoids pinning a model that fails at generation time.
1019
1026
  * Not every provider type can answer. `azure` lists deployments an operator named rather than models, and `ollama` lists whatever was pulled onto that host, so both return `400 MODEL_LISTING_UNSUPPORTED`.
1020
- * Listing resolves credentials the same way generation does, so a record that can generate can list. The API-key types (`openai`, `groq`, `xai`, `gateway`, `custom`, `anthropic`, `google`) use the record's linked secret and cannot list without one. `bedrock` and `vertex` use the linked secret when there is one — IAM keys or a Bedrock API key, a Google service-account key and otherwise fall back to the server environment (the AWS default credential chain, Google Application Default Credentials), so a record with no `secret_id` can still list.
1027
+ * Listing resolves credentials the same way generation does, so a record that can generate can list. The API-key types (`openai`, `groq`, `xai`, `gateway`, `custom`, `anthropic`, `google`) use the record's linked secret and cannot list without one. `bedrock` and `vertex` use the linked secret — IAM keys or a Bedrock API key, a Google service-account key. A record with no `secret_id` would fall back to the server's own credentials (the AWS default credential chain, Google Application Default Credentials); it can list only on a deployment that allows a record to use them, and returns `400 AI_PROVIDER_MISCONFIGURED` otherwise.
1021
1028
  * A Vertex record needs no `config.project` when its secret is a service-account key, since the key file names its own project. A Vertex record in express mode (API key) cannot list at all: the publisher-model listing rejects API keys and needs a credential that asserts a principal, so it returns `400 MODEL_LISTING_UNSUPPORTED`.
1022
1029
  * The Vertex answer is the publisher catalogue the record's `config.location` region serves. The project behind the credential is billed and quota'd for the call but does not filter the result, so a listed model may still be unavailable to that project at generation time.
1023
1030
  *
@@ -3243,7 +3250,9 @@ var Quotas = class {
3243
3250
  /**
3244
3251
  * Create a quota
3245
3252
  *
3246
- * Creates a project-scoped quota. `requests` is valid for `scope: project`/`api_key`; `tokens` and `cost_usd` are valid for `scope: project`/`agent`/`actor`. Any other scope/metric pair is rejected with 400 (no attribution exists to enforce it). An `actor` quota caps one end user's spend, matched from the generation's session; a null `scope_ref` means one budget *per* actor rather than a pooled project total. A `cost_usd` quota may name one `meter_type` to cap; omitting it caps every priced meter. A duplicate quota (same project, scope, scope_ref, metric, window, meter_type) is rejected with 409.
3253
+ * Creates a project-scoped quota. `requests` is valid for `scope: project`/`api_key`; `tokens` and `cost_usd` are valid for `scope: project`/`agent`/`actor`; `storage_bytes` is valid for `scope: project` only. Any other scope/metric pair is rejected with 400 (no attribution exists to enforce it). An `actor` quota caps one end user's spend, matched from the generation's session; a null `scope_ref` means one budget *per* actor rather than a pooled project total. A `cost_usd` quota may name one `meter_type` to cap; omitting it caps every priced meter. A duplicate quota (same project, scope, scope_ref, metric, window, meter_type) is rejected with 409.
3254
+ *
3255
+ * `storage_bytes` caps a stored total rather than a windowed one, so it takes `window: current` and every other metric refuses that value (400 either way). It is enforced at the corpus write paths — file upload and create, document create, document ingest and re-ingest, memory-entry create — with `409 QUOTA_STORAGE_EXCEEDED` and no `Retry-After`, since no window reset clears a footprint.
3247
3256
  */
3248
3257
  static createQuota(options) {
3249
3258
  return (options.client ?? client).post({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soat/sdk",
3
- "version": "0.43.0",
3
+ "version": "0.44.0",
4
4
  "description": "TypeScript SDK for SOAT — open-source infrastructure for production-ready AI agents.",
5
5
  "keywords": [
6
6
  "ai-agents",