Download desktop/src/api/teams.ts from chenbhao/codev: direct link, hf CLI and curl.
- Browser
- Download file 1.13 kB
-
https://huggingface.co/chenbhao/codev/resolve/e40073cc959cd4729bf4009662bca374c5c4e266/desktop/src/api/teams.ts
- Command line
-
hf download hf://chenbhao/codev@e40073cc959cd4729bf4009662bca374c5c4e266/desktop/src/api/teams.ts
-
curl -L -o teams.ts https://huggingface.co/chenbhao/codev/resolve/e40073cc959cd4729bf4009662bca374c5c4e266/desktop/src/api/teams.ts
1.13 kB
| import { api } from './client' | |
| import type { TeamSummary, TeamDetail } from '../types/team' | |
| type TeamsResponse = { teams: TeamSummary[] } | |
| type TranscriptMessage = { | |
| id: string | |
| type: string | |
| content: unknown | |
| timestamp: string | |
| model?: string | |
| parentToolUseId?: string | |
| } | |
| type TranscriptResponse = { messages: TranscriptMessage[] } | |
| export type { TranscriptMessage } | |
| export const teamsApi = { | |
| list() { | |
| return api.get<TeamsResponse>('/api/teams') | |
| }, | |
| get(name: string) { | |
| return api.get<TeamDetail>(`/api/teams/${encodeURIComponent(name)}`) | |
| }, | |
| getMemberTranscript(teamName: string, agentId: string) { | |
| return api.get<TranscriptResponse>( | |
| `/api/teams/${encodeURIComponent(teamName)}/members/${encodeURIComponent(agentId)}/transcript`, | |
| ) | |
| }, | |
| sendMemberMessage(teamName: string, agentId: string, content: string) { | |
| return api.post<{ ok: true }>( | |
| `/api/teams/${encodeURIComponent(teamName)}/members/${encodeURIComponent(agentId)}/messages`, | |
| { content }, | |
| ) | |
| }, | |
| delete(name: string) { | |
| return api.delete<{ ok: true }>(`/api/teams/${encodeURIComponent(name)}`) | |
| }, | |
| } | |