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:
@@ -4,6 +4,7 @@ import type {
|
||||
EventPayload,
|
||||
MessageUpdatedProps,
|
||||
MessagePartUpdatedProps,
|
||||
MessagePartDeltaProps,
|
||||
ToolExecuteProps,
|
||||
ToolResultProps,
|
||||
SessionErrorProps,
|
||||
@@ -93,6 +94,15 @@ export function logEventVerbose(ctx: RunContext, payload: EventPayload): void {
|
||||
break
|
||||
}
|
||||
|
||||
case "message.part.delta": {
|
||||
const deltaProps = props as MessagePartDeltaProps | undefined
|
||||
const field = deltaProps?.field ?? "unknown"
|
||||
const delta = deltaProps?.delta ?? ""
|
||||
const preview = delta.slice(0, 80).replace(/\n/g, "\\n")
|
||||
console.error(pc.dim(`${sessionTag} message.part.delta (${field}): "${preview}${delta.length > 80 ? "..." : ""}"`))
|
||||
break
|
||||
}
|
||||
|
||||
case "message.updated": {
|
||||
const msgProps = props as MessageUpdatedProps | undefined
|
||||
const role = msgProps?.info?.role ?? "unknown"
|
||||
|
||||
Reference in New Issue
Block a user