| 12345678910111213141516171819202122232425262728293031323334 |
- 'use strict';
- const assert = require('assert/strict');
- const crypto = require('crypto');
- const fs = require('fs');
- const path = require('path');
- const packageRoot = path.resolve(__dirname, '..');
- const sourceRoot = process.env.AGENT_HOUSE_DASHBOARD_DIR
- ? path.resolve(process.env.AGENT_HOUSE_DASHBOARD_DIR)
- : path.resolve(packageRoot, '..', 'agent-house', '.claude', 'plugins', 'qiwei-assistant', 'mcp', 'src', 'dashboard');
- const dashboardRoot = path.join(packageRoot, 'mcp', 'src', 'dashboard');
- const assets = ['index.html', 'app.js', 'styles.css'];
- function digest(filePath) {
- return crypto.createHash('sha256').update(fs.readFileSync(filePath)).digest('hex');
- }
- assert(fs.existsSync(sourceRoot), `agent-house dashboard source not found: ${sourceRoot}`);
- for (const asset of assets) {
- const source = path.join(sourceRoot, asset);
- const target = path.join(dashboardRoot, asset);
- assert.equal(digest(target), digest(source), `${asset} is not synchronized with agent-house`);
- }
- const html = fs.readFileSync(path.join(dashboardRoot, 'index.html'), 'utf8');
- const app = fs.readFileSync(path.join(dashboardRoot, 'app.js'), 'utf8');
- assert.match(html, /20260807-voice-preview-persist/);
- assert.match(app, /AGENT_SNAPSHOT_KEY/);
- assert.match(app, /\/api\/accounts\/switch/);
- assert.match(app, /voicePreview/);
- assert.match(app, /openSessionConversation/);
- console.log(JSON.stringify({ status: 'ok', synchronized: assets }, null, 2));
|