deepline 0.3.237 → 0.3.238
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 +158 -295
- package/dist/bundling-sources/sdk/src/http.ts +1 -1
- package/dist/bundling-sources/sdk/src/index.ts +1 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/runs/observe-transport.ts +5 -468
- package/dist/bundling-sources/sdk/src/runs/watch-polling.ts +220 -0
- package/dist/bundling-sources/sdk/src/stream-reconnect.ts +9 -12
- package/dist/bundling-sources/shared_libs/play-runtime/run-snapshot-stream.ts +4 -4
- package/dist/cli/index.js +540 -2056
- package/dist/cli/index.mjs +540 -2056
- package/dist/index.d.mts +71 -57
- package/dist/index.d.ts +71 -57
- package/dist/index.js +297 -1732
- package/dist/index.mjs +297 -1732
- package/dist/install-integrity.json +1 -0
- 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
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { DeeplineError } from './errors.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* function ceiling even while the run keeps executing. Consumers that wait for
|
|
8
|
-
* a terminal status (`plays run --watch`, `runs tail`, `client.runs.tail`)
|
|
9
|
-
* therefore reconnect with full-jitter exponential backoff instead of treating
|
|
10
|
-
* a window end as a failure.
|
|
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.
|
|
11
7
|
*/
|
|
12
8
|
|
|
13
9
|
/** Base delay for the full-jitter exponential backoff between reconnects. */
|
|
@@ -29,7 +25,7 @@ export function streamReconnectDelayMs(attempt: number): number {
|
|
|
29
25
|
return Math.max(1, Math.floor(Math.random() * (cappedExponentialMs + 1)));
|
|
30
26
|
}
|
|
31
27
|
|
|
32
|
-
export function
|
|
28
|
+
export function isTransientPlayRunReadError(error: unknown): boolean {
|
|
33
29
|
if (
|
|
34
30
|
error instanceof DeeplineError &&
|
|
35
31
|
error.code === 'PLAY_STREAM_NETWORK_ABORTED'
|
|
@@ -37,10 +33,8 @@ export function isTransientPlayStreamError(error: unknown): boolean {
|
|
|
37
33
|
return true;
|
|
38
34
|
}
|
|
39
35
|
if (error instanceof DeeplineError && typeof error.statusCode === 'number') {
|
|
40
|
-
//
|
|
41
|
-
//
|
|
42
|
-
// since the server may recover, but 4xx (especially 404 = run gone) is
|
|
43
|
-
// terminal and should not be hidden behind a silent retry loop.
|
|
36
|
+
// 5xx responses and network-level failures may recover. Client errors,
|
|
37
|
+
// especially 404, stay visible instead of disappearing into a retry loop.
|
|
44
38
|
return error.statusCode >= 500 && error.statusCode < 600;
|
|
45
39
|
}
|
|
46
40
|
const text = error instanceof Error ? error.message : String(error);
|
|
@@ -48,3 +42,6 @@ export function isTransientPlayStreamError(error: unknown): boolean {
|
|
|
48
42
|
text,
|
|
49
43
|
);
|
|
50
44
|
}
|
|
45
|
+
|
|
46
|
+
/** @deprecated Use `isTransientPlayRunReadError`. */
|
|
47
|
+
export const isTransientPlayStreamError = isTransientPlayRunReadError;
|
|
@@ -30,9 +30,9 @@ import { stripProvenanceTag } from './log-provenance';
|
|
|
30
30
|
* The canonical client-side projection of a persisted Play Run document into
|
|
31
31
|
* the live snapshot shape, plus the differ that turns successive snapshots
|
|
32
32
|
* into incremental `play.*` live events. This module is shared between the
|
|
33
|
-
* Vercel app (legacy SSE
|
|
34
|
-
* (`packages/sdk/src/runs/
|
|
35
|
-
* event
|
|
33
|
+
* Vercel app (dashboard and legacy SSE compatibility) and the SDK REST polling
|
|
34
|
+
* watcher (`packages/sdk/src/runs/watch-polling.ts`), so both use the same
|
|
35
|
+
* event projection from the persisted Run Snapshot. See ADR-0008.
|
|
36
36
|
*/
|
|
37
37
|
|
|
38
38
|
export type PlayRunLiveStatus = PlayRunLifecycleStatus;
|
|
@@ -551,7 +551,7 @@ function diffLogLines(input: {
|
|
|
551
551
|
const missingCount = tailFirstSeq - 1 - input.lastLogSeq;
|
|
552
552
|
return {
|
|
553
553
|
lines: [
|
|
554
|
-
`[
|
|
554
|
+
`[watch] ${missingCount} log lines not retained in the live window; full logs via runs logs`,
|
|
555
555
|
...logs,
|
|
556
556
|
],
|
|
557
557
|
lastLogSeq: totalLogCount,
|