deepline 0.3.259 → 0.3.260

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.
@@ -200,7 +200,7 @@ export const SDK_RELEASE = {
200
200
  // getters keep their established compatibility behavior.
201
201
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
202
202
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
203
- version: '0.3.259',
203
+ version: '0.3.260',
204
204
  updateSummary:
205
205
  '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.',
206
206
  packageCapabilities: {
@@ -0,0 +1,95 @@
1
+ import { createHash } from 'node:crypto';
2
+
3
+ type CrashFrame = {
4
+ source: string;
5
+ sourceFingerprint?: string;
6
+ line: number;
7
+ column: number;
8
+ };
9
+
10
+ /** Fixed-shape diagnostics: never include customer exception text or source. */
11
+ export type DaytonaCrashDetails = {
12
+ errorName: string;
13
+ nodeErrorCode: string | null;
14
+ message: string | null;
15
+ firstFrame: CrashFrame | null;
16
+ lastFrame: CrashFrame | null;
17
+ frameCount: number;
18
+ fingerprint: string;
19
+ };
20
+
21
+ const SAFE_RUNTIME_MESSAGES = new Set([
22
+ 'Maximum call stack size exceeded',
23
+ 'Invalid array length',
24
+ 'Invalid string length',
25
+ 'Invalid time value',
26
+ 'Array buffer allocation failed',
27
+ 'WebAssembly.Memory(): could not allocate memory',
28
+ ]);
29
+
30
+ function frameLocation(line: string): CrashFrame | null {
31
+ // Only Node stack frames, never arbitrary output lines containing a path.
32
+ if (!/^\s*at\s+/.test(line)) return null;
33
+ const match = line.match(
34
+ /(?:\(|\s)((?:node:|\/|file:\/\/)[^\s()]+):(\d+):(\d+)\)?$/,
35
+ );
36
+ if (!match) return null;
37
+ const [, path, lineText, columnText] = match;
38
+ const lineNumber = Number(lineText);
39
+ const column = Number(columnText);
40
+ if (!Number.isSafeInteger(lineNumber) || !Number.isSafeInteger(column))
41
+ return null;
42
+ if (/^node:[a-z_/-]{1,160}$/.test(path!)) {
43
+ return { source: path!, line: lineNumber, column };
44
+ }
45
+ if (
46
+ /^\/home\/daytona\/deepline-play-runner-[a-zA-Z0-9-]+\.cjs$/.test(path!)
47
+ ) {
48
+ return { source: 'runner-bundle', line: lineNumber, column };
49
+ }
50
+ // Source maps can contain user names, emails and private checkout paths.
51
+ // A digest can be matched against the pinned artifact without logging them.
52
+ return {
53
+ source: 'mapped-source',
54
+ sourceFingerprint: `sha256_${createHash('sha256').update(path!).digest('hex')}`,
55
+ line: lineNumber,
56
+ column,
57
+ };
58
+ }
59
+
60
+ export function extractDaytonaCrashDetails(
61
+ outputTail: string,
62
+ ): DaytonaCrashDetails | null {
63
+ let details: Omit<DaytonaCrashDetails, 'fingerprint'> | null = null;
64
+ let fingerprint = createHash('sha256');
65
+ for (const line of outputTail.split(/\r?\n/)) {
66
+ // A result envelope or JSON row must never become exception evidence.
67
+ if (/^\s*[\[{]/.test(line)) continue;
68
+ const header = line.match(
69
+ /^((?:Type|Range|Reference|Syntax|Aggregate|Eval|URI)?Error)(?: \[(ERR_[A-Z0-9_]{1,64})\])?:\s*(.*)$/,
70
+ );
71
+ if (header) {
72
+ const message = SAFE_RUNTIME_MESSAGES.has(header[3]!) ? header[3]! : null;
73
+ details = {
74
+ errorName: header[1]!,
75
+ nodeErrorCode: header[2] ?? null,
76
+ message,
77
+ firstFrame: null,
78
+ lastFrame: null,
79
+ frameCount: 0,
80
+ };
81
+ fingerprint = createHash('sha256').update(JSON.stringify(details));
82
+ continue;
83
+ }
84
+ if (!details) continue;
85
+ const frame = frameLocation(line);
86
+ if (!frame) continue;
87
+ details.firstFrame ??= frame;
88
+ details.lastFrame = frame;
89
+ details.frameCount += 1;
90
+ fingerprint.update(JSON.stringify(frame));
91
+ }
92
+ return details
93
+ ? { ...details, fingerprint: `sha256_${fingerprint.digest('hex')}` }
94
+ : null;
95
+ }
@@ -56,6 +56,10 @@ import {
56
56
  import { RUNTIME_RELIABILITY_POLICY } from '../../runtime-reliability-policy';
57
57
  import { daytonaSandboxStartAdmission } from './daytona-start-admission';
58
58
  import { RUNNER_MEMORY_CGROUP_ROOT } from './daytona-runtime-watchdog';
59
+ import {
60
+ extractDaytonaCrashDetails,
61
+ type DaytonaCrashDetails,
62
+ } from './daytona-crash-details';
59
63
 
60
64
  const DAYTONA_COMMAND_RECOVERY_POLL_MS =
61
65
  RUNTIME_RELIABILITY_POLICY.sandbox.daytonaCommandRecoveryPollMs;
@@ -110,6 +114,7 @@ export type DaytonaCrashDiagnostic = {
110
114
  tailBytes: number;
111
115
  tailTruncated: boolean;
112
116
  signals: string[];
117
+ details?: DaytonaCrashDetails | null;
113
118
  unclassifiedLineCount: number;
114
119
  termination: DaytonaTerminationDiagnostic | null;
115
120
  resourceSnapshot?: DaytonaCrashResourceSnapshot | null;
@@ -414,6 +419,7 @@ function daytonaCrashDiagnosticSignature(line: string): string | null {
414
419
  export function extractDaytonaCrashDiagnosticSignals(outputTail: string): {
415
420
  signals: string[];
416
421
  unclassifiedLineCount: number;
422
+ details: DaytonaCrashDetails | null;
417
423
  } {
418
424
  const candidates: string[] = [];
419
425
  let unclassifiedLineCount = 0;
@@ -446,7 +452,11 @@ export function extractDaytonaCrashDiagnosticSignals(outputTail: string): {
446
452
  signals.push(line);
447
453
  retainedBytes += lineBytes + (signals.length > 1 ? 1 : 0);
448
454
  }
449
- return { signals, unclassifiedLineCount };
455
+ return {
456
+ signals,
457
+ unclassifiedLineCount,
458
+ details: extractDaytonaCrashDetails(outputTail),
459
+ };
450
460
  }
451
461
 
452
462
  export function buildDaytonaCrashDiagnosticSnapshotSource(): string {
@@ -728,7 +738,7 @@ export async function readDetachedDaytonaCrashDiagnostic(input: {
728
738
  Number.isFinite(snapshot.outputBytes)
729
739
  ? snapshot.outputBytes
730
740
  : null;
731
- const { signals, unclassifiedLineCount } =
741
+ const { signals, unclassifiedLineCount, details } =
732
742
  extractDaytonaCrashDiagnosticSignals(tail);
733
743
  const sessionExitCode =
734
744
  sessionResult.status === 'fulfilled' &&
@@ -774,6 +784,7 @@ export async function readDetachedDaytonaCrashDiagnostic(input: {
774
784
  outputBytes !== null &&
775
785
  outputBytes > DAYTONA_CRASH_DIAGNOSTIC_TAIL_MAX_BYTES,
776
786
  signals,
787
+ details,
777
788
  unclassifiedLineCount,
778
789
  termination,
779
790
  resourceSnapshot,
package/dist/cli/index.js CHANGED
@@ -3512,7 +3512,7 @@ var SDK_RELEASE = {
3512
3512
  // getters keep their established compatibility behavior.
3513
3513
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
3514
3514
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
3515
- version: "0.3.259",
3515
+ version: "0.3.260",
3516
3516
  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.",
3517
3517
  packageCapabilities: {
3518
3518
  updatePreferences: 1
@@ -3507,7 +3507,7 @@ var SDK_RELEASE = {
3507
3507
  // getters keep their established compatibility behavior.
3508
3508
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
3509
3509
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
3510
- version: "0.3.259",
3510
+ version: "0.3.260",
3511
3511
  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.",
3512
3512
  packageCapabilities: {
3513
3513
  updatePreferences: 1
package/dist/index.js CHANGED
@@ -1325,7 +1325,7 @@ var SDK_RELEASE = {
1325
1325
  // getters keep their established compatibility behavior.
1326
1326
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
1327
1327
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
1328
- version: "0.3.259",
1328
+ version: "0.3.260",
1329
1329
  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.",
1330
1330
  packageCapabilities: {
1331
1331
  updatePreferences: 1
package/dist/index.mjs CHANGED
@@ -1229,7 +1229,7 @@ var SDK_RELEASE = {
1229
1229
  // getters keep their established compatibility behavior.
1230
1230
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
1231
1231
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
1232
- version: "0.3.259",
1232
+ version: "0.3.260",
1233
1233
  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.",
1234
1234
  packageCapabilities: {
1235
1235
  updatePreferences: 1
@@ -327,6 +327,7 @@
327
327
  "dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-sheet-persistence-retry.ts",
328
328
  "dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-terminal-push.ts",
329
329
  "dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-control-transport.ts",
330
+ "dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-crash-details.ts",
330
331
  "dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-labels.ts",
331
332
  "dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-launch-transport.ts",
332
333
  "dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts",
@@ -149,7 +149,7 @@ type SdkRelease = {
149
149
  supportPolicy: SdkSupportPolicy;
150
150
  };
151
151
  declare const SDK_RELEASE: {
152
- readonly version: "0.3.259";
152
+ readonly version: "0.3.260";
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.259";
152
+ readonly version: "0.3.260";
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.259",
77
+ version: "0.3.260",
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.259",
51
+ version: "0.3.260",
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,6 +1,6 @@
1
1
  {
2
2
  "name": "deepline",
3
- "version": "0.3.259",
3
+ "version": "0.3.260",
4
4
  "description": "GTM data CLI and TypeScript SDK for coding agents",
5
5
  "license": "MIT",
6
6
  "homepage": "https://code.deepline.com",