@getanyapi/sdk 0.9.2 → 0.9.6
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 +21 -4
- package/dist/index.cjs +239 -108
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +105 -97
- package/dist/index.d.ts +105 -97
- package/dist/index.js +239 -108
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -126,13 +126,30 @@ Per-call transport overrides: `timeoutMs`, `maxRetries`, and an `AbortSignal` vi
|
|
|
126
126
|
| `ResultNotFoundError` | - | `unwrap` on an empty found-data result |
|
|
127
127
|
| `RateLimitedError` | 429 | Too many requests (retried automatically) |
|
|
128
128
|
| `UpstreamError` | 502 | An upstream backend failed |
|
|
129
|
-
| `ConnectionError` | 0 | Network or transport failure
|
|
129
|
+
| `ConnectionError` | 0 | Network or transport failure |
|
|
130
130
|
| `TimeoutError` | 0 | Request exceeded its timeout (not retried) |
|
|
131
131
|
|
|
132
132
|
All extend `AnyAPIError` (with `status` and `requestId`). Retries cover only 429 and network
|
|
133
|
-
failures, with jittered exponential backoff honoring
|
|
134
|
-
(up to 3 attempts); set it on the client or per request.
|
|
135
|
-
|
|
133
|
+
failures proven to happen before a request was sent, with jittered exponential backoff honoring
|
|
134
|
+
`Retry-After`. Default `maxRetries` is 2 (up to 3 attempts); set it on the client or per request.
|
|
135
|
+
Timeouts are never retried. Connection failures during or after a billed `POST /v1/run` are not
|
|
136
|
+
retried because the call may already have been charged. When the send phase is unknown, the SDK
|
|
137
|
+
does not retry. Configure with `new AnyAPI({ timeoutMs, maxRetries })`.
|
|
138
|
+
|
|
139
|
+
Automatic network retry of a billed `run()` requires structured runtime evidence that the
|
|
140
|
+
request body was not sent:
|
|
141
|
+
|
|
142
|
+
| Runtime | Automatic billed-run network retry | Evidence available to the SDK |
|
|
143
|
+
| ------- | ---------------------------------- | ----------------------------- |
|
|
144
|
+
| Node 18+ with built-in undici `fetch` | Yes | DNS and connect codes, connect-phase timeouts, or an undici socket reporting zero bytes written |
|
|
145
|
+
| Bun 1.3.11 | Yes | `ConnectionRefused`, which Bun 1.3.11 emits only while establishing the origin or proxy connection |
|
|
146
|
+
| Cloudflare Workers | No | `retryable: true` means transient, not undelivered; it can appear after the origin received the full body |
|
|
147
|
+
| Deno | No | Fetch exposes only prose without a structured connection code |
|
|
148
|
+
| Browsers | No | Fetch generally exposes an opaque `TypeError` |
|
|
149
|
+
|
|
150
|
+
On a runtime without strict non-delivery evidence, the SDK makes no automatic network retry for a
|
|
151
|
+
billed `run()`. HTTP 429 retry is unchanged. Handle other retries explicitly only when your
|
|
152
|
+
application can establish non-delivery.
|
|
136
153
|
|
|
137
154
|
## Agent signup
|
|
138
155
|
|