mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-16 13:03:31 +08:00
Move session tasks, background tasks, subagents, and team activity into a floating right-side activity panel with capped section scrolling. Add subagent run detail tabs backed by the existing session run data so member activity can be inspected from the main chat. Tested: cd desktop && bun run test -- src/components/activity/SessionActivityPanel.test.tsx Tested: bun run check:desktop
38 lines
995 B
TypeScript
38 lines
995 B
TypeScript
import { api } from './client'
|
|
import type { MessageEntry } from '../types/session'
|
|
|
|
export type SubagentRunStatus = 'running' | 'completed' | 'failed' | 'stopped' | 'unknown'
|
|
export type SubagentRunSource = 'subagent-jsonl' | 'session-history' | 'live-task' | 'none'
|
|
|
|
export type SubagentRunUsage = {
|
|
inputTokens?: number
|
|
outputTokens?: number
|
|
totalTokens?: number
|
|
}
|
|
|
|
export type SubagentRunResponse = {
|
|
sessionId: string
|
|
toolUseId: string
|
|
agentId: string | null
|
|
taskId?: string
|
|
status: SubagentRunStatus
|
|
description?: string
|
|
prompt?: string
|
|
summary?: string
|
|
result?: string
|
|
outputFile?: string
|
|
usage?: SubagentRunUsage
|
|
messages: MessageEntry[]
|
|
truncated: boolean
|
|
updatedAt?: string
|
|
source: SubagentRunSource
|
|
}
|
|
|
|
export const subagentsApi = {
|
|
getRunByTool(sessionId: string, toolUseId: string) {
|
|
return api.get<SubagentRunResponse>(
|
|
`/api/sessions/${encodeURIComponent(sessionId)}/subagents/by-tool/${encodeURIComponent(toolUseId)}`,
|
|
)
|
|
},
|
|
}
|