web: integrate QoL slices 1-5 (model switch/rename, history deletes, usage stats, repo prepare+badges+imageUsed, markdown/search/FAB/timestamps) — 263 tests, ≥95% all metrics
This commit is contained in:
@@ -40,6 +40,10 @@ export interface ChatMessage {
|
||||
toolCalls: { id: string; name: string; argsJson: string }[];
|
||||
toolCallId: string | null;
|
||||
streaming: boolean;
|
||||
/** envelope ts of the persisted message_end (0 while streaming) */
|
||||
ts: number;
|
||||
/** true for daemon/plugin error notices: rendered as a notice line, not a chat bubble */
|
||||
notice?: boolean;
|
||||
}
|
||||
|
||||
export interface ChatDerivation {
|
||||
@@ -128,10 +132,24 @@ export function deriveChat(events: EventFrame[]): ChatDerivation {
|
||||
toolCalls: m.toolCalls ?? [],
|
||||
toolCallId: m.toolCallId,
|
||||
streaming: false,
|
||||
ts: e.ts ?? 0,
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "error_notice":
|
||||
messages.push({
|
||||
key: `notice-${e.seq}`,
|
||||
role: "system",
|
||||
text: e.reason ?? "unknown error",
|
||||
thinking: null,
|
||||
toolCalls: [],
|
||||
toolCallId: null,
|
||||
streaming: false,
|
||||
ts: e.ts ?? 0,
|
||||
notice: true,
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -146,6 +164,7 @@ export function deriveChat(events: EventFrame[]): ChatDerivation {
|
||||
toolCalls: [],
|
||||
toolCallId: null,
|
||||
streaming: true,
|
||||
ts: 0,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user