unpeek 2.0.0 → 3.0.0

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.
Files changed (103) hide show
  1. package/README.md +30 -8
  2. package/README.tr.md +30 -8
  3. package/dist/adapters/esbuild.cjs +13 -0
  4. package/dist/{esbuild.d.cts → adapters/esbuild.d.cts} +2 -2
  5. package/dist/{esbuild.d.ts → adapters/esbuild.d.ts} +2 -2
  6. package/dist/adapters/esbuild.js +11 -0
  7. package/dist/adapters/next/adapter.cjs +42 -0
  8. package/dist/{next → adapters/next}/adapter.d.cts +4 -4
  9. package/dist/{next → adapters/next}/adapter.d.ts +4 -4
  10. package/dist/adapters/next/adapter.js +42 -0
  11. package/dist/adapters/next/index.cjs +15 -0
  12. package/dist/adapters/next/index.d.cts +53 -0
  13. package/dist/adapters/next/index.d.ts +53 -0
  14. package/dist/adapters/next/index.js +15 -0
  15. package/dist/adapters/rollup.cjs +13 -0
  16. package/dist/{rollup.d.cts → adapters/rollup.d.cts} +2 -2
  17. package/dist/{rollup.d.ts → adapters/rollup.d.ts} +2 -2
  18. package/dist/adapters/rollup.js +11 -0
  19. package/dist/adapters/rspack.cjs +12 -0
  20. package/dist/adapters/rspack.d.cts +13 -0
  21. package/dist/adapters/rspack.d.ts +11 -0
  22. package/dist/adapters/rspack.js +12 -0
  23. package/dist/adapters/vite.cjs +13 -0
  24. package/dist/{vite.d.cts → adapters/vite.d.cts} +2 -2
  25. package/dist/{vite.d.ts → adapters/vite.d.ts} +2 -2
  26. package/dist/adapters/vite.js +11 -0
  27. package/dist/adapters/webpack.cjs +13 -0
  28. package/dist/{webpack.d.cts → adapters/webpack.d.cts} +2 -2
  29. package/dist/{webpack.d.ts → adapters/webpack.d.ts} +2 -2
  30. package/dist/adapters/webpack.js +11 -0
  31. package/dist/browser.cjs +8 -5
  32. package/dist/browser.d.cts +41 -3
  33. package/dist/browser.d.ts +41 -3
  34. package/dist/browser.js +10 -7
  35. package/dist/{chunk-GAVI2C44.cjs → chunk-6TDCSIRZ.cjs} +76 -47
  36. package/dist/{chunk-5LCMI2TL.js → chunk-APWMNVAZ.js} +221 -32
  37. package/dist/{chunk-5QD6FZPB.js → chunk-BPRSCRUZ.js} +71 -42
  38. package/dist/{chunk-X5MKMFMX.js → chunk-DUK2SECY.js} +7 -7
  39. package/dist/chunk-FCF2EGPM.js +80 -0
  40. package/dist/{chunk-7YVEHJVM.cjs → chunk-I6GXEHFR.cjs} +241 -52
  41. package/dist/{chunk-LXP73HJC.cjs → chunk-IAD5DV3D.cjs} +1048 -213
  42. package/dist/chunk-IEBVL5BT.cjs +80 -0
  43. package/dist/{chunk-GZB7PFLY.js → chunk-IICVBTR2.js} +25 -62
  44. package/dist/{chunk-UMPUYLLZ.js → chunk-IZIWDJRF.js} +936 -101
  45. package/dist/chunk-L6BOM5VS.cjs +40 -0
  46. package/dist/{chunk-OOXSZTRV.js → chunk-LA6J3BT3.js} +26 -1
  47. package/dist/{chunk-24K5NDXH.cjs → chunk-ONM2CSTU.cjs} +45 -82
  48. package/dist/{chunk-5M6Z7ZFT.cjs → chunk-RXUY3MPH.cjs} +10 -10
  49. package/dist/cli/index.js +7309 -32
  50. package/dist/{types-BBSRUEab.d.cts → config-CfXY_iDD.d.cts} +44 -86
  51. package/dist/{types-BBSRUEab.d.ts → config-CfXY_iDD.d.ts} +44 -86
  52. package/dist/config.cjs +4 -16
  53. package/dist/config.d.cts +1 -12
  54. package/dist/config.d.ts +1 -12
  55. package/dist/config.js +5 -17
  56. package/dist/index-CjRTNPlj.d.cts +46 -0
  57. package/dist/index-Cm1IloVm.d.ts +46 -0
  58. package/dist/index.cjs +636 -9
  59. package/dist/index.d.cts +9 -17
  60. package/dist/index.d.ts +9 -17
  61. package/dist/index.js +638 -11
  62. package/dist/plugins/unplugin.cjs +20 -0
  63. package/dist/plugins/unplugin.d.cts +17 -0
  64. package/dist/plugins/unplugin.d.ts +15 -0
  65. package/dist/{bundler → plugins}/unplugin.js +5 -5
  66. package/dist/types-DYQIzGf6.d.cts +112 -0
  67. package/dist/types-ZHAFdOd3.d.ts +112 -0
  68. package/package.json +48 -52
  69. package/dist/ast/index.cjs +0 -17
  70. package/dist/ast/index.d.cts +0 -18
  71. package/dist/ast/index.d.ts +0 -18
  72. package/dist/ast/index.js +0 -17
  73. package/dist/bundler/unplugin.cjs +0 -20
  74. package/dist/bundler/unplugin.d.cts +0 -16
  75. package/dist/bundler/unplugin.d.ts +0 -14
  76. package/dist/chunk-27HR647Q.js +0 -190
  77. package/dist/chunk-4TDLLEEU.cjs +0 -15
  78. package/dist/chunk-6N6S6WTQ.cjs +0 -423
  79. package/dist/chunk-J5CGNZDM.cjs +0 -190
  80. package/dist/chunk-KQWNFKT2.js +0 -423
  81. package/dist/chunk-R6EBIR3T.cjs +0 -14
  82. package/dist/chunk-S4S2WXGC.js +0 -14
  83. package/dist/cli/index.cjs +0 -324
  84. package/dist/cli/index.d.cts +0 -22
  85. package/dist/cli/index.d.ts +0 -22
  86. package/dist/esbuild.cjs +0 -15
  87. package/dist/esbuild.js +0 -13
  88. package/dist/next/adapter.cjs +0 -31
  89. package/dist/next/adapter.js +0 -31
  90. package/dist/next/index.cjs +0 -18
  91. package/dist/next/index.d.cts +0 -42
  92. package/dist/next/index.d.ts +0 -42
  93. package/dist/next/index.js +0 -18
  94. package/dist/rollup.cjs +0 -15
  95. package/dist/rollup.js +0 -13
  96. package/dist/runtime/index.cjs +0 -17
  97. package/dist/runtime/index.d.cts +0 -36
  98. package/dist/runtime/index.d.ts +0 -36
  99. package/dist/runtime/index.js +0 -17
  100. package/dist/vite.cjs +0 -15
  101. package/dist/vite.js +0 -13
  102. package/dist/webpack.cjs +0 -15
  103. package/dist/webpack.js +0 -13
@@ -1,7 +1,28 @@
1
- type DetectedFramework = 'nextjs' | 'vite' | 'webpack' | 'vanilla';
2
1
  type DeterrentMode = 'gradual' | 'passive';
3
- type ConfigFramework = 'nextjs' | 'vite' | 'webpack' | 'vanilla';
2
+ interface ShieldConfig {
3
+ seed: number;
4
+ deterrentMode?: DeterrentMode;
5
+ detectHeadless?: boolean;
6
+ expectedIntegrityHash?: number;
7
+ windowKeySymbol?: string;
8
+ expectedDelta?: number;
9
+ }
10
+ interface ShieldPayload {
11
+ preambleCode: string;
12
+ expectedHash: number;
13
+ windowKeySymbol?: string;
14
+ expectedDelta?: number;
15
+ }
16
+
17
+ type UnpeekProfile = 'minimal' | 'recommended' | 'strict';
18
+ declare const PRESETS: Record<UnpeekProfile, UnpeekConfig>;
19
+
20
+ declare function loadUnpeekConfig(cwd?: string, explicitConfig?: UnpeekConfig): Promise<UnpeekConfig>;
21
+
22
+ type UnpeekFramework = 'nextjs' | 'vite' | 'webpack' | 'vanilla';
4
23
  type ConfigTarget = 'browser' | 'worker' | 'universal';
24
+ type PatternInput = RegExp | string;
25
+
5
26
  interface FilterConfig {
6
27
  include?: string[];
7
28
  exclude?: string[];
@@ -9,16 +30,16 @@ interface FilterConfig {
9
30
  interface HotPathConfig {
10
31
  customAnimationCalls?: string[];
11
32
  importSources?: Record<string, string[]>;
12
- hookPattern?: RegExp;
33
+ hookPattern?: PatternInput;
13
34
  customHooks?: string[];
14
35
  arrayHofMethods?: string[];
15
- eventHandlerRegex?: RegExp;
36
+ eventHandlerRegex?: PatternInput;
16
37
  maxPipelineCallers?: number;
17
38
  hocWrappers?: string[];
18
39
  excludeComponents?: string[];
19
40
  }
20
41
  interface SemanticAnchorsConfig {
21
- patterns?: RegExp[];
42
+ patterns?: PatternInput[];
22
43
  excludeUiClasses?: boolean;
23
44
  }
24
45
  interface VaultConfig {
@@ -28,12 +49,14 @@ interface VaultConfig {
28
49
  cssFramework?: 'tailwind' | 'unocss' | 'none';
29
50
  semanticAnchors?: SemanticAnchorsConfig;
30
51
  polymorphicDecoys?: boolean;
52
+ fragmented?: boolean;
53
+ fragmentCount?: number;
31
54
  }
32
55
  interface ManglerConfig {
33
56
  minLength?: number;
34
57
  reservedIdentifiers?: string[];
35
58
  excludePrefixes?: string[];
36
- excludePatterns?: RegExp[];
59
+ excludePatterns?: PatternInput[];
37
60
  }
38
61
  interface ShieldOptionsConfig {
39
62
  detectHeadless?: boolean;
@@ -52,11 +75,13 @@ interface ViteConfigOptions {
52
75
  assetsDir?: string;
53
76
  }
54
77
  interface UnpeekConfig {
55
- framework?: ConfigFramework;
78
+ framework?: UnpeekFramework;
56
79
  target?: ConfigTarget;
80
+ profile?: UnpeekProfile;
57
81
  outDir?: string;
58
82
  extensions?: string[];
59
83
  publicDirs?: string[];
84
+ scrubPaths?: boolean;
60
85
  filter?: FilterConfig;
61
86
  hotPath?: HotPathConfig;
62
87
  vault?: VaultConfig;
@@ -66,96 +91,29 @@ interface UnpeekConfig {
66
91
  next?: NextConfigOptions;
67
92
  vite?: ViteConfigOptions;
68
93
  }
69
- interface ProtectOptions {
70
- /** Target project root directory (defaults to process.cwd()) */
71
- cwd?: string;
72
- /** Explicit client output directory override */
73
- outDir?: string;
94
+ interface BaseProtectionOptions {
74
95
  /** Polymorphic deterministic seed (defaults to random per build) */
75
96
  seed?: number;
76
- /** Move .map files to .unpeek-maps/ instead of permanently deleting (default: true) */
77
- keepPrivateMaps?: boolean;
78
- /** Private directory to store extracted source maps (default: '.unpeek-maps') */
79
- privateMapsDir?: string;
97
+ /** Minimum string length to encrypt in the O(1) kConst string vault (default: 4) */
98
+ minStringLength?: number;
99
+ /** Inject runtime integrity and DevTools shield into entry chunks (default: true) */
100
+ injectRuntimeShield?: boolean;
80
101
  /** Runtime anti-tamper deterrent mode (default: 'passive') */
81
102
  deterrentMode?: DeterrentMode;
82
103
  /** Treat navigator.webdriver / HeadlessChrome as tamper (default: false) */
83
104
  detectHeadless?: boolean;
84
- /** Inject runtime integrity and DevTools shield into entry chunks (default: true) */
85
- injectRuntimeShield?: boolean;
86
- /** Minimum string length to encrypt in the O(1) kConst string vault (default: 4) */
87
- minStringLength?: number;
88
105
  /** Enable Layer 2 aggressive protection (Bytecode Micro-VM, Inline WASM KDF, Call-Site Salted Vault) */
89
106
  aggressive?: boolean;
107
+ /** Protection preset profile */
108
+ profile?: UnpeekProfile;
90
109
  /** Optional Unpeek configuration */
91
110
  config?: UnpeekConfig;
92
111
  }
93
- interface HotPathReport {
94
- totalFunctions: number;
95
- hotFunctionsSkipped: string[];
96
- coldFunctionsProtected: string[];
97
- }
98
- interface TransformOptions {
99
- seed?: number;
100
- minStringLength?: number;
101
- filename?: string;
102
- injectRuntimeShield?: boolean;
103
- deterrentMode?: DeterrentMode;
104
- detectHeadless?: boolean;
105
- /** Enable Layer 2 aggressive protection */
106
- aggressive?: boolean;
107
- /** Throw UnpeekError on JavaScript parse failures instead of returning input unchanged */
108
- strict?: boolean;
109
- /** Optional Unpeek configuration */
112
+ interface UnpeekPluginOptions extends BaseProtectionOptions {
113
+ /** Explicit Unpeek configuration object */
110
114
  config?: UnpeekConfig;
111
115
  }
112
- interface TransformResult {
113
- code: string;
114
- encryptedStringsCount: number;
115
- mangledSymbolsCount: number;
116
- hotPathReport: HotPathReport;
117
- integrityToken: number;
118
- virtualizedFunctionsCount?: number;
119
- }
120
- interface ShieldConfig {
121
- seed: number;
122
- deterrentMode?: DeterrentMode;
123
- detectHeadless?: boolean;
124
- expectedIntegrityHash?: number;
125
- windowKeySymbol?: string;
126
- expectedDelta?: number;
127
- }
128
- interface ShieldPayload {
129
- preambleCode: string;
130
- expectedHash: number;
131
- windowKeySymbol?: string;
132
- expectedDelta?: number;
133
- }
134
- interface SourceMapVaultResult {
135
- movedMapsCount: number;
136
- strippedFilesCount: number;
137
- vaultDir: string;
138
- movedFiles: string[];
139
- dockerIgnoreMissing?: boolean;
140
- }
141
- interface ProtectSummary {
142
- framework: DetectedFramework;
143
- outDir: string;
144
- processedFiles: number;
145
- movedSourceMaps: number;
146
- originalBytes: number;
147
- protectedBytes: number;
148
- originalGzipBytes: number;
149
- protectedGzipBytes: number;
150
- gzipDeltaPercent: number;
151
- totalHotFunctionsSkipped: number;
152
- totalColdFunctionsProtected: number;
153
- totalEncryptedStrings: number;
154
- totalMangledSymbols: number;
155
- elapsedMs: number;
156
- tier?: string;
157
- aggressive?: boolean;
158
- dockerIgnoreMissing?: boolean;
159
- }
116
+ declare function defineConfig<const T extends UnpeekConfig>(config: T): T;
160
117
 
161
- export type { ConfigFramework as C, DetectedFramework as D, FilterConfig as F, HotPathConfig as H, ManglerConfig as M, NextConfigOptions as N, ProtectOptions as P, SemanticAnchorsConfig as S, TransformOptions as T, UnpeekConfig as U, VaultConfig as V, ConfigTarget as a, DeterrentMode as b, HotPathReport as c, ShieldConfig as d, ShieldOptionsConfig as e, ShieldPayload as f, SourcemapsConfig as g, TransformResult as h, ViteConfigOptions as i, ProtectSummary as j, SourceMapVaultResult as k };
118
+ export { PRESETS as P, defineConfig as j, loadUnpeekConfig as l };
119
+ export type { BaseProtectionOptions as B, ConfigTarget as C, DeterrentMode as D, FilterConfig as F, HotPathConfig as H, ManglerConfig as M, NextConfigOptions as N, ShieldConfig as S, UnpeekConfig as U, VaultConfig as V, ShieldPayload as a, PatternInput as b, SemanticAnchorsConfig as c, ShieldOptionsConfig as d, SourcemapsConfig as e, UnpeekFramework as f, UnpeekPluginOptions as g, UnpeekProfile as h, ViteConfigOptions as i };
@@ -1,7 +1,28 @@
1
- type DetectedFramework = 'nextjs' | 'vite' | 'webpack' | 'vanilla';
2
1
  type DeterrentMode = 'gradual' | 'passive';
3
- type ConfigFramework = 'nextjs' | 'vite' | 'webpack' | 'vanilla';
2
+ interface ShieldConfig {
3
+ seed: number;
4
+ deterrentMode?: DeterrentMode;
5
+ detectHeadless?: boolean;
6
+ expectedIntegrityHash?: number;
7
+ windowKeySymbol?: string;
8
+ expectedDelta?: number;
9
+ }
10
+ interface ShieldPayload {
11
+ preambleCode: string;
12
+ expectedHash: number;
13
+ windowKeySymbol?: string;
14
+ expectedDelta?: number;
15
+ }
16
+
17
+ type UnpeekProfile = 'minimal' | 'recommended' | 'strict';
18
+ declare const PRESETS: Record<UnpeekProfile, UnpeekConfig>;
19
+
20
+ declare function loadUnpeekConfig(cwd?: string, explicitConfig?: UnpeekConfig): Promise<UnpeekConfig>;
21
+
22
+ type UnpeekFramework = 'nextjs' | 'vite' | 'webpack' | 'vanilla';
4
23
  type ConfigTarget = 'browser' | 'worker' | 'universal';
24
+ type PatternInput = RegExp | string;
25
+
5
26
  interface FilterConfig {
6
27
  include?: string[];
7
28
  exclude?: string[];
@@ -9,16 +30,16 @@ interface FilterConfig {
9
30
  interface HotPathConfig {
10
31
  customAnimationCalls?: string[];
11
32
  importSources?: Record<string, string[]>;
12
- hookPattern?: RegExp;
33
+ hookPattern?: PatternInput;
13
34
  customHooks?: string[];
14
35
  arrayHofMethods?: string[];
15
- eventHandlerRegex?: RegExp;
36
+ eventHandlerRegex?: PatternInput;
16
37
  maxPipelineCallers?: number;
17
38
  hocWrappers?: string[];
18
39
  excludeComponents?: string[];
19
40
  }
20
41
  interface SemanticAnchorsConfig {
21
- patterns?: RegExp[];
42
+ patterns?: PatternInput[];
22
43
  excludeUiClasses?: boolean;
23
44
  }
24
45
  interface VaultConfig {
@@ -28,12 +49,14 @@ interface VaultConfig {
28
49
  cssFramework?: 'tailwind' | 'unocss' | 'none';
29
50
  semanticAnchors?: SemanticAnchorsConfig;
30
51
  polymorphicDecoys?: boolean;
52
+ fragmented?: boolean;
53
+ fragmentCount?: number;
31
54
  }
32
55
  interface ManglerConfig {
33
56
  minLength?: number;
34
57
  reservedIdentifiers?: string[];
35
58
  excludePrefixes?: string[];
36
- excludePatterns?: RegExp[];
59
+ excludePatterns?: PatternInput[];
37
60
  }
38
61
  interface ShieldOptionsConfig {
39
62
  detectHeadless?: boolean;
@@ -52,11 +75,13 @@ interface ViteConfigOptions {
52
75
  assetsDir?: string;
53
76
  }
54
77
  interface UnpeekConfig {
55
- framework?: ConfigFramework;
78
+ framework?: UnpeekFramework;
56
79
  target?: ConfigTarget;
80
+ profile?: UnpeekProfile;
57
81
  outDir?: string;
58
82
  extensions?: string[];
59
83
  publicDirs?: string[];
84
+ scrubPaths?: boolean;
60
85
  filter?: FilterConfig;
61
86
  hotPath?: HotPathConfig;
62
87
  vault?: VaultConfig;
@@ -66,96 +91,29 @@ interface UnpeekConfig {
66
91
  next?: NextConfigOptions;
67
92
  vite?: ViteConfigOptions;
68
93
  }
69
- interface ProtectOptions {
70
- /** Target project root directory (defaults to process.cwd()) */
71
- cwd?: string;
72
- /** Explicit client output directory override */
73
- outDir?: string;
94
+ interface BaseProtectionOptions {
74
95
  /** Polymorphic deterministic seed (defaults to random per build) */
75
96
  seed?: number;
76
- /** Move .map files to .unpeek-maps/ instead of permanently deleting (default: true) */
77
- keepPrivateMaps?: boolean;
78
- /** Private directory to store extracted source maps (default: '.unpeek-maps') */
79
- privateMapsDir?: string;
97
+ /** Minimum string length to encrypt in the O(1) kConst string vault (default: 4) */
98
+ minStringLength?: number;
99
+ /** Inject runtime integrity and DevTools shield into entry chunks (default: true) */
100
+ injectRuntimeShield?: boolean;
80
101
  /** Runtime anti-tamper deterrent mode (default: 'passive') */
81
102
  deterrentMode?: DeterrentMode;
82
103
  /** Treat navigator.webdriver / HeadlessChrome as tamper (default: false) */
83
104
  detectHeadless?: boolean;
84
- /** Inject runtime integrity and DevTools shield into entry chunks (default: true) */
85
- injectRuntimeShield?: boolean;
86
- /** Minimum string length to encrypt in the O(1) kConst string vault (default: 4) */
87
- minStringLength?: number;
88
105
  /** Enable Layer 2 aggressive protection (Bytecode Micro-VM, Inline WASM KDF, Call-Site Salted Vault) */
89
106
  aggressive?: boolean;
107
+ /** Protection preset profile */
108
+ profile?: UnpeekProfile;
90
109
  /** Optional Unpeek configuration */
91
110
  config?: UnpeekConfig;
92
111
  }
93
- interface HotPathReport {
94
- totalFunctions: number;
95
- hotFunctionsSkipped: string[];
96
- coldFunctionsProtected: string[];
97
- }
98
- interface TransformOptions {
99
- seed?: number;
100
- minStringLength?: number;
101
- filename?: string;
102
- injectRuntimeShield?: boolean;
103
- deterrentMode?: DeterrentMode;
104
- detectHeadless?: boolean;
105
- /** Enable Layer 2 aggressive protection */
106
- aggressive?: boolean;
107
- /** Throw UnpeekError on JavaScript parse failures instead of returning input unchanged */
108
- strict?: boolean;
109
- /** Optional Unpeek configuration */
112
+ interface UnpeekPluginOptions extends BaseProtectionOptions {
113
+ /** Explicit Unpeek configuration object */
110
114
  config?: UnpeekConfig;
111
115
  }
112
- interface TransformResult {
113
- code: string;
114
- encryptedStringsCount: number;
115
- mangledSymbolsCount: number;
116
- hotPathReport: HotPathReport;
117
- integrityToken: number;
118
- virtualizedFunctionsCount?: number;
119
- }
120
- interface ShieldConfig {
121
- seed: number;
122
- deterrentMode?: DeterrentMode;
123
- detectHeadless?: boolean;
124
- expectedIntegrityHash?: number;
125
- windowKeySymbol?: string;
126
- expectedDelta?: number;
127
- }
128
- interface ShieldPayload {
129
- preambleCode: string;
130
- expectedHash: number;
131
- windowKeySymbol?: string;
132
- expectedDelta?: number;
133
- }
134
- interface SourceMapVaultResult {
135
- movedMapsCount: number;
136
- strippedFilesCount: number;
137
- vaultDir: string;
138
- movedFiles: string[];
139
- dockerIgnoreMissing?: boolean;
140
- }
141
- interface ProtectSummary {
142
- framework: DetectedFramework;
143
- outDir: string;
144
- processedFiles: number;
145
- movedSourceMaps: number;
146
- originalBytes: number;
147
- protectedBytes: number;
148
- originalGzipBytes: number;
149
- protectedGzipBytes: number;
150
- gzipDeltaPercent: number;
151
- totalHotFunctionsSkipped: number;
152
- totalColdFunctionsProtected: number;
153
- totalEncryptedStrings: number;
154
- totalMangledSymbols: number;
155
- elapsedMs: number;
156
- tier?: string;
157
- aggressive?: boolean;
158
- dockerIgnoreMissing?: boolean;
159
- }
116
+ declare function defineConfig<const T extends UnpeekConfig>(config: T): T;
160
117
 
161
- export type { ConfigFramework as C, DetectedFramework as D, FilterConfig as F, HotPathConfig as H, ManglerConfig as M, NextConfigOptions as N, ProtectOptions as P, SemanticAnchorsConfig as S, TransformOptions as T, UnpeekConfig as U, VaultConfig as V, ConfigTarget as a, DeterrentMode as b, HotPathReport as c, ShieldConfig as d, ShieldOptionsConfig as e, ShieldPayload as f, SourcemapsConfig as g, TransformResult as h, ViteConfigOptions as i, ProtectSummary as j, SourceMapVaultResult as k };
118
+ export { PRESETS as P, defineConfig as j, loadUnpeekConfig as l };
119
+ export type { BaseProtectionOptions as B, ConfigTarget as C, DeterrentMode as D, FilterConfig as F, HotPathConfig as H, ManglerConfig as M, NextConfigOptions as N, ShieldConfig as S, UnpeekConfig as U, VaultConfig as V, ShieldPayload as a, PatternInput as b, SemanticAnchorsConfig as c, ShieldOptionsConfig as d, SourcemapsConfig as e, UnpeekFramework as f, UnpeekPluginOptions as g, UnpeekProfile as h, ViteConfigOptions as i };
package/dist/config.cjs CHANGED
@@ -1,22 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
+ var _chunkONM2CSTUcjs = require('./chunk-ONM2CSTU.cjs');
5
+ require('./chunk-IEBVL5BT.cjs');
6
+ require('./chunk-L6BOM5VS.cjs');
4
7
 
5
8
 
6
9
 
7
-
8
-
9
-
10
- var _chunk24K5NDXHcjs = require('./chunk-24K5NDXH.cjs');
11
- require('./chunk-R6EBIR3T.cjs');
12
- require('./chunk-4TDLLEEU.cjs');
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
-
22
- exports.CONFIG_CANDIDATES = _chunk24K5NDXHcjs.CONFIG_CANDIDATES; exports.DEFAULT_CONFIG = _chunk24K5NDXHcjs.DEFAULT_CONFIG; exports.defineConfig = _chunk24K5NDXHcjs.defineConfig; exports.findConfigFile = _chunk24K5NDXHcjs.findConfigFile; exports.loadUnpeekConfig = _chunk24K5NDXHcjs.loadUnpeekConfig; exports.mergeUnpeekConfig = _chunk24K5NDXHcjs.mergeUnpeekConfig; exports.normalizeConfig = _chunk24K5NDXHcjs.normalizeConfig; exports.resolveUnpeekConfigSync = _chunk24K5NDXHcjs.resolveUnpeekConfigSync;
10
+ exports.defineConfig = _chunkONM2CSTUcjs.defineConfig; exports.loadUnpeekConfig = _chunkONM2CSTUcjs.loadUnpeekConfig;
package/dist/config.d.cts CHANGED
@@ -1,12 +1 @@
1
- import { UnpeekConfig } from './browser.cjs';
2
-
3
- declare const CONFIG_CANDIDATES: string[];
4
- declare const DEFAULT_CONFIG: UnpeekConfig;
5
- declare function normalizeConfig(raw: Record<string, unknown>): UnpeekConfig;
6
- declare function mergeUnpeekConfig(base: UnpeekConfig, override?: UnpeekConfig): UnpeekConfig;
7
- declare function findConfigFile(cwd?: string): string | null;
8
- declare function loadUnpeekConfig(cwd?: string, explicitConfig?: UnpeekConfig): Promise<UnpeekConfig>;
9
- declare function resolveUnpeekConfigSync(cwd?: string, explicitConfig?: UnpeekConfig): UnpeekConfig;
10
- declare function defineConfig(config: UnpeekConfig): UnpeekConfig;
11
-
12
- export { CONFIG_CANDIDATES, DEFAULT_CONFIG, defineConfig, findConfigFile, loadUnpeekConfig, mergeUnpeekConfig, normalizeConfig, resolveUnpeekConfigSync };
1
+ export { B as BaseProtectionOptions, C as ConfigTarget, F as FilterConfig, H as HotPathConfig, M as ManglerConfig, N as NextConfigOptions, b as PatternInput, c as SemanticAnchorsConfig, d as ShieldOptionsConfig, e as SourcemapsConfig, U as UnpeekConfig, f as UnpeekFramework, g as UnpeekPluginOptions, h as UnpeekProfile, V as VaultConfig, i as ViteConfigOptions, j as defineConfig, l as loadUnpeekConfig } from './config-CfXY_iDD.cjs';
package/dist/config.d.ts CHANGED
@@ -1,12 +1 @@
1
- import { UnpeekConfig } from './browser.js';
2
-
3
- declare const CONFIG_CANDIDATES: string[];
4
- declare const DEFAULT_CONFIG: UnpeekConfig;
5
- declare function normalizeConfig(raw: Record<string, unknown>): UnpeekConfig;
6
- declare function mergeUnpeekConfig(base: UnpeekConfig, override?: UnpeekConfig): UnpeekConfig;
7
- declare function findConfigFile(cwd?: string): string | null;
8
- declare function loadUnpeekConfig(cwd?: string, explicitConfig?: UnpeekConfig): Promise<UnpeekConfig>;
9
- declare function resolveUnpeekConfigSync(cwd?: string, explicitConfig?: UnpeekConfig): UnpeekConfig;
10
- declare function defineConfig(config: UnpeekConfig): UnpeekConfig;
11
-
12
- export { CONFIG_CANDIDATES, DEFAULT_CONFIG, defineConfig, findConfigFile, loadUnpeekConfig, mergeUnpeekConfig, normalizeConfig, resolveUnpeekConfigSync };
1
+ export { B as BaseProtectionOptions, C as ConfigTarget, F as FilterConfig, H as HotPathConfig, M as ManglerConfig, N as NextConfigOptions, b as PatternInput, c as SemanticAnchorsConfig, d as ShieldOptionsConfig, e as SourcemapsConfig, U as UnpeekConfig, f as UnpeekFramework, g as UnpeekPluginOptions, h as UnpeekProfile, V as VaultConfig, i as ViteConfigOptions, j as defineConfig, l as loadUnpeekConfig } from './config-CfXY_iDD.js';
package/dist/config.js CHANGED
@@ -1,22 +1,10 @@
1
1
  import {
2
- CONFIG_CANDIDATES,
3
- DEFAULT_CONFIG,
4
2
  defineConfig,
5
- findConfigFile,
6
- loadUnpeekConfig,
7
- mergeUnpeekConfig,
8
- normalizeConfig,
9
- resolveUnpeekConfigSync
10
- } from "./chunk-GZB7PFLY.js";
11
- import "./chunk-S4S2WXGC.js";
12
- import "./chunk-OOXSZTRV.js";
3
+ loadUnpeekConfig
4
+ } from "./chunk-IICVBTR2.js";
5
+ import "./chunk-FCF2EGPM.js";
6
+ import "./chunk-LA6J3BT3.js";
13
7
  export {
14
- CONFIG_CANDIDATES,
15
- DEFAULT_CONFIG,
16
8
  defineConfig,
17
- findConfigFile,
18
- loadUnpeekConfig,
19
- mergeUnpeekConfig,
20
- normalizeConfig,
21
- resolveUnpeekConfigSync
9
+ loadUnpeekConfig
22
10
  };
@@ -0,0 +1,46 @@
1
+ import { B as BaseProtectionOptions } from './config-CfXY_iDD.cjs';
2
+
3
+ interface HotPathReport {
4
+ totalFunctions: number;
5
+ hotFunctionsSkipped: string[];
6
+ coldFunctionsProtected: string[];
7
+ }
8
+ type TransformSkippedReason = 'empty' | 'already-protected' | 'parse-error';
9
+ interface ScrubberOptions {
10
+ scrubPaths?: boolean;
11
+ rootDir?: string;
12
+ exemptStrings?: string[];
13
+ }
14
+ interface TransformOptions extends BaseProtectionOptions {
15
+ filename?: string;
16
+ /** Throw UnpeekError on JavaScript parse failures instead of returning input unchanged */
17
+ strict?: boolean;
18
+ /** Scrub local filesystem paths and residual dev metadata (CWE-540) */
19
+ scrubPaths?: boolean;
20
+ }
21
+ interface TransformResult {
22
+ code: string;
23
+ encryptedStringsCount: number;
24
+ mangledSymbolsCount: number;
25
+ hotPathReport: HotPathReport;
26
+ integrityToken: number;
27
+ virtualizedFunctionsCount?: number;
28
+ skippedReason?: TransformSkippedReason;
29
+ debugId?: string;
30
+ }
31
+
32
+ type UnpeekErrorCode = 'ERR_CONFIG_INVALID' | 'ERR_CONFIG_LOAD' | 'ERR_INIT_INVALID_PACKAGE_JSON' | 'ERR_SECURITY_PATH_TRAVERSAL' | 'ERR_CLI_INVALID_ARGS' | 'ERR_PARSE_FAILED' | 'ERR_NEXT_ADAPTER' | 'ERR_BUDGET_EXCEEDED';
33
+ declare const UNPEEK_ERROR_BRAND: unique symbol;
34
+ declare class UnpeekError extends Error {
35
+ readonly code: UnpeekErrorCode;
36
+ readonly [UNPEEK_ERROR_BRAND] = true;
37
+ constructor(code: UnpeekErrorCode, message: string, options?: {
38
+ cause?: unknown;
39
+ });
40
+ }
41
+ declare function isUnpeekError(err: unknown): err is UnpeekError;
42
+
43
+ declare function transformJavaScript(code: string, options?: TransformOptions): TransformResult;
44
+
45
+ export { UnpeekError as U, isUnpeekError as i, transformJavaScript as t };
46
+ export type { HotPathReport as H, ScrubberOptions as S, TransformOptions as T, TransformResult as a, TransformSkippedReason as b, UnpeekErrorCode as c };
@@ -0,0 +1,46 @@
1
+ import { B as BaseProtectionOptions } from './config-CfXY_iDD.js';
2
+
3
+ interface HotPathReport {
4
+ totalFunctions: number;
5
+ hotFunctionsSkipped: string[];
6
+ coldFunctionsProtected: string[];
7
+ }
8
+ type TransformSkippedReason = 'empty' | 'already-protected' | 'parse-error';
9
+ interface ScrubberOptions {
10
+ scrubPaths?: boolean;
11
+ rootDir?: string;
12
+ exemptStrings?: string[];
13
+ }
14
+ interface TransformOptions extends BaseProtectionOptions {
15
+ filename?: string;
16
+ /** Throw UnpeekError on JavaScript parse failures instead of returning input unchanged */
17
+ strict?: boolean;
18
+ /** Scrub local filesystem paths and residual dev metadata (CWE-540) */
19
+ scrubPaths?: boolean;
20
+ }
21
+ interface TransformResult {
22
+ code: string;
23
+ encryptedStringsCount: number;
24
+ mangledSymbolsCount: number;
25
+ hotPathReport: HotPathReport;
26
+ integrityToken: number;
27
+ virtualizedFunctionsCount?: number;
28
+ skippedReason?: TransformSkippedReason;
29
+ debugId?: string;
30
+ }
31
+
32
+ type UnpeekErrorCode = 'ERR_CONFIG_INVALID' | 'ERR_CONFIG_LOAD' | 'ERR_INIT_INVALID_PACKAGE_JSON' | 'ERR_SECURITY_PATH_TRAVERSAL' | 'ERR_CLI_INVALID_ARGS' | 'ERR_PARSE_FAILED' | 'ERR_NEXT_ADAPTER' | 'ERR_BUDGET_EXCEEDED';
33
+ declare const UNPEEK_ERROR_BRAND: unique symbol;
34
+ declare class UnpeekError extends Error {
35
+ readonly code: UnpeekErrorCode;
36
+ readonly [UNPEEK_ERROR_BRAND] = true;
37
+ constructor(code: UnpeekErrorCode, message: string, options?: {
38
+ cause?: unknown;
39
+ });
40
+ }
41
+ declare function isUnpeekError(err: unknown): err is UnpeekError;
42
+
43
+ declare function transformJavaScript(code: string, options?: TransformOptions): TransformResult;
44
+
45
+ export { UnpeekError as U, isUnpeekError as i, transformJavaScript as t };
46
+ export type { HotPathReport as H, ScrubberOptions as S, TransformOptions as T, TransformResult as a, TransformSkippedReason as b, UnpeekErrorCode as c };