@nexface/chat 0.1.20-alpha.0 → 0.1.20

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,12 +11,10 @@ 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, disclosureContentClass } from "./ui/home-demo/trace.js";
14
+ import { DisclosureTrigger, ToolCall, 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";
20
18
  export function AttachmentTile({ binding, savedPreview, }) {
21
19
  const attachment = useAuiState((s) => s.attachment);
22
20
  const preview = binding?.attachments.preview(attachment.id) ??
@@ -105,10 +103,7 @@ const groupAssistantParts = groupPartByType({
105
103
  "standalone-tool-call": [],
106
104
  });
107
105
  export function AssistantParts({ showDetails, tools = [], }) {
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 }) => {
106
+ return (_jsx(_Fragment, { children: _jsx(GroupedParts, { groupBy: groupAssistantParts, children: ({ part, children }) => {
112
107
  switch (part.type) {
113
108
  case "group-chainOfThought":
114
109
  return _jsx("div", { className: cn("mb-3"), children: children });
@@ -126,7 +121,7 @@ export function AssistantParts({ showDetails, tools = [], }) {
126
121
  case "text":
127
122
  return part.text === "" && part.status?.type === "running" ? (_jsx(TraceLine, { live: true, label: "thinking" })) : (_jsx(MarkdownText, {}));
128
123
  case "tool-call":
129
- return (part.toolUI ?? (_jsx(ToolPresentationUI, { ...part, showDetails: showDetails, presentation: tools.find((tool) => tool.type === "tool" && tool.toolCallId === part.toolCallId) })));
124
+ return (part.toolUI ?? (_jsx(ToolCall, { ...part, showDetails: showDetails, presentation: tools.find((tool) => tool.type === "tool" && tool.toolCallId === part.toolCallId) })));
130
125
  case "indicator":
131
126
  return _jsx(TraceLine, { live: true, label: "thinking" });
132
127
  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, welcomeIcon, 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, open, onOpenChange, placeholder, layout, side, className, style, suggestions, suggestNextMessage, attachments, dictation, sessionSidebar, showToolDetails, onFullscreenChange, onRunResult, }: ChatProps): ReactElement | null;