@nexface/chat 0.1.19 → 0.1.20-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,10 +11,12 @@ import { TooltipIconButton } from "./ui/tooltip-icon-button.js";
11
11
  import { Button } from "./ui/button.js";
12
12
  import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./ui/tooltip.js";
13
13
  import { ToolGroupRoot, ToolGroupContent } from "./ui/tool-group.aui.js";
14
- import { DisclosureTrigger, ToolCall, disclosureContentClass } from "./ui/home-demo/trace.js";
14
+ import { DisclosureTrigger, disclosureContentClass } from "./ui/home-demo/trace.js";
15
15
  import { Reasoning, ReasoningRoot, ReasoningContent, ReasoningText } from "./ui/reasoning.aui.js";
16
16
  import { TraceLine } from "./ui/home-demo/trace-line.js";
17
17
  import { attachmentAccept } from "./attachments.js";
18
+ import { useToolPresentations } from "./react.js";
19
+ import { ToolPresentationUI } from "./tool-presentation.js";
18
20
  export function AttachmentTile({ binding, savedPreview, }) {
19
21
  const attachment = useAuiState((s) => s.attachment);
20
22
  const preview = binding?.attachments.preview(attachment.id) ??
@@ -103,7 +105,10 @@ const groupAssistantParts = groupPartByType({
103
105
  "standalone-tool-call": [],
104
106
  });
105
107
  export function AssistantParts({ showDetails, tools = [], }) {
106
- return (_jsx(_Fragment, { children: _jsx(GroupedParts, { groupBy: groupAssistantParts, children: ({ part, children }) => {
108
+ const registry = useToolPresentations();
109
+ return (_jsx(_Fragment, { children: _jsx(GroupedParts, { groupBy: (part, context) => part.type === "tool-call" && registry?.controller?.get(part.toolName)
110
+ ? []
111
+ : groupAssistantParts(part, context), children: ({ part, children }) => {
107
112
  switch (part.type) {
108
113
  case "group-chainOfThought":
109
114
  return _jsx("div", { className: cn("mb-3"), children: children });
@@ -121,7 +126,7 @@ export function AssistantParts({ showDetails, tools = [], }) {
121
126
  case "text":
122
127
  return part.text === "" && part.status?.type === "running" ? (_jsx(TraceLine, { live: true, label: "thinking" })) : (_jsx(MarkdownText, {}));
123
128
  case "tool-call":
124
- return (part.toolUI ?? (_jsx(ToolCall, { ...part, showDetails: showDetails, presentation: tools.find((tool) => tool.type === "tool" && tool.toolCallId === part.toolCallId) })));
129
+ return (part.toolUI ?? (_jsx(ToolPresentationUI, { ...part, showDetails: showDetails, presentation: tools.find((tool) => tool.type === "tool" && tool.toolCallId === part.toolCallId) })));
125
130
  case "indicator":
126
131
  return _jsx(TraceLine, { live: true, label: "thinking" });
127
132
  default:
@@ -1,3 +1,3 @@
1
1
  import { type ReactElement } from "react";
2
2
  import type { ChatProps } from "./types.js";
3
- export declare function Chat({ title, avatar, welcomeMessage, welcomeDescription, open, onOpenChange, placeholder, layout, side, className, style, suggestions, suggestNextMessage, attachments, dictation, sessionSidebar, showToolDetails, onFullscreenChange, onRunResult, }: ChatProps): ReactElement | null;
3
+ export declare function Chat({ title, avatar, welcomeMessage, welcomeDescription, welcomeIcon, open, onOpenChange, placeholder, layout, side, className, style, suggestions, suggestNextMessage, attachments, dictation, sessionSidebar, showToolDetails, onFullscreenChange, onRunResult, }: ChatProps): ReactElement | null;