Repository navigation
v12
🇺🇸 [v12] - Intelligent Constraint-Safe Updates, FS Watcher & Marker Redesign
🇨🇳 [v12] - 智能依赖约束更新、文件系统联动同步与终端状态检测重构 (中文说明)
本次更新显著增强了包管理的智能化程度,引入了自动探测安全中间版本的能力,并实现了 UI 与物理硬盘状态的实时同步。同时,底层终端状态追踪机制进行了重构,极大地提升了在高压力输出场景下的任务可靠性。
🛡️ 智能依赖约束更新
- 安全中间版本推荐:引入
safe_update_version逻辑。当包的最新版本因依赖关系被其他包锁定(Breaks Constraints)时,OmniPack 现在会自动探测版本历史,并推荐一个在约束范围内的“最高安全版本”。 - 可视化约束引导:
- 针对受限包引入全新的蓝色 UI 主题 (
PkgVersionUpdateConstrained)。 - 悬停提示 大幅增强:不仅显示“可能导致冲突”,还会详细列出是哪些上游包施加了什么范围的约束(例如:
Django 要求 djangorestframework<3.15),让用户对版本锁定原因一目了然。 - “一键全选过时包”逻辑优化:会自动包含这些受限但可安全升级到中间版本的包,而彻底无法无损升级的包仍保持手动确认模式。
- 针对受限包引入全新的蓝色 UI 主题 (
- 预发布版本智能过滤:引入
is_prerelease_version逻辑,在探测可用包版本及安全中间版本时自动排除 alpha、beta、rc 等非稳定的预发布版本,防止用户在自动升级中误入预览版分支。
🔄 实时文件系统联动
- 环境自愈同步:在
PipPanel和NpmPanel中集成了QFileSystemWatcher。 - 命令行脱机联动:当用户直接在系统终端或内置终端中运行
pip install或npm install等命令导致本地文件变化时,OmniPack 会在静默期(Debounce)后自动触发环境刷新,确保 UI 状态始终与物理硬盘保持实时一致,无需手动点击刷新按钮。
🧩 终端状态检测重构
- 基于物理文件的 Marker 机制:彻底重构了 PTY 终端任务结束的检测逻辑。由原来的“拦截输出流并正则匹配 UUID”改为“写入临时标记文件 (
.done)”。 - 极致稳定性:解决了在极高并发输出、ANSI 颜色代码干扰或终端自动换行时,正则匹配 UUID 标记位可能失效导致界面无限加载的问题。新机制完全免疫任何终端字符流干扰。
⚙️ 底层健壮性与代理优化
- 集成终端代理自动联动:集成 PTY 终端在启动时会自动读取并继承全局代理配置。一旦软件的代理启用,PTY 进程将同步注入
HTTP_PROXY、HTTPS_PROXY以及 NPM 专用的NPM_CONFIG_PROXY与忽略证书校验环境变量(如NODE_TLS_REJECT_UNAUTHORIZED=0),从而保证内置命令行操作和主程序具备一致的网络穿透能力。 - 多级版本探测 API 容灾回退:在 Pip 可用版本扫描中引入三级 Fallback 保护。当默认的
pip index命令由于不支持或源限制无法查询时,会自动请求 PyPI 官方 JSON 接口;对于私有源则尝试拉取其 Simple API 的 JSON 响应,最终回退到直接请求 HTML 并以正则从链接名中解析提取版本号。这彻底解决了弱网、局域网或特定私有镜像源下无法探测更新的问题。 - 安装规范(Spec)智能清洗:
- 新增
extract_npm_package_name智能包名提取算法,能自动在各种复杂的 npm 安装 spec(如本地路径、Workspace 符号链接、Git URL、别名包等)中剥离噪音并提取出最终注册到node_modules里的真实包名。 - 在 Pip 局部扫描中,引入
extract_pip_requirement_name对传入的包名先过滤约束条件等参数再扫描,双端齐下确保局部更新和扫描解析时不发生错位。
- 新增
- 控制台 ANSI OSC 控制流净化:升级了内置的流式 ANSI 剥离器,增加了对 OSC 控制序列(如终端改名、标题重设等
\x1b]...指令)的过滤支持,有效规避了高彩 PTY 流在向只读日志投射时的字符杂音与乱码。
🏗️ 性能与细节改进
- 渲染精度修复:修复了
RealTerminalPanel在渲染pyte缓冲区时过度裁剪行尾空格导致交互式光标定位偏移的 Bug。 - 并发性能优化:Pip 环境在计算依赖约束时引入了版本缓存池,大幅减少了重复查询 PyPI 元数据带来的网络开销。
This release significantly enhances package management intelligence by introducing constraint-safe intermediate version recommendations and real-time synchronization with physical disk states. Additionally, the underlying PTY terminal tracking mechanism has been refactored to achieve ultimate stability under heavy CLI output.
🛡️ Intelligent Constraint-Safe Updates
- Safe Update Recommendations: Introduced
safe_update_versionlogic. When a package's latest version is locked by other packages (Breaks Constraints), OmniPack now automatically probes its version history to recommend the highest available version within the constraint range. - Visual Constraint Guidance:
- Applied a brand-new blue UI theme (
PkgVersionUpdateConstrained) for constrained packages. - Greatly enhanced ToolTips: Instead of just displaying "may break version constraints," they now detail the exact upstream packages and constraint ranges (e.g.,
Django requires djangorestframework<3.15) for clear version locking diagnostics. - Optimized "Select Outdated" logic: Now automatically includes constrained packages that can be safely upgraded to an intermediate version, while packages that cannot be safely upgraded still require manual confirmation.
- Applied a brand-new blue UI theme (
- Prerelease Version Filtering: Introduced
is_prerelease_versionlogic to automatically exclude unstable pre-release versions (like alpha, beta, rc, pre, dev) during package version detection and safe intermediate recommendations, avoiding unintentional upgrades to unstable builds.
🔄 Real-time File System Watcher
- Auto-Refresh on External Changes: Integrated
QFileSystemWatcherinPipPanelandNpmPanel. - Command-line Offline Synchronization: When users run commands like
pip installornpm installdirectly in an external system terminal or the built-in terminal, OmniPack automatically triggers environment scanning after a quiet debounce period, keeping the UI state consistent with the physical disk without manual refreshes.
🧩 Terminal Marker Redesign
- File-based Marker Mechanism: Completely refactored PTY terminal command completion detection. Shifted from "intercepting stdout and regex-matching UUID" to "writing a temporary marker file (
.done)". - Ultimate Stability: Resolved the issue where the UUID marker regex matching failed due to high-concurrency outputs, ANSI color code interference, or terminal line wrapping, which previously led to infinite UI loading. The new mechanism is entirely immune to any terminal stream text noise.
⚙️ Core Robustness & Proxy Enhancements
- Terminal Proxy Auto-Sync: The integrated PTY terminal now inherits global proxy configurations upon startup. When active, it automatically injects
HTTP_PROXY,HTTPS_PROXY, npm-specificNPM_CONFIG_PROXY, and SSL certificate bypass variables (NODE_TLS_REJECT_UNAUTHORIZED=0), ensuring the terminal CLI commands share the same network penetration capabilities as the main UI. - Fallback Version Discovery: Implemented a 3-level fallback version query pipeline for Pip. If the default
pip indexfails or is unsupported, OmniPack queries the official PyPI JSON API, falls back to simple repository API JSON endpoints, and ultimately parses simple HTML directories with regex to extract version numbers from wheel/sdist packages, safeguarding functionality on restricted, offline, or private index mirrors. - Smart Spec Extraction:
- Added the
extract_npm_package_namealgorithm to parse complex npm installation specs (local paths, workspaces, Git URLs, alias packages with@npm:) and isolate the clean package name registered innode_modules. - Added
extract_pip_requirement_namein Pip partial scanning to strip constraint parameters before queries, ensuring alignment for partial sync operations.
- Added the
- OSC Sequence Filtering: Upgraded the streaming ANSI stripper to filter out Operating System Command (OSC) sequences (such as terminal title changes like
\x1b]0;...), keeping the read-only simulated console clean and free of control character noise.
🏗️ Performance & UI Refinement
- Rendering Precision Fix: Fixed a bug where
RealTerminalPanelover-clipped trailing spaces when renderingpytebuffers, which previously led to interactive cursor offsets. - Concurrent Optimization: Integrated a version caching pool in Pip dependency constraint resolution, dramatically reducing repetitive PyPI registry metadata queries.