feat: custom tool renderers

This commit is contained in:
Zoe
2026-09-25 19:46:00 -05:00
parent 3f81f96bda
commit bb5795e00d
18 changed files with 1294 additions and 65 deletions
@@ -0,0 +1,15 @@
import type { Component } from "vue";
import Generic from "./Generic.vue";
import Search from "./Search.vue";
// Renderers receive a readonly toolCall prop and own their presentation only.
const renderers: Readonly<Record<string, Component>> = Object.freeze({
search: Search,
});
export const resolveToolRenderer = (toolName: string): Component => {
if (Object.hasOwn(renderers, toolName)) {
return renderers[toolName] ?? Generic;
}
return Generic;
};