feat: 发布用户输入 Kafka 正式事件

This commit is contained in:
root
2026-07-11 04:26:07 +02:00
parent ef241221ec
commit c74aaed848
13 changed files with 308 additions and 33 deletions
+5 -4
View File
@@ -528,7 +528,7 @@ export function summarizeSessionEventPage(page: JsonValue, options: SessionEvent
items,
drillDownCommands: sessionEventDrillDownCommands(options.kind, options.sessionId, { afterSeq: options.afterSeq, limit: options.limit, runId }),
progressiveDisclosure: {
default: "assistant messages plus tool summaries; command_output/backend_status chunks are counted, not displayed",
default: "user and assistant messages plus tool summaries; command_output/backend_status chunks are counted, not displayed",
includeOutputFlag: "--include-output",
detailFlags: "--seq <seq> or --item-id <itemId> --full",
fullFlag: "--full",
@@ -576,8 +576,9 @@ export function summarizeQueueDispatchResult(result: JsonValue, taskId: string):
function summarizeRunEvent(event: JsonRecord, summaryChars: number): JsonRecord {
const payload = jsonRecordValue(event.payload) ?? {};
const type = stringValue(event.type) ?? "unknown";
const command = type === "assistant_message" ? null : boundedSummaryString(stringValue(payload.command), Math.min(summaryChars, 240));
const text = type === "assistant_message" ? boundedSummaryString(stringValue(payload.text), summaryChars) : null;
const messageEvent = type === "user_message" || type === "assistant_message";
const command = messageEvent ? null : boundedSummaryString(stringValue(payload.command), Math.min(summaryChars, 240));
const text = messageEvent ? boundedSummaryString(stringValue(payload.text), summaryChars) : null;
const outputSummary = boundedSummaryString(stringValue(payload.outputSummary) ?? nestedSummaryText(payload), summaryChars);
const message = boundedSummaryString(stringValue(payload.failureMessage) ?? stringValue(payload.message), summaryChars);
const summary = text ?? outputSummary ?? command ?? message ?? "";
@@ -610,7 +611,7 @@ function summarizeRunEvent(event: JsonRecord, summaryChars: number): JsonRecord
function isDefaultVisibleSessionEvent(item: JsonRecord): boolean {
const type = stringValue(item.type);
return type === "assistant_message" || type === "tool_call" || type === "error";
return type === "user_message" || type === "assistant_message" || type === "tool_call" || type === "error";
}
function summarizeSuppressedSessionEvents(all: JsonRecord[], visible: JsonRecord[]): JsonRecord {