@jaypie/llm 1.2.33 → 1.2.34
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/cjs/index.cjs +87 -50
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/operate/retry/createStaleRejectionGuard.d.ts +19 -0
- package/dist/esm/index.js +87 -50
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/operate/retry/createStaleRejectionGuard.d.ts +19 -0
- package/package.json +1 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface StaleRejectionGuard {
|
|
2
|
+
/** Install the unhandledRejection listener (idempotent) */
|
|
3
|
+
install(): void;
|
|
4
|
+
/** Remove the listener and forget recorded errors */
|
|
5
|
+
remove(): void;
|
|
6
|
+
/** Record an error the retry loop has caught and is handling */
|
|
7
|
+
recordCaught(error: unknown): void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Create a guard that suppresses unhandled rejections firing as siblings of
|
|
11
|
+
* an error the retry loop has already caught. Provider SDKs occasionally
|
|
12
|
+
* surface a single upstream failure as twin rejections — the retry layer
|
|
13
|
+
* accepts responsibility for the first; this guard prevents the second from
|
|
14
|
+
* crashing the host while the retry is in flight.
|
|
15
|
+
*
|
|
16
|
+
* The guard also continues to suppress transient socket teardown errors
|
|
17
|
+
* (e.g. undici `TypeError: terminated`) emitted between attempts.
|
|
18
|
+
*/
|
|
19
|
+
export declare function createStaleRejectionGuard(): StaleRejectionGuard;
|