- 新增小红书前端模块(启动服务、内容分析、爆款创作、发布记录、技能卡片、拟人设置、AI 助手) - 新增 xhs-agent-desktop 独立桌面 Agent,对接 OMS 任务调度 - 登录页重构,整合微信登录与 OMS JWT 认证 - 订单、渠道、用户中心等页面与 API 增强 Co-authored-by: Cursor <cursoragent@cursor.com>
30 lines
842 B
Python
30 lines
842 B
Python
"""内置浏览器自动化运行时(engine/),无需单独安装 LIKE AI。"""
|
||
|
||
from __future__ import annotations
|
||
|
||
import sys
|
||
from pathlib import Path
|
||
|
||
|
||
def engine_root() -> Path:
|
||
return Path(__file__).resolve().parent.parent / "engine"
|
||
|
||
|
||
def extension_dir() -> Path:
|
||
return engine_root() / "extension"
|
||
|
||
|
||
def ensure_runtime_importable() -> Path:
|
||
root = engine_root()
|
||
if not (root / "xhs_bridge").is_dir():
|
||
raise RuntimeError(f"内置运行时缺失: {root / 'xhs_bridge'}")
|
||
if not (root / "scripts").is_dir():
|
||
raise RuntimeError(f"内置脚本缺失: {root / 'scripts'}")
|
||
if not (root / "extension").is_dir():
|
||
raise RuntimeError(f"Chrome 扩展缺失: {root / 'extension'}")
|
||
|
||
root_str = str(root)
|
||
if root_str not in sys.path:
|
||
sys.path.insert(0, root_str)
|
||
return root
|