Show task notifications as synthetic tool calls in chat (#79)
* fix(server): render claude task notifications as synthetic tool calls * refactor(claude): extract task-notification tool-call mapper * refactor: drive tool icons from plain_text detail metadata * refactor(claude): make task-notification parsing schema-first
This commit is contained in:
@@ -7,6 +7,7 @@ const iconMocks = vi.hoisted(() => ({
|
||||
MicVocal: () => null,
|
||||
Pencil: () => null,
|
||||
Search: () => null,
|
||||
Sparkles: () => null,
|
||||
SquareTerminal: () => null,
|
||||
Wrench: () => null,
|
||||
}));
|
||||
@@ -48,4 +49,24 @@ describe("tool-call-icon", () => {
|
||||
|
||||
expect(icon).toBe(iconMocks.Brain);
|
||||
});
|
||||
|
||||
it("uses custom icon from plain_text detail", () => {
|
||||
const icon = resolveToolCallIcon("custom_tool", {
|
||||
type: "plain_text",
|
||||
label: "Background task completed",
|
||||
icon: "sparkles",
|
||||
text: "notification payload",
|
||||
});
|
||||
|
||||
expect(icon).toBe(iconMocks.Sparkles);
|
||||
});
|
||||
|
||||
it("does not special-case skill tool names", () => {
|
||||
const icon = resolveToolCallIcon("skill", {
|
||||
type: "plain_text",
|
||||
label: "Skill output",
|
||||
});
|
||||
|
||||
expect(icon).toBe(iconMocks.Wrench);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user