refactor(app): replace voice hooks with voice runtime and audio engine architecture
This commit is contained in:
@@ -106,4 +106,38 @@ describe("shared tool-call display mapping", () => {
|
||||
|
||||
expect(display.errorText).toBe('{\n "message": "boom"\n}');
|
||||
});
|
||||
|
||||
it("labels terminal interaction rows without a summary when no command is available", () => {
|
||||
const display = buildToolCallDisplayModel({
|
||||
name: "terminal",
|
||||
status: "completed",
|
||||
error: null,
|
||||
detail: {
|
||||
type: "plain_text",
|
||||
icon: "square_terminal",
|
||||
},
|
||||
});
|
||||
|
||||
expect(display).toEqual({
|
||||
displayName: "Interacted with terminal",
|
||||
});
|
||||
});
|
||||
|
||||
it("uses the command as terminal interaction summary when available", () => {
|
||||
const display = buildToolCallDisplayModel({
|
||||
name: "terminal",
|
||||
status: "completed",
|
||||
error: null,
|
||||
detail: {
|
||||
type: "plain_text",
|
||||
label: "npm run test",
|
||||
icon: "square_terminal",
|
||||
},
|
||||
});
|
||||
|
||||
expect(display).toEqual({
|
||||
displayName: "Interacted with terminal",
|
||||
summary: "npm run test",
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -103,6 +103,12 @@ export function buildToolCallDisplayModel(input: ToolCallDisplayInput): ToolCall
|
||||
summary = isRecord(input.metadata) ? readString(input.metadata.subAgentActivity) : undefined;
|
||||
} else if (lowerName === "thinking" && input.detail.type === "unknown") {
|
||||
displayName = "Thinking";
|
||||
} else if (lowerName === "terminal") {
|
||||
displayName = "Interacted with terminal";
|
||||
summary =
|
||||
input.detail.type === "plain_text"
|
||||
? readString(input.detail.label)
|
||||
: undefined;
|
||||
}
|
||||
|
||||
const errorText = input.status === "failed" ? formatErrorText(input.error) : undefined;
|
||||
|
||||
Reference in New Issue
Block a user