@mastra/core
Version:
37 lines • 1.76 kB
TypeScript
import type { ProcessInputStepArgs } from '../processors/index.js';
import type { ChatChannelRenderContext } from './output-processor.js';
export declare const GENERATIVE_UI_PROCESSOR_ID = "chat-channel-generative-ui";
export declare const RENDER_CARD_TOOL_NAME = "render_card";
/** Rebuilds a channel-backed thread's render context; `AgentChannels` provides it. */
interface RenderContextResolver {
buildRenderContextForThread(threadId: string): Promise<ChatChannelRenderContext | null>;
}
/**
* Gives the agent a `render_card` tool on runs whose adapter opted into
* `generativeUI`. The tool turns a json-render spec into a Chat SDK card and
* posts it to the run's thread; invalid specs come back as issues the model
* can fix. Runs on other adapters, or not on a channel at all, are untouched.
*
* Added automatically by `AgentChannels` when the Slack adapter sets `generativeUI`.
*/
export declare class ChatChannelGenerativeUIProcessor {
#private;
readonly id = "chat-channel-generative-ui";
constructor(channels?: RenderContextResolver);
processInputStep({ requestContext, tools, state }: ProcessInputStepArgs): Promise<{
tools: {
render_card: import("../tools").Tool<{
spec: {
root: string;
elements: Record<string, {
type: string;
props?: Record<string, unknown> | undefined;
children?: string[] | undefined;
}>;
};
}, unknown, unknown, unknown, import("../tools").ToolExecutionContext<unknown, unknown, unknown>, "render_card", unknown>;
};
} | undefined>;
}
export {};
//# sourceMappingURL=generative-ui.d.ts.map