From a6056f58e888e882b79907310ea4dc0fb351fa74 Mon Sep 17 00:00:00 2001 From: zh Date: Wed, 23 Sep 2026 20:00:59 +0800 Subject: [PATCH] =?UTF-8?q?fix(contracts):=20=E8=A1=A5=20ProjectSummary=20?= =?UTF-8?q?=E4=B8=8E=20ProjectListResponse=20=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 端点表引用了 ProjectSummary 但类型文件里没定义;同时把协议文档的响应列改成 ProjectListResponse。 --- contracts/protocol.ts | 11 +++++++++++ docs/spec/protocol.md | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/contracts/protocol.ts b/contracts/protocol.ts index 442736d..dd02fca 100644 --- a/contracts/protocol.ts +++ b/contracts/protocol.ts @@ -65,6 +65,17 @@ export interface SessionSummary { createdAt: number; } +export interface ProjectSummary { + projectId: string; + name: string; + status: 'active' | 'archived'; + /** 项目内可写;个人会话只读(ADR-0003) */ + writable: boolean; +} + +export interface ProjectListResponse { + projects: ProjectSummary[]; +} export interface CreateSessionRequest { projectId?: string; scope: 'personal' | 'project'; diff --git a/docs/spec/protocol.md b/docs/spec/protocol.md index 3928541..f6df0c5 100644 --- a/docs/spec/protocol.md +++ b/docs/spec/protocol.md @@ -33,7 +33,7 @@ | --- | --- | --- | --- | --- | | GET | `/v1/health` | — | `HealthResponse` | 健康检查 | | GET | `/v1/me` | — | `MeResponse` | 当前身份与客户端形态 | -| GET | `/v1/projects` | — | `ProjectSummary[]` | 可见项目 | +| GET | `/v1/projects` | — | `ProjectListResponse` | 可见项目 | | GET | `/v1/sessions` | `?projectId=` | `SessionListResponse` | 会话列表 | | POST | `/v1/sessions` | `CreateSessionRequest` | `CreateSessionResponse` | 建会话;写操作必须建在项目会话(ADR-0003) | | GET | `/v1/sessions/{id}` | `?limit=` | `SessionDetailResponse` | 会话详情与最近消息 |