deepline 0.3.245 → 0.3.247
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/observability/scheduled-jobs.json +18 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-work-manual.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +8 -5
- package/dist/bundling-sources/shared_libs/play-runtime/coordinator-headers.ts +10 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +118 -77
- package/dist/bundling-sources/shared_libs/play-runtime/transient-service-error.ts +3 -2
- 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
package/dist/index.js
CHANGED
|
@@ -1286,7 +1286,7 @@ var SDK_RELEASE = {
|
|
|
1286
1286
|
// getters keep their established compatibility behavior.
|
|
1287
1287
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
1288
1288
|
// 0.3.90 is the first deliberately versioned SDK release for API v3.
|
|
1289
|
-
version: "0.3.
|
|
1289
|
+
version: "0.3.247",
|
|
1290
1290
|
updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.",
|
|
1291
1291
|
packageCapabilities: {
|
|
1292
1292
|
updatePreferences: 1
|
|
@@ -1592,6 +1592,7 @@ var COORDINATOR_URL_OVERRIDE_HEADER = "x-deepline-coordinator-url";
|
|
|
1592
1592
|
var WORKER_CALLBACK_URL_OVERRIDE_HEADER = "x-deepline-worker-callback-url";
|
|
1593
1593
|
var RUNTIME_SCHEDULER_SCHEMA_OVERRIDE_HEADER = "x-deepline-runtime-scheduler-schema";
|
|
1594
1594
|
var RUNTIME_ENVIRONMENT_TOKEN_HEADER = "x-deepline-runtime-environment-token";
|
|
1595
|
+
var RETAINED_PIPELINE_RECEIVERS_HEADER = "x-deepline-retained-pipeline-receivers";
|
|
1595
1596
|
var ABSURD_RELEASE_OVERRIDE_HEADER = "x-deepline-absurd-release";
|
|
1596
1597
|
var PREFERRED_RECEIPT_GATEWAY_MACHINE_ID_HEADER = "x-deepline-preferred-receipt-gateway-machine-id";
|
|
1597
1598
|
var SYNTHETIC_RUN_HEADER = "x-deepline-synthetic-run";
|
|
@@ -2011,6 +2012,11 @@ var HttpClient = class {
|
|
|
2011
2012
|
if (runtimeTestFault?.trim()) {
|
|
2012
2013
|
headers[PLAY_RUNTIME_TEST_FAULT_HEADER] = runtimeTestFault.trim();
|
|
2013
2014
|
}
|
|
2015
|
+
const retainedReceivers = typeof process !== "undefined" ? process.env?.DEEPLINE_RUNTIME_RETAINED_PIPELINE_RECEIVERS?.trim() : void 0;
|
|
2016
|
+
if (retainedReceivers && coordinatorInternalToken?.trim()) {
|
|
2017
|
+
headers[RETAINED_PIPELINE_RECEIVERS_HEADER] = retainedReceivers;
|
|
2018
|
+
headers[COORDINATOR_INTERNAL_TOKEN_HEADER] = coordinatorInternalToken.trim();
|
|
2019
|
+
}
|
|
2014
2020
|
if (absurdReleaseOverride?.trim() && coordinatorInternalToken?.trim()) {
|
|
2015
2021
|
headers[ABSURD_RELEASE_OVERRIDE_HEADER] = absurdReleaseOverride.trim();
|
|
2016
2022
|
}
|
|
@@ -3220,7 +3226,7 @@ function diffPlayRunStreamEvents(input) {
|
|
|
3220
3226
|
return { events, next };
|
|
3221
3227
|
}
|
|
3222
3228
|
|
|
3223
|
-
// src/
|
|
3229
|
+
// src/runs/read-errors.ts
|
|
3224
3230
|
function isTransientPlayRunReadError(error) {
|
|
3225
3231
|
if (error instanceof DeeplineError && error.code === "PLAY_STREAM_NETWORK_ABORTED") {
|
|
3226
3232
|
return true;
|
|
@@ -3488,7 +3494,6 @@ function parseNotificationGroupTarget(value) {
|
|
|
3488
3494
|
function notificationObjectKey(kind) {
|
|
3489
3495
|
return `${kind}.${globalThis.crypto.randomUUID()}`;
|
|
3490
3496
|
}
|
|
3491
|
-
var TERMINAL_PLAY_STATUSES = /* @__PURE__ */ new Set(["completed", "failed", "cancelled"]);
|
|
3492
3497
|
var MONITOR_NON_RETRYABLE_MUTATION_OPTIONS = {
|
|
3493
3498
|
maxRetries: 0,
|
|
3494
3499
|
exactUrlOnly: true
|
|
@@ -3595,7 +3600,11 @@ function runtimeSelectionHeaders(runtime) {
|
|
|
3595
3600
|
"RUNTIME_ENVIRONMENT_TOKEN_REQUIRED"
|
|
3596
3601
|
);
|
|
3597
3602
|
}
|
|
3598
|
-
|
|
3603
|
+
const receivers = process.env.DEEPLINE_RUNTIME_RETAINED_PIPELINE_RECEIVERS?.trim();
|
|
3604
|
+
return {
|
|
3605
|
+
[RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
|
|
3606
|
+
...receivers ? { [RETAINED_PIPELINE_RECEIVERS_HEADER]: receivers } : {}
|
|
3607
|
+
};
|
|
3599
3608
|
}
|
|
3600
3609
|
function normalizeTestPolicyOverrides(value, source) {
|
|
3601
3610
|
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
@@ -3779,7 +3788,7 @@ function normalizePlayRunStart(raw) {
|
|
|
3779
3788
|
name: runPackage.run.playName,
|
|
3780
3789
|
status,
|
|
3781
3790
|
...runPackage.run.dashboardUrl ? { dashboardUrl: runPackage.run.dashboardUrl } : {},
|
|
3782
|
-
...
|
|
3791
|
+
...isTerminalPlayRunLifecycleStatus(status) ? { finalStatus: runPackage } : {},
|
|
3783
3792
|
package: runPackage
|
|
3784
3793
|
};
|
|
3785
3794
|
}
|
|
@@ -3857,11 +3866,12 @@ function readStringArray(value) {
|
|
|
3857
3866
|
function getPlayLiveEventPayload(event) {
|
|
3858
3867
|
return event.payload && typeof event.payload === "object" ? event.payload : {};
|
|
3859
3868
|
}
|
|
3860
|
-
function
|
|
3861
|
-
if (
|
|
3862
|
-
return
|
|
3869
|
+
function playLiveRunStatus(event) {
|
|
3870
|
+
if (event.type !== "play.run.snapshot" && event.type !== "play.run.status" && event.type !== "play.run.final_status") {
|
|
3871
|
+
return null;
|
|
3863
3872
|
}
|
|
3864
|
-
|
|
3873
|
+
const payload = getPlayLiveEventPayload(event);
|
|
3874
|
+
return decodePlayRunPublicStatus(payload.status) ?? (isPlayRunPackage(payload) ? decodePlayRunPublicStatus(payload.run.status) : null);
|
|
3865
3875
|
}
|
|
3866
3876
|
function appendPlayLiveLogLines(state, payload) {
|
|
3867
3877
|
const lines = readStringArray(payload.lines);
|
|
@@ -3894,7 +3904,7 @@ function updatePlayLiveStatusState(state, event) {
|
|
|
3894
3904
|
return null;
|
|
3895
3905
|
}
|
|
3896
3906
|
const runId = typeof payload.runId === "string" && payload.runId ? payload.runId : isPlayRunPackage(payload) ? payload.run.id : state.runId;
|
|
3897
|
-
const status =
|
|
3907
|
+
const status = playLiveRunStatus(event) ?? state.status;
|
|
3898
3908
|
const progressPayload = isRecord4(payload.progress) ? payload.progress : {};
|
|
3899
3909
|
if (event.type === "play.run.final_status" && state.logs.length === 0 && state.lastLogSeq === 0) {
|
|
3900
3910
|
const payloadLogs = readStringArray(payload.logs);
|
|
@@ -5052,13 +5062,6 @@ var DeeplineClient = class _DeeplineClient {
|
|
|
5052
5062
|
}
|
|
5053
5063
|
/** Poll snapshots to terminal status and return the durable package. */
|
|
5054
5064
|
async watchRunToTerminal(runId, options) {
|
|
5055
|
-
const state = {
|
|
5056
|
-
runId,
|
|
5057
|
-
status: "running",
|
|
5058
|
-
logs: [],
|
|
5059
|
-
lastLogSeq: 0,
|
|
5060
|
-
latest: null
|
|
5061
|
-
};
|
|
5062
5065
|
let terminalObserved = false;
|
|
5063
5066
|
for await (const event of this.watchRunEvents(runId, {
|
|
5064
5067
|
signal: options?.signal,
|
|
@@ -5066,19 +5069,17 @@ var DeeplineClient = class _DeeplineClient {
|
|
|
5066
5069
|
onRetry: options?.onRetry ?? options?.onReconnect
|
|
5067
5070
|
})) {
|
|
5068
5071
|
options?.onEvent?.(event);
|
|
5069
|
-
|
|
5070
|
-
if (status && TERMINAL_PLAY_STATUSES.has(status.status)) {
|
|
5072
|
+
if (isTerminalPlayRunLifecycleStatus(playLiveRunStatus(event))) {
|
|
5071
5073
|
terminalObserved = true;
|
|
5072
5074
|
}
|
|
5073
5075
|
}
|
|
5074
5076
|
if (options?.signal?.aborted) {
|
|
5075
5077
|
throw new DeeplineError("Run watch aborted.", void 0, "ABORTED");
|
|
5076
5078
|
}
|
|
5077
|
-
if (terminalObserved) {
|
|
5078
|
-
return await this.getRunStatus(runId);
|
|
5079
|
-
}
|
|
5080
5079
|
const refreshed = await this.getRunStatus(runId);
|
|
5081
|
-
if (
|
|
5080
|
+
if (terminalObserved || isTerminalPlayRunLifecycleStatus(refreshed.status)) {
|
|
5081
|
+
return refreshed;
|
|
5082
|
+
}
|
|
5082
5083
|
throw new DeeplineError(
|
|
5083
5084
|
`Run watch for ${runId} ended before a terminal status.`,
|
|
5084
5085
|
void 0,
|
|
@@ -5259,15 +5260,7 @@ var DeeplineClient = class _DeeplineClient {
|
|
|
5259
5260
|
`/api/v2/runs/${encodeURIComponent(runId)}${query}`,
|
|
5260
5261
|
{ headers: { "x-deepline-run-status": "1" } }
|
|
5261
5262
|
);
|
|
5262
|
-
const responseRunStatus = isPlayRunPackage(response) ? response.runStatus : isPlayRunPackage(response.package) ? response.package.runStatus : response.runStatus;
|
|
5263
|
-
const responseOverview = isPlayRunPackage(response) ? response.overview : isPlayRunPackage(response.package) ? response.package.overview : response.overview;
|
|
5264
5263
|
const status = normalizePlayStatus(response);
|
|
5265
|
-
if (isRecord4(responseRunStatus)) {
|
|
5266
|
-
status.runStatus = responseRunStatus;
|
|
5267
|
-
}
|
|
5268
|
-
if (isRecord4(responseOverview)) {
|
|
5269
|
-
status.overview = responseOverview;
|
|
5270
|
-
}
|
|
5271
5264
|
if (options?.failedLogs !== true || status.status !== "failed") {
|
|
5272
5265
|
return status;
|
|
5273
5266
|
}
|
|
@@ -6245,7 +6238,7 @@ var DeeplineClient = class _DeeplineClient {
|
|
|
6245
6238
|
if (event.type !== "play.run.status" || status.status !== previousStatus) {
|
|
6246
6239
|
options?.onProgress?.(status);
|
|
6247
6240
|
}
|
|
6248
|
-
if (
|
|
6241
|
+
if (isTerminalPlayRunLifecycleStatus(status.status)) {
|
|
6249
6242
|
terminalObserved = status;
|
|
6250
6243
|
}
|
|
6251
6244
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1190,7 +1190,7 @@ var SDK_RELEASE = {
|
|
|
1190
1190
|
// getters keep their established compatibility behavior.
|
|
1191
1191
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
1192
1192
|
// 0.3.90 is the first deliberately versioned SDK release for API v3.
|
|
1193
|
-
version: "0.3.
|
|
1193
|
+
version: "0.3.247",
|
|
1194
1194
|
updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.",
|
|
1195
1195
|
packageCapabilities: {
|
|
1196
1196
|
updatePreferences: 1
|
|
@@ -1496,6 +1496,7 @@ var COORDINATOR_URL_OVERRIDE_HEADER = "x-deepline-coordinator-url";
|
|
|
1496
1496
|
var WORKER_CALLBACK_URL_OVERRIDE_HEADER = "x-deepline-worker-callback-url";
|
|
1497
1497
|
var RUNTIME_SCHEDULER_SCHEMA_OVERRIDE_HEADER = "x-deepline-runtime-scheduler-schema";
|
|
1498
1498
|
var RUNTIME_ENVIRONMENT_TOKEN_HEADER = "x-deepline-runtime-environment-token";
|
|
1499
|
+
var RETAINED_PIPELINE_RECEIVERS_HEADER = "x-deepline-retained-pipeline-receivers";
|
|
1499
1500
|
var ABSURD_RELEASE_OVERRIDE_HEADER = "x-deepline-absurd-release";
|
|
1500
1501
|
var PREFERRED_RECEIPT_GATEWAY_MACHINE_ID_HEADER = "x-deepline-preferred-receipt-gateway-machine-id";
|
|
1501
1502
|
var SYNTHETIC_RUN_HEADER = "x-deepline-synthetic-run";
|
|
@@ -1915,6 +1916,11 @@ var HttpClient = class {
|
|
|
1915
1916
|
if (runtimeTestFault?.trim()) {
|
|
1916
1917
|
headers[PLAY_RUNTIME_TEST_FAULT_HEADER] = runtimeTestFault.trim();
|
|
1917
1918
|
}
|
|
1919
|
+
const retainedReceivers = typeof process !== "undefined" ? process.env?.DEEPLINE_RUNTIME_RETAINED_PIPELINE_RECEIVERS?.trim() : void 0;
|
|
1920
|
+
if (retainedReceivers && coordinatorInternalToken?.trim()) {
|
|
1921
|
+
headers[RETAINED_PIPELINE_RECEIVERS_HEADER] = retainedReceivers;
|
|
1922
|
+
headers[COORDINATOR_INTERNAL_TOKEN_HEADER] = coordinatorInternalToken.trim();
|
|
1923
|
+
}
|
|
1918
1924
|
if (absurdReleaseOverride?.trim() && coordinatorInternalToken?.trim()) {
|
|
1919
1925
|
headers[ABSURD_RELEASE_OVERRIDE_HEADER] = absurdReleaseOverride.trim();
|
|
1920
1926
|
}
|
|
@@ -3124,7 +3130,7 @@ function diffPlayRunStreamEvents(input) {
|
|
|
3124
3130
|
return { events, next };
|
|
3125
3131
|
}
|
|
3126
3132
|
|
|
3127
|
-
// src/
|
|
3133
|
+
// src/runs/read-errors.ts
|
|
3128
3134
|
function isTransientPlayRunReadError(error) {
|
|
3129
3135
|
if (error instanceof DeeplineError && error.code === "PLAY_STREAM_NETWORK_ABORTED") {
|
|
3130
3136
|
return true;
|
|
@@ -3392,7 +3398,6 @@ function parseNotificationGroupTarget(value) {
|
|
|
3392
3398
|
function notificationObjectKey(kind) {
|
|
3393
3399
|
return `${kind}.${globalThis.crypto.randomUUID()}`;
|
|
3394
3400
|
}
|
|
3395
|
-
var TERMINAL_PLAY_STATUSES = /* @__PURE__ */ new Set(["completed", "failed", "cancelled"]);
|
|
3396
3401
|
var MONITOR_NON_RETRYABLE_MUTATION_OPTIONS = {
|
|
3397
3402
|
maxRetries: 0,
|
|
3398
3403
|
exactUrlOnly: true
|
|
@@ -3499,7 +3504,11 @@ function runtimeSelectionHeaders(runtime) {
|
|
|
3499
3504
|
"RUNTIME_ENVIRONMENT_TOKEN_REQUIRED"
|
|
3500
3505
|
);
|
|
3501
3506
|
}
|
|
3502
|
-
|
|
3507
|
+
const receivers = process.env.DEEPLINE_RUNTIME_RETAINED_PIPELINE_RECEIVERS?.trim();
|
|
3508
|
+
return {
|
|
3509
|
+
[RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
|
|
3510
|
+
...receivers ? { [RETAINED_PIPELINE_RECEIVERS_HEADER]: receivers } : {}
|
|
3511
|
+
};
|
|
3503
3512
|
}
|
|
3504
3513
|
function normalizeTestPolicyOverrides(value, source) {
|
|
3505
3514
|
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
@@ -3683,7 +3692,7 @@ function normalizePlayRunStart(raw) {
|
|
|
3683
3692
|
name: runPackage.run.playName,
|
|
3684
3693
|
status,
|
|
3685
3694
|
...runPackage.run.dashboardUrl ? { dashboardUrl: runPackage.run.dashboardUrl } : {},
|
|
3686
|
-
...
|
|
3695
|
+
...isTerminalPlayRunLifecycleStatus(status) ? { finalStatus: runPackage } : {},
|
|
3687
3696
|
package: runPackage
|
|
3688
3697
|
};
|
|
3689
3698
|
}
|
|
@@ -3761,11 +3770,12 @@ function readStringArray(value) {
|
|
|
3761
3770
|
function getPlayLiveEventPayload(event) {
|
|
3762
3771
|
return event.payload && typeof event.payload === "object" ? event.payload : {};
|
|
3763
3772
|
}
|
|
3764
|
-
function
|
|
3765
|
-
if (
|
|
3766
|
-
return
|
|
3773
|
+
function playLiveRunStatus(event) {
|
|
3774
|
+
if (event.type !== "play.run.snapshot" && event.type !== "play.run.status" && event.type !== "play.run.final_status") {
|
|
3775
|
+
return null;
|
|
3767
3776
|
}
|
|
3768
|
-
|
|
3777
|
+
const payload = getPlayLiveEventPayload(event);
|
|
3778
|
+
return decodePlayRunPublicStatus(payload.status) ?? (isPlayRunPackage(payload) ? decodePlayRunPublicStatus(payload.run.status) : null);
|
|
3769
3779
|
}
|
|
3770
3780
|
function appendPlayLiveLogLines(state, payload) {
|
|
3771
3781
|
const lines = readStringArray(payload.lines);
|
|
@@ -3798,7 +3808,7 @@ function updatePlayLiveStatusState(state, event) {
|
|
|
3798
3808
|
return null;
|
|
3799
3809
|
}
|
|
3800
3810
|
const runId = typeof payload.runId === "string" && payload.runId ? payload.runId : isPlayRunPackage(payload) ? payload.run.id : state.runId;
|
|
3801
|
-
const status =
|
|
3811
|
+
const status = playLiveRunStatus(event) ?? state.status;
|
|
3802
3812
|
const progressPayload = isRecord4(payload.progress) ? payload.progress : {};
|
|
3803
3813
|
if (event.type === "play.run.final_status" && state.logs.length === 0 && state.lastLogSeq === 0) {
|
|
3804
3814
|
const payloadLogs = readStringArray(payload.logs);
|
|
@@ -4956,13 +4966,6 @@ var DeeplineClient = class _DeeplineClient {
|
|
|
4956
4966
|
}
|
|
4957
4967
|
/** Poll snapshots to terminal status and return the durable package. */
|
|
4958
4968
|
async watchRunToTerminal(runId, options) {
|
|
4959
|
-
const state = {
|
|
4960
|
-
runId,
|
|
4961
|
-
status: "running",
|
|
4962
|
-
logs: [],
|
|
4963
|
-
lastLogSeq: 0,
|
|
4964
|
-
latest: null
|
|
4965
|
-
};
|
|
4966
4969
|
let terminalObserved = false;
|
|
4967
4970
|
for await (const event of this.watchRunEvents(runId, {
|
|
4968
4971
|
signal: options?.signal,
|
|
@@ -4970,19 +4973,17 @@ var DeeplineClient = class _DeeplineClient {
|
|
|
4970
4973
|
onRetry: options?.onRetry ?? options?.onReconnect
|
|
4971
4974
|
})) {
|
|
4972
4975
|
options?.onEvent?.(event);
|
|
4973
|
-
|
|
4974
|
-
if (status && TERMINAL_PLAY_STATUSES.has(status.status)) {
|
|
4976
|
+
if (isTerminalPlayRunLifecycleStatus(playLiveRunStatus(event))) {
|
|
4975
4977
|
terminalObserved = true;
|
|
4976
4978
|
}
|
|
4977
4979
|
}
|
|
4978
4980
|
if (options?.signal?.aborted) {
|
|
4979
4981
|
throw new DeeplineError("Run watch aborted.", void 0, "ABORTED");
|
|
4980
4982
|
}
|
|
4981
|
-
if (terminalObserved) {
|
|
4982
|
-
return await this.getRunStatus(runId);
|
|
4983
|
-
}
|
|
4984
4983
|
const refreshed = await this.getRunStatus(runId);
|
|
4985
|
-
if (
|
|
4984
|
+
if (terminalObserved || isTerminalPlayRunLifecycleStatus(refreshed.status)) {
|
|
4985
|
+
return refreshed;
|
|
4986
|
+
}
|
|
4986
4987
|
throw new DeeplineError(
|
|
4987
4988
|
`Run watch for ${runId} ended before a terminal status.`,
|
|
4988
4989
|
void 0,
|
|
@@ -5163,15 +5164,7 @@ var DeeplineClient = class _DeeplineClient {
|
|
|
5163
5164
|
`/api/v2/runs/${encodeURIComponent(runId)}${query}`,
|
|
5164
5165
|
{ headers: { "x-deepline-run-status": "1" } }
|
|
5165
5166
|
);
|
|
5166
|
-
const responseRunStatus = isPlayRunPackage(response) ? response.runStatus : isPlayRunPackage(response.package) ? response.package.runStatus : response.runStatus;
|
|
5167
|
-
const responseOverview = isPlayRunPackage(response) ? response.overview : isPlayRunPackage(response.package) ? response.package.overview : response.overview;
|
|
5168
5167
|
const status = normalizePlayStatus(response);
|
|
5169
|
-
if (isRecord4(responseRunStatus)) {
|
|
5170
|
-
status.runStatus = responseRunStatus;
|
|
5171
|
-
}
|
|
5172
|
-
if (isRecord4(responseOverview)) {
|
|
5173
|
-
status.overview = responseOverview;
|
|
5174
|
-
}
|
|
5175
5168
|
if (options?.failedLogs !== true || status.status !== "failed") {
|
|
5176
5169
|
return status;
|
|
5177
5170
|
}
|
|
@@ -6149,7 +6142,7 @@ var DeeplineClient = class _DeeplineClient {
|
|
|
6149
6142
|
if (event.type !== "play.run.status" || status.status !== previousStatus) {
|
|
6150
6143
|
options?.onProgress?.(status);
|
|
6151
6144
|
}
|
|
6152
|
-
if (
|
|
6145
|
+
if (isTerminalPlayRunLifecycleStatus(status.status)) {
|
|
6153
6146
|
terminalObserved = status;
|
|
6154
6147
|
}
|
|
6155
6148
|
}
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"dist/bundling-sources/sdk/src/plays/local-file-discovery.ts",
|
|
22
22
|
"dist/bundling-sources/sdk/src/release.ts",
|
|
23
23
|
"dist/bundling-sources/sdk/src/runs/observe-transport.ts",
|
|
24
|
+
"dist/bundling-sources/sdk/src/runs/read-errors.ts",
|
|
24
25
|
"dist/bundling-sources/sdk/src/runs/watch-polling.ts",
|
|
25
26
|
"dist/bundling-sources/sdk/src/skills-version.ts",
|
|
26
|
-
"dist/bundling-sources/sdk/src/stream-reconnect.ts",
|
|
27
27
|
"dist/bundling-sources/sdk/src/tool-calls.ts",
|
|
28
28
|
"dist/bundling-sources/sdk/src/tool-output.ts",
|
|
29
29
|
"dist/bundling-sources/sdk/src/types.ts",
|
package/dist/release.d.mts
CHANGED
|
@@ -149,7 +149,7 @@ type SdkRelease = {
|
|
|
149
149
|
supportPolicy: SdkSupportPolicy;
|
|
150
150
|
};
|
|
151
151
|
declare const SDK_RELEASE: {
|
|
152
|
-
readonly version: "0.3.
|
|
152
|
+
readonly version: "0.3.247";
|
|
153
153
|
readonly updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.";
|
|
154
154
|
readonly packageCapabilities: {
|
|
155
155
|
readonly updatePreferences: 1;
|
package/dist/release.d.ts
CHANGED
|
@@ -149,7 +149,7 @@ type SdkRelease = {
|
|
|
149
149
|
supportPolicy: SdkSupportPolicy;
|
|
150
150
|
};
|
|
151
151
|
declare const SDK_RELEASE: {
|
|
152
|
-
readonly version: "0.3.
|
|
152
|
+
readonly version: "0.3.247";
|
|
153
153
|
readonly updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.";
|
|
154
154
|
readonly packageCapabilities: {
|
|
155
155
|
readonly updatePreferences: 1;
|
package/dist/release.js
CHANGED
|
@@ -74,7 +74,7 @@ var SDK_RELEASE = {
|
|
|
74
74
|
// getters keep their established compatibility behavior.
|
|
75
75
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
76
76
|
// 0.3.90 is the first deliberately versioned SDK release for API v3.
|
|
77
|
-
version: "0.3.
|
|
77
|
+
version: "0.3.247",
|
|
78
78
|
updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.",
|
|
79
79
|
packageCapabilities: {
|
|
80
80
|
updatePreferences: 1
|
package/dist/release.mjs
CHANGED
|
@@ -48,7 +48,7 @@ var SDK_RELEASE = {
|
|
|
48
48
|
// getters keep their established compatibility behavior.
|
|
49
49
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
50
50
|
// 0.3.90 is the first deliberately versioned SDK release for API v3.
|
|
51
|
-
version: "0.3.
|
|
51
|
+
version: "0.3.247",
|
|
52
52
|
updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.",
|
|
53
53
|
packageCapabilities: {
|
|
54
54
|
updatePreferences: 1
|
package/package.json
CHANGED
|
@@ -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;
|