feat: 完成本地 API 中心与 Reader Skill 流程

This commit is contained in:
电摇小子
2026-07-14 11:07:35 +08:00
committed by 电摇小子
parent 519c10223d
commit 5d041aa137
30 changed files with 1743 additions and 5 deletions
+40
View File
@@ -0,0 +1,40 @@
export const LOCAL_API_ENDPOINTS = {
health: { method: 'GET', path: '/api/v1/health', queryKeys: [] },
'current-time': { method: 'GET', path: '/api/v1/current_time', queryKeys: [] },
contact: { method: 'GET', path: '/api/v1/contact', queryKeys: ['filter', 'type'] },
chatroom: { method: 'GET', path: '/api/v1/chatroom', queryKeys: ['keyword'] },
'recent-chat': { method: 'GET', path: '/api/v1/recent_chat', queryKeys: ['limit'] },
chatlog: {
method: 'GET',
path: '/api/v1/chatlog',
queryKeys: ['talker', 'time', 'startTime', 'endTime']
},
'group-snapshot': { method: 'GET', path: '/api/v1/group_snapshot', queryKeys: ['md5'] },
resolve: { method: 'GET', path: '/api/v1/resolve', queryKeys: ['q'] },
report: { method: 'POST', path: '/api/v1/report', queryKeys: [] }
} as const
export type LocalApiEndpointId = keyof typeof LOCAL_API_ENDPOINTS
export type LocalApiMethod = (typeof LOCAL_API_ENDPOINTS)[LocalApiEndpointId]['method']
export interface LocalApiTestRequest {
endpointId: LocalApiEndpointId
query?: Record<string, string>
body?: string
}
export interface LocalApiTestResponse {
ok: boolean
method: LocalApiMethod
path: string
url: string
status?: number
statusText?: string
durationMs: number
responseSize: number
contentType?: string
json?: unknown
bodyText?: string
errorCode?: 'API_NOT_RUNNING' | 'CONNECTION_REFUSED' | 'TIMEOUT' | 'INVALID_REQUEST' | 'UNKNOWN'
error?: string
}