Files
ai-terminal-assistant/packages/server/package.json
T
kurihada 5835799b69 test(server): 添加 server 模块单元测试
- 新增 vitest 配置和测试基础设施
- 添加 adapter.test.ts: 测试 Core 模块初始化和 Agent 管理 (18 tests)
- 添加 token.test.ts: 测试 Token 生成、验证和中间件 (25 tests)
- 添加 handler.test.ts: 测试权限处理器 (18 tests)
- 添加 ws.test.ts: 测试 WebSocket 连接和消息处理 (19 tests)
- 添加 sse.test.ts: 测试 SSE 事件发送 (14 tests)
- 添加 sessions.test.ts: 测试会话路由 (16 tests)
- 添加 config.test.ts: 测试配置路由 (10 tests)
- 添加 context.test.ts: 测试上下文压缩路由 (9 tests)
- 添加 providers.test.ts: 测试 Provider 管理路由 (18 tests)
- 添加 manager.test.ts: 测试 SessionManager (48 tests)

总计 195 个测试,覆盖率从 0% 提升至 29.59%
2025-12-15 00:07:32 +08:00

37 lines
881 B
JSON

{
"name": "@ai-assistant/server",
"version": "1.0.0",
"description": "HTTP Server for AI terminal assistant - REST API, WebSocket, SSE",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
}
},
"scripts": {
"build": "tsc",
"dev": "tsc --watch",
"start": "bun run src/bin/server.ts",
"start:dev": "bun --watch run src/bin/server.ts",
"test": "vitest run",
"test:watch": "vitest"
},
"dependencies": {
"@ai-assistant/core": "workspace:*",
"hono": "^4.6.0",
"uuid": "^13.0.0",
"zod": "^4.1.13"
},
"devDependencies": {
"@types/bun": "^1.1.0",
"@types/node": "^22.0.0",
"@types/uuid": "^10.0.0",
"@vitest/coverage-v8": "^4.0.15",
"typescript": "^5.6.0",
"vitest": "^4.0.15"
}
}