feat: add TypeScript types, API client, and TanStack Query hooks

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-26 22:15:48 -05:00
parent 2b0266b51e
commit d896fe36a8
6 changed files with 238 additions and 1 deletions

View File

@@ -0,0 +1,71 @@
export const WorkTaskStatus = {
Pending: 0,
Active: 1,
Paused: 2,
Completed: 3,
Abandoned: 4,
} as const
export type WorkTaskStatus = (typeof WorkTaskStatus)[keyof typeof WorkTaskStatus]
export const NoteType = {
PauseNote: 0,
ResumeNote: 1,
General: 2,
} as const
export type NoteType = (typeof NoteType)[keyof typeof NoteType]
export interface WorkTask {
id: number
title: string
description: string | null
status: WorkTaskStatus
category: string | null
createdAt: string
startedAt: string | null
completedAt: string | null
estimatedMinutes: number | null
parentTaskId: number | null
subTasks: WorkTask[]
notes: TaskNote[]
contextEvents: ContextEvent[]
}
export interface TaskNote {
id: number
workTaskId: number
content: string
type: NoteType
createdAt: string
}
export interface ContextEvent {
id: number
workTaskId: number | null
source: string
appName: string
windowTitle: string
url: string | null
timestamp: string
}
export interface AppMapping {
id: number
pattern: string
matchType: string
category: string
friendlyName: string | null
}
export interface ContextSummaryItem {
appName: string
category: string
eventCount: number
firstSeen: string
lastSeen: string
}
export interface ApiResponse<T> {
success: boolean
data: T
error: string | null
}