feat: purge legacy agent hosts and land vault Chrome extension path

Retire ACP/Hermes/OpenCode surfaces and rename hermes_tools to
mnote_agent_tools so Page AI stays on Pi Lab only. Add Chrome vault
extension + extension token route, pre-release purge design, and soft-retire
legacy smokes for the small-group production cut.
This commit is contained in:
Agent Board
2026-07-25 14:25:37 +08:00
parent bc6f8488ee
commit 262e66b02e
137 changed files with 9018 additions and 46049 deletions
@@ -1,32 +1,16 @@
#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
"use strict";
const repoRoot = path.resolve(__dirname, '..');
const runtimePath = path.join(repoRoot, 'rust/crates/mnote-web/browser/sidebar-page-ai-runtime.js');
const cssPath = path.join(repoRoot, 'rust/crates/mnote-web/src/ssr/styles/components/page-ai.css');
const runtime = fs.readFileSync(runtimePath, 'utf8');
const css = fs.readFileSync(cssPath, 'utf8');
const checks = [
['opencode host switch', runtime.includes('mnote.page_ai.opencode_host')],
['opencode status api', runtime.includes('/api/page-ai/opencode/status')],
['opencode diff api', runtime.includes('/api/page-ai/opencode/diff?sessionId=')],
['opencode event api', runtime.includes('/api/page-ai/opencode/events') && runtime.includes('new EventSource')],
['opencode iframe route', runtime.includes('/page-ai/opencode/') && runtime.includes('src="about:blank"')],
['persistent binding source', runtime.includes('/api/page-ai/opencode/session') && !runtime.includes('sessionStorage.setItem(storageKey')],
['changed file opener', runtime.includes('__mnoteDocumentPaneRuntime.openResourceInActiveTab({ path: targetPath })')],
['current page refresh', runtime.includes('__mnoteDocumentPaneRuntime.refreshPrimaryDocument({ reason: \'page-ai-opencode-host\' })')],
['no interval polling', !/setInterval\s*\(/.test(runtime)],
['opencode css scope', css.includes('[data-page-ai-opencode-host="true"]')],
['opencode iframe css', css.includes('.wolai-page-ai-opencode-iframe')],
];
const failed = checks.filter(([, ok]) => !ok);
if (failed.length) {
console.error('Page AI opencode host static smoke failed:');
for (const [name] of failed) console.error(`- ${name}`);
process.exit(1);
}
console.log('Page AI opencode host static smoke passed.');
/**
* RETIRED (Wave 10 / pre-release legacy purge)
* 依赖已删除的 /api/hermes/client/* 或 OpenCode Page AI host。
* 产品 Page AI 仅 Pi Lab/api/page-ai/pi/*);agent tools 为 /api/mnote/tools/*。
* 本文件保留作历史对照,直接 exit 0,不再执行浏览器/静态断言。
*/
console.log(JSON.stringify({
ok: true,
retired: true,
reason: "legacy hermes client / opencode page-ai path deleted; use Pi Lab + /api/mnote/tools",
script: require("node:path").basename(__filename),
}, null, 2));
process.exit(0);