deepline 0.1.262 → 0.1.263

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.
@@ -123,7 +123,7 @@ export const SDK_RELEASE = {
123
123
  // Deepline-native radars. Older clients must update before discovering,
124
124
  // checking, or deploying an unlaunched monitor integration.
125
125
  // 0.1.253 makes play-page browser opening opt-in and retires --no-open.
126
- version: '0.1.262',
126
+ version: '0.1.263',
127
127
  apiContract: '2026-07-native-monitor-launch-hard-cutover',
128
128
  supportPolicy: {
129
129
  minimumSupported: '0.1.53',
@@ -1,5 +1,6 @@
1
1
  import { isHardBillingToolHttpError } from './tool-http-errors';
2
2
  import { isRuntimePersistenceCircuitOpenError } from './persistence-latch';
3
+ import { isWorkspaceStorageNotReadyFailure } from './run-failure';
3
4
 
4
5
  /**
5
6
  * Thrown by runner Adapters when a Play Run is externally cancelled. Row
@@ -41,6 +42,7 @@ export function isRowIsolationExemptError(error: unknown): boolean {
41
42
  if (isRuntimeReceiptPersistenceError(error)) return true;
42
43
  if (isRuntimeStoragePersistenceError(error)) return true;
43
44
  if (isRuntimePersistenceCircuitOpenError(error)) return true;
45
+ if (isWorkspaceStorageNotReadyFailure(error)) return true;
44
46
  return isHardBillingToolHttpError(error);
45
47
  }
46
48
 
@@ -59,6 +59,24 @@ export class WorkspaceStorageNotReadyError extends Error {
59
59
  }
60
60
  }
61
61
 
62
+ export function isWorkspaceStorageNotReadyFailure(error: unknown): boolean {
63
+ if (error instanceof WorkspaceStorageNotReadyError) return true;
64
+ if (!error) return false;
65
+ if (typeof error === 'object') {
66
+ const code = (error as { code?: unknown }).code;
67
+ if (code === WORKSPACE_STORAGE_NOT_READY_CODE) return true;
68
+ const nestedErrors = (error as { errors?: unknown }).errors;
69
+ if (
70
+ Array.isArray(nestedErrors) &&
71
+ nestedErrors.some(isWorkspaceStorageNotReadyFailure)
72
+ ) {
73
+ return true;
74
+ }
75
+ }
76
+ const message = error instanceof Error ? error.message : String(error);
77
+ return /\bWORKSPACE_STORAGE_NOT_READY\b/.test(message);
78
+ }
79
+
62
80
  export const PROVIDER_EXHAUSTED_CODE = 'PROVIDER_EXHAUSTED';
63
81
 
64
82
  /**
@@ -331,7 +349,7 @@ export function normalizePlayRunFailure(error: unknown): PlayRunFailureDetails {
331
349
  };
332
350
  }
333
351
  if (
334
- error instanceof WorkspaceStorageNotReadyError ||
352
+ isWorkspaceStorageNotReadyFailure(error) ||
335
353
  /\bWORKSPACE_STORAGE_NOT_READY\b/.test(rawCause)
336
354
  ) {
337
355
  return {
@@ -490,6 +490,25 @@ function isRetryableDaytonaInfrastructureFailure(error: unknown): boolean {
490
490
  return DAYTONA_INFRASTRUCTURE_RETRY_PATTERN.test(message);
491
491
  }
492
492
 
493
+ function isRetryableUnstartedDaytonaRunner(
494
+ error: unknown,
495
+ ): error is DaytonaRunnerInitializationError {
496
+ if (!(error instanceof DaytonaRunnerInitializationError)) return false;
497
+ const diagnostic = error.startupDiagnostic;
498
+ // The sandbox runner cannot execute customer code until the worker observes
499
+ // its heartbeat, parks the scheduler attempt, and the gateway acknowledges
500
+ // that waiting state. If no heartbeat was observed and Daytona has no exit
501
+ // evidence, deleting this fenced sandbox and retrying once cannot duplicate
502
+ // customer side effects.
503
+ return (
504
+ diagnostic.commandFound &&
505
+ diagnostic.sessionFound &&
506
+ diagnostic.exitCode === null &&
507
+ diagnostic.exitCodeFile === null &&
508
+ !diagnostic.schedulerReadinessObserved
509
+ );
510
+ }
511
+
493
512
  function prepareDaytonaExecution(
494
513
  input: PlayRunnerPrepareInput,
495
514
  callbacks: Parameters<PlayRunnerBackend['execute']>[1],
@@ -930,14 +949,19 @@ export const daytonaPlayRunnerBackend: PlayRunnerBackend = {
930
949
  onCancel();
931
950
  throw new Error(DAYTONA_CANCELLED_ERROR);
932
951
  }
952
+ const retryReason = isRetryableUnstartedDaytonaRunner(error)
953
+ ? 'runner_startup_not_live'
954
+ : isRetryableDaytonaInfrastructureFailure(error)
955
+ ? 'daytona_infrastructure'
956
+ : null;
933
957
  if (
934
958
  executionAttempt < DAYTONA_INFRASTRUCTURE_MAX_ATTEMPTS &&
935
- isRetryableDaytonaInfrastructureFailure(error)
959
+ retryReason
936
960
  ) {
937
961
  emitDaytonaStage(callbacks, config.context, 'execute:retry', {
938
962
  sandboxId: sandboxForAttempt?.id ?? null,
939
963
  attempt: executionAttempt + 1,
940
- reason: 'daytona_infrastructure',
964
+ reason: retryReason,
941
965
  error: error instanceof Error ? error.message : String(error),
942
966
  elapsedMs: Date.now() - startedAt,
943
967
  });
package/dist/cli/index.js CHANGED
@@ -716,7 +716,7 @@ var SDK_RELEASE = {
716
716
  // Deepline-native radars. Older clients must update before discovering,
717
717
  // checking, or deploying an unlaunched monitor integration.
718
718
  // 0.1.253 makes play-page browser opening opt-in and retires --no-open.
719
- version: "0.1.262",
719
+ version: "0.1.263",
720
720
  apiContract: "2026-07-native-monitor-launch-hard-cutover",
721
721
  supportPolicy: {
722
722
  minimumSupported: "0.1.53",
@@ -12465,13 +12465,21 @@ function getStatusFromLiveEvent(event) {
12465
12465
  const payload = getEventPayload(event);
12466
12466
  return playStatusValue(payload.status) ?? playStatusValue(getRunRecordFromPackage(payload)?.status);
12467
12467
  }
12468
+ function getWaitKindFromLiveEvent(event) {
12469
+ const payload = getEventPayload(event);
12470
+ const progress = payload.progress && typeof payload.progress === "object" ? payload.progress : null;
12471
+ const waitKind = payload.waitKind ?? progress?.waitKind;
12472
+ return typeof waitKind === "string" && waitKind.trim() ? waitKind.trim() : null;
12473
+ }
12468
12474
  function writePlayWaitingHint(input2) {
12469
12475
  if (getStatusFromLiveEvent(input2.event) !== "waiting") return;
12470
12476
  const runId = getRunIdFromLiveEvent(input2.event);
12471
12477
  if (!runId || input2.state.waitingRunId === runId) return;
12472
12478
  input2.state.waitingRunId = runId;
12479
+ const waitKind = getWaitKindFromLiveEvent(input2.event);
12480
+ const message = waitKind === "integration_event" || waitKind === "integration_event_batch" ? "is waiting for an external event." : waitKind === "sleep" ? "is waiting for its scheduled resume." : waitKind === "detached_runner" ? "is executing in the runtime." : "is waiting on a durable runtime boundary.";
12473
12481
  input2.progress.writeLine(
12474
- `[play waiting] ${runId} is waiting for an external approval or event. The command will continue watching; inspect it with 'deepline runs get ${runId} --full --json'.`
12482
+ `[play waiting] ${runId} ${message} The command will continue watching; inspect it with 'deepline runs get ${runId} --full --json'.`
12475
12483
  );
12476
12484
  }
12477
12485
  function getFinalStatusFromLiveEvent(event) {
@@ -12734,6 +12742,9 @@ function getRunningHeartbeatLine(input2) {
12734
12742
  return `queued ${target}: waiting for worker capacity`;
12735
12743
  }
12736
12744
  if (status === "waiting") {
12745
+ if (getWaitKindFromLiveEvent(input2.event) === "detached_runner") {
12746
+ return `running ${target}: executing in detached runtime`;
12747
+ }
12737
12748
  return `waiting ${target}: waiting on external work`;
12738
12749
  }
12739
12750
  return `running ${target}: still processing`;
@@ -701,7 +701,7 @@ var SDK_RELEASE = {
701
701
  // Deepline-native radars. Older clients must update before discovering,
702
702
  // checking, or deploying an unlaunched monitor integration.
703
703
  // 0.1.253 makes play-page browser opening opt-in and retires --no-open.
704
- version: "0.1.262",
704
+ version: "0.1.263",
705
705
  apiContract: "2026-07-native-monitor-launch-hard-cutover",
706
706
  supportPolicy: {
707
707
  minimumSupported: "0.1.53",
@@ -12494,13 +12494,21 @@ function getStatusFromLiveEvent(event) {
12494
12494
  const payload = getEventPayload(event);
12495
12495
  return playStatusValue(payload.status) ?? playStatusValue(getRunRecordFromPackage(payload)?.status);
12496
12496
  }
12497
+ function getWaitKindFromLiveEvent(event) {
12498
+ const payload = getEventPayload(event);
12499
+ const progress = payload.progress && typeof payload.progress === "object" ? payload.progress : null;
12500
+ const waitKind = payload.waitKind ?? progress?.waitKind;
12501
+ return typeof waitKind === "string" && waitKind.trim() ? waitKind.trim() : null;
12502
+ }
12497
12503
  function writePlayWaitingHint(input2) {
12498
12504
  if (getStatusFromLiveEvent(input2.event) !== "waiting") return;
12499
12505
  const runId = getRunIdFromLiveEvent(input2.event);
12500
12506
  if (!runId || input2.state.waitingRunId === runId) return;
12501
12507
  input2.state.waitingRunId = runId;
12508
+ const waitKind = getWaitKindFromLiveEvent(input2.event);
12509
+ const message = waitKind === "integration_event" || waitKind === "integration_event_batch" ? "is waiting for an external event." : waitKind === "sleep" ? "is waiting for its scheduled resume." : waitKind === "detached_runner" ? "is executing in the runtime." : "is waiting on a durable runtime boundary.";
12502
12510
  input2.progress.writeLine(
12503
- `[play waiting] ${runId} is waiting for an external approval or event. The command will continue watching; inspect it with 'deepline runs get ${runId} --full --json'.`
12511
+ `[play waiting] ${runId} ${message} The command will continue watching; inspect it with 'deepline runs get ${runId} --full --json'.`
12504
12512
  );
12505
12513
  }
12506
12514
  function getFinalStatusFromLiveEvent(event) {
@@ -12763,6 +12771,9 @@ function getRunningHeartbeatLine(input2) {
12763
12771
  return `queued ${target}: waiting for worker capacity`;
12764
12772
  }
12765
12773
  if (status === "waiting") {
12774
+ if (getWaitKindFromLiveEvent(input2.event) === "detached_runner") {
12775
+ return `running ${target}: executing in detached runtime`;
12776
+ }
12766
12777
  return `waiting ${target}: waiting on external work`;
12767
12778
  }
12768
12779
  return `running ${target}: still processing`;
package/dist/index.js CHANGED
@@ -435,7 +435,7 @@ var SDK_RELEASE = {
435
435
  // Deepline-native radars. Older clients must update before discovering,
436
436
  // checking, or deploying an unlaunched monitor integration.
437
437
  // 0.1.253 makes play-page browser opening opt-in and retires --no-open.
438
- version: "0.1.262",
438
+ version: "0.1.263",
439
439
  apiContract: "2026-07-native-monitor-launch-hard-cutover",
440
440
  supportPolicy: {
441
441
  minimumSupported: "0.1.53",
package/dist/index.mjs CHANGED
@@ -365,7 +365,7 @@ var SDK_RELEASE = {
365
365
  // Deepline-native radars. Older clients must update before discovering,
366
366
  // checking, or deploying an unlaunched monitor integration.
367
367
  // 0.1.253 makes play-page browser opening opt-in and retires --no-open.
368
- version: "0.1.262",
368
+ version: "0.1.263",
369
369
  apiContract: "2026-07-native-monitor-launch-hard-cutover",
370
370
  supportPolicy: {
371
371
  minimumSupported: "0.1.53",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepline",
3
- "version": "0.1.262",
3
+ "version": "0.1.263",
4
4
  "description": "Deepline SDK + CLI — B2B data enrichment powered by durable cloud execution",
5
5
  "license": "MIT",
6
6
  "repository": {