refactor(ui-conversation): register business node definitions

This commit is contained in:
imccyu
2026-08-09 15:48:40 +08:00
parent 81d6886006
commit 6d09b3168d
41 changed files with 2744 additions and 745 deletions

View File

@@ -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' },

View File

@@ -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'>

View File

@@ -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}