Files
persistent-chat-plugin/scripts/co-integration/pchat_verify_cochat_bundle.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

31 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
VENDOR="$ROOT/.persistent-chat-v1.1/vendor/cochat-engine/3.3.34"
node -e "
const crypto=require('crypto'),fs=require('fs'),path=require('path');
const vendor=process.argv[1];
const im=JSON.parse(fs.readFileSync(path.join(vendor,'resources/integrity-manifest.json'),'utf8'));
const hashes=JSON.parse(im.manifest).hashes;
const map={
'extension.js':'dist/extension.js','mcp-server.cjs':'resources/mcp-server.cjs',
'license-core.wasm':'resources/license-core.wasm','webview-js':'dist/webview/main.js',
'webview-css':'dist/webview/main.css','uninstall':'dist/uninstall.cjs',
'reset':'resources/reset-cursor-env.mjs','sqljs':'resources/sqljs/sql-wasm.js',
'skill-autopilot':'resources/skills/co-autopilot/SKILL.md',
};
function sha(p){return crypto.createHash('sha256').update(fs.readFileSync(p)).digest('hex');}
let ok=0,fail=0;
for(const [k,rel] of Object.entries(map)){
const p=path.join(vendor,rel);
if(!fs.existsSync(p)){console.log('MISSING',k);fail++;continue;}
if(sha(p)===hashes[k]){console.log('OK',k);ok++;}
else{console.log('FAIL',k);fail++;}
}
['resources/sqljs/sql-wasm.wasm','resources/sqlite3/darwin-arm64/sqlite3','dist/reset-cursor-env.mjs'].forEach(r=>{
console.log(fs.existsSync(path.join(vendor,r))?'OK':'MISS',r);
});
console.log('---',ok,'manifest ok',fail,'fail');
process.exit(fail?1:0);
" "$VENDOR"