MindOS_CLI/mindcli/__init__.py
lidf 69dd868e2f init: MindOS CLI 本地执行体(从 mindOSv2/mindos-cli 独立)
- 独立 pyproject.toml(pip install -e .)
- vendor_hermes.sh 已改为显式路径模式(不再依赖相对目录)
- 包含 hermes vendor 快照
2026-04-28 13:12:54 +08:00

23 lines
863 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""
MindOS CLI — Cloud Hermes 的受管理执行节点。
包初始化:将 _vendor/ 目录加入 sys.path
使 Hermes 模块的内部 import 路径保持原样工作。
POC 验证结论sys.path.insert(0, _vendor_dir) 一行即可,
不需要重写 Hermes 的 10K 行代码中的任何 import。
"""
import os
import sys
__version__ = "0.1.0"
# ── Vendor 路径注入 ──────────────────────────────────────────
# 将 _vendor/ 目录加入 sys.path 头部,
# 使 Hermes 的 `from hermes_state import ...` 等裸 import 直接工作。
# 类似 pip._vendor 的 sys.path 策略。
_VENDOR_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "_vendor")
if os.path.isdir(_VENDOR_DIR) and _VENDOR_DIR not in sys.path:
sys.path.insert(0, _VENDOR_DIR)