chore(framework): TS 测试基建(tsx+node:test) + core 常量

- 补 @types/node(tsconfig types:[node] 所需,原计划遗漏)
- tsconfig 加 allowImportingTsExtensions(import 带 .ts 后缀所需)
- test:framework 改用 run-framework-tests.mjs 递归枚举(node 20.13 <20.14 不支持 --test glob)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-28 14:20:25 +08:00
co-authored by Claude Opus 4.8
parent 2e18396388
commit f693f45895
6 changed files with 620 additions and 1 deletions
@@ -0,0 +1,23 @@
/**
* 框架常量。协议取值参见 docs/protocol/01、02(spec §0.1:只引用、不内联协议细节)。
*/
export const APP = 'youle';
export const Route = {
platform: 'platform',
agent: 'agent',
room: 'room',
} as const;
export type RouteName = (typeof Route)[keyof typeof Route];
/** 收包超时阈值(ms)。来源 docs/protocol/01 §4(ConstVal.Max.heartbeat=30000)。 */
export const RECV_TIMEOUT_MS = 30000;
/** 重连定时器间隔(ms)。来源 docs/protocol/01 §7.2(GameData.timer=10000)。 */
export const RECONNECT_INTERVAL_MS = 10000;
/** 发登录后等待响应的守护超时(ms)。来源 docs/protocol/01 §6.2(4000)。 */
export const LOGIN_GUARD_MS = 4000;
/** 失败累计到该次数轮换一个候选服务器。来源 docs/protocol/01 §7.3(tryReconnectTimes%3)。 */
export const SERVER_ROTATE_EVERY = 3;