Files
mnote/scripts/task126-rust-web-ai-bridge-structured-write-smoke.js
T
Agent Board 262e66b02e 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.
2026-07-25 14:25:37 +08:00

68 lines
1.9 KiB
JavaScript
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 node
"use strict";
/**
* 历史:曾验证 /api/hermes/bridge structured write 合同。
* Wave 10Hermes bridge 已删除;改为负向门禁(404),主链用 /api/mnote/tools + Pi Lab。
* tools manifest 可能需登录(401 仍表示路由挂载,区别于 404)。
*/
const assert = require("node:assert");
const BASE_URL = (process.env.MNOTE_UI_BASE_URL || "http://127.0.0.1:3000").replace(/\/$/, "");
async function main() {
const response = await fetch(`${BASE_URL}/api/hermes/bridge`, {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({
stream: true,
scope: "document",
messages: [{ role: "user", content: "生成摘要" }],
context: { documentId: "doc_1", workspaceId: "ws_demo" },
}),
});
const text = await response.text();
assert.equal(
response.status,
404,
`legacy /api/hermes/bridge 应已删除,实际 ${response.status}: ${text.slice(0, 300)}`,
);
const tools = await fetch(`${BASE_URL}/api/mnote/tools/manifest`);
const toolsText = await tools.text();
assert.notEqual(
tools.status,
404,
`/api/mnote/tools/manifest 路由应挂载(200 或 401),实际 ${tools.status}`,
);
// 未登录时 401;已登录时 200 且含 schema
if (tools.status === 200) {
assert.ok(
toolsText.includes("mnote.agent_tool_manifest.v1"),
"tools manifest 应使用 mnote.agent_tool_manifest.v1",
);
}
console.log(
JSON.stringify(
{
ok: true,
legacyHermesBridge: { status: 404 },
agentTools: {
status: tools.status,
mounted: true,
schemaOk: tools.status === 200 ? toolsText.includes("mnote.agent_tool_manifest.v1") : null,
},
},
null,
2,
),
);
}
main().catch((error) => {
console.error(error instanceof Error ? error.stack || error.message : String(error));
process.exit(1);
});