@docyrus/ui-pro-ai-assistant 0.6.6 → 0.6.7
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.
- package/README.md +1 -1
- package/dist/docy-assistant.d.ts +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/views/assistant-view.d.ts +2 -2
- package/dist/views/chat-panel.d.ts +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -264,7 +264,7 @@ The main chat interface component.
|
|
|
264
264
|
| `hostEnvironment` | `string` | — | Host environment identifier sent to the chat endpoint as `hostEnvironment`. The backend uses this to filter the tool list bound to the agent so only tools available in the current environment are exposed. Common values: `"web"`, `"desktop"`, `"chrome"`, `"word"`, `"excel"`, `"powerpoint"`, `"outlook"` |
|
|
265
265
|
| `appId` | `string` | — | ID of the host app currently open in the page. Forwarded to the chat endpoint as `appId` so the agent can scope its behavior/tools to it. Renders a dismissable "Talking about <app>" chip above the input; once the user clears it, the id stops being sent |
|
|
266
266
|
| `appName` | `string` | — | Display name for the current host app, shown in the context chip |
|
|
267
|
-
| `
|
|
267
|
+
| `appIcon` | `string` | — | Docyrus icon identifier (e.g. `"fas inbox"`) for the current host app. Rendered via `<DocyrusIcon>` in the context chip |
|
|
268
268
|
|
|
269
269
|
#### Callbacks
|
|
270
270
|
|
package/dist/docy-assistant.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type RefObject } from 'react';
|
|
2
2
|
import { type DocyAssistantProps } from './types';
|
|
3
|
-
export declare const DocyAssistant: ({ ref, isOpen, onClose, supportWebSearch, supportThinking, supportFiles, supportDocumentSearch, supportDeepResearch, supportMultiModels, supportWorkCanvas, apiEndpoint, title: titleProp, description: descriptionProp, placeholder: placeholderProp, logo, footerText: footerTextProp, variant, renderMode, enableSidebar, enableNavDropdown, enableVoice, enableMicrophone, enableWelcomePage, tenantAiAgentId, onMessageSend, onVoiceStart, onVoiceEnd, className, defaultFullscreen, hideExpand, hideCloseButton, hideAgentSelector, hideBorder, showHeader, hideHeaderOnWelcome, agentSelectorUrl, baseAgentSelectorUrl, onAgentChange, enableSharing, onShare: onShareProp, initialPrompt, initialModelId, initialFeatures, initialFiles, hostEnvironment, appId, appName,
|
|
3
|
+
export declare const DocyAssistant: ({ ref, isOpen, onClose, supportWebSearch, supportThinking, supportFiles, supportDocumentSearch, supportDeepResearch, supportMultiModels, supportWorkCanvas, apiEndpoint, title: titleProp, description: descriptionProp, placeholder: placeholderProp, logo, footerText: footerTextProp, variant, renderMode, enableSidebar, enableNavDropdown, enableVoice, enableMicrophone, enableWelcomePage, tenantAiAgentId, onMessageSend, onVoiceStart, onVoiceEnd, className, defaultFullscreen, hideExpand, hideCloseButton, hideAgentSelector, hideBorder, showHeader, hideHeaderOnWelcome, agentSelectorUrl, baseAgentSelectorUrl, onAgentChange, enableSharing, onShare: onShareProp, initialPrompt, initialModelId, initialFeatures, initialFiles, hostEnvironment, appId, appName, appIcon, clientTools, ...props }: DocyAssistantProps & {
|
|
4
4
|
ref?: RefObject<HTMLDivElement | null>;
|
|
5
5
|
}) => import("react/jsx-runtime").JSX.Element;
|
package/dist/index.js
CHANGED
|
@@ -18,6 +18,7 @@ import { createPortal } from 'react-dom';
|
|
|
18
18
|
import { Avatar as Avatar$1, AvatarImage as AvatarImage$1, AvatarFallback as AvatarFallback$1 } from '@docyrus/ui-pro-shared/components/avatar';
|
|
19
19
|
import { Message, AIMessageAvatar, MessageContent, MessageActions, MessageAction, AIConversation, AIConversationContent, MessageResponse, AIConversationScrollButton, Tool, ToolHeader, ToolContent, ToolInput, ToolOutput, CodeBlock, CodeBlockCopyButton, resolveToolIcon, PromptInputButton, PromptInput, PromptInputTextarea, PromptInputFooter, PromptInputTools, PromptInputSubmit, usePromptInputAttachments } from '@docyrus/ui-pro-shared/ai';
|
|
20
20
|
import { Spinner } from '@docyrus/ui-pro-shared/components/spinner';
|
|
21
|
+
import { DocyrusIcon } from '@docyrus/ui-pro-shared/docyrus-icon';
|
|
21
22
|
import { Badge as Badge$1 } from '@docyrus/ui-pro-shared/components/badge';
|
|
22
23
|
import { DotLottieReact } from '@lottiefiles/dotlottie-react';
|
|
23
24
|
import { Reasoning, ReasoningTrigger, ReasoningContent } from '@docyrus/ui-pro-shared/ai-elements/reasoning';
|
|
@@ -29,7 +30,6 @@ import { Input as Input$1 } from '@docyrus/ui-pro-shared/input';
|
|
|
29
30
|
import { Textarea as Textarea$1 } from '@docyrus/ui-pro-shared/textarea';
|
|
30
31
|
import { Checkbox } from '@docyrus/ui-pro-shared/checkbox';
|
|
31
32
|
import { Switch } from '@docyrus/ui-pro-shared/switch';
|
|
32
|
-
import { DocyrusIcon } from '@docyrus/ui-pro-shared/docyrus-icon';
|
|
33
33
|
import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from '@docyrus/ui-pro-shared/select';
|
|
34
34
|
import { Badge } from '@docyrus/ui-pro-shared/badge';
|
|
35
35
|
import { tUi } from '@docyrus/ui-pro-shared/lib/ui-i18n';
|
|
@@ -15023,7 +15023,7 @@ function ChatPanel({
|
|
|
15023
15023
|
const renderAppContextChip = () => {
|
|
15024
15024
|
if (!appContext) return null;
|
|
15025
15025
|
return /* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center gap-2 self-start rounded-full border bg-muted/50 px-2 py-1 text-xs text-foreground", children: [
|
|
15026
|
-
appContext.
|
|
15026
|
+
appContext.icon ? /* @__PURE__ */ jsx(DocyrusIcon, { icon: appContext.icon, className: "size-4 shrink-0" }) : /* @__PURE__ */ jsx(LayoutGrid, { className: "size-4 text-muted-foreground" }),
|
|
15027
15027
|
/* @__PURE__ */ jsx("span", { className: "max-w-[200px] truncate", children: appContext.name ? `${appContext.name}` : "App context attached" }),
|
|
15028
15028
|
onClearAppContext ? /* @__PURE__ */ jsx(
|
|
15029
15029
|
"button",
|
|
@@ -32022,7 +32022,7 @@ var DocyAssistant = ({
|
|
|
32022
32022
|
hostEnvironment,
|
|
32023
32023
|
appId,
|
|
32024
32024
|
appName,
|
|
32025
|
-
|
|
32025
|
+
appIcon,
|
|
32026
32026
|
clientTools,
|
|
32027
32027
|
...props
|
|
32028
32028
|
}) => {
|
|
@@ -32060,11 +32060,11 @@ var DocyAssistant = ({
|
|
|
32060
32060
|
const [isInlineFullscreen, setIsInlineFullscreen] = useState(defaultFullscreen);
|
|
32061
32061
|
const [sharingEditorOpen, setSharingEditorOpen] = useState(false);
|
|
32062
32062
|
const [appContext, setAppContext] = useState(
|
|
32063
|
-
appId ? { id: appId, name: appName,
|
|
32063
|
+
appId ? { id: appId, name: appName, icon: appIcon } : null
|
|
32064
32064
|
);
|
|
32065
32065
|
useEffect(() => {
|
|
32066
|
-
setAppContext(appId ? { id: appId, name: appName,
|
|
32067
|
-
}, [appId, appName,
|
|
32066
|
+
setAppContext(appId ? { id: appId, name: appName, icon: appIcon } : null);
|
|
32067
|
+
}, [appId, appName, appIcon]);
|
|
32068
32068
|
const clearAppContext = useCallback(() => setAppContext(null), []);
|
|
32069
32069
|
const { isRecording, recognition, handleMicrophoneClick } = useSpeechRecognition({
|
|
32070
32070
|
enabled: enableMicrophone,
|