unpeek 1.0.1 → 1.2.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 (102) hide show
  1. package/README.md +131 -60
  2. package/README.tr.md +317 -0
  3. package/dist/ast/index.cjs +802 -0
  4. package/dist/ast/index.cjs.map +1 -0
  5. package/dist/ast/index.d.cts +9 -0
  6. package/dist/ast/index.d.ts +9 -4
  7. package/dist/ast/index.js +762 -52
  8. package/dist/ast/index.js.map +1 -0
  9. package/dist/browser.cjs +816 -0
  10. package/dist/browser.cjs.map +1 -0
  11. package/dist/browser.d.cts +3 -0
  12. package/dist/browser.d.ts +3 -0
  13. package/dist/browser.js +773 -0
  14. package/dist/browser.js.map +1 -0
  15. package/dist/bundler/detector.cjs +180 -0
  16. package/dist/bundler/detector.cjs.map +1 -0
  17. package/dist/bundler/detector.d.cts +9 -0
  18. package/dist/bundler/detector.d.ts +6 -3
  19. package/dist/bundler/detector.js +130 -135
  20. package/dist/bundler/detector.js.map +1 -0
  21. package/dist/bundler/sourcemap-vault.cjs +210 -0
  22. package/dist/bundler/sourcemap-vault.cjs.map +1 -0
  23. package/dist/bundler/sourcemap-vault.d.cts +6 -0
  24. package/dist/bundler/sourcemap-vault.d.ts +6 -2
  25. package/dist/bundler/sourcemap-vault.js +161 -85
  26. package/dist/bundler/sourcemap-vault.js.map +1 -0
  27. package/dist/bundler/unplugin.cjs +848 -0
  28. package/dist/bundler/unplugin.cjs.map +1 -0
  29. package/dist/bundler/unplugin.d.cts +14 -0
  30. package/dist/bundler/unplugin.d.ts +14 -7
  31. package/dist/bundler/unplugin.js +805 -51
  32. package/dist/bundler/unplugin.js.map +1 -0
  33. package/dist/cli/index.cjs +1361 -0
  34. package/dist/cli/index.cjs.map +1 -0
  35. package/dist/cli/index.d.cts +3 -0
  36. package/dist/cli/index.d.ts +3 -1
  37. package/dist/cli/index.js +1309 -94
  38. package/dist/cli/index.js.map +1 -0
  39. package/dist/cli/init.cjs +200 -0
  40. package/dist/cli/init.cjs.map +1 -0
  41. package/dist/cli/init.d.cts +13 -0
  42. package/dist/cli/init.d.ts +10 -2
  43. package/dist/cli/init.js +162 -46
  44. package/dist/cli/init.js.map +1 -0
  45. package/dist/cli/protect.cjs +1147 -0
  46. package/dist/cli/protect.cjs.map +1 -0
  47. package/dist/cli/protect.d.cts +5 -0
  48. package/dist/cli/protect.d.ts +5 -2
  49. package/dist/cli/protect.js +1107 -83
  50. package/dist/cli/protect.js.map +1 -0
  51. package/dist/esbuild.cjs +844 -0
  52. package/dist/esbuild.cjs.map +1 -0
  53. package/dist/esbuild.d.cts +11 -0
  54. package/dist/esbuild.d.ts +11 -0
  55. package/dist/esbuild.js +807 -0
  56. package/dist/esbuild.js.map +1 -0
  57. package/dist/index.cjs +1453 -0
  58. package/dist/index.cjs.map +1 -0
  59. package/dist/index.d.cts +14 -0
  60. package/dist/index.d.ts +9 -4
  61. package/dist/index.js +1395 -8
  62. package/dist/index.js.map +1 -0
  63. package/dist/rollup.cjs +844 -0
  64. package/dist/rollup.cjs.map +1 -0
  65. package/dist/rollup.d.cts +11 -0
  66. package/dist/rollup.d.ts +11 -0
  67. package/dist/rollup.js +807 -0
  68. package/dist/rollup.js.map +1 -0
  69. package/dist/runtime/index.cjs +88 -0
  70. package/dist/runtime/index.cjs.map +1 -0
  71. package/dist/runtime/index.d.cts +23 -0
  72. package/dist/runtime/index.d.ts +23 -4
  73. package/dist/runtime/index.js +57 -15
  74. package/dist/runtime/index.js.map +1 -0
  75. package/dist/{types.d.ts → types-BTMkXmVE.d.cts} +14 -12
  76. package/dist/types-BTMkXmVE.d.ts +73 -0
  77. package/dist/vite.cjs +844 -0
  78. package/dist/vite.cjs.map +1 -0
  79. package/dist/vite.d.cts +11 -0
  80. package/dist/vite.d.ts +11 -0
  81. package/dist/vite.js +807 -0
  82. package/dist/vite.js.map +1 -0
  83. package/dist/webpack.cjs +844 -0
  84. package/dist/webpack.cjs.map +1 -0
  85. package/dist/webpack.d.cts +11 -0
  86. package/dist/webpack.d.ts +11 -0
  87. package/dist/webpack.js +807 -0
  88. package/dist/webpack.js.map +1 -0
  89. package/package.json +104 -7
  90. package/dist/ast/cold-flow-guard.d.ts +0 -2
  91. package/dist/ast/cold-flow-guard.js +0 -39
  92. package/dist/ast/hot-path-detector.d.ts +0 -10
  93. package/dist/ast/hot-path-detector.js +0 -235
  94. package/dist/ast/polymorphic-mangler.d.ts +0 -2
  95. package/dist/ast/polymorphic-mangler.js +0 -270
  96. package/dist/ast/string-vault.d.ts +0 -7
  97. package/dist/ast/string-vault.js +0 -139
  98. package/dist/runtime/devtools-deterrent.d.ts +0 -7
  99. package/dist/runtime/devtools-deterrent.js +0 -27
  100. package/dist/runtime/integrity-guard.d.ts +0 -11
  101. package/dist/runtime/integrity-guard.js +0 -25
  102. package/dist/types.js +0 -1
package/README.md CHANGED
@@ -11,83 +11,110 @@ English | [Türkçe](./README.tr.md) · [Live Interactive Playground](https://wo
11
11
 
12
12
  ---
13
13
 
14
- <baglam>
15
-
16
14
  ## Why unpeek?
17
15
 
18
- Shipping a modern web application in Next.js, Vite, or Webpack exposes client-side business logic, internal API endpoints, feature flags, and proprietary algorithms to anyone who opens Chrome DevTools or runs an automated AST deobfuscator (`webcrack`, `synchrony`).
16
+ Deploying a web application built with Next.js, Vite, or Webpack exposes client-side business logic, internal API endpoints, feature flags, and proprietary algorithms to anyone who opens browser developer tools or runs automated AST deobfuscators like `webcrack` or `synchrony`.
19
17
 
20
18
  Existing tools force an uncomfortable trade-off:
21
- - **Standard minifiers (`esbuild`, `SWC`, `Terser`)** compress whitespace and shorten variable names, leaving string literals, endpoint URLs, and control flow readable after a single click on the DevTools Pretty-Print (`{}`) button.
22
- - **Legacy AST obfuscators (`javascript-obfuscator`)** apply indiscriminate control-flow flattening, `eval` traps, and eager string-array rotation to every function in the bundle. This inflates bundle sizes by 40–300%, breaks V8 TurboFan JIT inlining inside 60fps UI rendering loops, and triggers false-positive browser freezes.
19
+ - **Standard minifiers (`esbuild`, `SWC`, `Terser`):** Compress whitespace and shorten variable names, leaving string literals, endpoint URLs, and control flow readable after a single click on the DevTools Pretty-Print (`{}`) button.
20
+ - **Legacy AST obfuscators (`javascript-obfuscator`):** Apply indiscriminate control-flow flattening, `eval` traps, and eager string-array rotation across every function in the bundle. This inflates bundle sizes by 40% to 300%, degrades V8 TurboFan JIT inlining in 60fps UI rendering loops, and triggers browser freezes.
23
21
 
24
22
  `unpeek` resolves this trade-off by combining static call-graph analysis with polymorphic compile-time encryption:
25
23
 
26
24
  | Capability | Standard Minifiers (`Terser` / `SWC`) | Legacy AST Obfuscators | `unpeek` |
27
25
  | :--- | :--- | :--- | :--- |
28
- | **Runtime CPU Overhead** | ~0% | 15% – 85% (throttles UI loops) | **< 2.0%** (Call-Graph Hot-Path Exemption) |
29
- | **Gzip Bundle Growth** | 0% (Baseline) | +45% – +300% | **< 15%** (O(1) Lazy String Vault) |
26
+ | **Runtime CPU Overhead** | ~0% | 15% to 85% (throttles UI loops) | **< 2.0%** (Call-Graph Hot-Path Exemption) |
27
+ | **Gzip Bundle Growth** | 0% (Baseline) | +45% to +300% | **< 15%** (O(1) Lazy String Vault) |
30
28
  | **String & Endpoint Encryption** | Plaintext in bundle | Eager array rotation (high CPU) | **Polymorphic XOR + O(1) Memoized Vault** |
31
29
  | **DevTools Pretty-Print (`{}`) Defense** | None | `debugger` infinite loops (easily bypassed) | **`Function.prototype.toString()` FNV-1a Integrity** |
32
30
  | **Source Map Isolation** | Manual CI scripts | Manual configuration | **Automatic `.unpeek-maps/` Vault + Comment Strip** |
33
- | **Static Deobfuscator Resistance** | None | Fixed templates (fingerprinted by `webcrack`) | **Per-Build Polymorphic AST Seed** |
31
+ | **Static Deobfuscator Resistance** | None | Fixed templates (fingerprinted by deobfuscators) | **Per-Build Polymorphic AST Seed** |
34
32
  | **SSR / Next.js Compatibility** | Native | Frequently breaks server hydration | **Client-Only Auto-Detection + SSR Guard** |
35
33
 
36
34
  ### Core Architecture
37
35
 
36
+ ```mermaid
37
+ flowchart TD
38
+ A["Client Build Output (.next/static, dist/assets, build/static)"] --> B["Framework Detector (detectTargetFramework)"]
39
+ B --> C["Source Map Vault (relocateSourceMaps)"]
40
+ C -->|Extract .map and strip sourceMappingURL| D[".unpeek-maps/ (Private Vault)"]
41
+ C --> E["Client JS Bundles (.js, .mjs)"]
42
+ E --> F["AST Hot-Path Traversal (detectHotPaths)"]
43
+ F -->|Loops, Array Callbacks, UI Renders| G["Hot Path: 0% Tax (Skip Opaque Predicates)"]
44
+ F -->|Cold Functions: Auth, Licensing, Signers| H["Cold Path: Opaque Control-Flow Predicates"]
45
+ G --> I["Polymorphic String Vault (O(1) Lazy XOR)"]
46
+ H --> I
47
+ I --> J["Identifier and Symbol Mangling"]
48
+ J --> K["Runtime Integrity Shield (FNV-1a Checksum)"]
49
+ K --> L["Hardened Production Bundles"]
50
+ ```
51
+
38
52
  1. **Call-Graph Hot-Path Exemption (`<2%` CPU Budget)**
39
- Before modifying a single AST node, [`detectHotPaths`](packages/unpeek/src/ast/index.ts) traverses the file's call graph. Functions containing loops (`for`, `while`, `do-while`, `for-of`), array higher-order callbacks (`.map`, `.filter`, `.reduce`, `.forEach`), `requestAnimationFrame` tickers, and React/UI render components (`useState`, `useEffect`, `createElement`) are flagged as hot paths. `unpeek` mangles identifiers and encrypts string constants across the entire bundle, while injecting opaque control-flow predicates exclusively into cold functions (such as license checks, request signers, and auth validators). V8 JIT optimization inside hot loops remains untouched.
53
+ Before modifying an AST node, [`detectHotPaths`](packages/unpeek/src/ast/index.ts) traverses the file call graph. Functions containing loops (`for`, `while`, `do-while`, `for-of`), array higher-order callbacks (`.map`, `.filter`, `.reduce`, `.forEach`), `requestAnimationFrame` tickers, and React/UI render components (`useState`, `useEffect`, `createElement`) are flagged as hot paths. `unpeek` mangles identifiers and encrypts string constants across the entire bundle, while injecting opaque control-flow predicates exclusively into cold functions (such as license checks, request signers, and auth validators). V8 JIT optimization inside hot loops remains untouched.
40
54
  2. **O(1) Lazy String Vault (`<15%` Gzip Budget)**
41
- Plaintext string literals (`minStringLength >= 4`) are encrypted at build time with a polymorphic XOR stream cipher keyed by a per-build 32-bit seed. Instead of decrypting every string on page startup, the injected vault helper decodes each string lazily on its first access and caches the plaintext result in its array slot. Subsequent reads resolve in O(1) time via direct array indexing.
42
- 3. **Self-Defending `Function.prototype.toString()` Integrity & Passive Deterrent**
43
- When an analyst formats a protected chunk using DevTools Pretty-Print (`{}`) or edits a branch instruction in the Sources panel, the formatted source alters `Function.prototype.toString()`. [`verifyCodeIntegrity`](packages/unpeek/src/runtime/index.ts) validates a seeded 32-bit FNV-1a checksum against the function's source representation with zero false positives on untouched minified code, triggering gradual state degradation (`deterrentMode: 'gradual'`) rather than an obvious crash point that attackers can patch out.
55
+ Plaintext string literals (`minStringLength >= 4`) are encrypted at build time with a polymorphic XOR stream cipher keyed by a per-build 32-bit seed. Instead of decrypting every string on page startup, the injected vault helper decodes each string lazily on its first access and caches the plaintext result in its array slot. Subsequent reads resolve in O(1) time through direct array indexing.
56
+ 3. **Self-Defending `Function.prototype.toString()` Integrity and Passive Deterrent**
57
+ When an analyst formats a protected chunk using DevTools Pretty-Print (`{}`) or edits a branch instruction in the Sources panel, the formatted source alters `Function.prototype.toString()`. [`verifyCodeIntegrity`](packages/unpeek/src/runtime/index.ts) validates a seeded 32-bit FNV-1a checksum against the function source representation with zero false positives on untouched minified code, triggering gradual state degradation (`deterrentMode: 'gradual'`) rather than an obvious crash point that attackers can patch out.
44
58
  4. **Automatic Source Map Vault (`.unpeek-maps/`)**
45
- Leaving `.js.map` files in a public build directory reconstructs your original TypeScript project tree inside DevTools. [`protectDirectory`](packages/unpeek/src/cli/index.ts) automatically extracts `.map` files from your public build directory into a private `.unpeek-maps/` folder and strips `//# sourceMappingURL=` comments from every client bundle so you can upload maps to Sentry or Datadog without serving them to end users.
46
-
47
- </baglam>
59
+ Leaving `.js.map` files in a public build directory reconstructs your original TypeScript project tree inside DevTools. [`protectProject`](packages/unpeek/src/cli/protect.ts) extracts `.map` files from your public build directory into a private `.unpeek-maps/` folder and strips `//# sourceMappingURL=` comments from every client bundle so you can upload maps to Sentry or Datadog without serving them to end users.
48
60
 
49
61
  ---
50
62
 
51
- <talimat>
52
-
53
63
  ## Quick Start
54
64
 
55
- ### 1. One-Command Project Setup (`npx unpeek init`)
65
+ ### 1. Project Setup (`npx unpeek init`)
56
66
 
57
- Run the initializer from your project root (Next.js, Vite, Webpack, or vanilla):
67
+ Run the initializer from your project root (Next.js, Vite, Webpack, or vanilla JS):
58
68
 
59
69
  ```bash
60
70
  npx unpeek init
61
71
  ```
62
72
 
63
- This command performs three non-destructive setup actions:
73
+ This command performs three setup actions:
64
74
  1. Detects your framework (`nextjs`, `vite`, `webpack`, or `vanilla`) from `package.json` and build config files.
65
75
  2. Adds `"postbuild": "unpeek protect"` to your `package.json` scripts so every production build is automatically protected.
66
76
  3. Appends `.unpeek-maps/` to `.gitignore` so extracted source maps stay out of version control.
67
77
 
68
78
  ### 2. CLI Usage (`unpeek protect`)
69
79
 
70
- You can also install `unpeek` as a development dependency and run it directly in CI/CD or local builds:
80
+ Install `unpeek` as a development dependency and run it directly in CI/CD or local builds:
71
81
 
72
82
  ```bash
73
83
  npm install -D unpeek
74
84
  npx unpeek protect
75
85
  ```
76
86
 
77
- #### CLI Options
87
+ #### CLI Commands & Options
78
88
 
79
- | Flag | Description | Default |
89
+ | Command / Flag | Description | Default |
80
90
  | :--- | :--- | :--- |
81
- | `--dir <path>` | Explicit client output directory override (e.g., `dist/assets`, `.next/static/chunks`) | Auto-detected |
91
+ | `init [--dry-run]` | Automatically detect project framework, configure `postbuild` script, and create `.unpeek-maps/` vault | |
92
+ | `protect` | Protect production client bundles in-place (default command) | |
93
+ | `--out-dir <path>` | Explicit client output directory override (e.g., `dist/assets`, `.next/static/chunks`) | Auto-detected from project framework |
82
94
  | `--seed <number>` | Deterministic 32-bit polymorphic build seed | Random per build |
83
- | `--mode <gradual\|passive>` | Runtime anti-tamper deterrent mode | `gradual` |
84
- | `--min-str <number>` | Minimum character length for O(1) lazy string vault encryption | `4` |
85
- | `--no-shield` | Skip injecting the runtime integrity and DevTools telemetry preamble | Shield enabled |
86
- | `--delete-maps` | Permanently delete `.map` files instead of moving them to `.unpeek-maps/` | Moves to `.unpeek-maps/` |
95
+ | `--passive` | Use passive deterrent mode instead of gradual state degradation | Default: gradual degradation |
96
+ | `--no-maps` | Permanently delete `.map` files instead of moving them to `.unpeek-maps/` | Moves to `.unpeek-maps/` |
97
+ | `--min-string-length <num>` | Minimum string length for lazy encryption vault | `4` |
98
+ | `--private-maps-dir <dir>` | Directory to store vaulted private source maps | `.unpeek-maps` |
99
+ | `--no-shield` | Do not inject runtime anti-tamper deterrent shield | Shield injected into entry chunks |
100
+ | `-h, --help` | Show CLI help message | |
101
+ | `-v, --version` | Show CLI version number | |
102
+
103
+ > [!NOTE]
104
+ > Programmatic execution through `protectProject(options)` supports additional fine-grained options, including `minStringLength`, `privateMapsDir`, `injectRuntimeShield`, and `cwd`.
105
+
106
+ > [!IMPORTANT]
107
+ > **CommonJS Users (Dynamic `import()`):**
108
+ > Because `unpeek` is distributed with native ECMAScript Modules (`"type": "module"`), in CommonJS environments (`.cjs` files or `require()` scripts) load `unpeek` using dynamic `import()`:
109
+ > ```javascript
110
+ > // CommonJS (next.config.js / webpack.config.js / scripts)
111
+ > const unpeek = (await import('unpeek/unplugin')).default;
112
+ > const { protectProject, transformJavaScript } = await import('unpeek');
113
+ > ```
87
114
 
88
115
  ### 3. Universal Bundler Plugin (`unpeek/unplugin`)
89
116
 
90
- If you prefer in-memory chunk transformations during the bundler lifecycle rather than a post-build CLI pass, use [`unpeek/unplugin`](packages/unpeek/src/bundler/unplugin.ts):
117
+ For in-memory chunk transformations during the bundler build lifecycle rather than a post-build CLI pass, use [`unpeek/unplugin`](packages/unpeek/src/bundler/unplugin.ts):
91
118
 
92
119
  #### Vite (`vite.config.ts`)
93
120
 
@@ -96,13 +123,9 @@ import { defineConfig } from 'vite';
96
123
  import unpeek from 'unpeek/unplugin';
97
124
 
98
125
  export default defineConfig({
99
- build: {
100
- sourcemap: true, // Extracted into .unpeek-maps/ automatically
101
- },
102
126
  plugins: [
103
127
  unpeek.vite({
104
128
  deterrentMode: 'gradual',
105
- keepPrivateMaps: true,
106
129
  }),
107
130
  ],
108
131
  });
@@ -122,7 +145,6 @@ const nextConfig = {
122
145
  config.plugins.push(
123
146
  unpeek.webpack({
124
147
  deterrentMode: 'gradual',
125
- keepPrivateMaps: true,
126
148
  })
127
149
  );
128
150
  }
@@ -136,7 +158,7 @@ export default nextConfig;
136
158
  #### Programmatic API
137
159
 
138
160
  ```ts
139
- import { transformJavaScript, protectDirectory } from 'unpeek';
161
+ import { transformJavaScript, protectProject } from 'unpeek';
140
162
 
141
163
  // Transform an individual JavaScript string in memory
142
164
  const result = transformJavaScript(sourceCode, {
@@ -150,7 +172,7 @@ console.log(result.hotPathReport);
150
172
  // { totalFunctions: 12, hotFunctionsSkipped: ['renderLoop'], coldFunctionsProtected: ['signRequest'] }
151
173
 
152
174
  // Or protect an entire build directory
153
- const summary = await protectDirectory({
175
+ const summary = await protectProject({
154
176
  cwd: process.cwd(),
155
177
  keepPrivateMaps: true,
156
178
  privateMapsDir: '.unpeek-maps',
@@ -161,7 +183,7 @@ const summary = await protectDirectory({
161
183
 
162
184
  ## `.unpeek-maps/` Source Map Vault & Sentry Workflow
163
185
 
164
- When `keepPrivateMaps` is enabled (the default), `unpeek` relocates all `.js.map` files from your public output directory into `.unpeek-maps/` while preserving their relative filenames, and strips `//# sourceMappingURL=` directives from the public `.js` chunks.
186
+ When `keepPrivateMaps` is enabled (the default), `unpeek` relocates all `.js.map` files from your public output directory into `.unpeek-maps/` while preserving relative filenames, and strips `//# sourceMappingURL=` directives from public `.js` chunks.
165
187
 
166
188
  To retain full stack-trace symbolication in production error trackers:
167
189
 
@@ -177,39 +199,74 @@ npx @sentry/cli sourcemaps upload .unpeek-maps --release="$GIT_COMMIT_SHA"
177
199
 
178
200
  ---
179
201
 
180
- ## Official AI Agent Skill Installation
202
+ ## AI Coding Agent Integration
203
+
204
+ `unpeek` ships with an official AI Agent Skill ([`skills/unpeek/SKILL.md`](skills/unpeek/SKILL.md)) following the open Vercel Agent Skills specification and Agent Skills Discovery Optimization (SDO) standards. Installing this skill equips coding agents (Claude Code, Cursor, OpenAI Codex, Gemini CLI, GitHub Copilot, OpenCode) with deep domain knowledge for protecting client-side bundles, preserving hot-path performance budgets (<2% CPU, <15% Gzip), guarding SSR boundaries, and managing `.unpeek-maps/` in CI/CD pipelines.
181
205
 
182
- `unpeek` ships with an official, token-optimized AI Agent Skill ([`skills/unpeek/SKILL.md`](skills/unpeek/SKILL.md)) following Agent Skills Discovery Optimization (SDO) standards. Installing this skill teaches your coding agent (Claude Code, Cursor, Antigravity, OpenAI Codex, or Gemini CLI) how to configure `unpeek`, guard SSR chunks, and wire `.unpeek-maps/` into CI/CD pipelines.
206
+ ### Skill Installation
183
207
 
184
- ### Project-Scoped Installation (Shared with Team via Git)
208
+ #### 1. Standard Installation (Vercel Agent Skills CLI)
185
209
 
186
- Copy the skill into your repository's `.agents/skills/unpeek/` directory:
210
+ Install the skill directly into your project or configured agent environment:
187
211
 
188
212
  ```bash
189
- mkdir -p .agents/skills/unpeek
190
- curl -fsSL https://raw.githubusercontent.com/Woffluon/unpeek/main/skills/unpeek/SKILL.md \
191
- -o .agents/skills/unpeek/SKILL.md
213
+ npx skills add Woffluon/unpeek
192
214
  ```
193
215
 
194
- ### Global Machine Installation (Antigravity / Gemini CLI / Claude Code)
216
+ #### 2. Local Repository Installation
217
+
218
+ When developing or testing directly within the `unpeek` repository:
219
+
220
+ ```bash
221
+ npx skills add .
222
+ ```
223
+
224
+ #### 3. Multi-Agent Targeting & Global Installation
225
+
226
+ Install globally across multiple coding agents without interactive confirmation:
195
227
 
196
228
  ```bash
197
- # Antigravity & Gemini CLI
198
- mkdir -p ~/.gemini/config/skills/unpeek
229
+ npx skills add Woffluon/unpeek --agent claude-code codex cursor gemini-cli github-copilot opencode --global --yes
230
+ ```
231
+
232
+ #### 4. Manual / Direct Copy Fallback
233
+
234
+ You can also copy the skill definition manually into project-level or global agent skill directories:
235
+
236
+ ```bash
237
+ # Project-scoped (.agents/skills/unpeek/SKILL.md)
238
+ mkdir -p .agents/skills/unpeek
199
239
  curl -fsSL https://raw.githubusercontent.com/Woffluon/unpeek/main/skills/unpeek/SKILL.md \
200
- -o ~/.gemini/config/skills/unpeek/SKILL.md
240
+ -o .agents/skills/unpeek/SKILL.md
201
241
 
202
- # Cross-agent standard (~/.agents/skills)
242
+ # Global agent directories (Antigravity / Gemini CLI / Claude Code)
203
243
  mkdir -p ~/.agents/skills/unpeek
204
244
  curl -fsSL https://raw.githubusercontent.com/Woffluon/unpeek/main/skills/unpeek/SKILL.md \
205
245
  -o ~/.agents/skills/unpeek/SKILL.md
206
246
  ```
207
247
 
208
- </talimat>
248
+ ### Agent Trigger Example
209
249
 
210
- ---
250
+ Once installed, invoke the skill directly in any agent session using the `$unpeek` prompt:
251
+
252
+ ```text
253
+ $unpeek Protect this build with passive telemetry and seed 0x7f4a2c.
254
+ ```
255
+
256
+ ### Token-Optimized Modular References (`skills/unpeek/references/`)
257
+
258
+ To conserve agent context windows and eliminate unnecessary token consumption, the primary [`skills/unpeek/SKILL.md`](skills/unpeek/SKILL.md) remains concise while delegating specialized guidance to on-demand modular reference documents in `skills/unpeek/references/`:
211
259
 
212
- <dogrulama>
260
+ - **`quickstart.md`**: Immediate setup, zero-config postbuild wiring, and 3-step verification loops.
261
+ - **`frameworks.md`**: Bundler configurations and SSR client boundaries (Next.js, Vite, Webpack, Rollup).
262
+ - **`architecture.md`**: Acorn AST parsing, transitive call-graph hot-path exemption, and FNV-1a checksums.
263
+ - **`sourcemaps.md`**: `.unpeek-maps/` vault isolation, CI pipelines, and Sentry/Datadog symbol uploads.
264
+ - **`api.md`**: CLI flags, programmatic Node.js methods (`protectProject`, `transformJavaScript`), and TypeScript interfaces.
265
+ - **`recipes.md`**: Production hardening recipes, deterministic CI seeds, and passive telemetry troubleshooting.
266
+
267
+ Agents read only the relevant reference file on-demand, preventing context bloat.
268
+
269
+ ---
213
270
 
214
271
  ## Verification, Testing & Benchmarks
215
272
 
@@ -219,10 +276,13 @@ This monorepo is managed with `pnpm` and verified against strict semantic equiva
219
276
  # Install workspace dependencies
220
277
  pnpm install
221
278
 
222
- # Run unit & reverse-engineering resistance test suites (Vitest)
279
+ # Run unit and reverse-engineering resistance test suites (Vitest)
223
280
  pnpm test
224
281
 
225
- # Run the V8 VM CPU overhead (<2%) & Gzip delta (<15%) benchmark
282
+ # Run unit tests with V8 code coverage report
283
+ pnpm --filter unpeek run test:coverage
284
+
285
+ # Run the V8 VM CPU overhead (<2%) and Gzip delta (<15%) benchmark
226
286
  pnpm bench
227
287
 
228
288
  # Run strict TypeScript typechecking across packages/unpeek and apps/web
@@ -232,14 +292,25 @@ pnpm typecheck
232
292
  pnpm build
233
293
  ```
234
294
 
235
- ### Benchmark Output Reference ([`packages/unpeek/benchmarks/overhead.bench.ts`](packages/unpeek/benchmarks/overhead.bench.ts))
295
+ ### Monorepo Scripts & Release Integrity
296
+
297
+ ```bash
298
+ # Verify Conventional Commit version calculation
299
+ powershell -File scripts/test-versioning.ps1
236
300
 
237
- - **Build / Transform Time**: `< 3000 ms`
238
- - **Gzip Size Delta**: `< 15%` on production application bundles
239
- - **Runtime CPU Overhead**: `< 2.00%` (interleaved multi-round V8 JIT benchmark)
240
- - **Plaintext Leak Rate**: `0%` for string literals meeting `minStringLength`
301
+ # Validate release readiness against planned commit message
302
+ powershell -File scripts/validate-version.ps1 -Message "fix: description"
303
+
304
+ # Stage release artifacts and compute SHA-256 manifests
305
+ powershell -File scripts/stage-release.ps1
306
+ ```
307
+
308
+ ### Benchmark Output Reference ([`packages/unpeek/benchmarks/overhead.bench.ts`](packages/unpeek/benchmarks/overhead.bench.ts))
241
309
 
242
- </dogrulama>
310
+ - **Build / Transform Time:** `< 3000 ms`
311
+ - **Gzip Size Delta:** `< 15%` on production application bundles
312
+ - **Runtime CPU Overhead:** `< 2.00%` (interleaved multi-round V8 JIT benchmark)
313
+ - **Plaintext Leak Rate:** `0%` for string literals meeting `minStringLength`
243
314
 
244
315
  ## License
245
316
 
package/README.tr.md ADDED
@@ -0,0 +1,317 @@
1
+ # unpeek
2
+
3
+ **Sıfır yapılandırma gerektiren, çağrı grafiği (call-graph) farkındalıklı, <%2 CPU ek yüküne sahip polimorfik JavaScript koruma ve çalışma zamanı (runtime) müdahale önleme aracı.**
4
+
5
+ [![Lisans: MIT](https://img.shields.io/badge/Lisans-MIT-emerald.svg)](LICENSE)
6
+ [![CPU Ek Yükü](https://img.shields.io/badge/CPU_Ek_Y%C3%BCk%C3%BC-%3C2%25-10b981.svg)](packages/unpeek/benchmarks/overhead.bench.ts)
7
+ [![Gzip Artışı](https://img.shields.io/badge/Gzip_Art%C4%B1%C5%9F%C4%B1-%3C15%25-06b6d4.svg)](packages/unpeek/benchmarks/overhead.bench.ts)
8
+ [![Canlı Demo](https://img.shields.io/badge/Playground-Canl%C4%B1_Demo-6366f1.svg)](https://woffluon.github.io/unpeek)
9
+
10
+ [English](./README.md) | Türkçe · [Canlı İnteraktif Playground](https://woffluon.github.io/unpeek) · [Ajan Mimari Kılavuzu](./AGENTS.md) · [Yapay Zeka Becerisi (SKILL.md)](./skills/unpeek/SKILL.md)
11
+
12
+ ---
13
+
14
+ ## Neden unpeek?
15
+
16
+ Next.js, Vite veya Webpack ile geliştirilen modern bir web uygulamasını yayına aldığınızda; istemci tarafındaki iş mantığı, iç API uç noktaları, özellik bayrakları (feature flags) ve algoritmalar Chrome DevTools veya `webcrack` / `synchrony` gibi otomatik AST çözücüler aracılığıyla açıkça okunabilir.
17
+
18
+ Mevcut araçlar geliştiricileri zor bir ödünleşime zorlar:
19
+ - **Standart küçültücüler (`esbuild`, `SWC`, `Terser`):** Yalnızca boşlukları siler ve değişken adlarını kısaltır. DevTools içerisindeki Pretty-Print (`{}`) düğmesine tek bir tıklamayla metin sabitleri, API adresleri ve kontrol akışı yeniden okunabilir hale gelir.
20
+ - **Geleneksel AST karmaşıklaştırıcılar (`javascript-obfuscator`):** Paketteki her fonksiyona ayrım gözetmeksizin ağır kontrol akışı düzleştirme (control-flow flattening), `eval` tuzakları ve dizi döndürme işlemleri uygular. Bu yaklaşım paket boyutunu %40 ile %300 oranında şişirir, V8 TurboFan JIT derleyicisinin 60fps arayüz döngülerindeki satır içi optimizasyonlarını bozar ve tarayıcıda donmalara yol açar.
21
+
22
+ `unpeek`, statik çağrı grafiği analizini derleme zamanı polimorfik şifreleme ile birleştirerek bu sorunu çözer:
23
+
24
+ | Yetenek | Standart Küçültücüler (`Terser` / `SWC`) | Geleneksel AST Karmaşıklaştırıcılar | `unpeek` |
25
+ | :--- | :--- | :--- | :--- |
26
+ | **Çalışma Zamanı CPU Ek Yükü** | ~%0 | %15 ile %85 (arayüz döngülerini yavaşlatır) | **< %2.0** (Çağrı Grafiği Hot-Path Muafiyeti) |
27
+ | **Gzip Paket Büyümesi** | %0 (Referans) | +%45 ile +%300 | **< %15** (O(1) Tembel Metin Kasası) |
28
+ | **Metin ve API Uç Noktası Şifreleme** | Pakette düz metin (plaintext) | Başlangıçta tam dizi çözme (yüksek CPU) | **Polimorfik XOR + O(1) Önbellekli Kasa** |
29
+ | **DevTools Pretty-Print (`{}`) Koruması** | Yok | `debugger` döngüleri (kolayca devre dışı bırakılır) | **`Function.prototype.toString()` FNV-1a Bütünlük Doğrulaması** |
30
+ | **Source Map Yalıtımı** | Manuel CI betikleri | Manuel yapılandırma | **Otomatik `.unpeek-maps/` Kasası + Yorum Temizliği** |
31
+ | **Statik Deobfuscator Direnci** | Yok | Sabit şablonlar (`webcrack` tarafından tanınır) | **Derleme Başına Polimorfik AST Tohumu (Seed)** |
32
+ | **SSR / Next.js Uyumluluğu** | Doğal | Sunucu hidrasyonunu (hydration) sıklıkla bozar | **Yalnızca İstemci Otomatik Tespiti + SSR Koruması** |
33
+
34
+ ### Temel Mimari
35
+
36
+ ```mermaid
37
+ flowchart TD
38
+ A["İstemci Derleme Çıktısı (.next/static, dist/assets, build/static)"] --> B["Framework Dedektörü (detectTargetFramework)"]
39
+ B --> C["Source Map Kasası (relocateSourceMaps)"]
40
+ C -->|Haritaları taşı ve sourceMappingURL kaldır| D[".unpeek-maps/ (Özel Kasa)"]
41
+ C --> E["İstemci JS Paketleri (.js, .mjs)"]
42
+ E --> F["AST Sıcak Yol Analizi (detectHotPaths)"]
43
+ F -->|Döngüler, Dizi Fonksiyonları, UI Render| G["Sıcak Yol: %0 Vergi (Opak Akış Atlanır)"]
44
+ F -->|Soğuk Fonksiyonlar: Yetki, Lisans, İmza| H["Soğuk Yol: Opak Kontrol Akışı Koruması"]
45
+ G --> I["Polimorfik Metin Kasası (O(1) Tembel XOR)"]
46
+ H --> I
47
+ I --> J["Tanımlayıcı ve Sembol Maskeleme"]
48
+ J --> K["Çalışma Zamanı Bütünlük Kalkanı (FNV-1a Özeti)"]
49
+ K --> L["Güçlendirilmiş Üretim Paketleri"]
50
+ ```
51
+
52
+ 1. **Çağrı Grafiği (Call-Graph) Hot-Path Muafiyeti (`<%2` CPU Bütçesi)**
53
+ [`detectHotPaths`](packages/unpeek/src/ast/index.ts), tek bir AST düğümünü değiştirmeden önce dosyanın çağrı grafiğini tarar. Döngü içeren fonksiyonlar (`for`, `while`, `do-while`, `for-of`), dizi yüksek mertebe geri çağrıları (`.map`, `.filter`, `.reduce`, `.forEach`), `requestAnimationFrame` zamanlayıcıları ve React/UI bileşenleri (`useState`, `useEffect`, `createElement`) sıcak yol (hot path) olarak işaretlenir. `unpeek` tüm paketteki yerel tanımlayıcıları maskeler ve metin sabitlerini şifreler; opak kontrol akışı korumalarını ise yalnızca soğuk fonksiyonlara (lisans doğrulama, istek imzalama, yetki kontrolü gibi) enjekte eder. Sıcak döngülerdeki V8 JIT optimizasyonu doğal hızında çalışmayı sürdürür.
54
+ 2. **O(1) Tembel Metin Kasası (Lazy String Vault, `<%15` Gzip Bütçesi)**
55
+ Düz metin sabitleri (`minStringLength >= 4`), derleme zamanında 32-bitlik polimorfik bir tohum (seed) ile anahtarlanan XOR akış şifresiyle kodlanır. Sayfa açılışında tüm metinleri aynı anda çözmek yerine, enjekte edilen kasa yardımcısı her metni ilk erişildiğinde tembel (lazy) olarak çözer ve düz metin sonucunu kendi dizi hücresine önbellekler. Sonraki tüm okumalar doğrudan dizi indeksleme ile O(1) sürede tamamlanır.
56
+ 3. **Öz-Savunmalı `Function.prototype.toString()` Bütünlük Kontrolü ve Pasif Caydırıcı**
57
+ Bir analist korumalı bir dosyayı DevTools Pretty-Print (`{}`) ile biçimlendirdiğinde veya Sources panelinde bir koşulu değiştirdiğinde, biçimlendirilen kod `Function.prototype.toString()` çıktısını değiştirir. [`verifyCodeIntegrity`](packages/unpeek/src/runtime/index.ts), dokunulmamış küçültülmüş kodda sıfır yanlış pozitif oranıyla 32-bit FNV-1a özetini doğrular ve saldırganların doğrudan yamayabileceği ani bir çökme yerine kademeli durum bozulması (`deterrentMode: 'gradual'`) başlatır.
58
+ 4. **Otomatik Source Map Kasası (`.unpeek-maps/`)**
59
+ Üretim çıktısında `.js.map` dosyalarını bırakmak, orijinal TypeScript proje ağacınızın DevTools içinde birebir yeniden oluşturulmasına yol açar. [`protectProject`](packages/unpeek/src/cli/protect.ts), `.map` dosyalarını genel çıktı dizininden özel `.unpeek-maps/` klasörüne taşır ve tüm istemci paketlerinden `//# sourceMappingURL=` yorumlarını temizler. Böylece haritaları son kullanıcılara sunmadan Sentry veya Datadog gibi platformlara yükleyebilirsiniz.
60
+
61
+ ---
62
+
63
+ ## Hızlı Başlangıç
64
+
65
+ ### 1. Proje Kurulumu (`npx unpeek init`)
66
+
67
+ Proje kök dizininizde (Next.js, Vite, Webpack veya yalın JS) başlatıcıyı çalıştırın:
68
+
69
+ ```bash
70
+ npx unpeek init
71
+ ```
72
+
73
+ Bu komut üç hazırlık adımını tamamlar:
74
+ 1. `package.json` ve yapılandırma dosyalarından çatınızı (`nextjs`, `vite`, `webpack` veya `vanilla`) otomatik tespit eder.
75
+ 2. Her üretim derlemesinin otomatik olarak korunması için `package.json` betiklerine `"postbuild": "unpeek protect"` satırını ekler.
76
+ 3. Çıkarılan kaynak haritalarının (source maps) git geçmişine girmemesi için `.gitignore` dosyasına `.unpeek-maps/` dizinini ekler.
77
+
78
+ ### 2. CLI Kullanımı (`unpeek protect`)
79
+
80
+ `unpeek` paketini geliştirme bağımlılığı olarak kurup CI/CD süreçlerinde veya yerel derlemelerde doğrudan çalıştırabilirsiniz:
81
+
82
+ ```bash
83
+ npm install -D unpeek
84
+ npx unpeek protect
85
+ ```
86
+
87
+ #### CLI Komutları ve Seçenekleri
88
+
89
+ | Komut / Bayrak | Açıklama | Varsayılan |
90
+ | :--- | :--- | :--- |
91
+ | `init [--dry-run]` | Proje çerçevesini otomatik algılar, `postbuild` kancasını ve `.unpeek-maps/` kasasını yapılandırır | |
92
+ | `protect` | Üretim istemci paketlerini yerinde korur (varsayılan komut) | |
93
+ | `--out-dir <yol>` | İstemci çıktı klasörünü açıkça belirtir (ör. `dist/assets`, `.next/static/chunks`) | Proje framework'ünden otomatik tespit |
94
+ | `--seed <sayı>` | Deterministik 32-bit polimorfik derleme tohumu (seed) | Derleme başına rastgele |
95
+ | `--passive` | Kademeli bozulma yerine pasif telemetri caydırıcı modunu kullan | Varsayılan: kademeli bozulma (`gradual`) |
96
+ | `--no-maps` | `.map` dosyalarını `.unpeek-maps/` klasörüne taşımak yerine kalıcı olarak sil | `.unpeek-maps/` içine taşır |
97
+ | `--min-string-length <sayı>` | Tembel şifreleme kasasına alınacak minimum metin uzunluğu | `4` |
98
+ | `--private-maps-dir <dizin>` | Kaynak haritalarının taşınacağı özel kasa klasörü | `.unpeek-maps` |
99
+ | `--no-shield` | Çalışma zamanı anti-tamper kalkanının enjekte edilmesini devre dışı bırak | Giriş paketlerine kalkan eklenir |
100
+ | `-h, --help` | Yardım iletisini göster | |
101
+ | `-v, --version` | Sürüm numarasını göster | |
102
+
103
+ > [!NOTE]
104
+ > `protectProject(options)` üzerinden programatik kullanım; `minStringLength`, `privateMapsDir`, `injectRuntimeShield` ve `cwd` gibi ek yapılandırma seçeneklerini destekler.
105
+
106
+ > [!IMPORTANT]
107
+ > **CommonJS Kullanıcıları İçin Dinamik `import()` Uyarısı:**
108
+ > `unpeek` varsayılan olarak yerel ECMAScript Modülleri (`"type": "module"`) ile dağıtılmaktadır. CommonJS kullanan projelerde (`require()` veya `.cjs` yapılandırma dosyaları) `unpeek` modüllerini dinamik `import()` ile yükleyiniz:
109
+ > ```javascript
110
+ > // CommonJS (next.config.js / webpack.config.js / betikler)
111
+ > const unpeek = (await import('unpeek/unplugin')).default;
112
+ > const { protectProject, transformJavaScript } = await import('unpeek');
113
+ > ```
114
+
115
+ ### 3. Evrensel Paketleyici Eklentisi (`unpeek/unplugin`)
116
+
117
+ Derleme sonrası CLI adımı yerine paketleyicinin `renderChunk` yaşam döngüsü sırasında bellek içi dönüşüm yapmak isterseniz [`unpeek/unplugin`](packages/unpeek/src/bundler/unplugin.ts) modülünü kullanabilirsiniz:
118
+
119
+ #### Vite (`vite.config.ts`)
120
+
121
+ ```ts
122
+ import { defineConfig } from 'vite';
123
+ import unpeek from 'unpeek/unplugin';
124
+
125
+ export default defineConfig({
126
+ plugins: [
127
+ unpeek.vite({
128
+ deterrentMode: 'gradual',
129
+ }),
130
+ ],
131
+ });
132
+ ```
133
+
134
+ #### Next.js (`next.config.mjs`)
135
+
136
+ Node.js sunucu paketlerinin özgün yığın izlerini (stack traces) koruması için eklentiyi istemci paketleriyle (`!isServer`) sınırlandırın:
137
+
138
+ ```js
139
+ import unpeek from 'unpeek/unplugin';
140
+
141
+ /** @type {import('next').NextConfig} */
142
+ const nextConfig = {
143
+ webpack(config, { dev, isServer }) {
144
+ if (!dev && !isServer) {
145
+ config.plugins.push(
146
+ unpeek.webpack({
147
+ deterrentMode: 'gradual',
148
+ })
149
+ );
150
+ }
151
+ return config;
152
+ },
153
+ };
154
+
155
+ export default nextConfig;
156
+ ```
157
+
158
+ #### Programatik API
159
+
160
+ ```ts
161
+ import { transformJavaScript, protectProject } from 'unpeek';
162
+
163
+ // Tek bir JavaScript kod dizesini bellek içinde dönüştürün
164
+ const result = transformJavaScript(sourceCode, {
165
+ seed: 0x7f3a91,
166
+ minStringLength: 4,
167
+ injectRuntimeShield: true,
168
+ deterrentMode: 'gradual',
169
+ });
170
+
171
+ console.log(result.hotPathReport);
172
+ // { totalFunctions: 12, hotFunctionsSkipped: ['renderLoop'], coldFunctionsProtected: ['signRequest'] }
173
+
174
+ // Veya tüm derleme dizinini koruyun
175
+ const summary = await protectProject({
176
+ cwd: process.cwd(),
177
+ keepPrivateMaps: true,
178
+ privateMapsDir: '.unpeek-maps',
179
+ });
180
+ ```
181
+
182
+ ---
183
+
184
+ ## `.unpeek-maps/` Source Map Kasası ve Sentry İş Akışı
185
+
186
+ `keepPrivateMaps` etkinleştirildiğinde (varsayılan), `unpeek` genel çıktı dizininizdeki tüm `.js.map` dosyalarını göreli dosya adlarını koruyarak `.unpeek-maps/` dizinine taşır ve genel `.js` dosyalarından `//# sourceMappingURL=` yönergelerini temizler.
187
+
188
+ Üretim hata izleme sistemlerinde tam yığın izi çözümlemesini (symbolication) korumak için:
189
+
190
+ ```bash
191
+ # 1. Uygulamanızı derleyin ve unpeek'i çalıştırın (postbuild ile otomatik tetiklenir)
192
+ npm run build
193
+
194
+ # 2. .unpeek-maps/ klasöründeki gizli kaynak haritalarını Sentry veya Datadog'a yükleyin
195
+ npx @sentry/cli sourcemaps upload .unpeek-maps --release="$GIT_COMMIT_SHA"
196
+
197
+ # 3. Genel derleme klasörünüzü (.next/, dist/ veya build/) dağıtın
198
+ ```
199
+
200
+ ---
201
+
202
+ ## Yapay Zeka Kodlama Ajanı Entegrasyonu (AI Coding Agent Integration)
203
+
204
+ `unpeek`, açık Vercel Agent Skills belirtimi ve Ajan Becerileri Keşif Optimizasyonu (SDO) standartlarıyla tam uyumlu resmi bir Yapay Zeka Ajan Becerisi ([`skills/unpeek/SKILL.md`](skills/unpeek/SKILL.md)) sunar. Bu beceriyi eklemek; kodlama ajanlarınıza (Claude Code, Cursor, OpenAI Codex, Gemini CLI, GitHub Copilot, OpenCode) istemci paketlerini koruma, hot-path performans bütçelerini (<%2 CPU, <%15 Gzip) koruma, SSR sınırlarını gözetme ve `.unpeek-maps/` kasasını CI/CD hatlarına bağlama konularında derin uzmanlık kazandırır.
205
+
206
+ ### Beceri (Skill) Kurulumu
207
+
208
+ #### 1. Standart Kurulum (Vercel Agent Skills CLI)
209
+
210
+ Beceriyi doğrudan GitHub üzerinden projenize veya yapılandırılmış ajan ortamınıza kurun:
211
+
212
+ ```bash
213
+ npx skills add Woffluon/unpeek
214
+ ```
215
+
216
+ #### 2. Yerel Depo Kurulumu
217
+
218
+ `unpeek` deposu içerisinde doğrudan geliştirme veya test yaparken:
219
+
220
+ ```bash
221
+ npx skills add .
222
+ ```
223
+
224
+ #### 3. Çoklu Ajan Hedefleme ve Global Kurulum
225
+
226
+ Etkileşimli onay istemlerini atlayarak birden çok kodlama ajanını global olarak hedefleyin:
227
+
228
+ ```bash
229
+ npx skills add Woffluon/unpeek --agent claude-code codex cursor gemini-cli github-copilot opencode --global --yes
230
+ ```
231
+
232
+ #### 4. Manuel / Doğrudan Kopyalama ile Kurulum
233
+
234
+ Beceriyi proje düzeyindeki veya genel ajan dizinlerine manuel olarak da indirebilirsiniz:
235
+
236
+ ```bash
237
+ # Proje kapsamında (.agents/skills/unpeek/SKILL.md)
238
+ mkdir -p .agents/skills/unpeek
239
+ curl -fsSL https://raw.githubusercontent.com/Woffluon/unpeek/main/skills/unpeek/SKILL.md \
240
+ -o .agents/skills/unpeek/SKILL.md
241
+
242
+ # Genel ajan dizinleri (Antigravity / Gemini CLI / Claude Code)
243
+ mkdir -p ~/.agents/skills/unpeek
244
+ curl -fsSL https://raw.githubusercontent.com/Woffluon/unpeek/main/skills/unpeek/SKILL.md \
245
+ -o ~/.agents/skills/unpeek/SKILL.md
246
+ ```
247
+
248
+ ### Ajan Tetikleme Örneği (Prompt)
249
+
250
+ Kurulum tamamlandıktan sonra herhangi bir ajan oturumunda `$unpeek` istemiyle koruma sürecini başlatın:
251
+
252
+ ```text
253
+ $unpeek Protect this build with passive telemetry and seed 0x7f4a2c.
254
+ ```
255
+
256
+ ### Token-Optimize Modüler Referans Yapısı (`skills/unpeek/references/`)
257
+
258
+ Ajan bağlam penceresini (context window) korumak ve gereksiz token tüketimini önlemek için ana [`skills/unpeek/SKILL.md`](skills/unpeek/SKILL.md) dosyası kompakt tutulmuş; detaylı rehberler `skills/unpeek/references/` dizini altındaki 6 modüler dokümana ayrılmıştır:
259
+
260
+ - **`quickstart.md`**: Sıfır ayarlı kurulum, postbuild betikleri ve 3 adımlı doğrulama döngüsü.
261
+ - **`frameworks.md`**: Çatı bazlı yapılandırmalar ve SSR istemci sınırları (Next.js, Vite, Webpack, Rollup).
262
+ - **`architecture.md`**: Acorn AST ayrıştırma, geçişken çağrı grafiği hot-path muafiyeti ve FNV-1a sağlama toplamları.
263
+ - **`sourcemaps.md`**: `.unpeek-maps/` kasa izolasyonu, CI hatları ve Sentry/Datadog sembol yükleme iş akışları.
264
+ - **`api.md`**: CLI bayrakları, programatik Node.js metotları (`protectProject`, `transformJavaScript`) ve TypeScript arayüzleri.
265
+ - **`recipes.md`**: Üretim zırhlama tarifleri, deterministik CI tohumları ve pasif telemetri sorun giderme adımları.
266
+
267
+ Ajanlar yalnızca o anki görevin gerektirdiği referans dosyasını seçici olarak okur; böylece bağlam şişmesi engellenir.
268
+
269
+ ---
270
+
271
+ ## Doğrulama, Testler ve Benchmarklar
272
+
273
+ Bu monorepo `pnpm` ile yönetilir; semantik denklik, çözücü direnci ve çalışma zamanı ek yük bütçeleri doğrulanır:
274
+
275
+ ```bash
276
+ # Çalışma alanı bağımlılıklarını kurun
277
+ pnpm install
278
+
279
+ # Birim ve tersine mühendislik direnç testlerini çalıştırın (Vitest)
280
+ pnpm test
281
+
282
+ # V8 kod kapsamı raporu ile birim testlerini çalıştırın
283
+ pnpm --filter unpeek run test:coverage
284
+
285
+ # V8 VM CPU ek yükü (<%2) ve Gzip artışı (<%15) benchmark testini çalıştırın
286
+ pnpm bench
287
+
288
+ # packages/unpeek ve apps/web genelinde katı TypeScript tip kontrolü yapın
289
+ pnpm typecheck
290
+
291
+ # Çekirdek paketi ve statik interaktif web arayüzünü derleyin
292
+ pnpm build
293
+ ```
294
+
295
+ ### Monorepo Betikleri ve Sürüm Bütünlüğü
296
+
297
+ ```bash
298
+ # Conventional Commit sürüm hesaplamasını test edin
299
+ powershell -File scripts/test-versioning.ps1
300
+
301
+ # Planlanan commit ile sürüm uygunluğunu doğrulayın
302
+ powershell -File scripts/validate-version.ps1 -Message "fix: description"
303
+
304
+ # Sürüm paketlerini ve SHA-256 manifestlerini hazırlayın
305
+ powershell -File scripts/stage-release.ps1
306
+ ```
307
+
308
+ ### Benchmark Çıktı Referansı ([`packages/unpeek/benchmarks/overhead.bench.ts`](packages/unpeek/benchmarks/overhead.bench.ts))
309
+
310
+ - **Derleme / Dönüşüm Süresi:** `< 3000 ms`
311
+ - **Gzip Boyut Artışı:** `< %15` (üretim uygulama paketlerinde)
312
+ - **Çalışma Zamanı CPU Ek Yükü:** `< %2.00` (aralıklı çok turlu V8 JIT testi)
313
+ - **Düz Metin Sızıntı Oranı:** `%0` (`minStringLength` kuralını karşılayan metin sabitleri için)
314
+
315
+ ## Lisans
316
+
317
+ [MIT Lisansı](./LICENSE) kapsamında yayınlanmıştır.