Files
persistent-chat-plugin/scripts/co-integration/retire_cochat.sh
卡若AI ba786b3700 feat: Persistent Chat v1.1 CO-Chat 整合上传 Gitea
同步 enhance/bridge/smoke/retire 模块、vendor 3.3.34、增强面板与 PRD 文档,
Hub 接入 hub-routes-prd,含安装/经验/模块说明与 co-integration 运维脚本。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 17:42:16 +08:00

46 lines
1.5 KiB
Bash
Executable File
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.

#!/usr/bin/env bash
# FR-RETIRE: 验收通过后卸载 co-chat仅保留 pchat
set -euo pipefail
BACKUP_ROOT="$HOME/.persistent-chat-local/backups/cochat-retire-$(date +%Y%m%d-%H%M%S)"
ENHANCE="$HOME/.persistent-chat-local/composer-enhance.json"
echo "=== pchat retire co-chat ==="
if [[ -f "$ENHANCE" ]]; then
permOk=$(python3 -c "import json; print(json.load(open('$ENHANCE')).get('permOk',False))" 2>/dev/null || echo False)
patchOk=$(python3 -c "import json; print(json.load(open('$ENHANCE')).get('patchOk',False))" 2>/dev/null || echo False)
if [[ "$permOk" != "True" || "$patchOk" != "True" ]]; then
echo "阻断composer-enhance.json 未全绿 (permOk=$permOk patchOk=$patchOk)"
echo "请先完成 Hub 向导 W2/W8"
exit 1
fi
else
echo "警告:无 composer-enhance.json继续需自担风险"
read -r -p "输入 YES 继续: " ans
[[ "$ans" == "YES" ]] || exit 1
fi
mkdir -p "$BACKUP_ROOT"
# 备份扩展
for ext in "$HOME/.cursor/extensions"/co-chat.co-chat-panel-*; do
[[ -d "$ext" ]] || continue
echo "备份 $ext"
cp -R "$ext" "$BACKUP_ROOT/"
done
# 备份 globalStorage
GS="$HOME/Library/Application Support/Cursor/User/globalStorage/co-chat.co-chat-panel"
if [[ -d "$GS" ]]; then
cp -R "$GS" "$BACKUP_ROOT/globalStorage-co-chat"
fi
# 备份 mcp.json
MCP="$HOME/.cursor/mcp.json"
[[ -f "$MCP" ]] && cp "$MCP" "$BACKUP_ROOT/mcp.json.bak"
echo "备份完成: $BACKUP_ROOT"
echo "下一步:手动删除扩展目录、清理 mcp.json 中 co-mcp、删除 co-chat.mdc"
echo "回滚:从 $BACKUP_ROOT 恢复"