wangzhibo
2026-08-26 70481429367ca00144b24f118cbfdfb28b02967d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from pathlib import Path
 
ROOT = Path(__file__).resolve().parents[1]
 
 
def read_text(path: str) -> str:
    return (ROOT / path).read_text(encoding="utf-8")
 
 
def require(condition: bool, message: str) -> None:
    if not condition:
        raise SystemExit(message)
 
 
def main() -> None:
    board = read_text("main/boards/sening-xiaozhi-s3/sening_xiaozhi_s3.cc")
    alarm_block = board.split('mcp_server.AddTool("self.alarm.add"', 1)[1].split(
        'mcp_server.AddTool("self.alarm.get_list"', 1
    )[0]
 
    require('Property("hour", kPropertyTypeInteger, 0, 23)' in alarm_block, "alarm.add must require hour")
    require('Property("minute", kPropertyTypeInteger, 0, 59)' in alarm_block, "alarm.add must require minute")
    require('Property("second", kPropertyTypeInteger, 0, 0, 59)' in alarm_block, "alarm.add must default second")
    require('Property("trigger_time"' not in alarm_block, "alarm.add must not expose stale trigger_time schema")
    require('Property("label"' not in alarm_block, "alarm.add must not expose stale label schema")
 
 
if __name__ == "__main__":
    main()