agent_deply/packaging/README_packaged_agent.md
2026-06-01 15:26:09 +08:00

123 lines
3.2 KiB
Markdown
Raw 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.

# PAM 部署 Agent 解压即用包
这是打包后的 PAM 部署 Agent 使用说明。该包已包含 Python 运行时和 Python 依赖,目标 Linux 机器解压后即可运行。
## 目录说明
```text
pam-deploy-agent-linux-x86_64/
run.sh # 推荐入口,带中文帮助
pam-deploy-agent # PyInstaller 生成的可执行程序
doc_scripts/
deploy.sh # Linux 脚本 action 入口
config.txt.example # 参数配置示例
PAM_AUTO_DEPLY_SKILL.md
README.md # 当前说明
LICENSE
```
`doc_scripts` 只保留运行必需文件,不包含项目设计文档、测试脚本或 Windows 脚本。
## 查看帮助
```bash
./run.sh --help
```
查看某个子命令的原始参数:
```bash
./run.sh chat --help
./run.sh run-deploy --help
```
## 交互式使用
推荐先用 fake 策略验证流程:
```bash
./run.sh chat --config doc_scripts/config.txt.example --strategy fake --checkpoint runtime/checkpoints/demo.json
```
进入对话框后可输入:
```text
PAM> 请用 MCP 预演部署 HET PAM Node 版本 2.0.5,不要动环境
PAM> preview
PAM> set VERSION_NUMBER=2.0.6
PAM> run
即将执行真实 action确认执行请输入 yes: yes
PAM> status
PAM> approve
PAM> resume
PAM> exit
```
## 一次性命令
只做理解和计划生成,不执行:
```bash
./run.sh analyze --config doc_scripts/config.txt.example --text "请用 MCP 预演部署 HET PAM Node 版本 2.0.5,不要动环境"
```
预演 action 路由:
```bash
./run.sh preview --config doc_scripts/config.txt.example --strategy fake
```
执行 fake 完整部署流程:
```bash
./run.sh run-deploy --config doc_scripts/config.txt.example --strategy fake --checkpoint runtime/checkpoints/demo.json --confirm
```
处理失败后的回滚确认:
```bash
./run.sh confirm --checkpoint runtime/checkpoints/demo.json --decision approve --confirm
./run.sh resume --checkpoint runtime/checkpoints/demo.json --confirm
```
拒绝回滚:
```bash
./run.sh confirm --checkpoint runtime/checkpoints/demo.json --decision reject --note "人工决定暂不回滚" --confirm
```
## LLM 配置
不配置 LLM 时会使用本地规则 fallback。真实 LLM 使用 OpenAI-compatible `/chat/completions`
```bash
export PAM_LLM_BASE_URL="https://your-llm.example.com/v1"
export PAM_LLM_API_KEY="your-api-key"
export PAM_LLM_MODEL="your-model-name"
./run.sh analyze --config doc_scripts/config.txt.example --text "请分析这次部署"
```
也可以用 CLI 参数:
```bash
./run.sh analyze \
--config doc_scripts/config.txt.example \
--text "请分析这次部署" \
--llm-base-url https://your-llm.example.com/v1 \
--llm-api-key your-api-key \
--llm-model your-model-name
```
## 策略说明
- `fake`:全部使用 fake runner不访问真实环境。
- `script_only`:全部 action 走脚本。
- `hybrid_node_mcp`PAM_HOME 走脚本PAM_NODE 走 MCP。
## 注意事项
- 执行真实 action 前请确认配置文件中的 `HOME_BASE_URL``CLIENT_ID``CLIENT_SECRET``AIRPORT_CODE``APP_NAME``MODULE_NAME``VERSION_NUMBER``ZIP_FILE_PATH`
- `checkpoint` 会保存完整运行参数,请放在受控目录。
- 真实 MCP session 需要你在外部接入;当前包包含 MCP client adapter 和 action 映射能力。