@forgezero/providers 0.1.10 → 0.1.12

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/README.md CHANGED
@@ -1,185 +1,290 @@
1
+ <!--
2
+ GENERATED FILE — do not edit.
3
+
4
+ Change scripts/generate-guides.ts or its typed sources, run `bun run guides`,
5
+ and commit the generator and rendered files together.
6
+ -->
7
+
1
8
  # @forgezero/providers
2
9
 
3
- Provider identities, named capabilities, and service-owned priority/fallback.
4
-
5
- A provider declares what a vendor can do. A service declares what an
6
- application needs. Configuration attaches one provider method to one service
7
- method, so adding a provider never changes the service contract and adding a
8
- service never forks a provider.
9
-
10
- ```bash
11
- bun add @forgezero/providers
12
- ```
13
-
14
- ## Built-in providers
15
-
16
- | provider | methods | import |
17
- |---|---|---|
18
- | JetEmail | `send`, `sendBatch` | `@forgezero/providers/email` |
19
- | SMTP | `send` | `@forgezero/providers/email` |
20
- | ArangoDB | `query` | `@forgezero/providers/database` |
21
- | EVM JSON-RPC | `request` | `@forgezero/providers/chain` |
22
- | HTTP | `request` | `@forgezero/providers/http` |
23
- | S3-compatible storage | `request` | `@forgezero/providers/storage` |
24
- | Google AI Studio | `translate` | `@forgezero/providers/translation` |
25
-
26
- `pool`, `binance`, and `realtime` are specialised provider utilities/clients.
27
- Every public subpath is documented at
28
- [forgezero.net/docs/providers](https://www.forgezero.net/docs/providers).
29
-
30
- ## Email: exact capability routing
31
-
32
- JetEmail provides native single and batch delivery. SMTP provides single
33
- delivery only. ForgeZero does not pretend SMTP has a batch capability by
34
- silently looping.
35
-
36
- ```ts
37
- import {
38
- createRegistry,
39
- envCredentials,
40
- staticConfig
41
- } from '@forgezero/providers';
42
- import {
43
- emailProviders,
44
- emailService
45
- } from '@forgezero/providers/email';
46
-
47
- const registry = createRegistry({
48
- providers: emailProviders,
49
- credentials: envCredentials(process.env),
50
- config: staticConfig({
51
- providers: {
52
- jetPrimary: {
53
- providerId: 'jetemail',
54
- enabled: true,
55
- config: { from: 'ops@example.com' },
56
- secretRef: 'jetemail'
57
- },
58
- smtpBackup: {
59
- providerId: 'smtp',
60
- enabled: true,
61
- config: {
62
- host: 'smtp.example.com',
63
- port: 587,
64
- from: 'ops@example.com',
65
- transport
66
- },
67
- secretRef: 'smtp'
68
- }
69
- },
70
- services: {
71
- email: {
72
- send: [
73
- { instanceKey: 'jetPrimary', providerMethod: 'send', priority: 1, enabled: true },
74
- { instanceKey: 'smtpBackup', providerMethod: 'send', priority: 2, enabled: true }
75
- ],
76
- sendBatch: [
77
- { instanceKey: 'jetPrimary', providerMethod: 'sendBatch', priority: 1, enabled: true }
78
- ]
79
- }
80
- }
81
- })
82
- });
10
+ Send through whichever provider is up. Priority and failover, reordered live.
83
11
 
84
- const email = registry.service(emailService);
85
- const outcome = await email.call('send', {
86
- to: 'ada@example.com',
87
- subject: 'Your invite',
88
- html: '<p>Welcome</p>'
89
- });
12
+ ## Global package root and supported runtimes
90
13
 
91
- if (!outcome.ok) throw outcome.error;
92
- outcome.result; // provider-neutral result
93
- outcome.selected; // exact provider instance and method
94
- outcome.fallbackUsed; // true when a lower priority succeeded
95
- outcome.attempts; // every failed, skipped and successful attempt
14
+ Anyone calling somebody else's API who needs the failure classified rather than guessed. Provider capabilities stay independent from application-owned services, which attach named methods by priority with health tracking. Supported runtimes: bun, node, workers, deno. The global base/root import is @forgezero/providers. Every public import or command is listed below; the documentation inventory is checked in both directions against package.json exports.
15
+
16
+ ```text
17
+ import * as root from '@forgezero/providers';
96
18
  ```
97
19
 
98
- Hooks and health writes are awaited. A successful fallback therefore still
99
- returns the complete failure trail for auditing or operator notification.
20
+ ## Commands
100
21
 
101
- ## Define a custom provider
22
+ bun add @forgezero/providers @forgezero/vault — Install provider/service routing and the optional ForgeZero Vault credential adapter.
23
+ bun test — Run the consumer project tests containing provider failure and fallback cases.
102
24
 
103
- A provider does not name a service:
25
+ ```text
26
+ bun add @forgezero/providers @forgezero/vault
27
+ bun test
28
+ ```
104
29
 
105
- ```ts
106
- import {
107
- defineProvider,
108
- defineProviderMethod
109
- } from '@forgezero/providers';
30
+ ## @forgezero/providers
110
31
 
111
- export const postmark = defineProvider({
112
- id: 'postmark',
113
- label: 'Postmark',
114
- credentials: {
115
- type: 'object',
116
- additionalProperties: false,
117
- properties: { token: { type: 'string', writeOnly: true } }
118
- },
119
- methods: {
120
- deliver: defineProviderMethod<Notice, DeliveryReceipt>({
121
- invoke: async (context, notice) =>
122
- post(context.config, await context.secret('token'), notice),
123
- classify: (error) => status(error) === 400 ? 'terminal' : 'retryable'
124
- })
125
- }
126
- });
32
+ The registry: priority, health, and a terminal-versus-retryable verdict per failure.
33
+
34
+ ```text
35
+ import * as api from '@forgezero/providers';
36
+ ```
37
+
38
+ ## @forgezero/providers/email
39
+
40
+ JetEmail (`send`, `sendBatch`), SMTP (`send` only), and the typed email service contract; SMTP transport is injected.
41
+
42
+ ```text
43
+ import * as api from '@forgezero/providers/email';
127
44
  ```
128
45
 
129
- ## Define a custom service
46
+ ## @forgezero/providers/database
130
47
 
131
- The application owns the service vocabulary and attaches provider methods in
132
- configuration:
48
+ ArangoDB in the registry for credential rotation and health with failover off by default.
133
49
 
134
- ```ts
135
- import { defineService, serviceMethod } from '@forgezero/providers';
50
+ ```text
51
+ import * as api from '@forgezero/providers/database';
52
+ ```
136
53
 
137
- export const notifications = defineService({
138
- key: 'notifications',
139
- methods: {
140
- deliver: serviceMethod<Notice, DeliveryReceipt>()
141
- }
142
- });
54
+ ## @forgezero/providers/http
55
+
56
+ Outbound HTTP with a per-host weight budget reserved before the call and settled from the response.
143
57
 
144
- // services.notifications.deliver attaches postmark.deliver by priority.
145
- const result = await registry.service(notifications).call('deliver', notice);
58
+ ```text
59
+ import * as api from '@forgezero/providers/http';
146
60
  ```
147
61
 
148
- An SSOT route handler calls `notifications.deliver`; it never imports Postmark,
149
- JetEmail, or SMTP. A tenant may add both its own provider and its own service
150
- without changing ForgeZero source.
62
+ ## @forgezero/providers/pool
63
+
64
+ Which outbound address a request leaves by, sticky per key, over the same budget as everything else.
65
+
66
+ ```text
67
+ import * as api from '@forgezero/providers/pool';
68
+ ```
69
+
70
+ ## @forgezero/providers/chain
71
+
72
+ An EVM node behind the same failover as any other service: read logs, broadcast, and never stop scanning because one endpoint rate-limited.
73
+
74
+ ```text
75
+ import * as api from '@forgezero/providers/chain';
76
+ ```
77
+
78
+ ## @forgezero/providers/binance
79
+
80
+ Binance behind the venue adapter: three hosts, one weight budget, signed over the exact string that is sent.
81
+
82
+ ```text
83
+ import * as api from '@forgezero/providers/binance';
84
+ ```
85
+
86
+ ## @forgezero/providers/storage
87
+
88
+ S3-compatible object storage, SigV4 signed with Web Crypto and no vendor SDK.
89
+
90
+ ```text
91
+ import * as api from '@forgezero/providers/storage';
92
+ ```
93
+
94
+ ## @forgezero/providers/translation
95
+
96
+ Google AI Studio translation with strict batch alignment and classified quota failures.
97
+
98
+ ```text
99
+ import * as api from '@forgezero/providers/translation';
100
+ ```
101
+
102
+ ## @forgezero/providers/realtime
103
+
104
+ Cloudflare KV node-directory and Durable Object fan-out clients for project-defined realtime services.
105
+
106
+ ```text
107
+ import * as api from '@forgezero/providers/realtime';
108
+ ```
109
+
110
+ ## Email with ordered provider fallback
111
+
112
+ The service owns send/sendBatch. Attach provider methods directly in priority arrays; SMTP is never presented as batch-capable.
113
+
114
+ ```text
115
+ import { createService, type EmailMessage } from '@forgezero/providers';
116
+ import { emailService, jetemail, smtp, type SmtpTransport } from '@forgezero/providers/email';
117
+ import { createVault } from '@forgezero/vault';
118
+ import { vaultCredentials } from '@forgezero/vault/providers';
119
+
120
+ // Adapt Nodemailer, Bun, or an HTTP SMTP relay once at the host boundary.
121
+ declare const transport: SmtpTransport;
122
+
123
+ const vault = createVault({ project: 'my-project', environment: 'production' });
124
+ const email = createService(emailService, {
125
+ send: [
126
+ { provider: jetemail, method: 'send', credentials: vaultCredentials(vault, 'jetemail'), config: { from: 'ops@example.com' }, priority: 1 },
127
+ { provider: smtp, method: 'send', credentials: vaultCredentials(vault, 'smtp'), config: { host: 'smtp.example.com', port: 587, from: 'ops@example.com', transport }, priority: 2 }
128
+ ],
129
+ sendBatch: [
130
+ { provider: jetemail, method: 'sendBatch', credentials: vaultCredentials(vault, 'jetemail'), config: { from: 'ops@example.com' }, priority: 1 }
131
+ ]
132
+ });
133
+
134
+ const message: EmailMessage = { to: 'user@example.com', subject: 'Hello', text: 'Sent by ForgeZero' };
135
+ const outcome = await email.call('send', message);
136
+ if (!outcome.ok) throw outcome.error;
137
+ console.log(outcome.result, outcome.attempts);
138
+ ```
151
139
 
152
- ## Vault and external credential sources
140
+ ## Extend with a custom provider and service
153
141
 
154
- `@forgezero/providers` never imports `@forgezero/vault`. It consumes a tiny
155
- structural interface. ForgeZero provides adapters in `@forgezero/vault/providers`;
156
- other consumers can inject any secret manager.
142
+ Public consumers define provider capabilities and application services independently, then attach them with the same ordered-array API.
157
143
 
158
- ```ts
159
- import { chainCredentials, envCredentials } from '@forgezero/providers';
144
+ ```text
145
+ import { createService, defineService, defineSingleMethodProvider, serviceMethod } from '@forgezero/providers';
146
+ import { createVault } from '@forgezero/vault';
160
147
  import { vaultCredentials } from '@forgezero/vault/providers';
161
148
 
162
- const credentials = chainCredentials(
163
- vaultCredentials(vault),
164
- {
165
- name: 'customer-secret-service',
166
- get: (reference, field) => external.read(reference, field)
149
+ type Notice = { text: string };
150
+ type Receipt = { id: string };
151
+ const vault = createVault({ project: 'my-project', environment: 'production' });
152
+
153
+ const postmark = defineSingleMethodProvider({
154
+ id: 'postmark', label: 'Postmark', method: 'deliver',
155
+ async invoke(context, notice: Notice): Promise<Receipt> {
156
+ const response = await fetch('https://api.postmarkapp.com/email', {
157
+ method: 'POST', signal: context.signal,
158
+ headers: { 'x-postmark-server-token': await context.secret('apiKey') },
159
+ body: JSON.stringify(notice)
160
+ });
161
+ if (!response.ok) throw new Error(`Postmark returned ${response.status}`);
162
+ return { id: response.headers.get('x-message-id') ?? crypto.randomUUID() };
167
163
  },
168
- envCredentials(process.env) // bootstrap/systemd-projected fallback
164
+ classify: () => 'retryable'
165
+ });
166
+ const notifications = defineService({
167
+ key: 'notifications', methods: { deliver: serviceMethod<Notice, Receipt>() }
168
+ });
169
+ const service = createService(notifications, {
170
+ deliver: [{ provider: postmark, method: 'deliver', credentials: vaultCredentials(vault, 'postmark'), priority: 1 }]
171
+ });
172
+ ```
173
+
174
+ ## Vault first, systemd credential fallback
175
+
176
+ Bootstrap tries the scoped Vault entry first and the identically named systemd credential second. If neither exists, the provider call fails.
177
+
178
+ ```text
179
+ import { chainScopedCredentials, scopeCredentials } from '@forgezero/providers';
180
+ import { createVault, systemdCredentials } from '@forgezero/vault';
181
+ import { vaultCredentials } from '@forgezero/vault/providers';
182
+
183
+ const vault = createVault({ project: 'my-project', environment: 'production' });
184
+ const credentials = chainScopedCredentials(
185
+ vaultCredentials(vault, 'jetemail'),
186
+ scopeCredentials(systemdCredentials({
187
+ nameFor: (reference, field) => `${reference}-${field}`
188
+ }), 'jetemail')
169
189
  );
170
190
  ```
171
191
 
172
- ## Failure classification
192
+ ## Built-in provider capabilities
193
+
194
+ A provider owns capabilities; it does not own a service. A service method attaches a provider instance and one of its methods. This keeps custom providers and custom services independent.
195
+
196
+ ```text
197
+ evm-rpc request
198
+ jetemail send, sendBatch
199
+ smtp send
200
+ arangodb query
201
+ http request
202
+ s3 request
203
+ google-ai-studio translate
204
+ ```
205
+
206
+ ## EVM JSON-RPC node (evm-rpc)
207
+
208
+ Import: @forgezero/providers/chain. Methods: request. Credential fields: url, bearer. Nonsecret config: chainId, maxLogRange, timeoutMs. Several endpoints per chain is the normal case, not a luxury: public RPC is rate-limited and paid gateways have outages, and a scanner that stops when one is down stops crediting deposits while the money sits on the chain. "Already known" and "nonce too low" are TERMINAL — the transaction is already in flight, so rebroadcasting through another node is how a sweep gets sent twice.
209
+
210
+ ```text
211
+ importPath: '@forgezero/providers/chain'
212
+ providerId: 'evm-rpc'
213
+ methods: request
214
+ credentials: url, bearer
215
+ config: chainId, maxLogRange, timeoutMs
216
+ ```
173
217
 
174
- | kind | meaning | registry action |
175
- |---|---|---|
176
- | `terminal` | the request is invalid for every provider | stop |
177
- | `retryable` | this provider/key failed | try the next attachment |
178
- | `backoff` | the provider is healthy but rate-limiting | preserve health and continue according to policy |
218
+ ## JetEmail (jetemail)
179
219
 
180
- Three fault strikes mark an attachment offline; a success clears them. Backoff
181
- does not count as a fault.
220
+ Import: @forgezero/providers/email. Methods: send, sendBatch. Credential fields: apiKey. Nonsecret config: eu, from. A 401 is RETRYABLE at the loop level — that key is bad, the next provider's may not be. Treating any 4xx as fatal is what loses the fallback.
182
221
 
183
- ## Licence
222
+ ```text
223
+ importPath: '@forgezero/providers/email'
224
+ providerId: 'jetemail'
225
+ methods: send, sendBatch
226
+ credentials: apiKey
227
+ config: eu, from
228
+ ```
229
+
230
+ ## SMTP (smtp)
231
+
232
+ Import: @forgezero/providers/email. Methods: send. Credential fields: user, password. Nonsecret config: host, port, secure, from, transport. Any number of named relays, each with its own priority slot. Also the bootstrap path: the vault opens after a ceremony, and the ceremony needs mail.
233
+
234
+ ```text
235
+ importPath: '@forgezero/providers/email'
236
+ providerId: 'smtp'
237
+ methods: send
238
+ credentials: user, password
239
+ config: host, port, secure, from, transport
240
+ ```
241
+
242
+ ## ArangoDB (arangodb)
243
+
244
+ Import: @forgezero/providers/database. Methods: query. Credential fields: password. Nonsecret config: url, urls, readPreferredUrls, readPreferredFallback, clusterId, database, username. Failover is OFF by default. Writing to a different database because the first was slow is data loss with extra steps; this is here for credential rotation and health.
245
+
246
+ ```text
247
+ importPath: '@forgezero/providers/database'
248
+ providerId: 'arangodb'
249
+ methods: query
250
+ credentials: password
251
+ config: url, urls, readPreferredUrls, readPreferredFallback, clusterId, database, username
252
+ ```
253
+
254
+ ## HTTP (http)
255
+
256
+ Import: @forgezero/providers/http. Methods: request. Credential fields: apiKey, apiSecret. Nonsecret config: baseUrl, limit, windowMs, headroom. 418 and 429 back off rather than falling through. 418 is a venue saying "you ignored a 429 and are now banned", and hammering makes the ban longer.
257
+
258
+ ```text
259
+ importPath: '@forgezero/providers/http'
260
+ providerId: 'http'
261
+ methods: request
262
+ credentials: apiKey, apiSecret
263
+ config: baseUrl, limit, windowMs, headroom
264
+ ```
265
+
266
+ ## S3-compatible storage (s3)
267
+
268
+ Import: @forgezero/providers/storage. Methods: request. Credential fields: accessKeyId, secretAccessKey, sessionToken. Nonsecret config: endpoint, region, bucket, addressing. A 403 is retryable because on S3 it usually means this key lacks a permission, not that the key is invalid. Works against AWS, R2, MinIO, Garage and Backblaze — path-style addressing by default, because that is what everything except AWS expects.
269
+
270
+ ```text
271
+ importPath: '@forgezero/providers/storage'
272
+ providerId: 's3'
273
+ methods: request
274
+ credentials: accessKeyId, secretAccessKey, sessionToken
275
+ config: endpoint, region, bucket, addressing
276
+ ```
277
+
278
+ ## Google AI Studio (google-ai-studio)
279
+
280
+ Import: @forgezero/providers/translation. Methods: translate. Credential fields: apiKey. Nonsecret config: model. Machine translation for a tenant that wants it — ForgeZero translates nothing at runtime. Chosen as the first adapter because the free tier needs no billing account, so the feature can be tried without a procurement conversation. A 429 is a BACKOFF rather than a failure: on the free tier it is expected traffic, and treating it as terminal abandons a catalogue most of the way through. A short answer is terminal, because one translation missing from a batch shifts every later string onto the wrong source and nothing about the result looks broken afterwards.
281
+
282
+ ```text
283
+ importPath: '@forgezero/providers/translation'
284
+ providerId: 'google-ai-studio'
285
+ methods: translate
286
+ credentials: apiKey
287
+ config: model
288
+ ```
184
289
 
185
- MIT. Usable independently of a ForgeZero account.
290
+ Full rendered documentation: https://www.forgezero.net/docs/providers
package/dist/binance.js CHANGED
@@ -38,13 +38,39 @@ function chainCredentials(...sources) {
38
38
  }
39
39
  };
40
40
  }
41
+ function scopeCredentials(source, reference) {
42
+ return {
43
+ name: `${source.name}:${reference}`,
44
+ get: (field) => source.get(reference, field)
45
+ };
46
+ }
47
+ function chainScopedCredentials(...sources) {
48
+ return {
49
+ name: sources.map((source) => source.name).join("+"),
50
+ async get(field) {
51
+ let last;
52
+ for (const source of sources) {
53
+ try {
54
+ return await source.get(field);
55
+ } catch (error) {
56
+ last = error;
57
+ }
58
+ }
59
+ throw last instanceof Error ? last : new ProviderError("CREDENTIAL_MISSING", `No scoped source held field "${field}".`);
60
+ }
61
+ };
62
+ }
41
63
  function staticConfig(config) {
64
+ const providers = new Map(config.providers.map((provider) => [provider.instanceKey, provider]));
65
+ if (providers.size !== config.providers.length) {
66
+ throw new ProviderError("CONFIG_DUPLICATE_INSTANCE", "Provider instance keys must be unique.");
67
+ }
42
68
  const health = new Map;
43
69
  return {
44
70
  name: "static",
45
71
  async provider(instanceKey) {
46
- const provider = config.providers[instanceKey];
47
- return provider ? { instanceKey, ...provider, config: { ...provider.config } } : undefined;
72
+ const provider = providers.get(instanceKey);
73
+ return provider ? { ...provider, config: { ...provider.config } } : undefined;
48
74
  },
49
75
  async list(serviceKey, methodKey) {
50
76
  return (config.services[serviceKey]?.[methodKey] ?? []).map((attachment) => ({
@@ -201,7 +227,78 @@ function createRegistry(options) {
201
227
  }
202
228
  return { call, service };
203
229
  }
204
- var VERSION = "0.1.10";
230
+ function createService(definition, methods, options = {}) {
231
+ const providers = new Map;
232
+ const credentials = new Map;
233
+ const instances = [];
234
+ const serviceMethods = {};
235
+ for (const methodKey of Object.keys(definition.methods)) {
236
+ const attachments = methods[methodKey];
237
+ if (!Array.isArray(attachments)) {
238
+ throw new ProviderError("CONFIG_METHOD_MISSING", `Service method "${definition.key}.${methodKey}" needs an attachment array.`);
239
+ }
240
+ const priorities = new Set;
241
+ serviceMethods[methodKey] = attachments.map((attachment, index) => {
242
+ if (!Number.isInteger(attachment.priority) || attachment.priority < 1 || attachment.priority > 1000) {
243
+ throw new ProviderError("CONFIG_PRIORITY", `Priority for "${definition.key}.${methodKey}" must be an integer from 1 to 1000.`);
244
+ }
245
+ if (priorities.has(attachment.priority)) {
246
+ throw new ProviderError("CONFIG_PRIORITY_DUPLICATE", `Priorities for "${definition.key}.${methodKey}" must be unique.`);
247
+ }
248
+ priorities.add(attachment.priority);
249
+ if (!attachment.provider.methods[attachment.method]) {
250
+ throw new ProviderError("CONFIG_METHOD_UNSUPPORTED", `Provider "${attachment.provider.id}" does not support "${attachment.method}".`);
251
+ }
252
+ const existing = providers.get(attachment.provider.id);
253
+ if (existing && existing !== attachment.provider) {
254
+ throw new ProviderError("CONFIG_PROVIDER_DUPLICATE", `Provider id "${attachment.provider.id}" has more than one definition.`);
255
+ }
256
+ providers.set(attachment.provider.id, attachment.provider);
257
+ const internalKey = `${definition.key}:${methodKey}:${index}`;
258
+ credentials.set(internalKey, attachment.credentials);
259
+ instances.push({
260
+ instanceKey: internalKey,
261
+ providerId: attachment.provider.id,
262
+ enabled: attachment.enabled ?? true,
263
+ config: { ...attachment.config ?? {} },
264
+ secretRef: internalKey
265
+ });
266
+ return {
267
+ instanceKey: internalKey,
268
+ providerMethod: attachment.method,
269
+ priority: attachment.priority,
270
+ enabled: attachment.enabled ?? true
271
+ };
272
+ });
273
+ }
274
+ const registry = createRegistry({
275
+ providers: [...providers.values()],
276
+ config: staticConfig({ providers: instances, services: { [definition.key]: serviceMethods } }),
277
+ credentials: {
278
+ name: [...new Set([...credentials.values()].map((source) => source.name))].join("+"),
279
+ async get(reference, field) {
280
+ const source = credentials.get(reference);
281
+ if (!source)
282
+ throw new ProviderError("CREDENTIAL_SOURCE_MISSING", "The provider credential source is unavailable.");
283
+ return source.get(field);
284
+ }
285
+ },
286
+ ...options
287
+ });
288
+ const dynamic = registry.service(definition);
289
+ return {
290
+ async call(method, args, callOptions) {
291
+ const result = await dynamic.call(method, args, callOptions);
292
+ const { instance: _instance, selected, attempts, ...rest } = result;
293
+ return {
294
+ ...rest,
295
+ ...selected ? { selected: { providerId: selected.providerId, providerMethod: selected.providerMethod } } : {},
296
+ attempts: attempts.map(({ instanceKey: _instanceKey, ...attempt }) => attempt)
297
+ };
298
+ }
299
+ };
300
+ }
301
+ var VERSION = "0.1.12";
205
302
 
206
303
  // src/http.ts
207
304
  class BudgetExhausted extends ProviderError {