mirror of
https://bitbucket.org/siakitem/my-pi.git
synced 2026-10-26 10:45:22 +00:00
feat: 组合包配置集中到 my-pi/ 目录并改为整体重建
- 组合包拥有、可随时重建的配置、日志与缓存统一放在 <agentDir>/my-pi/:permission-system/(policy.jsonc、hard-guards.jsonc、 logs/)、rtk-optimizer/config.json、tool-search/(config.json、 catalog-v1.json)与 system-prompt-cover.md。hashline.json、lsp.json 由外部扩展读取固定路径,是唯一例外。 - 新增 config/bundle-manifest.json 与 scripts/rebuild-bundle-config.mjs: 先校验全部来源与目标,在临时目录构建完整树,再整体删除旧 my-pi/ (符号链接只删链接)并原子替换,不备份。install.sh / update.sh 每次 运行都调用它;扩展自身不再播种或迁移配置。 - update.sh 删除 pi update 失败后的 git clean 恢复逻辑:Pi 1.3.0 会在 下一次 pi update 时依据中断标记自行恢复。同时删除 Tool Search settings.json 快照迁移与封面部署脚本。 - Tool Search 改为读取 my-pi/tool-search/config.json(源为 config/tool-search.json,须与 BUNDLE_TOOL_SEARCH_DEFAULTS 一致), 不再读写 settings.json 的 toolSearch 段,移除 bundleDefaultsVersion。 - 默认权限策略开启 debugLog。 - 旧位置的残留文件不迁移、不清理;AGENTS.md / README 同步新约束。 Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
parent
7e6a8faae1
commit
2682bd7fa7
+13
-15
@@ -75,28 +75,26 @@ resolve_agent_dir() {
|
||||
printf '%s\n' "$HOME/.pi/agent"
|
||||
}
|
||||
|
||||
# 部署组合包权威的系统提示词封面;脚本目录内的组合包副本即为来源。
|
||||
deploy_system_prompt_cover() {
|
||||
cover_helper=$SCRIPT_DIR/scripts/deploy-system-prompt-cover.mjs
|
||||
if [ ! -f "$cover_helper" ]; then
|
||||
warn "找不到 SYSTEM_COVER.md 部署辅助脚本,已跳过封面部署。"
|
||||
# 整体删除并重建组合包拥有的 <agentDir>/my-pi/ 配置目录;脚本目录内的组合包副本即为来源。
|
||||
rebuild_bundle_config() {
|
||||
rebuild_helper=$SCRIPT_DIR/scripts/rebuild-bundle-config.mjs
|
||||
if [ ! -f "$rebuild_helper" ]; then
|
||||
warn "找不到组合包配置重建辅助脚本,已跳过配置重建。"
|
||||
return 1
|
||||
fi
|
||||
if ! command -v node >/dev/null 2>&1; then
|
||||
warn "找不到 node,无法部署 SYSTEM_COVER.md;Pi 将使用默认系统提示词封面。"
|
||||
warn "找不到 node,无法重建组合包配置目录。"
|
||||
return 1
|
||||
fi
|
||||
cover_agent_dir=$(resolve_agent_dir) || return 1
|
||||
cover_status=$(node "$cover_helper" "$cover_agent_dir" 2>&1) || {
|
||||
warn "SYSTEM_COVER.md 部署失败:$cover_status"
|
||||
rebuild_agent_dir=$(resolve_agent_dir) || return 1
|
||||
rebuild_status=$(node "$rebuild_helper" "$rebuild_agent_dir" 2>&1) || {
|
||||
warn "组合包配置目录重建失败:$rebuild_status"
|
||||
return 1
|
||||
}
|
||||
case $cover_status in
|
||||
created) say "✓ 已部署系统提示词封面:$cover_agent_dir/SYSTEM_COVER.md" ;;
|
||||
updated) say "✓ 已同步系统提示词封面到组合包当前版本。" ;;
|
||||
current) say "✓ 系统提示词封面已是当前组合包版本。" ;;
|
||||
case $rebuild_status in
|
||||
rebuilt:*) say "✓ 已重建组合包配置目录:${rebuild_status#rebuilt:}" ;;
|
||||
*)
|
||||
warn "SYSTEM_COVER.md 部署返回未知状态:$cover_status"
|
||||
warn "组合包配置重建返回未知状态:$rebuild_status"
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
@@ -373,7 +371,7 @@ fi
|
||||
|
||||
say "Pi 组合包安装完成,开始部署受管配置。"
|
||||
|
||||
deploy_system_prompt_cover || record_install_failure "SYSTEM_COVER.md"
|
||||
rebuild_bundle_config || record_install_failure "组合包配置重建"
|
||||
|
||||
say "开始检查终端环境和机器级 CLI 依赖。"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user