llm 提示词和规则:新增 progress_complete 判断字段。 deploy.sh / deploy.ps1:poll-* action 入口改为单次查询。 interactive.py:chat 会播报进度更新。 config.txt.example / README / packaging 文档 / Skill 文档:同步进度查询参数和新 workflow 语义。 测试补充了进度重复查询、超时暂停、chat 进度播报。
33 lines
880 B
Python
33 lines
880 B
Python
"""为 PAM_HOME 脚本 action 写入 config.txt 风格配置文件。"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from pathlib import Path
|
|
from typing import Any
|
|
|
|
CONFIG_KEYS = (
|
|
"HOME_BASE_URL",
|
|
"CLIENT_ID",
|
|
"CLIENT_SECRET",
|
|
"AIRPORT_CODE",
|
|
"APP_NAME",
|
|
"MODULE_NAME",
|
|
"VERSION_NUMBER",
|
|
"ZIP_FILE_PATH",
|
|
"ACTION_TYPE",
|
|
"TIMEOUT",
|
|
"LOG_NAME",
|
|
"POLL_INTERVAL_SEC",
|
|
"DOWNLOAD_POLL_MAX_ATTEMPTS",
|
|
"UPGRADE_POLL_MAX_ATTEMPTS",
|
|
)
|
|
|
|
|
|
def write_config(params: dict[str, Any], path: str | Path) -> Path:
|
|
"""按脚本约定的字段顺序生成配置文件,并返回最终路径。"""
|
|
config_path = Path(path)
|
|
config_path.parent.mkdir(parents=True, exist_ok=True)
|
|
lines = [f"{key}={params.get(key, '')}" for key in CONFIG_KEYS]
|
|
config_path.write_text("\n".join(lines) + "\n", encoding="utf-8")
|
|
return config_path
|