@docyrus/ui-pro-ai-assistant 0.6.8 → 0.6.9
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 +7 -8
- package/dist/components/agent-tabs.d.ts +33 -0
- package/dist/docy-assistant.d.ts +1 -1
- package/dist/hooks/use-assistant-api.d.ts +7 -0
- package/dist/index.js +1104 -1026
- package/dist/index.js.map +1 -1
- package/dist/styles.css +17 -34
- package/dist/types/index.d.ts +5 -6
- package/dist/views/assistant-view.d.ts +11 -5
- package/dist/views/chat-panel.d.ts +6 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -78,7 +78,6 @@ function App() {
|
|
|
78
78
|
tenantAiAgentId="your-agent-id"
|
|
79
79
|
renderMode="inline"
|
|
80
80
|
enableSidebar
|
|
81
|
-
enableNavDropdown
|
|
82
81
|
className="h-full w-full"
|
|
83
82
|
/>
|
|
84
83
|
</AssistantProvider>
|
|
@@ -220,14 +219,12 @@ The main chat interface component.
|
|
|
220
219
|
| Prop | Type | Default | Description |
|
|
221
220
|
|------|------|---------|-------------|
|
|
222
221
|
| `enableSidebar` | `boolean` | `true` | Show the session list sidebar |
|
|
223
|
-
| `enableNavDropdown` | `boolean` | `false` | Show navigation dropdown |
|
|
224
222
|
| `enableWelcomePage` | `boolean` | `true` | Show a welcome landing page on first open with agent greeting, inline prompt input, and recent sessions. Sidebar and header are hidden in this view. Dismissed on interaction (new chat, session click, or message send) |
|
|
225
223
|
| `defaultFullscreen` | `boolean` | `false` | Start in fullscreen |
|
|
226
224
|
| `hideExpand` | `boolean` | `false` | Hide the fullscreen toggle |
|
|
227
225
|
| `hideCloseButton` | `boolean` | `false` | Hide the close (X) button in the header |
|
|
228
|
-
| `hideAgentSelector` | `boolean` | `false` | Hide the agent selector dropdown; shows agent name as static text instead |
|
|
229
226
|
| `hideBorder` | `boolean` | `false` | Hide the outer border and shadow of the assistant container |
|
|
230
|
-
| `showHeader` | `boolean` | `true` | Show the header bar
|
|
227
|
+
| `showHeader` | `boolean` | `true` | Show the header bar with the agent tabs |
|
|
231
228
|
| `maxMessages` | `number` | — | Max messages to keep in context |
|
|
232
229
|
|
|
233
230
|
#### Features
|
|
@@ -248,13 +245,14 @@ The main chat interface component.
|
|
|
248
245
|
|
|
249
246
|
> **Note:** Feature props serve as defaults. When the agent deployment is loaded, the API response capabilities (`supportWebSearch`, `documentSearch`, `supportDeepResearch`, `supportThinking`, `featureWorks`, `supportFiles`, `supportMultipleModels`, `promptOptimizationChoice`) take precedence over prop values.
|
|
250
247
|
|
|
251
|
-
#### Agent
|
|
248
|
+
#### Agent tabs
|
|
249
|
+
|
|
250
|
+
The header renders a tab strip. The first tab is pinned to `tenantAiAgentId` and cannot be closed. The `+` button next to it opens a dropdown listing the available base agents (from `agentSelectorUrl`); selecting one opens a new closable tab with its own isolated thread and message history. Open tabs are persisted to `localStorage`.
|
|
252
251
|
|
|
253
252
|
| Prop | Type | Default | Description |
|
|
254
253
|
|------|------|---------|-------------|
|
|
255
|
-
| `agentSelectorUrl` | `string` | `"/ai/agent-deployments"` |
|
|
256
|
-
| `
|
|
257
|
-
| `onAgentChange` | `(agentId: string, agentType: "base" \| "deployment") => void` | — | Fires when the active agent changes |
|
|
254
|
+
| `agentSelectorUrl` | `string` | `"/ai/agent-deployments/base"` | Endpoint listing base agents shown in the "+" dropdown |
|
|
255
|
+
| `onAgentChange` | `(agentId: string, agentType: "base" \| "deployment") => void` | — | Fires when the user opens a new agent tab |
|
|
258
256
|
|
|
259
257
|
#### API
|
|
260
258
|
|
|
@@ -273,6 +271,7 @@ The main chat interface component.
|
|
|
273
271
|
| `onMessageSend` | `(message: string) => void` | Fires when a message is sent |
|
|
274
272
|
| `onVoiceStart` | `() => void` | Fires when voice recording starts |
|
|
275
273
|
| `onVoiceEnd` | `() => void` | Fires when voice recording ends |
|
|
274
|
+
| `onFullscreenChange` | `(isFullscreen: boolean) => void` | Fires when the assistant enters or exits fullscreen (true = entered) |
|
|
276
275
|
| `onShare` | `(info: { dataSourceId: string; recordId: string }) => void` | Custom share handler. When provided, the thread header share button calls this instead of the built-in sharing editor |
|
|
277
276
|
|
|
278
277
|
#### Initial prompt
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface AgentTabItem {
|
|
2
|
+
/** Unique tab id (stable across renders). */
|
|
3
|
+
id: string;
|
|
4
|
+
/** Agent (base) id or deployment id used at the API level. */
|
|
5
|
+
agentId: string;
|
|
6
|
+
/** Set when the tab represents a deployed agent. */
|
|
7
|
+
deploymentId?: string;
|
|
8
|
+
/** 'base' for tenantAiAgentId-style agents, 'deployment' otherwise. */
|
|
9
|
+
agentType: 'base' | 'deployment';
|
|
10
|
+
name?: string;
|
|
11
|
+
avatar?: string;
|
|
12
|
+
/** The first tab is pinned and cannot be closed. */
|
|
13
|
+
pinned?: boolean;
|
|
14
|
+
}
|
|
15
|
+
interface AgentTabsProps {
|
|
16
|
+
tabs: AgentTabItem[];
|
|
17
|
+
activeTabId: string;
|
|
18
|
+
onTabSelect: (tabId: string) => void;
|
|
19
|
+
onTabClose: (tabId: string) => void;
|
|
20
|
+
onAddTab: (agent: {
|
|
21
|
+
id: string;
|
|
22
|
+
type: 'base' | 'deployment';
|
|
23
|
+
name?: string;
|
|
24
|
+
avatar?: string;
|
|
25
|
+
}) => void;
|
|
26
|
+
/** URL listing deployed agents shown in the "+" dropdown. */
|
|
27
|
+
agentSelectorUrl?: string;
|
|
28
|
+
isFullscreen?: boolean;
|
|
29
|
+
fallbackLogo?: string;
|
|
30
|
+
fallbackTitle?: string;
|
|
31
|
+
}
|
|
32
|
+
export declare const AgentTabs: ({ tabs, activeTabId, onTabSelect, onTabClose, onAddTab, agentSelectorUrl, isFullscreen, fallbackLogo, fallbackTitle }: AgentTabsProps) => import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export {};
|
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,
|
|
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, enableVoice, enableMicrophone, enableWelcomePage, tenantAiAgentId, onMessageSend, onVoiceStart, onVoiceEnd, className, defaultFullscreen, hideExpand, hideCloseButton, hideBorder, showHeader, hideHeaderOnWelcome, agentSelectorUrl, onAgentChange, onFullscreenChange, 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;
|
|
@@ -12,6 +12,13 @@ interface UseAssistantApiReturn {
|
|
|
12
12
|
name?: string;
|
|
13
13
|
welcomeMessage?: string;
|
|
14
14
|
} | null;
|
|
15
|
+
/**
|
|
16
|
+
* Agent identifier (deploymentId || tenantAiAgentId) that `agentDetails`,
|
|
17
|
+
* `subagents`, and `agentTools` correspond to. Consumers can compare this
|
|
18
|
+
* against the active agent id to avoid rendering stale data while a refetch
|
|
19
|
+
* is in flight after the active agent changes.
|
|
20
|
+
*/
|
|
21
|
+
agentDetailsForId: string | null;
|
|
15
22
|
isLoadingAgentDetails: boolean;
|
|
16
23
|
/**
|
|
17
24
|
* Combined list of subagents reachable from this orchestrator (direct
|