uneven-ai 1.1.5 → 1.1.9

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 (114) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +9 -10
  3. package/dist/application/analysis/active/helpers.d.ts.map +1 -1
  4. package/dist/application/analysis/active/helpers.js +9 -2
  5. package/dist/application/analysis/active/index.js +1 -1
  6. package/dist/application/analysis/data-security/context.d.ts.map +1 -1
  7. package/dist/application/analysis/data-security/context.js +2 -0
  8. package/dist/application/analysis/pentest-security-context.d.ts +1 -0
  9. package/dist/application/analysis/pentest-security-context.d.ts.map +1 -1
  10. package/dist/application/analysis/pentest-security-context.js +2 -0
  11. package/dist/application/analysis/report-packager.d.ts +1 -1
  12. package/dist/application/analysis/report-packager.d.ts.map +1 -1
  13. package/dist/application/analysis/report-packager.js +2 -2
  14. package/dist/application/analysis/security/analyzer.d.ts +2 -1
  15. package/dist/application/analysis/security/analyzer.d.ts.map +1 -1
  16. package/dist/application/analysis/security/analyzer.js +10 -8
  17. package/dist/application/analysis/security/dependency-scanner.d.ts +2 -2
  18. package/dist/application/analysis/security/dependency-scanner.d.ts.map +1 -1
  19. package/dist/application/analysis/security/dependency-scanner.js +6 -6
  20. package/dist/application/analysis/security/header-scanner.d.ts +1 -1
  21. package/dist/application/analysis/security/header-scanner.d.ts.map +1 -1
  22. package/dist/application/analysis/security/header-scanner.js +5 -5
  23. package/dist/application/development/fix/patterns-compiled.d.ts +6 -0
  24. package/dist/application/development/fix/patterns-compiled.d.ts.map +1 -1
  25. package/dist/application/development/fix/patterns-compiled.js +66 -0
  26. package/dist/application/development/fix/patterns-runtime.d.ts +2 -0
  27. package/dist/application/development/fix/patterns-runtime.d.ts.map +1 -1
  28. package/dist/application/development/fix/patterns-runtime.js +89 -0
  29. package/dist/application/development/fix/suggest.d.ts.map +1 -1
  30. package/dist/application/development/fix/suggest.js +68 -1
  31. package/dist/application/orchestration/engine/error-handler.d.ts.map +1 -1
  32. package/dist/application/orchestration/engine/error-handler.js +3 -1
  33. package/dist/application/orchestration/engine/index.d.ts.map +1 -1
  34. package/dist/application/orchestration/engine/index.js +11 -1
  35. package/dist/application/orchestration/engine/indexer.d.ts.map +1 -1
  36. package/dist/application/orchestration/engine/indexer.js +12 -8
  37. package/dist/application/orchestration/engine/lifecycle.js +1 -1
  38. package/dist/application/orchestration/engine/pentest.js +4 -4
  39. package/dist/cli/commands/analyze/command.d.ts.map +1 -1
  40. package/dist/cli/commands/analyze/command.js +11 -6
  41. package/dist/cli/commands/ask.d.ts.map +1 -1
  42. package/dist/cli/commands/ask.js +10 -4
  43. package/dist/cli/commands/askf.d.ts.map +1 -1
  44. package/dist/cli/commands/askf.js +4 -2
  45. package/dist/cli/commands/chat.d.ts.map +1 -1
  46. package/dist/cli/commands/chat.js +9 -3
  47. package/dist/cli/commands/ci.d.ts.map +1 -1
  48. package/dist/cli/commands/ci.js +11 -10
  49. package/dist/cli/commands/explain.d.ts.map +1 -1
  50. package/dist/cli/commands/explain.js +8 -3
  51. package/dist/cli/commands/index.d.ts.map +1 -1
  52. package/dist/cli/commands/index.js +6 -5
  53. package/dist/cli/commands/info.d.ts.map +1 -1
  54. package/dist/cli/commands/info.js +7 -1
  55. package/dist/cli/commands/log.d.ts.map +1 -1
  56. package/dist/cli/commands/log.js +3 -1
  57. package/dist/cli/commands/pentest.d.ts.map +1 -1
  58. package/dist/cli/commands/pentest.js +5 -4
  59. package/dist/cli/commands/remote-shell.d.ts.map +1 -1
  60. package/dist/cli/commands/remote-shell.js +3 -1
  61. package/dist/cli/commands/reset.d.ts.map +1 -1
  62. package/dist/cli/commands/reset.js +5 -3
  63. package/dist/cli/commands/review.d.ts.map +1 -1
  64. package/dist/cli/commands/review.js +8 -4
  65. package/dist/cli/commands/scan.d.ts.map +1 -1
  66. package/dist/cli/commands/scan.js +5 -4
  67. package/dist/cli/commands/shell.d.ts.map +1 -1
  68. package/dist/cli/commands/shell.js +32 -36
  69. package/dist/cli/commands/watch.d.ts.map +1 -1
  70. package/dist/cli/commands/watch.js +5 -4
  71. package/dist/cli/shell/intent-classifier.js +2 -2
  72. package/dist/domain/entities/session/manager.d.ts.map +1 -1
  73. package/dist/domain/entities/session/manager.js +3 -0
  74. package/dist/infrastructure/adapters/bridge.d.ts.map +1 -1
  75. package/dist/infrastructure/adapters/bridge.js +1 -0
  76. package/dist/infrastructure/io/db-loader.d.ts +2 -1
  77. package/dist/infrastructure/io/db-loader.d.ts.map +1 -1
  78. package/dist/infrastructure/io/db-loader.js +31 -5
  79. package/dist/infrastructure/io/logger/index.d.ts +4 -0
  80. package/dist/infrastructure/io/logger/index.d.ts.map +1 -1
  81. package/dist/infrastructure/io/logger/index.js +8 -0
  82. package/dist/infrastructure/io/process-watcher.d.ts.map +1 -1
  83. package/dist/infrastructure/io/process-watcher.js +32 -0
  84. package/dist/infrastructure/license/gate.d.ts +3 -0
  85. package/dist/infrastructure/license/gate.d.ts.map +1 -1
  86. package/dist/infrastructure/license/gate.js +17 -0
  87. package/dist/infrastructure/license/index.d.ts +1 -1
  88. package/dist/infrastructure/license/index.d.ts.map +1 -1
  89. package/dist/infrastructure/license/index.js +1 -1
  90. package/dist/infrastructure/utils/config-loader.d.ts +8 -2
  91. package/dist/infrastructure/utils/config-loader.d.ts.map +1 -1
  92. package/dist/infrastructure/utils/config-loader.js +104 -21
  93. package/dist/infrastructure/utils/error-parser/index.d.ts.map +1 -1
  94. package/dist/infrastructure/utils/error-parser/index.js +9 -3
  95. package/dist/infrastructure/utils/error-parser/parsers-compiled.d.ts.map +1 -1
  96. package/dist/infrastructure/utils/error-parser/parsers-compiled.js +45 -3
  97. package/dist/infrastructure/utils/error-parser/parsers-dynamic.d.ts +2 -0
  98. package/dist/infrastructure/utils/error-parser/parsers-dynamic.d.ts.map +1 -1
  99. package/dist/infrastructure/utils/error-parser/parsers-dynamic.js +154 -8
  100. package/dist/infrastructure/utils/migration.d.ts +1 -1
  101. package/dist/infrastructure/utils/migration.d.ts.map +1 -1
  102. package/dist/infrastructure/utils/migration.js +1 -2
  103. package/dist/infrastructure/utils/network.d.ts +6 -0
  104. package/dist/infrastructure/utils/network.d.ts.map +1 -0
  105. package/dist/infrastructure/utils/network.js +44 -0
  106. package/dist/infrastructure/utils/process-lock.d.ts +1 -1
  107. package/dist/infrastructure/utils/process-lock.d.ts.map +1 -1
  108. package/dist/infrastructure/utils/process-lock.js +2 -2
  109. package/package.json +2 -2
  110. package/prebuilds/darwin-arm64/uneven_core.node +0 -0
  111. package/prebuilds/linux-arm64/uneven_core.node +0 -0
  112. package/prebuilds/linux-x64/uneven_core.node +0 -0
  113. package/prebuilds/win32-x64/uneven_core.node +0 -0
  114. package/types/index.d.ts +11 -2
package/CHANGELOG.md CHANGED
@@ -5,6 +5,31 @@ All notable changes to Uneven AI will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.1.9] - 2026-04-27
9
+
10
+ ### Added
11
+ - **Attacker Identification (Uneven Trace)**: Active pentester now injects a silent origin-tracking header (`X-Uneven-Origin-Trace`) containing the attacker's machine IP.
12
+ - **Threat Detection Engine**: Terminal watcher now detects incoming Uneven pentest probes and logs a critical security alert with the source IP.
13
+ - **Portuguese Intent Support**: Shell now recognizes "crie", "faça", "escreva" for AI tasks even in keyword-fallback mode.
14
+
15
+ ### Changed
16
+ - **License Gating**: Active Pentester mode is now restricted to the **Team** plan.
17
+ - **Shell Stability**: Improved intent classification to prevent substring collision (e.g., "mundo" no longer triggers "undo").
18
+ - **Success Hints**: Shell now only prints success hints if the underlying command actually returns a success exit code.
19
+
20
+ ## [1.1.8] - 2026-04-27
21
+
22
+ ### Added
23
+ - **3-Layer Privacy Protection**: Enhanced data safety suite for database analysis, featuring **Schema Filtering** (AI never sees blocked tables), **Semantic SQL Auditing** (blocks unauthorized access patterns), and **Live Result Redaction** (masks sensitive values in real-time).
24
+ - **Forensic Audit Logs**: New `log.path` configuration that persists a detailed history of all AI actions, terminal errors, and applied fixes in a structured Markdown format for accountability.
25
+ - **Autonomous Security Pentester**: Validated static analysis engine capable of detecting hardcoded secrets (Entropy-based), OS/SQL injections, and missing infrastructure security headers (HSTS, CSP).
26
+ - **Universal Data Indexing**: Full support for `.csv` and `.xlsx` files, enabling seamless context delivery for automated data scripts.
27
+
28
+ ### Fixed
29
+ - **Configuration Loading**: Resolved a critical issue where the `analyze` command would ignore the project's `uneven.config.ts`.
30
+ - **Infrastructure Stability**: Fixed a build-breaking import error in the Pro feature gate (`gate.ts`).
31
+ - **Provider Reliability**: Improved Gemini API error handling for rate-limit and overload scenarios.
32
+
8
33
  ## [1.1.5] - 2026-04-24
9
34
 
10
35
  ### Fixed
package/README.md CHANGED
@@ -158,7 +158,7 @@ uneven-ai ci
158
158
  Run `uneven-ai` with no arguments to open the interactive shell:
159
159
 
160
160
  ```
161
- ◈ Uneven AI v1.1.1
161
+ ◈ Uneven AI v1.1.9
162
162
  ────────────────────────────────────────────────────────────
163
163
  Olá! O que posso fazer por você hoje?
164
164
  (Escreva sua mensagem ou "sair" para encerrar)
@@ -334,9 +334,9 @@ Interactive workflow:
334
334
 
335
335
  | Layer | What it does |
336
336
  |---|---|
337
- | Schema filter | Removes sensitive tables/columns before LLM sees the schema |
338
- | SQL audit | Blocks DML/DDL and references to sensitive tables |
339
- | Result masking | Redacts values matching sensitive patterns (bcrypt, JWT, AWS keys, etc.) |
337
+ | **1. Schema Filter** | Automatically removes sensitive tables and columns from the schema before the AI analyzes it. |
338
+ | **2. Semantic SQL Audit** | Actively blocks suspicious queries or attempts to access unauthorized data patterns. |
339
+ | **3. Live Result Redaction** | Dynamically masks sensitive values (Passwords, JWTs, AWS keys) in real-time before they reach your screen. |
340
340
 
341
341
  ### Pentester [Pro]
342
342
 
@@ -445,12 +445,11 @@ Privacy is not a feature — it's the foundation.
445
445
  ✅ **Absolute sovereignty** — 100% local execution available
446
446
  ✅ **Privacy Sanity** — Development environment paths automatically stripped from distribution binaries
447
447
  ✅ **No telemetry** — zero usage tracking or analytics
448
- ✅ **No data sent anywhere** — your code stays on your machine
449
- ✅ **Scope-enforced pentester** — active mode blocked without explicit digital authorization
450
- ✅ **3-layer data protection** — sensitive schema and data never reach the LLM or output
451
- ✅ **Ethical safety guard** — built-in protection against generating malware or exploits
452
- ✅ **GPU acceleration** — automatic, transparent, no cloud involved
453
- ✅ **Auditable diffs** — every automated change is fully logged and reversible
448
+ ✅ **Forensic Audit Logs** — Detailed activity history with secure timestamps and auditable code diffs
449
+ ✅ **3-layer data protection** — Sensitive schema and results are dynamically filtered and redacted
450
+ ✅ **Scope-enforced pentester** — Active mode requires explicit authorization and digital scope signing
451
+ ✅ **Ethical safety guard** — Built-in protection against generating malicious payloads or exploits
452
+ ✅ **GPU acceleration** — Automatic, transparent, and completely private hardware utilization
454
453
 
455
454
  ---
456
455
 
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/application/analysis/active/helpers.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAG5B,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAO1F;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC;IACpF,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,CAAA;IACtD,IAAI,EAAE,MAAM,CAAA;CACb,CAAC,CAmBD;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAChE,KAAK,EAAE,OAAO,CAAA;IACd,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,EAAE,OAAO,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;CACf,GAAG,IAAI,CAAC,CA8BR;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAY9F"}
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/application/analysis/active/helpers.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAI5B,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAO1F;AAED,wBAAsB,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC;IAC1F,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,CAAA;IACtD,IAAI,EAAE,MAAM,CAAA;CACb,CAAC,CA0BD;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAChE,KAAK,EAAE,OAAO,CAAA;IACd,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,EAAE,OAAO,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;CACf,GAAG,IAAI,CAAC,CA8BR;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAY9F"}
@@ -3,6 +3,7 @@ import * as tls from 'tls';
3
3
  import * as https from 'https';
4
4
  import * as http from 'http';
5
5
  import { CONNECT_TIMEOUT_MS, HTTP_TIMEOUT_MS } from './context.js';
6
+ import { getPublicIp } from '../../../infrastructure/utils/network.js';
6
7
  export function tcpConnect(host, port, timeoutMs) {
7
8
  return new Promise(resolve => {
8
9
  const sock = net.createConnection({ host, port });
@@ -11,10 +12,16 @@ export function tcpConnect(host, port, timeoutMs) {
11
12
  sock.on('error', () => { clearTimeout(timer); resolve(false); });
12
13
  });
13
14
  }
14
- export function httpRequest(options, useHttps) {
15
+ export async function httpRequest(options, useHttps) {
16
+ const ip = await getPublicIp();
17
+ const customHeaders = {
18
+ ...options.headers,
19
+ 'User-Agent': 'Uneven-Pentester/1.1.9',
20
+ ...(ip ? { 'X-Uneven-Origin-Trace': ip } : {})
21
+ };
15
22
  return new Promise((resolve, reject) => {
16
23
  const mod = useHttps ? https : http;
17
- const req = mod.request({ ...options, rejectUnauthorized: false }, res => {
24
+ const req = mod.request({ ...options, headers: customHeaders, rejectUnauthorized: false }, res => {
18
25
  let body = '';
19
26
  res.on('data', (chunk) => { body += chunk.toString('utf-8'); });
20
27
  res.on('end', () => resolve({
@@ -16,7 +16,7 @@ export class ActiveScanner {
16
16
  }
17
17
  async flushAuditLog() {
18
18
  try {
19
- const logPath = path.join(process.cwd(), '.uneven', 'pentest-audit.log');
19
+ const logPath = path.join(this.ctx.projectRoot, '.uneven', 'pentest-audit.log');
20
20
  await fs.mkdir(path.dirname(logPath), { recursive: true });
21
21
  await fs.appendFile(logPath, this.auditLog.join('\n') + '\n', 'utf-8');
22
22
  this.auditLog = [];
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/application/analysis/data-security/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACxE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAIxD;;GAEG;AACH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,MAAM,CAA0B;IACxC,OAAO,CAAC,cAAc,CAAyC;IAC/D,OAAO,CAAC,aAAa,CAA2C;gBAEpD,MAAM,GAAE,OAAO,CAAC,cAAc,CAAM;IA8BhD;;OAEG;IACH,YAAY,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG;QAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;QAAC,KAAK,EAAE,WAAW,CAAA;KAAE;IA2BpF;;OAEG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW;IAkClC;;OAEG;IACH,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG;QAAE,MAAM,EAAE,WAAW,CAAC;QAAC,KAAK,EAAE,WAAW,CAAA;KAAE;IA0C5E,gBAAgB,IAAI,MAAM;IAiB1B,SAAS,IAAI,QAAQ,CAAC,cAAc,CAAC;IAErC,OAAO,CAAC,eAAe;IAUvB,OAAO,CAAC,cAAc;CAGvB"}
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/application/analysis/data-security/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACxE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAIxD;;GAEG;AACH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,MAAM,CAA0B;IACxC,OAAO,CAAC,cAAc,CAAyC;IAC/D,OAAO,CAAC,aAAa,CAA2C;gBAEpD,MAAM,GAAE,OAAO,CAAC,cAAc,CAAM;IAgChD;;OAEG;IACH,YAAY,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG;QAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;QAAC,KAAK,EAAE,WAAW,CAAA;KAAE;IA2BpF;;OAEG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW;IAkClC;;OAEG;IACH,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG;QAAE,MAAM,EAAE,WAAW,CAAC;QAAC,KAAK,EAAE,WAAW,CAAA;KAAE;IA0C5E,gBAAgB,IAAI,MAAM;IAiB1B,SAAS,IAAI,QAAQ,CAAC,cAAc,CAAC;IAErC,OAAO,CAAC,eAAe;IAUvB,OAAO,CAAC,cAAc;CAGvB"}
@@ -12,10 +12,12 @@ export class DataSecurityContext {
12
12
  blockedColumns: [
13
13
  ...DEFAULT_POLICY.blockedColumns,
14
14
  ...(policy.blockedColumns ?? []),
15
+ ...policy.mask ?? [],
15
16
  ],
16
17
  blockedTables: [
17
18
  ...DEFAULT_POLICY.blockedTables,
18
19
  ...(policy.blockedTables ?? []),
20
+ ...policy.block ?? [],
19
21
  ],
20
22
  sensitiveValuePatterns: [
21
23
  ...DEFAULT_POLICY.sensitiveValuePatterns,
@@ -63,6 +63,7 @@ export interface ScopePass {
63
63
  }
64
64
  export type ScopeCheck = ScopeViolation | ScopePass;
65
65
  export declare class PentestSecurityContext {
66
+ projectRoot: string;
66
67
  private scopePath;
67
68
  private auditPath;
68
69
  private scope;
@@ -1 +1 @@
1
- {"version":3,"file":"pentest-security-context.d.ts","sourceRoot":"","sources":["../../../src/application/analysis/pentest-security-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAQH,MAAM,WAAW,gBAAgB;IAC/B,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAA;IACb,qCAAqC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,8CAA8C;IAC9C,YAAY,EAAE,MAAM,CAAA;IACpB,4CAA4C;IAC5C,YAAY,EAAE,MAAM,CAAA;IACpB,sDAAsD;IACtD,SAAS,EAAE,MAAM,CAAA;IACjB,yBAAyB;IACzB,OAAO,EAAE,gBAAgB,EAAE,CAAA;IAC3B,yBAAyB;IACzB,YAAY,EAAE,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC,CAAA;IACxC,kDAAkD;IAClD,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,IAAI,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,KAAK,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,MAAM,UAAU,GAAG,cAAc,GAAG,SAAS,CAAA;AAuFnD,qBAAa,sBAAsB;IACjC,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,KAAK,CAA4B;gBAE7B,WAAW,GAAE,MAAsB;IAO/C;;;OAGG;IACG,YAAY,CAChB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,gBAAgB,EAAE,EAC3B,YAAY,GAAE,YAAY,CAAC,cAAc,CAAc,EACvD,YAAY,GAAE,MAAiB,GAC9B,OAAO,CAAC,YAAY,CAAC;IAqBxB;;;OAGG;IACG,SAAS,IAAI,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IA0B/C,mCAAmC;IAC7B,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAUjC;;;OAGG;IACG,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAiDtD;;;OAGG;IACG,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAqBhF;;;OAGG;IACH,sBAAsB,CAAC,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM;IAkCzD,QAAQ,IAAI,YAAY,GAAG,IAAI;IAE/B,cAAc,IAAI;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE;YAajF,KAAK;IASnB,OAAO,CAAC,WAAW;CAIpB"}
1
+ {"version":3,"file":"pentest-security-context.d.ts","sourceRoot":"","sources":["../../../src/application/analysis/pentest-security-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAQH,MAAM,WAAW,gBAAgB;IAC/B,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAA;IACb,qCAAqC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,8CAA8C;IAC9C,YAAY,EAAE,MAAM,CAAA;IACpB,4CAA4C;IAC5C,YAAY,EAAE,MAAM,CAAA;IACpB,sDAAsD;IACtD,SAAS,EAAE,MAAM,CAAA;IACjB,yBAAyB;IACzB,OAAO,EAAE,gBAAgB,EAAE,CAAA;IAC3B,yBAAyB;IACzB,YAAY,EAAE,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC,CAAA;IACxC,kDAAkD;IAClD,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,IAAI,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,KAAK,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,MAAM,UAAU,GAAG,cAAc,GAAG,SAAS,CAAA;AAuFnD,qBAAa,sBAAsB;IAKd,WAAW,EAAE,MAAM;IAJtC,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,KAAK,CAA4B;gBAEtB,WAAW,GAAE,MAAsB;IAOtD;;;OAGG;IACG,YAAY,CAChB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,gBAAgB,EAAE,EAC3B,YAAY,GAAE,YAAY,CAAC,cAAc,CAAc,EACvD,YAAY,GAAE,MAAiB,GAC9B,OAAO,CAAC,YAAY,CAAC;IAqBxB;;;OAGG;IACG,SAAS,IAAI,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IA0B/C,mCAAmC;IAC7B,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAUjC;;;OAGG;IACG,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAiDtD;;;OAGG;IACG,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAqBhF;;;OAGG;IACH,sBAAsB,CAAC,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM;IAkCzD,QAAQ,IAAI,YAAY,GAAG,IAAI;IAE/B,cAAc,IAAI;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE;YAajF,KAAK;IASnB,OAAO,CAAC,WAAW;CAIpB"}
@@ -108,10 +108,12 @@ const PRIVATE_RANGES = [
108
108
  ];
109
109
  // ─── PentestSecurityContext ───────────────────────────────────────────────────
110
110
  export class PentestSecurityContext {
111
+ projectRoot;
111
112
  scopePath;
112
113
  auditPath;
113
114
  scope = null;
114
115
  constructor(projectRoot = process.cwd()) {
116
+ this.projectRoot = projectRoot;
115
117
  this.scopePath = path.join(projectRoot, '.uneven', 'pentest-scope.json');
116
118
  this.auditPath = path.join(projectRoot, '.uneven', 'pentest-audit.log');
117
119
  }
@@ -34,7 +34,7 @@ export interface PackageResult {
34
34
  }
35
35
  export declare class ReportPackager {
36
36
  private cacheDir;
37
- constructor(cacheDir?: string);
37
+ constructor(projectRoot?: string);
38
38
  /**
39
39
  * Full pipeline: make offline HTML → bundle exe.
40
40
  */
@@ -1 +1 @@
1
- {"version":3,"file":"report-packager.d.ts","sourceRoot":"","sources":["../../../src/application/analysis/report-packager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAYH,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAA;IACjB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,yCAAyC;IACzC,MAAM,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,WAAW,GAAG,aAAa,GAAG,WAAW,CAAA;IAC5E,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAQ;gBAEZ,QAAQ,GAAE,MAAqD;IAI3E;;OAEG;IACG,OAAO,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;IAuCpF;;;OAGG;IACG,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAgC5E,OAAO,CAAC,iBAAiB;YA4FX,MAAM;YA6CN,YAAY;CAyB3B"}
1
+ {"version":3,"file":"report-packager.d.ts","sourceRoot":"","sources":["../../../src/application/analysis/report-packager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAYH,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAA;IACjB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,yCAAyC;IACzC,MAAM,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,WAAW,GAAG,aAAa,GAAG,WAAW,CAAA;IAC5E,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAQ;gBAEZ,WAAW,GAAE,MAAsB;IAI/C;;OAEG;IACG,OAAO,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;IAuCpF;;;OAGG;IACG,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAgC5E,OAAO,CAAC,iBAAiB;YA4FX,MAAM;YA6CN,YAAY;CAyB3B"}
@@ -27,8 +27,8 @@ const execFile = promisify(execFileCb);
27
27
  const CHARTJS_CDN = 'https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.min.js';
28
28
  export class ReportPackager {
29
29
  cacheDir;
30
- constructor(cacheDir = path.join(process.cwd(), '.uneven', 'cache')) {
31
- this.cacheDir = cacheDir;
30
+ constructor(projectRoot = process.cwd()) {
31
+ this.cacheDir = path.join(projectRoot, '.uneven', 'cache');
32
32
  }
33
33
  /**
34
34
  * Full pipeline: make offline HTML → bundle exe.
@@ -5,8 +5,9 @@ import { SecurityFinding } from './types.js';
5
5
  * Orchestrates Phase 1 and Phase 2 security audits.
6
6
  */
7
7
  export declare class SecurityAnalyzer {
8
+ private projectRoot;
8
9
  private logger;
9
- constructor(logger: Logger);
10
+ constructor(logger: Logger, projectRoot?: string);
10
11
  /**
11
12
  * Runs a complete security audit (Phase 1 + Phase 2).
12
13
  */
@@ -1 +1 @@
1
- {"version":3,"file":"analyzer.d.ts","sourceRoot":"","sources":["../../../../src/application/analysis/security/analyzer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAA;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAQ5C;;;GAGG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAQ;gBAEV,MAAM,EAAE,MAAM;IAI1B;;OAEG;IACG,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAmCxD,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAIvD,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAI9D,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAIrD,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAI1D,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAI9D,gBAAgB,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;IAI9C,wBAAwB,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;IAItD,WAAW,CAAC,IAAI,GAAE,MAAM,EAAoB,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAI/E;;OAEG;YACW,YAAY;CAc3B"}
1
+ {"version":3,"file":"analyzer.d.ts","sourceRoot":"","sources":["../../../../src/application/analysis/security/analyzer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAA;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAQ5C;;;GAGG;AACH,qBAAa,gBAAgB;IAGC,OAAO,CAAC,WAAW;IAF/C,OAAO,CAAC,MAAM,CAAQ;gBAEV,MAAM,EAAE,MAAM,EAAU,WAAW,GAAE,MAAsB;IAIvE;;OAEG;IACG,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAmCxD,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAIvD,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAI9D,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAIrD,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAI1D,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAI9D,gBAAgB,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;IAI9C,wBAAwB,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;IAItD,WAAW,CAAC,IAAI,GAAE,MAAM,EAAuB,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAIlF;;OAEG;YACW,YAAY;CAc3B"}
@@ -10,8 +10,10 @@ import { scanHeaders } from './header-scanner.js';
10
10
  * Orchestrates Phase 1 and Phase 2 security audits.
11
11
  */
12
12
  export class SecurityAnalyzer {
13
+ projectRoot;
13
14
  logger;
14
- constructor(logger) {
15
+ constructor(logger, projectRoot = process.cwd()) {
16
+ this.projectRoot = projectRoot;
15
17
  this.logger = logger;
16
18
  }
17
19
  /**
@@ -27,9 +29,9 @@ export class SecurityAnalyzer {
27
29
  scanOWASP(dirs, collectFiles, this.logger),
28
30
  scanInjections(dirs, collectFiles, this.logger),
29
31
  scanConfigurations(dirs, collectFiles, this.logger),
30
- scanDependencies(this.logger),
31
- scanDependenciesExpanded(this.logger),
32
- scanHeaders(dirs, collectFiles, this.logger),
32
+ scanDependencies(this.logger, this.projectRoot),
33
+ scanDependenciesExpanded(this.logger, this.projectRoot),
34
+ scanHeaders(dirs, collectFiles, this.logger, this.projectRoot),
33
35
  ]);
34
36
  const all = dedup([
35
37
  ...secrets, ...entropy, ...owasp, ...injections,
@@ -59,13 +61,13 @@ export class SecurityAnalyzer {
59
61
  return scanConfigurations(dirs, this.collectFiles.bind(this), this.logger);
60
62
  }
61
63
  async scanDependencies() {
62
- return scanDependencies(this.logger);
64
+ return scanDependencies(this.logger, this.projectRoot);
63
65
  }
64
66
  async scanDependenciesExpanded() {
65
- return scanDependenciesExpanded(this.logger);
67
+ return scanDependenciesExpanded(this.logger, this.projectRoot);
66
68
  }
67
- async scanHeaders(dirs = [process.cwd()]) {
68
- return scanHeaders(dirs, this.collectFiles.bind(this), this.logger);
69
+ async scanHeaders(dirs = [this.projectRoot]) {
70
+ return scanHeaders(dirs, this.collectFiles.bind(this), this.logger, this.projectRoot);
69
71
  }
70
72
  /**
71
73
  * Internal: collect files from dirs.
@@ -3,9 +3,9 @@ import { Logger } from '../../../infrastructure/index.js';
3
3
  /**
4
4
  * Scans package.json for known vulnerabilities and runs npm audit.
5
5
  */
6
- export declare function scanDependencies(logger: Logger): Promise<SecurityFinding[]>;
6
+ export declare function scanDependencies(logger: Logger, projectRoot?: string): Promise<SecurityFinding[]>;
7
7
  /**
8
8
  * Scans Python (requirements.txt) and Rust (Cargo.toml) for known vulnerabilities.
9
9
  */
10
- export declare function scanDependenciesExpanded(logger: Logger): Promise<SecurityFinding[]>;
10
+ export declare function scanDependenciesExpanded(logger: Logger, projectRoot?: string): Promise<SecurityFinding[]>;
11
11
  //# sourceMappingURL=dependency-scanner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dependency-scanner.d.ts","sourceRoot":"","sources":["../../../../src/application/analysis/security/dependency-scanner.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAE5C,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAA;AA+EzD;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CAsEjF;AAED;;GAEG;AACH,wBAAsB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CA8EzF"}
1
+ {"version":3,"file":"dependency-scanner.d.ts","sourceRoot":"","sources":["../../../../src/application/analysis/security/dependency-scanner.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAE5C,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAA;AA+EzD;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,GAAE,MAAsB,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CAsEtH;AAED;;GAEG;AACH,wBAAsB,wBAAwB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,GAAE,MAAsB,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CA8E9H"}
@@ -66,10 +66,10 @@ const CVE_DB = [
66
66
  /**
67
67
  * Scans package.json for known vulnerabilities and runs npm audit.
68
68
  */
69
- export async function scanDependencies(logger) {
69
+ export async function scanDependencies(logger, projectRoot = process.cwd()) {
70
70
  await logger.info('Dependencies: scanning package manifests');
71
71
  const findings = [];
72
- const packageJsonPath = path.join(process.cwd(), 'package.json');
72
+ const packageJsonPath = path.join(projectRoot, 'package.json');
73
73
  let installedDeps = {};
74
74
  try {
75
75
  const raw = await fs.readFile(packageJsonPath, 'utf-8');
@@ -101,7 +101,7 @@ export async function scanDependencies(logger) {
101
101
  try {
102
102
  const auditOutput = await new Promise((resolve, reject) => {
103
103
  const { execFile } = require('child_process');
104
- execFile('npm', ['audit', '--json'], { cwd: process.cwd(), timeout: 15000, encoding: 'utf-8' }, (err, stdout) => {
104
+ execFile('npm', ['audit', '--json'], { cwd: projectRoot, timeout: 15000, encoding: 'utf-8' }, (err, stdout) => {
105
105
  if (err && !stdout) {
106
106
  reject(err);
107
107
  return;
@@ -135,12 +135,12 @@ export async function scanDependencies(logger) {
135
135
  /**
136
136
  * Scans Python (requirements.txt) and Rust (Cargo.toml) for known vulnerabilities.
137
137
  */
138
- export async function scanDependenciesExpanded(logger) {
138
+ export async function scanDependenciesExpanded(logger, projectRoot = process.cwd()) {
139
139
  const findings = [];
140
140
  // Python requirements.txt
141
141
  const reqFiles = ['requirements.txt', 'requirements-dev.txt', 'requirements/base.txt'];
142
142
  for (const reqFile of reqFiles) {
143
- const content = await readFileSafe(path.join(process.cwd(), reqFile));
143
+ const content = await readFileSafe(path.join(projectRoot, reqFile));
144
144
  if (!content)
145
145
  continue;
146
146
  const PY_CVE = [
@@ -174,7 +174,7 @@ export async function scanDependenciesExpanded(logger) {
174
174
  }
175
175
  }
176
176
  // Rust Cargo.toml
177
- const cargoContent = await readFileSafe(path.join(process.cwd(), 'Cargo.toml'));
177
+ const cargoContent = await readFileSafe(path.join(projectRoot, 'Cargo.toml'));
178
178
  if (cargoContent) {
179
179
  const RUST_CVE = [
180
180
  { crate: 'openssl', maxVer: '0.10.47', cve: 'CVE-2022-0778', severity: 'high', cvss: 7.5, msg: 'openssl crate ≤0.10.47: infinite loop in BN_mod_sqrt() — DoS', fix: 'Upgrade to openssl ≥0.10.48' },
@@ -3,5 +3,5 @@ import { Logger } from '../../../infrastructure/index.js';
3
3
  /**
4
4
  * Scans server configuration files for missing security headers.
5
5
  */
6
- export declare function scanHeaders(dirs: string[], collectFiles: (dirs: string[]) => Promise<string[]>, logger: Logger): Promise<SecurityFinding[]>;
6
+ export declare function scanHeaders(dirs: string[], collectFiles: (dirs: string[]) => Promise<string[]>, logger: Logger, projectRoot?: string): Promise<SecurityFinding[]>;
7
7
  //# sourceMappingURL=header-scanner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"header-scanner.d.ts","sourceRoot":"","sources":["../../../../src/application/analysis/security/header-scanner.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAE5C,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAA;AAEzD;;GAEG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CAiHjJ"}
1
+ {"version":3,"file":"header-scanner.d.ts","sourceRoot":"","sources":["../../../../src/application/analysis/security/header-scanner.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAE5C,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAA;AAEzD;;GAEG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAE,MAAsB,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CAiHtL"}
@@ -3,7 +3,7 @@ import { readFileSafe, dedup } from './utils.js';
3
3
  /**
4
4
  * Scans server configuration files for missing security headers.
5
5
  */
6
- export async function scanHeaders(dirs, collectFiles, logger) {
6
+ export async function scanHeaders(dirs, collectFiles, logger, projectRoot = process.cwd()) {
7
7
  await logger.info('Headers: scanning server configuration files');
8
8
  const findings = [];
9
9
  const files = await collectFiles(dirs);
@@ -82,7 +82,7 @@ export async function scanHeaders(dirs, collectFiles, logger) {
82
82
  }
83
83
  }
84
84
  // Next.js / Nuxt config check
85
- // Look in the provided directories first, then fallback to cwd
85
+ // Look in the provided directories first, then fallback to projectRoot
86
86
  let nextConfig = null;
87
87
  for (const dir of dirs) {
88
88
  nextConfig = await readFileSafe(path.join(dir, 'next.config.js'))
@@ -92,9 +92,9 @@ export async function scanHeaders(dirs, collectFiles, logger) {
92
92
  break;
93
93
  }
94
94
  if (!nextConfig) {
95
- nextConfig = await readFileSafe(path.join(process.cwd(), 'next.config.js'))
96
- ?? await readFileSafe(path.join(process.cwd(), 'next.config.ts'))
97
- ?? await readFileSafe(path.join(process.cwd(), 'next.config.mjs'));
95
+ nextConfig = await readFileSafe(path.join(projectRoot, 'next.config.js'))
96
+ ?? await readFileSafe(path.join(projectRoot, 'next.config.ts'))
97
+ ?? await readFileSafe(path.join(projectRoot, 'next.config.mjs'));
98
98
  }
99
99
  if (nextConfig && !/headers\s*\(\s*\)/.test(nextConfig)) {
100
100
  findings.push({
@@ -3,4 +3,10 @@ import type { FixSuggestion } from './context.js';
3
3
  export declare function suggestTypeScriptFix(error: ParsedError): FixSuggestion | null;
4
4
  export declare function suggestRustFix(error: ParsedError): FixSuggestion | null;
5
5
  export declare function suggestGoFix(error: ParsedError): FixSuggestion | null;
6
+ export declare function suggestCobolFix(error: ParsedError): FixSuggestion | null;
7
+ export declare function suggestAssemblyFix(error: ParsedError): FixSuggestion | null;
8
+ export declare function suggestSvelteFix(error: ParsedError): FixSuggestion | null;
9
+ export declare function suggestVueFix(error: ParsedError): FixSuggestion | null;
10
+ export declare function suggestAstroFix(error: ParsedError): FixSuggestion | null;
11
+ export declare function suggestReactFix(error: ParsedError): FixSuggestion | null;
6
12
  //# sourceMappingURL=patterns-compiled.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"patterns-compiled.d.ts","sourceRoot":"","sources":["../../../../src/application/development/fix/patterns-compiled.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qDAAqD,CAAA;AACtF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAEjD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,WAAW,GAAG,aAAa,GAAG,IAAI,CAsC7E;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,aAAa,GAAG,IAAI,CA2BvE;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,aAAa,GAAG,IAAI,CAgErE"}
1
+ {"version":3,"file":"patterns-compiled.d.ts","sourceRoot":"","sources":["../../../../src/application/development/fix/patterns-compiled.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qDAAqD,CAAA;AACtF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAEjD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,WAAW,GAAG,aAAa,GAAG,IAAI,CAsC7E;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,aAAa,GAAG,IAAI,CA2BvE;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,aAAa,GAAG,IAAI,CAgErE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,WAAW,GAAG,aAAa,GAAG,IAAI,CAYxE;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,WAAW,GAAG,aAAa,GAAG,IAAI,CAY3E;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,GAAG,aAAa,GAAG,IAAI,CASzE;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,WAAW,GAAG,aAAa,GAAG,IAAI,CAStE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,WAAW,GAAG,aAAa,GAAG,IAAI,CASxE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,WAAW,GAAG,aAAa,GAAG,IAAI,CASxE"}
@@ -121,3 +121,69 @@ export function suggestGoFix(error) {
121
121
  }
122
122
  return null;
123
123
  }
124
+ export function suggestCobolFix(error) {
125
+ if (error.message.toLowerCase().includes('syntax error')) {
126
+ return {
127
+ error,
128
+ explanation: `COBOL: Syntax error near line ${error.line}`,
129
+ suggestedFix: `Check for missing periods (.), correct division/section headers, or invalid picture clauses`,
130
+ beforeCode: error.context.join('\n'),
131
+ afterCode: ` * Ensure valid COBOL syntax and area margins`,
132
+ confidence: 0.5,
133
+ };
134
+ }
135
+ return null;
136
+ }
137
+ export function suggestAssemblyFix(error) {
138
+ if (error.message.toLowerCase().includes('undefined') || error.message.toLowerCase().includes('symbol')) {
139
+ return {
140
+ error,
141
+ explanation: `Assembly: Undefined symbol or label`,
142
+ suggestedFix: `Ensure the label or variable is defined in the data/bss section or imported correctly`,
143
+ beforeCode: error.context.join('\n'),
144
+ afterCode: `; Define the label or variable`,
145
+ confidence: 0.5,
146
+ };
147
+ }
148
+ return null;
149
+ }
150
+ export function suggestSvelteFix(error) {
151
+ return {
152
+ error,
153
+ explanation: `Svelte: Error during compilation — ${error.message}`,
154
+ suggestedFix: `Check Svelte specific syntax: unclosed {#if} blocks, invalid $: reactive statements, or unclosed HTML tags`,
155
+ beforeCode: error.context.join('\n'),
156
+ afterCode: `<!-- Fix Svelte template syntax -->`,
157
+ confidence: 0.6,
158
+ };
159
+ }
160
+ export function suggestVueFix(error) {
161
+ return {
162
+ error,
163
+ explanation: `Vue: Error during compilation — ${error.message}`,
164
+ suggestedFix: `Check Vue specific syntax: unclosed <template> tags, invalid v-bind/v-on directives, or Setup script errors`,
165
+ beforeCode: error.context.join('\n'),
166
+ afterCode: `<!-- Fix Vue template syntax -->`,
167
+ confidence: 0.6,
168
+ };
169
+ }
170
+ export function suggestAstroFix(error) {
171
+ return {
172
+ error,
173
+ explanation: `Astro: Error during compilation — ${error.message}`,
174
+ suggestedFix: `Check Astro specific syntax: unclosed frontmatter (---), invalid JSX within HTML, or missing component imports`,
175
+ beforeCode: error.context.join('\n'),
176
+ afterCode: `// Fix Astro component syntax`,
177
+ confidence: 0.6,
178
+ };
179
+ }
180
+ export function suggestReactFix(error) {
181
+ return {
182
+ error,
183
+ explanation: `React/JSX: Error during compilation — ${error.message}`,
184
+ suggestedFix: `Check JSX specific syntax: unclosed tags, 'className' instead of 'class', or invalid inline styles`,
185
+ beforeCode: error.context.join('\n'),
186
+ afterCode: `{/* Fix JSX syntax */}`,
187
+ confidence: 0.6,
188
+ };
189
+ }
@@ -3,6 +3,8 @@ import type { FixSuggestion } from './context.js';
3
3
  export declare function suggestJavaFix(error: ParsedError): FixSuggestion | null;
4
4
  export declare function suggestPHPFix(error: ParsedError): FixSuggestion | null;
5
5
  export declare function suggestRubyFix(error: ParsedError): FixSuggestion | null;
6
+ export declare function suggestPythonFix(error: ParsedError): FixSuggestion | null;
7
+ export declare function suggestNodeFix(error: ParsedError): FixSuggestion | null;
6
8
  export declare function suggestRuntimeFix(error: ParsedError): FixSuggestion | null;
7
9
  export declare function suggestLinterFix(error: ParsedError): FixSuggestion | null;
8
10
  //# sourceMappingURL=patterns-runtime.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"patterns-runtime.d.ts","sourceRoot":"","sources":["../../../../src/application/development/fix/patterns-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qDAAqD,CAAA;AACtF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAEjD,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,aAAa,GAAG,IAAI,CAuEvE;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,WAAW,GAAG,aAAa,GAAG,IAAI,CAuDtE;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,aAAa,GAAG,IAAI,CA+DvE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,aAAa,GAAG,IAAI,CAgC1E;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,GAAG,aAAa,GAAG,IAAI,CAwBzE"}
1
+ {"version":3,"file":"patterns-runtime.d.ts","sourceRoot":"","sources":["../../../../src/application/development/fix/patterns-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qDAAqD,CAAA;AACtF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAEjD,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,aAAa,GAAG,IAAI,CAuEvE;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,WAAW,GAAG,aAAa,GAAG,IAAI,CAuDtE;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,aAAa,GAAG,IAAI,CA+DvE;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,GAAG,aAAa,GAAG,IAAI,CAiCzE;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,aAAa,GAAG,IAAI,CA4CvE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,aAAa,GAAG,IAAI,CAsC1E;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,GAAG,aAAa,GAAG,IAAI,CAwBzE"}
@@ -190,7 +190,91 @@ export function suggestRubyFix(error) {
190
190
  }
191
191
  return null;
192
192
  }
193
+ export function suggestPythonFix(error) {
194
+ switch (error.code) {
195
+ case 'SyntaxError':
196
+ return {
197
+ error,
198
+ explanation: `Python: Syntax error — ${error.message}`,
199
+ suggestedFix: `Check for missing colons, mismatched brackets, or indentation issues near line ${error.line}`,
200
+ beforeCode: error.context.join('\n'),
201
+ afterCode: `# Review syntax near line ${error.line}`,
202
+ confidence: 0.7,
203
+ };
204
+ case 'IndentationError':
205
+ return {
206
+ error,
207
+ explanation: `Python: Indentation error — mismatched whitespace`,
208
+ suggestedFix: `Ensure consistent use of 4 spaces for indentation`,
209
+ beforeCode: error.context.join('\n'),
210
+ afterCode: ` # Use 4 spaces for this block`,
211
+ confidence: 0.85,
212
+ };
213
+ case 'NameError': {
214
+ const nameMatch = error.message.match(/name ['"](\w+)['"] is not defined/);
215
+ return {
216
+ error,
217
+ explanation: `Python: Variable '${nameMatch?.[1] ?? 'x'}' is not defined`,
218
+ suggestedFix: `Initialize the variable or check for typos`,
219
+ beforeCode: error.context.join('\n'),
220
+ afterCode: `${nameMatch?.[1] ?? 'x'} = None`,
221
+ confidence: 0.6,
222
+ };
223
+ }
224
+ }
225
+ return null;
226
+ }
227
+ export function suggestNodeFix(error) {
228
+ switch (error.code) {
229
+ case 'TypeError':
230
+ if (error.message.includes('is not a function')) {
231
+ return {
232
+ error,
233
+ explanation: `Node.js: Type error — ${error.message}`,
234
+ suggestedFix: `Check if the variable is correctly initialized and is actually a function`,
235
+ beforeCode: error.context.join('\n'),
236
+ afterCode: `// Verify typeof object === 'function' before calling`,
237
+ confidence: 0.65,
238
+ };
239
+ }
240
+ if (error.message.includes('Cannot read properties of undefined') || error.message.includes('Cannot read properties of null')) {
241
+ return {
242
+ error,
243
+ explanation: `Node.js: Cannot read property on null or undefined`,
244
+ suggestedFix: `Add optional chaining (?.) or an explicit null check before accessing the property`,
245
+ beforeCode: error.context.join('\n'),
246
+ afterCode: `// Use optional chaining: obj?.property`,
247
+ confidence: 0.85,
248
+ };
249
+ }
250
+ break;
251
+ case 'ReferenceError':
252
+ return {
253
+ error,
254
+ explanation: `Node.js: Reference error — ${error.message}`,
255
+ suggestedFix: `Ensure the variable is declared and in scope before it is accessed, or check for typos`,
256
+ beforeCode: error.context.join('\n'),
257
+ afterCode: `// Ensure variable is imported or defined`,
258
+ confidence: 0.75,
259
+ };
260
+ case 'SyntaxError':
261
+ return {
262
+ error,
263
+ explanation: `Node.js: Syntax error — ${error.message}`,
264
+ suggestedFix: `Check for missing brackets, quotes, or invalid syntax near line ${error.line}`,
265
+ beforeCode: error.context.join('\n'),
266
+ afterCode: `// Review syntax near line ${error.line}`,
267
+ confidence: 0.7,
268
+ };
269
+ }
270
+ return null;
271
+ }
193
272
  export function suggestRuntimeFix(error) {
273
+ if (['TypeError', 'ReferenceError', 'SyntaxError', 'Error'].includes(error.code) && (error.file.endsWith('.js') || error.file.endsWith('.ts') || error.file.endsWith('.jsx') || error.file.endsWith('.tsx'))) {
274
+ const r = suggestNodeFix(error);
275
+ if (r)
276
+ return r;
277
+ }
194
278
  const isJava = error.code.startsWith('JAVA') ||
195
279
  ['NullPointerException', 'ArrayIndexOutOfBoundsException', 'ClassNotFoundException'].includes(error.code);
196
280
  if (isJava) {
@@ -208,6 +292,11 @@ export function suggestRuntimeFix(error) {
208
292
  if (r)
209
293
  return r;
210
294
  }
295
+ if (['SyntaxError', 'IndentationError', 'NameError', 'TypeError', 'ImportError'].includes(error.code) && error.file.endsWith('.py')) {
296
+ const r = suggestPythonFix(error);
297
+ if (r)
298
+ return r;
299
+ }
211
300
  if (error.message.match(/null|undefined|NoneType/i)) {
212
301
  return {
213
302
  error,
@@ -1 +1 @@
1
- {"version":3,"file":"suggest.d.ts","sourceRoot":"","sources":["../../../../src/application/development/fix/suggest.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qDAAqD,CAAA;AAItF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAKzD,wBAAsB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CA2CjG"}
1
+ {"version":3,"file":"suggest.d.ts","sourceRoot":"","sources":["../../../../src/application/development/fix/suggest.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qDAAqD,CAAA;AAItF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAKzD,wBAAsB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAuDjG"}