fix(contracts): 补 ProjectSummary 与 ProjectListResponse 类型

端点表引用了 ProjectSummary 但类型文件里没定义;同时把协议文档的响应列改成 ProjectListResponse。
This commit is contained in:
zh 2026-09-23 20:00:59 +08:00
parent 2023e5312b
commit a6056f58e8
2 changed files with 12 additions and 1 deletions

View File

@ -65,6 +65,17 @@ export interface SessionSummary {
createdAt: number; createdAt: number;
} }
export interface ProjectSummary {
projectId: string;
name: string;
status: 'active' | 'archived';
/** 项目内可写;个人会话只读(ADR-0003) */
writable: boolean;
}
export interface ProjectListResponse {
projects: ProjectSummary[];
}
export interface CreateSessionRequest { export interface CreateSessionRequest {
projectId?: string; projectId?: string;
scope: 'personal' | 'project'; scope: 'personal' | 'project';

View File

@ -33,7 +33,7 @@
| --- | --- | --- | --- | --- | | --- | --- | --- | --- | --- |
| GET | `/v1/health` | — | `HealthResponse` | 健康检查 | | GET | `/v1/health` | — | `HealthResponse` | 健康检查 |
| GET | `/v1/me` | — | `MeResponse` | 当前身份与客户端形态 | | GET | `/v1/me` | — | `MeResponse` | 当前身份与客户端形态 |
| GET | `/v1/projects` | — | `ProjectSummary[]` | 可见项目 | | GET | `/v1/projects` | — | `ProjectListResponse` | 可见项目 |
| GET | `/v1/sessions` | `?projectId=` | `SessionListResponse` | 会话列表 | | GET | `/v1/sessions` | `?projectId=` | `SessionListResponse` | 会话列表 |
| POST | `/v1/sessions` | `CreateSessionRequest` | `CreateSessionResponse` | 建会话;写操作必须建在项目会话(ADR-0003) | | POST | `/v1/sessions` | `CreateSessionRequest` | `CreateSessionResponse` | 建会话;写操作必须建在项目会话(ADR-0003) |
| GET | `/v1/sessions/{id}` | `?limit=` | `SessionDetailResponse` | 会话详情与最近消息 | | GET | `/v1/sessions/{id}` | `?limit=` | `SessionDetailResponse` | 会话详情与最近消息 |