- 新增 pam_deploy_graph 包,包含 agent、action router、runner、parser 和配置加载能力 - 支持 hybrid_node_mcp 路由策略:PAM_HOME 走脚本 action,PAM_NODE 走 MCP - 新增 fake runner 和 CLI 预演/全局流程验证入口 - 新增路由、输出解析、配置加载、脚本命令构造、Skill 策略加载测试 - 在 README 中记录当前代码骨架、实现进度、使用方式和下一步建议
28 lines
719 B
Python
28 lines
719 B
Python
"""Load deploy parameters from JSON or config.txt style files."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import json
|
|
from pathlib import Path
|
|
from typing import Any
|
|
|
|
|
|
def load_params_file(path: str | Path) -> dict[str, Any]:
|
|
config_path = Path(path)
|
|
text = config_path.read_text(encoding="utf-8")
|
|
stripped = text.lstrip()
|
|
if stripped.startswith("{"):
|
|
return json.loads(text)
|
|
|
|
values: dict[str, Any] = {}
|
|
for raw_line in text.splitlines():
|
|
line = raw_line.strip()
|
|
if not line or line.startswith("#"):
|
|
continue
|
|
if "=" not in line:
|
|
continue
|
|
key, value = line.split("=", 1)
|
|
values[key.strip()] = value.strip()
|
|
return values
|
|
|