refactor(ui-conversation): register business node definitions
This commit is contained in:
@@ -20,8 +20,9 @@ export const inject = ['slots']
|
||||
* @param ctx - Client root context.
|
||||
*/
|
||||
export function apply(ctx: ClientContext): void {
|
||||
ctx.slots.inject('conversation.chat.tool', () => ctx.slots.register({
|
||||
name: 'conversation.chat.tool',
|
||||
ctx.slots.inject('conversation.chat.node', () => ctx.slots.register({
|
||||
name: 'conversation.chat.node',
|
||||
key: 'tool-call',
|
||||
locale: NS,
|
||||
children: {
|
||||
'tool.call.toolview': { kind: 'keyed', scope: 'session' },
|
||||
|
||||
@@ -30,8 +30,8 @@ export interface ToolCallOwnerProps {
|
||||
/** Full props of a registered atomic Tool view. */
|
||||
export type ToolCallViewProps = PropsRuntime<'tool.call.toolview'>
|
||||
|
||||
/** Full props of the Tool call-tree renderer registered into the chat flow. */
|
||||
export type ToolTreeProps = PropsRuntime<'conversation.chat.tool'>
|
||||
/** Full props of the Tool call-tree renderer registered as a `tool-call` Chat Node. */
|
||||
export type ToolTreeProps = PropsRuntime<'conversation.chat.node', 'tool-call'>
|
||||
& PropsRenderSlots<'tool.call.toolview'>
|
||||
& PropsLocale<'conversation'>
|
||||
|
||||
|
||||
@@ -88,8 +88,9 @@ const ToolCallBranch = memo(function ToolCallBranch({
|
||||
* @returns the Tool call tree.
|
||||
*/
|
||||
export function ToolCallTree({
|
||||
renderSlot, block, selectedCallId, cwd, openFile, inspectCall, t,
|
||||
renderSlot, node, selectedCallId, cwd, openFile, inspectCall, t,
|
||||
}: ToolTreeProps) {
|
||||
const block = node.data.root
|
||||
return (
|
||||
<ToolCallBranch
|
||||
renderSlot={renderSlot}
|
||||
|
||||
Reference in New Issue
Block a user