deepline 0.3.245 → 0.3.246
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/bundling-sources/sdk/src/client.ts +38 -49
- package/dist/bundling-sources/sdk/src/http.ts +10 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/runs/read-errors.ts +19 -0
- package/dist/bundling-sources/sdk/src/runs/watch-polling.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/coordinator-headers.ts +10 -0
- package/dist/bundling-sources/shared_libs/plays/execution-pipeline.ts +2 -0
- package/dist/bundling-sources/shared_libs/plays/retained-pipeline-graph.ts +12 -6
- package/dist/bundling-sources/shared_libs/plays/static-pipeline-storage-codec.ts +2 -7
- package/dist/cli/index.js +36 -66
- package/dist/cli/index.mjs +36 -66
- package/dist/index.js +25 -32
- package/dist/index.mjs +25 -32
- package/dist/install-integrity.json +1 -1
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +1 -1
- package/dist/release.mjs +1 -1
- package/package.json +1 -1
- package/dist/bundling-sources/sdk/src/stream-reconnect.ts +0 -47
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { DeeplineError } from './errors.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Retry policy for the legacy run SSE compatibility method. Ordinary run
|
|
5
|
-
* watching uses a fixed REST snapshot cadence and shares only the transient
|
|
6
|
-
* read-error classification below.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/** Base delay for the full-jitter exponential backoff between reconnects. */
|
|
10
|
-
export const STREAM_RECONNECT_BASE_DELAY_MS = 500;
|
|
11
|
-
/** Upper bound for a single reconnect delay. */
|
|
12
|
-
export const STREAM_RECONNECT_MAX_DELAY_MS = 15_000;
|
|
13
|
-
/**
|
|
14
|
-
* A connection that stayed open at least this long (or delivered any event)
|
|
15
|
-
* counts as healthy and resets the backoff sequence.
|
|
16
|
-
*/
|
|
17
|
-
export const STREAM_HEALTHY_CONNECTION_MS = 30_000;
|
|
18
|
-
|
|
19
|
-
/** Full-jitter exponential backoff: uniform in [1, min(cap, base * 2^attempt)]. */
|
|
20
|
-
export function streamReconnectDelayMs(attempt: number): number {
|
|
21
|
-
const cappedExponentialMs = Math.min(
|
|
22
|
-
STREAM_RECONNECT_MAX_DELAY_MS,
|
|
23
|
-
STREAM_RECONNECT_BASE_DELAY_MS * 2 ** Math.max(0, attempt),
|
|
24
|
-
);
|
|
25
|
-
return Math.max(1, Math.floor(Math.random() * (cappedExponentialMs + 1)));
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function isTransientPlayRunReadError(error: unknown): boolean {
|
|
29
|
-
if (
|
|
30
|
-
error instanceof DeeplineError &&
|
|
31
|
-
error.code === 'PLAY_STREAM_NETWORK_ABORTED'
|
|
32
|
-
) {
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
if (error instanceof DeeplineError && typeof error.statusCode === 'number') {
|
|
36
|
-
// 5xx responses and network-level failures may recover. Client errors,
|
|
37
|
-
// especially 404, stay visible instead of disappearing into a retry loop.
|
|
38
|
-
return error.statusCode >= 500 && error.statusCode < 600;
|
|
39
|
-
}
|
|
40
|
-
const text = error instanceof Error ? error.message : String(error);
|
|
41
|
-
return /auth validation backend timed out|coordinator \/submit(?:\?[^ ]*)? 5\d\d|Worker threw exception|Internal Server Error|Service Unavailable|fetch failed|eaddrnotavail|econnreset|etimedout|eai_again|socket hang up/i.test(
|
|
42
|
-
text,
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/** @deprecated Use `isTransientPlayRunReadError`. */
|
|
47
|
-
export const isTransientPlayStreamError = isTransientPlayRunReadError;
|