fix(plugins): allow notification timeline transformers (#7582)

Co-authored-by: 陈睿 <chenrui.92@dcarlife.com>
Co-authored-by: Gavin Chen <chenrui920614@gmail.com>
Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
This commit is contained in:
paseo-bot[bot]
2026-10-21 14:57:22 +02:00
committed by GitHub
co-authored by 陈睿 Gavin Chen
parent 995ad2f878
commit 1e0a9d5af0
2 changed files with 4 additions and 3 deletions
+3 -3
View File
@@ -141,7 +141,7 @@ describe("evaluatePluginClientBundle", () => {
Reflect.deleteProperty(globalThis, "__pluginRemovals");
});
it("collects timeline transformers and renderers", () => {
it.each(["tool_call", "notification"])("collects %s transformers and renderers", (itemType) => {
const plugin = evaluatePluginClientBundle(
"reports",
bundle(`
@@ -149,7 +149,7 @@ describe("evaluatePluginClientBundle", () => {
const schema = { safeParse(value) { return { success: true, data: value }; } };
plugin.addTimelineTransformer({
id: "test-report",
query: { itemType: "tool_call" },
query: { itemType: "${itemType}" },
transform() { return { items: [] }; },
});
plugin.addTimelineRenderer({
@@ -162,7 +162,7 @@ describe("evaluatePluginClientBundle", () => {
);
expect(plugin.timelineTransformers.map(({ id, query }) => ({ id, query }))).toEqual([
{ id: "test-report", query: { itemType: "tool_call" } },
{ id: "test-report", query: { itemType } },
]);
expect(plugin.timelineRenderers.map(({ kind, version }) => ({ kind, version }))).toEqual([
{ kind: "test-report", version: 1 },
+1
View File
@@ -47,6 +47,7 @@ const TIMELINE_ITEM_TYPES = new Set([
"reasoning",
"tool_call",
"todo",
"notification",
"error",
"compaction",
]);