tzero-mcp 10.7.4 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +56 -29
- package/CONTRIBUTING.md +71 -71
- package/README.md +64 -64
- package/bin/tzero-mcp.js +62 -66
- package/bin/tzero.js +61 -65
- package/index.d.ts +25 -25
- package/index.js +15 -15
- package/package.json +88 -88
- package/src/addmcp.py +14 -11
- package/src/app.py +1810 -0
- package/src/main.py +1 -1
- package/src/pc_fixer_mcp.py +25 -0
- package/src/tzero/__init__.py +54 -0
- package/src/tzero/__main__.py +6 -0
- package/src/tzero/siber_akademi.ico +0 -0
- package/src/tzero/tzero_arch_test.py +463 -0
- package/src/{tzero_benchmark.py → tzero/tzero_benchmark.py} +475 -475
- package/src/tzero/tzero_blackboard.py +257 -0
- package/src/{tzero_bridge.py → tzero/tzero_bridge.py} +546 -362
- package/src/tzero/tzero_budget.py +195 -0
- package/src/{tzero_ci.py → tzero/tzero_ci.py} +153 -153
- package/src/{tzero_commit.py → tzero/tzero_commit.py} +192 -192
- package/src/tzero/tzero_contracts.py +1093 -0
- package/src/{tzero_cost.py → tzero/tzero_cost.py} +166 -163
- package/src/{tzero_dashboard.py → tzero/tzero_dashboard.py} +531 -19
- package/src/tzero/tzero_debt.py +461 -0
- package/src/{tzero_deps.py → tzero/tzero_deps.py} +179 -4
- package/src/{tzero_drift.py → tzero/tzero_drift.py} +208 -208
- package/src/{tzero_explain.py → tzero/tzero_explain.py} +73 -7
- package/src/{tzero_features.py → tzero/tzero_features.py} +19 -17
- package/src/tzero/tzero_federation.py +299 -0
- package/src/{tzero_fix.py → tzero/tzero_fix.py} +228 -228
- package/src/{tzero_fixer → tzero/tzero_fixer}/__init__.py +63 -63
- package/src/{tzero_fixer → tzero/tzero_fixer}/ast_syntax_healer.py +464 -464
- package/src/{tzero_fixer → tzero/tzero_fixer}/ast_type_modernizer.py +288 -288
- package/src/{tzero_fixer → tzero/tzero_fixer}/async_io_modernizer.py +127 -127
- package/src/{tzero_fixer → tzero/tzero_fixer}/automated_regression_suite.py +600 -600
- package/src/{tzero_fixer → tzero/tzero_fixer}/benchmarks_and_diagnostics.py +174 -174
- package/src/{tzero_fixer → tzero/tzero_fixer}/ci_cd_self_healing_gate.py +246 -246
- package/src/{tzero_fixer → tzero/tzero_fixer}/code_duplicity_and_refactorer.py +151 -151
- package/src/{tzero_fixer → tzero/tzero_fixer}/code_smells_healer.py +260 -260
- package/src/{tzero_fixer → tzero/tzero_fixer}/cwe_remediator.py +171 -171
- package/src/{tzero_fixer → tzero/tzero_fixer}/dead_code_eliminator.py +150 -150
- package/src/{tzero_fixer → tzero/tzero_fixer}/dependency_vulnerability_auditor.py +309 -309
- package/src/{tzero_fixer → tzero/tzero_fixer}/git_advanced_surgeon.py +1 -1
- package/src/{tzero_fixer → tzero/tzero_fixer}/hardware_and_disk_doctor.py +1 -1
- package/src/{tzero_fixer → tzero/tzero_fixer}/import_graph_healer.py +412 -412
- package/src/{tzero_fixer → tzero/tzero_fixer}/interactive_tui.py +91 -91
- package/src/{tzero_fixer → tzero/tzero_fixer}/knowledge_base.py +295 -295
- package/src/{tzero_fixer → tzero/tzero_fixer}/knowledge_base_extended.py +940 -940
- package/src/{tzero_fixer → tzero/tzero_fixer}/linters_and_static_analyzer.py +307 -307
- package/src/{tzero_fixer → tzero/tzero_fixer}/mcp_server.py +49 -7
- package/src/{tzero_fixer → tzero/tzero_fixer}/os_doctor.py +502 -502
- package/src/{tzero_fixer → tzero/tzero_fixer}/packaging_abi_surgeon.py +1 -1
- package/src/{tzero_fixer → tzero/tzero_fixer}/pc_fixer_doctor.py +600 -599
- package/src/{tzero_fixer → tzero/tzero_fixer}/performance_and_memory_profiler.py +274 -274
- package/src/{tzero_fixer → tzero/tzero_fixer}/polyglot_ast_parsers.py +313 -313
- package/src/{tzero_fixer → tzero/tzero_fixer}/polyglot_build_healer.py +1 -1
- package/src/{tzero_fixer → tzero/tzero_fixer}/polyglot_config_healer.py +318 -318
- package/src/{tzero_fixer → tzero/tzero_fixer}/polyglot_doctor.py +372 -372
- package/src/{tzero_fixer → tzero/tzero_fixer}/polyglot_linters.py +1 -1
- package/src/{tzero_fixer → tzero/tzero_fixer}/polyglot_schema_validator.py +305 -305
- package/src/{tzero_fixer → tzero/tzero_fixer}/security_cwe_database.py +444 -444
- package/src/{tzero_fixer → tzero/tzero_fixer}/security_deep_rules.py +114 -114
- package/src/{tzero_fixer → tzero/tzero_fixer}/security_rules_catalog.py +110 -110
- package/src/{tzero_fixer → tzero/tzero_fixer}/security_zero_leak.py +326 -326
- package/src/{tzero_fixer → tzero/tzero_fixer}/smart_patch_recommender.py +223 -223
- package/src/{tzero_fixer → tzero/tzero_fixer}/synthetic_workspace_generator.py +220 -220
- package/src/{tzero_fixer → tzero/tzero_fixer}/system_diagnostics_extended.py +1 -1
- package/src/{tzero_fixer → tzero/tzero_fixer}/system_repair_recipes.py +447 -447
- package/src/{tzero_fixer → tzero/tzero_fixer}/venv_doctor.py +309 -309
- package/src/tzero/tzero_golden.py +319 -0
- package/src/tzero/tzero_graph_hud.html +338 -0
- package/src/tzero/tzero_graph_rag.py +263 -0
- package/src/{tzero_guard.py → tzero/tzero_guard.py} +243 -243
- package/src/tzero/tzero_hooks.py +565 -0
- package/src/{tzero_infra.py → tzero/tzero_infra.py} +274 -274
- package/src/{tzero_jarvis → tzero/tzero_jarvis}/__init__.py +124 -124
- package/src/{tzero_jarvis → tzero/tzero_jarvis}/causal_graph.py +310 -310
- package/src/{tzero_jarvis → tzero/tzero_jarvis}/graph_visualizer.py +395 -395
- package/src/{tzero_jarvis → tzero/tzero_jarvis}/hybrid_search.py +214 -214
- package/src/{tzero_jarvis → tzero/tzero_jarvis}/latent_press.py +137 -137
- package/src/{tzero_jarvis → tzero/tzero_jarvis}/memory_consolidation.py +212 -212
- package/src/{tzero_jarvis → tzero/tzero_jarvis}/minhash_lsh.py +184 -184
- package/src/{tzero_jarvis → tzero/tzero_jarvis}/orchestrator.py +335 -335
- package/src/{tzero_jarvis → tzero/tzero_jarvis}/self_healing.py +308 -308
- package/src/{tzero_jarvis → tzero/tzero_jarvis}/semantic_compressor.py +887 -887
- package/src/{tzero_jarvis → tzero/tzero_jarvis}/swarm.py +261 -261
- package/src/{tzero_jarvis → tzero/tzero_jarvis}/swarm_bft.py +144 -144
- package/src/{tzero_jarvis → tzero/tzero_jarvis}/workspace_orchestrator.py +1167 -1167
- package/src/{tzero_jarvis → tzero/tzero_jarvis}/zero_key_router.py +173 -173
- package/src/tzero/tzero_lsp.py +634 -0
- package/src/{tzero_mcp.py → tzero/tzero_mcp.py} +479 -100
- package/src/tzero/tzero_mutation.py +358 -0
- package/src/tzero/tzero_packer.py +577 -0
- package/src/{tzero_patch.py → tzero/tzero_patch.py} +624 -624
- package/src/{tzero_pc_fixer.py → tzero/tzero_pc_fixer.py} +12699 -12657
- package/src/{tzero_pipe.py → tzero/tzero_pipe.py} +95 -95
- package/src/tzero/tzero_polyglot.py +799 -0
- package/src/tzero/tzero_proxy.py +127 -0
- package/src/{tzero_reachability.py → tzero/tzero_reachability.py} +272 -272
- package/src/{tzero_replay.py → tzero/tzero_replay.py} +141 -141
- package/src/tzero/tzero_rust_bridge.py +198 -0
- package/src/tzero/tzero_scip.py +368 -0
- package/src/{tzero_security.py → tzero/tzero_security.py} +5 -2
- package/src/tzero/tzero_semantic_merge.py +189 -0
- package/src/tzero/tzero_snapshot.py +471 -0
- package/src/{tzero_stubs.py → tzero/tzero_stubs.py} +313 -313
- package/src/tzero/tzero_subagent_engine.py +459 -0
- package/src/{tzero_superdesign.py → tzero/tzero_superdesign.py} +774 -774
- package/src/{tzero_sync.py → tzero/tzero_sync.py} +241 -241
- package/src/{tzero_task_benchmark.py → tzero/tzero_task_benchmark.py} +458 -363
- package/src/{tzero_tui.py → tzero/tzero_tui.py} +91 -22
- package/src/tzero/tzero_turbo.py +264 -0
- package/src/{tzero_v3.py → tzero/tzero_v3.py} +628 -163
- package/src/tzero.py +2 -54
- package/test/package.test.js +55 -43
- package/src/tzero/jarvis/semantic_compressor.py +0 -373
- package/src/tzero_gateway.py +0 -885
- package/src/tzero_packer.py +0 -370
- package/src/tzero_polyglot.py +0 -422
- package/src/tzero_snapshot.py +0 -258
- /package/src/{siber_akademi_icon.py → tzero/siber_akademi_icon.py} +0 -0
- /package/src/{tzero_fixer → tzero/tzero_fixer}/amalgamation.py +0 -0
- /package/src/{tzero_fixer → tzero/tzero_fixer}/models.py +0 -0
- /package/src/{tzero_fixer → tzero/tzero_fixer}/orchestrator.py +0 -0
- /package/src/{tzero_neural_cortex.py → tzero/tzero_neural_cortex.py} +0 -0
|
@@ -1,91 +1,91 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
"""T-Zero Autonomous Doctor Interactive Terminal Cockpit & TUI.
|
|
3
|
-
|
|
4
|
-
Provides high-impact ANSI terminal visualization:
|
|
5
|
-
- Visual health score gauges and dial meters.
|
|
6
|
-
- Multi-column toolchain status matrices.
|
|
7
|
-
- Colored syntax-highlighted diff hunk renderers.
|
|
8
|
-
- Interactive category filtering and self-healing menus.
|
|
9
|
-
|
|
10
|
-
Author: Toprak Ahmet Aydogmus (Siber Akademi)
|
|
11
|
-
Version: 10.4.0
|
|
12
|
-
"""
|
|
13
|
-
|
|
14
|
-
import os
|
|
15
|
-
import sys
|
|
16
|
-
from typing import Any, Dict, List, Optional
|
|
17
|
-
|
|
18
|
-
from .models import (
|
|
19
|
-
DiagnosticIssue,
|
|
20
|
-
DiagnosticReport,
|
|
21
|
-
HealAction,
|
|
22
|
-
HealReport,
|
|
23
|
-
SeverityLevel,
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
class InteractiveFixerTUI:
|
|
28
|
-
"""Terminal UI renderer for T-Zero Autonomous Doctor."""
|
|
29
|
-
|
|
30
|
-
@staticmethod
|
|
31
|
-
def render_gauge(percentage: int, width: int = 30) -> str:
|
|
32
|
-
"""Render a colored ASCII health progress bar gauge."""
|
|
33
|
-
fill = int(width * (percentage / 100))
|
|
34
|
-
empty = width - fill
|
|
35
|
-
if percentage >= 90:
|
|
36
|
-
color = "\033[1;32m" # Bold green
|
|
37
|
-
elif percentage >= 70:
|
|
38
|
-
color = "\033[1;33m" # Bold yellow
|
|
39
|
-
else:
|
|
40
|
-
color = "\033[1;31m" # Bold red
|
|
41
|
-
|
|
42
|
-
bar = "█" * fill + "░" * empty
|
|
43
|
-
return f"{color}[{bar}] {percentage}%\033[0m"
|
|
44
|
-
|
|
45
|
-
@classmethod
|
|
46
|
-
def render_cockpit(cls, diag: DiagnosticReport, heal: Optional[HealReport] = None):
|
|
47
|
-
"""Render full interactive cockpit view."""
|
|
48
|
-
term_width = 80
|
|
49
|
-
|
|
50
|
-
print("\033[36m" + "╔" + "═" * (term_width - 2) + "╗\033[0m")
|
|
51
|
-
print("\033[36m║\033[0m\033[1;37m ⚡ T-ZERO AUTONOMOUS PC-FIXER & CODEBASE DOCTOR COCKPIT \033[0m" + " " * 18 + "\033[36m║\033[0m")
|
|
52
|
-
print("\033[36m╠" + "═" * (term_width - 2) + "╣\033[0m")
|
|
53
|
-
|
|
54
|
-
# Top summary row
|
|
55
|
-
gauge = cls.render_gauge(diag.health_score_pct)
|
|
56
|
-
print(f"\033[36m║\033[0m Overall Health: {gauge:<38} \033[36m║\033[0m")
|
|
57
|
-
print(f"\033[36m║\033[0m Directory: \033[33m{diag.target_dir[:58]:<58}\033[0m \033[36m║\033[0m")
|
|
58
|
-
print(f"\033[36m║\033[0m Platform: \033[32m{diag.environment.os_release[:40]:<40}\033[0m (\033[35mv{diag.environment.python_version}\033[0m) \033[36m║\033[0m")
|
|
59
|
-
print(f"\033[36m║\033[0m Hardware: \033[36m{diag.environment.cpu_cores} Cores\033[0m | \033[36m{diag.environment.available_ram_gb:.1f}GB / {diag.environment.total_ram_gb:.1f}GB Free RAM\033[0m" + " " * 15 + "\033[36m║\033[0m")
|
|
60
|
-
print("\033[36m╠" + "═" * (term_width - 2) + "╣\033[0m")
|
|
61
|
-
|
|
62
|
-
# Diagnostics matrix
|
|
63
|
-
print("\033[36m║\033[0m \033[1mDIAGNOSTIC METRICS BREAKDOWN\033[0m" + " " * 48 + "\033[36m║\033[0m")
|
|
64
|
-
print(f"\033[36m║\033[0m • Critical Faults: \033[1;31m{diag.critical_count:<4}\033[0m │ Syntax Defects: \033[31m{diag.syntax_errors:<4}\033[0m \033[36m║\033[0m")
|
|
65
|
-
print(f"\033[36m║\033[0m • Error Level: \033[31m{diag.error_count:<4}\033[0m │ Missing Imports: \033[33m{diag.missing_imports:<4}\033[0m \033[36m║\033[0m")
|
|
66
|
-
print(f"\033[36m║\033[0m • Warnings: \033[33m{diag.warning_count:<4}\033[0m │ Security Leaks: \033[1;31m{diag.security_leaks:<4}\033[0m \033[36m║\033[0m")
|
|
67
|
-
print(f"\033[36m║\033[0m • Code Smells: \033[36m{diag.code_smells:<4}\033[0m │ Cache & Bytecode: \033[32m{diag.cache_issues:<4}\033[0m \033[36m║\033[0m")
|
|
68
|
-
print(f"\033[36m║\033[0m • Scanned Files: \033[35m{diag.scanned_file_count:<4}\033[0m │ Scan Latency: \033[35m{diag.scan_duration_ms}ms\033[0m" + " " * 9 + "\033[36m║\033[0m")
|
|
69
|
-
|
|
70
|
-
# Healing section if present
|
|
71
|
-
if heal:
|
|
72
|
-
print("\033[36m╠" + "═" * (term_width - 2) + "╣\033[0m")
|
|
73
|
-
print("\033[36m║\033[0m \033[1;32m💉 AUTONOMOUS SELF-HEALING OUTCOME\033[0m" + " " * 42 + "\033[36m║\033[0m")
|
|
74
|
-
print(f"\033[36m║\033[0m • Transaction: \033[35m{heal.transaction_id:<32}\033[0m \033[36m║\033[0m")
|
|
75
|
-
print(f"\033[36m║\033[0m • Issues Healed: \033[1;32m{heal.issues_healed} / {heal.issues_detected}\033[0m ({'DRY-RUN PREVIEW' if heal.dry_run else 'COMMITTED TO DISK'}) \033[36m║\033[0m")
|
|
76
|
-
print(f"\033[36m║\033[0m • Score Boost: \033[33m{heal.initial_health_score}%\033[0m -> \033[1;32m{heal.final_health_score}%\033[0m in \033[36m{heal.execution_duration_ms:.1f}ms\033[0m \033[36m║\033[0m")
|
|
77
|
-
|
|
78
|
-
print("\033[36m╚" + "═" * (term_width - 2) + "╝\033[0m")
|
|
79
|
-
|
|
80
|
-
@classmethod
|
|
81
|
-
def render_diff(cls, diff_text: str):
|
|
82
|
-
"""Render a unified diff with ANSI syntax colors."""
|
|
83
|
-
for line in diff_text.splitlines():
|
|
84
|
-
if line.startswith("+"):
|
|
85
|
-
print(f"\033[32m{line}\033[0m")
|
|
86
|
-
elif line.startswith("-"):
|
|
87
|
-
print(f"\033[31m{line}\033[0m")
|
|
88
|
-
elif line.startswith("@@"):
|
|
89
|
-
print(f"\033[35m{line}\033[0m")
|
|
90
|
-
else:
|
|
91
|
-
print(line)
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
"""T-Zero Autonomous Doctor Interactive Terminal Cockpit & TUI.
|
|
3
|
+
|
|
4
|
+
Provides high-impact ANSI terminal visualization:
|
|
5
|
+
- Visual health score gauges and dial meters.
|
|
6
|
+
- Multi-column toolchain status matrices.
|
|
7
|
+
- Colored syntax-highlighted diff hunk renderers.
|
|
8
|
+
- Interactive category filtering and self-healing menus.
|
|
9
|
+
|
|
10
|
+
Author: Toprak Ahmet Aydogmus (Siber Akademi)
|
|
11
|
+
Version: 10.4.0
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
import os
|
|
15
|
+
import sys
|
|
16
|
+
from typing import Any, Dict, List, Optional
|
|
17
|
+
|
|
18
|
+
from .models import (
|
|
19
|
+
DiagnosticIssue,
|
|
20
|
+
DiagnosticReport,
|
|
21
|
+
HealAction,
|
|
22
|
+
HealReport,
|
|
23
|
+
SeverityLevel,
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class InteractiveFixerTUI:
|
|
28
|
+
"""Terminal UI renderer for T-Zero Autonomous Doctor."""
|
|
29
|
+
|
|
30
|
+
@staticmethod
|
|
31
|
+
def render_gauge(percentage: int, width: int = 30) -> str:
|
|
32
|
+
"""Render a colored ASCII health progress bar gauge."""
|
|
33
|
+
fill = int(width * (percentage / 100))
|
|
34
|
+
empty = width - fill
|
|
35
|
+
if percentage >= 90:
|
|
36
|
+
color = "\033[1;32m" # Bold green
|
|
37
|
+
elif percentage >= 70:
|
|
38
|
+
color = "\033[1;33m" # Bold yellow
|
|
39
|
+
else:
|
|
40
|
+
color = "\033[1;31m" # Bold red
|
|
41
|
+
|
|
42
|
+
bar = "█" * fill + "░" * empty
|
|
43
|
+
return f"{color}[{bar}] {percentage}%\033[0m"
|
|
44
|
+
|
|
45
|
+
@classmethod
|
|
46
|
+
def render_cockpit(cls, diag: DiagnosticReport, heal: Optional[HealReport] = None):
|
|
47
|
+
"""Render full interactive cockpit view."""
|
|
48
|
+
term_width = 80
|
|
49
|
+
|
|
50
|
+
print("\033[36m" + "╔" + "═" * (term_width - 2) + "╗\033[0m")
|
|
51
|
+
print("\033[36m║\033[0m\033[1;37m ⚡ T-ZERO AUTONOMOUS PC-FIXER & CODEBASE DOCTOR COCKPIT \033[0m" + " " * 18 + "\033[36m║\033[0m")
|
|
52
|
+
print("\033[36m╠" + "═" * (term_width - 2) + "╣\033[0m")
|
|
53
|
+
|
|
54
|
+
# Top summary row
|
|
55
|
+
gauge = cls.render_gauge(diag.health_score_pct)
|
|
56
|
+
print(f"\033[36m║\033[0m Overall Health: {gauge:<38} \033[36m║\033[0m")
|
|
57
|
+
print(f"\033[36m║\033[0m Directory: \033[33m{diag.target_dir[:58]:<58}\033[0m \033[36m║\033[0m")
|
|
58
|
+
print(f"\033[36m║\033[0m Platform: \033[32m{diag.environment.os_release[:40]:<40}\033[0m (\033[35mv{diag.environment.python_version}\033[0m) \033[36m║\033[0m")
|
|
59
|
+
print(f"\033[36m║\033[0m Hardware: \033[36m{diag.environment.cpu_cores} Cores\033[0m | \033[36m{diag.environment.available_ram_gb:.1f}GB / {diag.environment.total_ram_gb:.1f}GB Free RAM\033[0m" + " " * 15 + "\033[36m║\033[0m")
|
|
60
|
+
print("\033[36m╠" + "═" * (term_width - 2) + "╣\033[0m")
|
|
61
|
+
|
|
62
|
+
# Diagnostics matrix
|
|
63
|
+
print("\033[36m║\033[0m \033[1mDIAGNOSTIC METRICS BREAKDOWN\033[0m" + " " * 48 + "\033[36m║\033[0m")
|
|
64
|
+
print(f"\033[36m║\033[0m • Critical Faults: \033[1;31m{diag.critical_count:<4}\033[0m │ Syntax Defects: \033[31m{diag.syntax_errors:<4}\033[0m \033[36m║\033[0m")
|
|
65
|
+
print(f"\033[36m║\033[0m • Error Level: \033[31m{diag.error_count:<4}\033[0m │ Missing Imports: \033[33m{diag.missing_imports:<4}\033[0m \033[36m║\033[0m")
|
|
66
|
+
print(f"\033[36m║\033[0m • Warnings: \033[33m{diag.warning_count:<4}\033[0m │ Security Leaks: \033[1;31m{diag.security_leaks:<4}\033[0m \033[36m║\033[0m")
|
|
67
|
+
print(f"\033[36m║\033[0m • Code Smells: \033[36m{diag.code_smells:<4}\033[0m │ Cache & Bytecode: \033[32m{diag.cache_issues:<4}\033[0m \033[36m║\033[0m")
|
|
68
|
+
print(f"\033[36m║\033[0m • Scanned Files: \033[35m{diag.scanned_file_count:<4}\033[0m │ Scan Latency: \033[35m{diag.scan_duration_ms}ms\033[0m" + " " * 9 + "\033[36m║\033[0m")
|
|
69
|
+
|
|
70
|
+
# Healing section if present
|
|
71
|
+
if heal:
|
|
72
|
+
print("\033[36m╠" + "═" * (term_width - 2) + "╣\033[0m")
|
|
73
|
+
print("\033[36m║\033[0m \033[1;32m💉 AUTONOMOUS SELF-HEALING OUTCOME\033[0m" + " " * 42 + "\033[36m║\033[0m")
|
|
74
|
+
print(f"\033[36m║\033[0m • Transaction: \033[35m{heal.transaction_id:<32}\033[0m \033[36m║\033[0m")
|
|
75
|
+
print(f"\033[36m║\033[0m • Issues Healed: \033[1;32m{heal.issues_healed} / {heal.issues_detected}\033[0m ({'DRY-RUN PREVIEW' if heal.dry_run else 'COMMITTED TO DISK'}) \033[36m║\033[0m")
|
|
76
|
+
print(f"\033[36m║\033[0m • Score Boost: \033[33m{heal.initial_health_score}%\033[0m -> \033[1;32m{heal.final_health_score}%\033[0m in \033[36m{heal.execution_duration_ms:.1f}ms\033[0m \033[36m║\033[0m")
|
|
77
|
+
|
|
78
|
+
print("\033[36m╚" + "═" * (term_width - 2) + "╝\033[0m")
|
|
79
|
+
|
|
80
|
+
@classmethod
|
|
81
|
+
def render_diff(cls, diff_text: str):
|
|
82
|
+
"""Render a unified diff with ANSI syntax colors."""
|
|
83
|
+
for line in diff_text.splitlines():
|
|
84
|
+
if line.startswith("+"):
|
|
85
|
+
print(f"\033[32m{line}\033[0m")
|
|
86
|
+
elif line.startswith("-"):
|
|
87
|
+
print(f"\033[31m{line}\033[0m")
|
|
88
|
+
elif line.startswith("@@"):
|
|
89
|
+
print(f"\033[35m{line}\033[0m")
|
|
90
|
+
else:
|
|
91
|
+
print(line)
|