feat(cli-run): add streaming delta, think block rendering, and rich tool headers
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)
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
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 {}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user