deepline 0.3.283 → 0.3.284

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.283',
203
+ version: '0.3.284',
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: {
@@ -6,6 +6,7 @@ type SecretRedactionOptions = {
6
6
  keyPolicy?: 'strict' | 'public-result';
7
7
  /** Replace sample cursor values with a non-capability-bearing placeholder. */
8
8
  placeholderContinuationValues?: boolean;
9
+ redactJsonStrings?: boolean;
9
10
  };
10
11
 
11
12
  const SENSITIVE_KEY_PATTERNS = [
@@ -399,12 +400,83 @@ function maybeRedactString(value: string, options: SecretRedactionOptions) {
399
400
  : redacted.replace(HIGH_ENTROPY_VALUE_PATTERN, REDACTED_VALUE);
400
401
  }
401
402
 
403
+ function parseJsonContainerText(value: unknown): unknown {
404
+ if (typeof value !== 'string') return value;
405
+ const trimmed = value.trim();
406
+ if (!trimmed.startsWith('{') && !trimmed.startsWith('[')) return value;
407
+ try {
408
+ return JSON.parse(value);
409
+ } catch {
410
+ return value;
411
+ }
412
+ }
413
+
414
+ function jsonStringContainsSecrets(
415
+ value: string,
416
+ options: SecretRedactionOptions,
417
+ parentKey?: string,
418
+ path: readonly string[] = [],
419
+ ): boolean {
420
+ // Inspect parsed values, but never reserialize SQL text and round its numeric literals.
421
+ const parsed = parseJsonContainerText(value);
422
+ if (!parsed || typeof parsed !== 'object') return false;
423
+ const pending = [
424
+ {
425
+ value: parsed,
426
+ parentKey,
427
+ path: [...path],
428
+ },
429
+ ];
430
+ const textOptions = { ...options, redactJsonStrings: false };
431
+ while (pending.length > 0) {
432
+ const current = pending.pop()!;
433
+ const sourceIsArray = Array.isArray(current.value);
434
+ for (const [key, rawItem] of Object.entries(current.value)) {
435
+ const item = parseJsonContainerText(rawItem);
436
+ const parentKey = sourceIsArray ? current.parentKey : key;
437
+ if (
438
+ !sourceIsArray &&
439
+ options.keyPolicy === 'public-result' &&
440
+ isPublicResultSafeTokenKey(key, current.path, item) &&
441
+ (!item || typeof item !== 'object')
442
+ ) {
443
+ if (
444
+ typeof item === 'string' &&
445
+ maybeRedactString(item, textOptions) !== item
446
+ )
447
+ return true;
448
+ continue;
449
+ }
450
+ if (!sourceIsArray && shouldRedactKey(key)) return true;
451
+ if (item && typeof item === 'object') {
452
+ pending.push({
453
+ value: item,
454
+ parentKey,
455
+ path: sourceIsArray ? current.path : [...current.path, key],
456
+ });
457
+ } else if (
458
+ typeof item === 'string' &&
459
+ redactSecretsInValue(item, parentKey, textOptions) !== item
460
+ ) {
461
+ return true;
462
+ }
463
+ }
464
+ }
465
+ return false;
466
+ }
467
+
402
468
  export function redactSecretsInValue<T>(
403
469
  value: T,
404
470
  parentKey?: string,
405
471
  options: SecretRedactionOptions = {},
406
472
  ): T {
407
473
  if (typeof value === 'string') {
474
+ if (
475
+ options.redactJsonStrings &&
476
+ jsonStringContainsSecrets(value, options, parentKey)
477
+ ) {
478
+ return REDACTED_VALUE as T;
479
+ }
408
480
  if (hasExplicitSecretValue(value, options)) {
409
481
  return REDACTED_VALUE as T;
410
482
  }
@@ -447,8 +519,15 @@ export function redactSecretsInValue<T>(
447
519
  const redactNestedValue = (
448
520
  item: unknown,
449
521
  itemParentKey: string | undefined,
522
+ path: readonly string[],
450
523
  ): unknown => {
451
524
  if (typeof item !== 'string') return item;
525
+ if (
526
+ options.redactJsonStrings &&
527
+ jsonStringContainsSecrets(item, options, itemParentKey, path)
528
+ ) {
529
+ return REDACTED_VALUE;
530
+ }
452
531
  if (hasExplicitSecretValue(item, options)) {
453
532
  return REDACTED_VALUE;
454
533
  }
@@ -473,7 +552,15 @@ export function redactSecretsInValue<T>(
473
552
  (!item || typeof item !== 'object')
474
553
  ) {
475
554
  const redacted =
476
- typeof item === 'string' ? maybeRedactString(item, options) : item;
555
+ typeof item === 'string'
556
+ ? options.redactJsonStrings &&
557
+ jsonStringContainsSecrets(item, options, itemParentKey, [
558
+ ...current.path,
559
+ key,
560
+ ])
561
+ ? REDACTED_VALUE
562
+ : maybeRedactString(item, options)
563
+ : item;
477
564
  (current.target as Record<string, unknown>)[key] =
478
565
  options.placeholderContinuationValues &&
479
566
  isPublicResultCursorKey(key, current.path) &&
@@ -502,6 +589,7 @@ export function redactSecretsInValue<T>(
502
589
  (current.target as Record<string, unknown>)[key] = redactNestedValue(
503
590
  item,
504
591
  itemParentKey,
592
+ sourceIsArray ? current.path : [...current.path, key],
505
593
  );
506
594
  }
507
595
  }
package/dist/cli/index.js CHANGED
@@ -3515,7 +3515,7 @@ var SDK_RELEASE = {
3515
3515
  // getters keep their established compatibility behavior.
3516
3516
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
3517
3517
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
3518
- version: "0.3.283",
3518
+ version: "0.3.284",
3519
3519
  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.",
3520
3520
  packageCapabilities: {
3521
3521
  updatePreferences: 1
@@ -3510,7 +3510,7 @@ var SDK_RELEASE = {
3510
3510
  // getters keep their established compatibility behavior.
3511
3511
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
3512
3512
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
3513
- version: "0.3.283",
3513
+ version: "0.3.284",
3514
3514
  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.",
3515
3515
  packageCapabilities: {
3516
3516
  updatePreferences: 1
package/dist/index.js CHANGED
@@ -1328,7 +1328,7 @@ var SDK_RELEASE = {
1328
1328
  // getters keep their established compatibility behavior.
1329
1329
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
1330
1330
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
1331
- version: "0.3.283",
1331
+ version: "0.3.284",
1332
1332
  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.",
1333
1333
  packageCapabilities: {
1334
1334
  updatePreferences: 1
package/dist/index.mjs CHANGED
@@ -1232,7 +1232,7 @@ var SDK_RELEASE = {
1232
1232
  // getters keep their established compatibility behavior.
1233
1233
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
1234
1234
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
1235
- version: "0.3.283",
1235
+ version: "0.3.284",
1236
1236
  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.",
1237
1237
  packageCapabilities: {
1238
1238
  updatePreferences: 1
@@ -149,7 +149,7 @@ type SdkRelease = {
149
149
  supportPolicy: SdkSupportPolicy;
150
150
  };
151
151
  declare const SDK_RELEASE: {
152
- readonly version: "0.3.283";
152
+ readonly version: "0.3.284";
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.283";
152
+ readonly version: "0.3.284";
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.283",
77
+ version: "0.3.284",
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.283",
51
+ version: "0.3.284",
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.283",
3
+ "version": "0.3.284",
4
4
  "description": "GTM data CLI and TypeScript SDK for coding agents",
5
5
  "license": "MIT",
6
6
  "homepage": "https://code.deepline.com",