mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-10 02:15:02 +00:00
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:
co-authored by
陈睿
Gavin Chen
parent
995ad2f878
commit
1e0a9d5af0
@@ -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 },
|
||||
|
||||
@@ -47,6 +47,7 @@ const TIMELINE_ITEM_TYPES = new Set([
|
||||
"reasoning",
|
||||
"tool_call",
|
||||
"todo",
|
||||
"notification",
|
||||
"error",
|
||||
"compaction",
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user