mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-16 13:03:31 +08:00
- Settings: new Providers tab with full CRUD, activation, and connectivity test; Model tab shows active provider name; General tab simplified - Tasks: new CLI Tasks page displaying task lists from ~/.claude/tasks/ with status, owner, and dependency (blocks/blockedBy) visualization - NewTaskModal: add Advanced options (model, permission mode, working dir) - Backend: fix TaskService to parse CLI V2 task format; extend /api/tasks with /lists endpoint for grouped queries - Fix ModelInfo.context type from number to string Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
29 lines
805 B
TypeScript
29 lines
805 B
TypeScript
import { api } from './client'
|
|
import type { ModelInfo, EffortLevel } from '../types/settings'
|
|
|
|
type ModelsResponse = { models: ModelInfo[]; provider: { id: string; name: string } | null }
|
|
type CurrentModelResponse = { model: ModelInfo }
|
|
type EffortResponse = { level: EffortLevel; available: EffortLevel[] }
|
|
|
|
export const modelsApi = {
|
|
list() {
|
|
return api.get<ModelsResponse>('/api/models')
|
|
},
|
|
|
|
getCurrent() {
|
|
return api.get<CurrentModelResponse>('/api/models/current')
|
|
},
|
|
|
|
setCurrent(modelId: string) {
|
|
return api.put<{ ok: true; model: string }>('/api/models/current', { modelId })
|
|
},
|
|
|
|
getEffort() {
|
|
return api.get<EffortResponse>('/api/effort')
|
|
},
|
|
|
|
setEffort(level: EffortLevel) {
|
|
return api.put<{ ok: true; level: EffortLevel }>('/api/effort', { level })
|
|
},
|
|
}
|