feat: align controlled AI sessions and MVP controls

This commit is contained in:
2026-07-21 19:19:36 +08:00
parent 8767446b78
commit 122f5d8c52
18 changed files with 758 additions and 468 deletions

30
apps/web_v1/src/api/ai.ts Normal file
View File

@@ -0,0 +1,30 @@
import { apiRequest, type ApiSession } from './client'
export type AISessionDTO = {
id: string
projectId: string
title: string
context: string
status: string
createdAt: string
updatedAt: string
}
export type CreateAISessionInput = {
title: string
context: string
}
export async function listAISessions(session: ApiSession, projectId: string) {
return apiRequest<AISessionDTO[]>(`/api/v1/projects/${projectId}/ai-sessions`, {
token: session.token,
})
}
export async function createAISession(session: ApiSession, projectId: string, input: CreateAISessionInput) {
return apiRequest<AISessionDTO>(`/api/v1/projects/${projectId}/ai-sessions`, {
method: 'POST',
token: session.token,
body: input,
})
}