uneven-ai 1.1.4 → 1.1.8
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.
- package/CHANGELOG.md +41 -12
- package/README.md +9 -10
- package/dist/application/analysis/active/index.js +1 -1
- package/dist/application/analysis/data-security/context.d.ts.map +1 -1
- package/dist/application/analysis/data-security/context.js +2 -0
- package/dist/application/analysis/pentest-security-context.d.ts +1 -0
- package/dist/application/analysis/pentest-security-context.d.ts.map +1 -1
- package/dist/application/analysis/pentest-security-context.js +2 -0
- package/dist/application/analysis/report-packager.d.ts +1 -1
- package/dist/application/analysis/report-packager.d.ts.map +1 -1
- package/dist/application/analysis/report-packager.js +2 -2
- package/dist/application/analysis/security/analyzer.d.ts +2 -1
- package/dist/application/analysis/security/analyzer.d.ts.map +1 -1
- package/dist/application/analysis/security/analyzer.js +10 -8
- package/dist/application/analysis/security/dependency-scanner.d.ts +2 -2
- package/dist/application/analysis/security/dependency-scanner.d.ts.map +1 -1
- package/dist/application/analysis/security/dependency-scanner.js +6 -6
- package/dist/application/analysis/security/header-scanner.d.ts +1 -1
- package/dist/application/analysis/security/header-scanner.d.ts.map +1 -1
- package/dist/application/analysis/security/header-scanner.js +5 -5
- package/dist/application/development/fix/patterns-compiled.d.ts +6 -0
- package/dist/application/development/fix/patterns-compiled.d.ts.map +1 -1
- package/dist/application/development/fix/patterns-compiled.js +66 -0
- package/dist/application/development/fix/patterns-runtime.d.ts +2 -0
- package/dist/application/development/fix/patterns-runtime.d.ts.map +1 -1
- package/dist/application/development/fix/patterns-runtime.js +89 -0
- package/dist/application/development/fix/suggest.d.ts.map +1 -1
- package/dist/application/development/fix/suggest.js +68 -1
- package/dist/application/orchestration/engine/error-handler.d.ts.map +1 -1
- package/dist/application/orchestration/engine/error-handler.js +3 -1
- package/dist/application/orchestration/engine/index.d.ts.map +1 -1
- package/dist/application/orchestration/engine/index.js +11 -1
- package/dist/application/orchestration/engine/indexer.d.ts.map +1 -1
- package/dist/application/orchestration/engine/indexer.js +12 -8
- package/dist/application/orchestration/engine/lifecycle.js +1 -1
- package/dist/application/orchestration/engine/pentest.js +4 -4
- package/dist/cli/commands/analyze/command.d.ts.map +1 -1
- package/dist/cli/commands/analyze/command.js +11 -6
- package/dist/cli/commands/ask.d.ts.map +1 -1
- package/dist/cli/commands/ask.js +10 -4
- package/dist/cli/commands/askf.d.ts.map +1 -1
- package/dist/cli/commands/askf.js +4 -2
- package/dist/cli/commands/chat.d.ts.map +1 -1
- package/dist/cli/commands/chat.js +9 -3
- package/dist/cli/commands/ci.d.ts.map +1 -1
- package/dist/cli/commands/ci.js +11 -10
- package/dist/cli/commands/explain.d.ts.map +1 -1
- package/dist/cli/commands/explain.js +8 -3
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +6 -5
- package/dist/cli/commands/info.d.ts.map +1 -1
- package/dist/cli/commands/info.js +7 -1
- package/dist/cli/commands/init/command.d.ts.map +1 -1
- package/dist/cli/commands/init/command.js +7 -17
- package/dist/cli/commands/log.d.ts.map +1 -1
- package/dist/cli/commands/log.js +3 -1
- package/dist/cli/commands/pentest.d.ts.map +1 -1
- package/dist/cli/commands/pentest.js +4 -3
- package/dist/cli/commands/remote-shell.d.ts.map +1 -1
- package/dist/cli/commands/remote-shell.js +3 -1
- package/dist/cli/commands/reset.d.ts.map +1 -1
- package/dist/cli/commands/reset.js +5 -3
- package/dist/cli/commands/review.d.ts.map +1 -1
- package/dist/cli/commands/review.js +8 -4
- package/dist/cli/commands/scan.d.ts.map +1 -1
- package/dist/cli/commands/scan.js +5 -4
- package/dist/cli/commands/shell.d.ts.map +1 -1
- package/dist/cli/commands/shell.js +3 -2
- package/dist/cli/commands/watch.d.ts.map +1 -1
- package/dist/cli/commands/watch.js +5 -4
- package/dist/domain/entities/session/manager.d.ts.map +1 -1
- package/dist/domain/entities/session/manager.js +3 -0
- package/dist/infrastructure/adapters/bridge.d.ts.map +1 -1
- package/dist/infrastructure/adapters/bridge.js +1 -0
- package/dist/infrastructure/io/db-loader.d.ts +2 -1
- package/dist/infrastructure/io/db-loader.d.ts.map +1 -1
- package/dist/infrastructure/io/db-loader.js +31 -5
- package/dist/infrastructure/io/process-watcher.d.ts.map +1 -1
- package/dist/infrastructure/io/process-watcher.js +15 -0
- package/dist/infrastructure/utils/config-loader.d.ts +8 -2
- package/dist/infrastructure/utils/config-loader.d.ts.map +1 -1
- package/dist/infrastructure/utils/config-loader.js +104 -21
- package/dist/infrastructure/utils/error-parser/index.d.ts.map +1 -1
- package/dist/infrastructure/utils/error-parser/index.js +9 -3
- package/dist/infrastructure/utils/error-parser/parsers-compiled.d.ts.map +1 -1
- package/dist/infrastructure/utils/error-parser/parsers-compiled.js +45 -3
- package/dist/infrastructure/utils/error-parser/parsers-dynamic.d.ts +2 -0
- package/dist/infrastructure/utils/error-parser/parsers-dynamic.d.ts.map +1 -1
- package/dist/infrastructure/utils/error-parser/parsers-dynamic.js +154 -8
- package/dist/infrastructure/utils/migration.d.ts +1 -1
- package/dist/infrastructure/utils/migration.d.ts.map +1 -1
- package/dist/infrastructure/utils/migration.js +1 -2
- package/dist/infrastructure/utils/process-lock.d.ts +1 -1
- package/dist/infrastructure/utils/process-lock.d.ts.map +1 -1
- package/dist/infrastructure/utils/process-lock.js +2 -2
- package/package.json +2 -2
- package/prebuilds/darwin-arm64/uneven_core.node +0 -0
- package/prebuilds/linux-arm64/uneven_core.node +0 -0
- package/prebuilds/linux-x64/uneven_core.node +0 -0
- package/prebuilds/win32-x64/uneven_core.node +0 -0
- package/types/index.d.ts +11 -2
- package/prebuilds/darwin-arm64/.gitkeep +0 -0
- package/prebuilds/darwin-x64/.gitkeep +0 -0
- package/prebuilds/linux-arm64/.gitkeep +0 -0
- package/prebuilds/linux-x64/.gitkeep +0 -0
- package/prebuilds/win32-x64/.gitkeep +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,24 +5,40 @@ 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.8] - 2026-04-27
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **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).
|
|
12
|
+
- **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.
|
|
13
|
+
- **Autonomous Security Pentester**: Validated static analysis engine capable of detecting hardcoded secrets (Entropy-based), OS/SQL injections, and missing infrastructure security headers (HSTS, CSP).
|
|
14
|
+
- **Universal Data Indexing**: Full support for `.csv` and `.xlsx` files, enabling seamless context delivery for automated data scripts.
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
- **Configuration Loading**: Resolved a critical issue where the `analyze` command would ignore the project's `uneven.config.ts`.
|
|
18
|
+
- **Infrastructure Stability**: Fixed a build-breaking import error in the Pro feature gate (`gate.ts`).
|
|
19
|
+
- **Provider Reliability**: Improved Gemini API error handling for rate-limit and overload scenarios.
|
|
20
|
+
|
|
21
|
+
## [1.1.5] - 2026-04-24
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
- **Setup Reliability**: Restored safe workspace initialization logic to prevent file permission conflicts during setup.
|
|
25
|
+
|
|
8
26
|
## [1.1.4] - 2026-04-24
|
|
9
27
|
|
|
10
28
|
### Changed
|
|
11
|
-
- **
|
|
12
|
-
- **
|
|
13
|
-
- **
|
|
14
|
-
- **
|
|
15
|
-
- **
|
|
29
|
+
- **System Stability**: Major update to core internal dependencies to ensure maximum compatibility and long-term stability.
|
|
30
|
+
- **Engine Optimization**: Significant performance enhancements across the primary analysis modules for faster processing.
|
|
31
|
+
- **Enhanced Installation Flow**: The initialization process has been refined for a more reliable out-of-the-box experience.
|
|
32
|
+
- **Improved Context Resolution**: Refined the intelligence layer to better handle complex project structures and file references.
|
|
33
|
+
- **Global Synchronization**: Optimized cross-layer communication for consistent and accurate project indexing.
|
|
16
34
|
|
|
17
35
|
## [1.1.3] - 2026-04-24
|
|
18
36
|
|
|
19
37
|
### Added
|
|
20
|
-
|
|
21
|
-
- **
|
|
22
|
-
- **
|
|
23
|
-
- **
|
|
24
|
-
- **Intelligent Debouncing**: Refined the fix engine to handle concurrent terminal errors and proactive scans without conflicts.
|
|
25
|
-
- **Dependency Injection**: Refactored orchestration engine for better testability and ESM compatibility.
|
|
38
|
+
- **Proactive Code Auditing**: New background engine that scans for logic and security issues during active development sessions.
|
|
39
|
+
- **Extended Project Compatibility**: Massive expansion of the analysis engine, now supporting a vast array of modern file formats and ecosystems.
|
|
40
|
+
- **Autonomous Agent Intelligence**: Enhanced conversational capabilities allowing for deep project-wide audits via natural language.
|
|
41
|
+
- **System Orchestration Refinement**: Core architectural improvements for better reliability and faster response times.
|
|
26
42
|
|
|
27
43
|
## [1.1.2] - 2026-04-24 [DEPRECATED]
|
|
28
44
|
|
|
@@ -151,7 +167,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
151
167
|
### Changed
|
|
152
168
|
|
|
153
169
|
- **README**: update architecture section reference from `v0.12.6` to `v1.0.0`
|
|
154
|
-
- **package-lock.json**: regenerated
|
|
170
|
+
- **package-lock.json**: regenerated| `feat` | `release` | Lançamento da v1.1.4 (Final Stable) |
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## Sessão — 2026-04-24 · v1.1.5: Hotfix de Setup (Safe Init)
|
|
175
|
+
Reversão da lógica destrutiva de limpeza no comando `init` para evitar conflitos de permissão e falhas de instalação em ambientes restritos.
|
|
176
|
+
- **Safe Init**: O comando agora preserva configurações e diretórios existentes, agindo apenas onde necessário.
|
|
177
|
+
- **Permission Fix**: Eliminação de operações `fs.rm` que causavam bloqueios de I/O em alguns sistemas.
|
|
178
|
+
|
|
179
|
+
| Tipo | Atividade | Descrição |
|
|
180
|
+
| :--- | :--- | :--- |
|
|
181
|
+
| `fix` | `init` | Restauração de setup não-destrutivo e seguro |
|
|
182
|
+
| `feat` | `release` | Hotfix v1.1.5 |
|
|
183
|
+
at `0.12.6`)
|
|
155
184
|
|
|
156
185
|
## [1.0.3] - 2026-04-15
|
|
157
186
|
|
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.
|
|
161
|
+
◈ Uneven AI v1.1.8
|
|
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
|
|
338
|
-
| SQL
|
|
339
|
-
| Result
|
|
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
|
-
✅ **
|
|
449
|
-
✅ **
|
|
450
|
-
✅ **
|
|
451
|
-
✅ **Ethical safety guard** —
|
|
452
|
-
✅ **GPU acceleration** —
|
|
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
|
|
|
@@ -16,7 +16,7 @@ export class ActiveScanner {
|
|
|
16
16
|
}
|
|
17
17
|
async flushAuditLog() {
|
|
18
18
|
try {
|
|
19
|
-
const logPath = path.join(
|
|
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;
|
|
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,
|
|
@@ -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;
|
|
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
|
}
|
|
@@ -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,
|
|
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(
|
|
31
|
-
this.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;
|
|
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 = [
|
|
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,
|
|
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(
|
|
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:
|
|
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(
|
|
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(
|
|
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,
|
|
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
|
|
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(
|
|
96
|
-
?? await readFileSafe(path.join(
|
|
97
|
-
?? await readFileSafe(path.join(
|
|
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,
|
|
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,
|
|
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"}
|