Files
story/scripts/sync-device-fleet-docs.cjs
Codex Local bf1233d5df
ci / verify (push) Canceled after 0s
feat: expand companion platform, device controls, and memoir workflows
Add customer and operator login, BLE provisioning, device fleet controls, call memory, memoir generation, and refreshed family and maintenance portals. Include API contracts, migrations, firmware sources, tests, assets, and deployment documentation.
2026-10-08 10:06:44 +08:00

13 lines
999 B
JavaScript
Raw Permalink 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.
// Mechanical sync of the maintained MQTT/OTA contract into the existing handoff.
const fs = require('node:fs'), path = require('node:path');
const root = path.resolve(__dirname, '..');
const target = path.join(root, 'docs/embedded-device-business-guide-20260914.md');
const source = fs.readFileSync(path.join(root, 'docs/device-mqtt-ota.md'), 'utf8');
let md = fs.readFileSync(target, 'utf8');
const start=md.indexOf('## 8.'),end=md.indexOf('## 附录 A.');
if(start<0||end<start)throw new Error('Expected handoff sections not found');
md=md.slice(0,start)+source.slice(source.indexOf('## 8.'))+'\n\n'+md.slice(end);
md=md.replace(/^第 1–7 节.*$/m,'第 1–7 节保留现有蓝牙绑定与平台代注册火山流程。第 8–12 节已按本次实现更新;最终硬件按协议对接,本次不修改或烧录 EchoEar。线上发布与验证状态见 `device-fleet-delivery.md`。');
fs.writeFileSync(target,md);
console.log('Updated MQTT/OTA business contract in the embedded handoff.');