feat: connect inbox confirmation workflow

This commit is contained in:
2026-07-21 18:24:15 +08:00
parent 8cc130244b
commit 85a25ca017
15 changed files with 1069 additions and 123 deletions

View File

@@ -12,6 +12,7 @@ export type InboxItemDTO = {
}
export type InboxSuggestionDTO = {
id: string
kind: 'task' | 'note' | 'source'
title: string
body: string
@@ -21,6 +22,10 @@ export type AnalyzeInboxResponseDTO = {
suggestions: InboxSuggestionDTO[]
}
export type ConfirmInboxResponseDTO = {
createdCount: number
}
export type CaptureInboxInput = {
sourceType: string
title: string
@@ -42,11 +47,10 @@ export async function analyzeInboxItem(session: ApiSession, inboxId: string) {
})
}
export async function confirmInboxItem(session: ApiSession, inboxId: string, suggestions: InboxSuggestionDTO[]) {
return apiRequest<void>(`/api/v1/inbox/${inboxId}/confirm`, {
export async function confirmInboxItem(session: ApiSession, inboxId: string, suggestionIds: string[]) {
return apiRequest<ConfirmInboxResponseDTO>(`/api/v1/inbox/${inboxId}/confirm`, {
method: 'POST',
token: session.token,
body: { suggestions },
responseType: 'void',
body: { suggestionIds },
})
}

View File

@@ -28,7 +28,7 @@ export function mapWorkspace(payload: ProjectWorkspaceDTO, index = 0): ProjectWo
return {
project,
channels: payload.channels.filter((channel) => channel.type !== 'inbox').map(mapChannel),
channels: payload.channels.map(mapChannel),
tags: payload.tags.map((tag) => tag.name),
recentSessions: payload.recentSessions.map(mapAISession),
inbox: payload.inbox.map(mapInbox),