gaza/README.md
Ubuntu fbcc342c5f 定义标准协议 TypeScript 数据模型
Co-authored-by: multica-agent <github@multica.ai>
2026-08-03 19:05:26 +00:00

21 lines
612 B
Markdown
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.

# gaza
GUI 与兼容 Teamserver 之间的首版强类型 TypeScript 协议模型。本包只定义标准对象与运行时解析边界,不包含网络请求、认证或私有 C2 适配。
## 使用
```ts
import { parseSession, type Session } from "@gaza/protocol";
const session: Session = parseSession(teamserverPayload);
```
`ServerId`、`ProjectId`、`SessionId` 等采用品牌类型,避免在编译期误用不同层级 ID。枚举使用前向兼容字符串表达解析器保留未知枚举和扩展字段。
## 验证
```bash
docker compose run --rm test
docker compose build production
```