eaf315a8d7
Adds message.part.delta event handling for real-time streaming output, reasoning/think block display with in-place updates, per-agent profile colors, padded text output, and semantic tool headers with icons. 🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
29 lines
682 B
TypeScript
29 lines
682 B
TypeScript
import type { OpencodeClient } from "@opencode-ai/sdk"
|
|
import { normalizeSDKResponse } from "../../shared"
|
|
|
|
interface AgentProfile {
|
|
name?: string
|
|
color?: string
|
|
}
|
|
|
|
export async function loadAgentProfileColors(
|
|
client: OpencodeClient,
|
|
): Promise<Record<string, string>> {
|
|
try {
|
|
const agentsRes = await client.app.agents()
|
|
const agents = normalizeSDKResponse(agentsRes, [] as AgentProfile[], {
|
|
preferResponseOnMissingData: true,
|
|
})
|
|
|
|
const colors: Record<string, string> = {}
|
|
for (const agent of agents) {
|
|
if (!agent.name || !agent.color) continue
|
|
colors[agent.name] = agent.color
|
|
}
|
|
|
|
return colors
|
|
} catch {
|
|
return {}
|
|
}
|
|
}
|