@docyrus/ui-pro-ai-assistant 0.6.7 → 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.
Files changed (82) hide show
  1. package/README.md +7 -8
  2. package/dist/components/adaptive-card-tool.d.ts +12 -0
  3. package/dist/components/agent-tabs.d.ts +33 -0
  4. package/dist/components/docyrus/adaptive-card/action-bar.d.ts +7 -0
  5. package/dist/components/docyrus/adaptive-card/actions/action-button.d.ts +11 -0
  6. package/dist/components/docyrus/adaptive-card/actions/action-execute.d.ts +4 -0
  7. package/dist/components/docyrus/adaptive-card/actions/action-open-url.d.ts +4 -0
  8. package/dist/components/docyrus/adaptive-card/actions/action-reset-inputs.d.ts +4 -0
  9. package/dist/components/docyrus/adaptive-card/actions/action-show-card.d.ts +7 -0
  10. package/dist/components/docyrus/adaptive-card/actions/action-submit.d.ts +4 -0
  11. package/dist/components/docyrus/adaptive-card/actions/action-toggle-visibility.d.ts +4 -0
  12. package/dist/components/docyrus/adaptive-card/adaptive-card-context.d.ts +43 -0
  13. package/dist/components/docyrus/adaptive-card/adaptive-card-types.d.ts +672 -0
  14. package/dist/components/docyrus/adaptive-card/adaptive-card-view.d.ts +6 -0
  15. package/dist/components/docyrus/adaptive-card/adaptive-card.d.ts +3 -0
  16. package/dist/components/docyrus/adaptive-card/element-node.d.ts +11 -0
  17. package/dist/components/docyrus/adaptive-card/element-registry.d.ts +4 -0
  18. package/dist/components/docyrus/adaptive-card/elements/accordion-element.d.ts +4 -0
  19. package/dist/components/docyrus/adaptive-card/elements/action-set.d.ts +4 -0
  20. package/dist/components/docyrus/adaptive-card/elements/badge-element.d.ts +4 -0
  21. package/dist/components/docyrus/adaptive-card/elements/carousel-element.d.ts +4 -0
  22. package/dist/components/docyrus/adaptive-card/elements/chart-elements.d.ts +19 -0
  23. package/dist/components/docyrus/adaptive-card/elements/chart-shared.d.ts +8 -0
  24. package/dist/components/docyrus/adaptive-card/elements/code-block-element.d.ts +4 -0
  25. package/dist/components/docyrus/adaptive-card/elements/column-set.d.ts +4 -0
  26. package/dist/components/docyrus/adaptive-card/elements/component-element.d.ts +4 -0
  27. package/dist/components/docyrus/adaptive-card/elements/compound-button-element.d.ts +4 -0
  28. package/dist/components/docyrus/adaptive-card/elements/container.d.ts +4 -0
  29. package/dist/components/docyrus/adaptive-card/elements/fact-set.d.ts +4 -0
  30. package/dist/components/docyrus/adaptive-card/elements/icon-element.d.ts +6 -0
  31. package/dist/components/docyrus/adaptive-card/elements/image-element.d.ts +4 -0
  32. package/dist/components/docyrus/adaptive-card/elements/image-set.d.ts +4 -0
  33. package/dist/components/docyrus/adaptive-card/elements/loop-component-element.d.ts +4 -0
  34. package/dist/components/docyrus/adaptive-card/elements/media-element.d.ts +4 -0
  35. package/dist/components/docyrus/adaptive-card/elements/progress-bar-element.d.ts +4 -0
  36. package/dist/components/docyrus/adaptive-card/elements/progress-ring-element.d.ts +4 -0
  37. package/dist/components/docyrus/adaptive-card/elements/rating-element.d.ts +10 -0
  38. package/dist/components/docyrus/adaptive-card/elements/rich-text-block.d.ts +4 -0
  39. package/dist/components/docyrus/adaptive-card/elements/tab-set-element.d.ts +4 -0
  40. package/dist/components/docyrus/adaptive-card/elements/table-element.d.ts +4 -0
  41. package/dist/components/docyrus/adaptive-card/elements/text-block.d.ts +4 -0
  42. package/dist/components/docyrus/adaptive-card/index.d.ts +15 -0
  43. package/dist/components/docyrus/adaptive-card/inputs/input-choice-set.d.ts +4 -0
  44. package/dist/components/docyrus/adaptive-card/inputs/input-date.d.ts +4 -0
  45. package/dist/components/docyrus/adaptive-card/inputs/input-number.d.ts +4 -0
  46. package/dist/components/docyrus/adaptive-card/inputs/input-rating.d.ts +4 -0
  47. package/dist/components/docyrus/adaptive-card/inputs/input-shell.d.ts +7 -0
  48. package/dist/components/docyrus/adaptive-card/inputs/input-text.d.ts +4 -0
  49. package/dist/components/docyrus/adaptive-card/inputs/input-time.d.ts +4 -0
  50. package/dist/components/docyrus/adaptive-card/inputs/input-toggle.d.ts +4 -0
  51. package/dist/components/docyrus/adaptive-card/inputs/use-input-register.d.ts +2 -0
  52. package/dist/components/docyrus/adaptive-card/lib/chart-palette.d.ts +4 -0
  53. package/dist/components/docyrus/adaptive-card/lib/collect-inputs.d.ts +3 -0
  54. package/dist/components/docyrus/adaptive-card/lib/color-tokens.d.ts +9 -0
  55. package/dist/components/docyrus/adaptive-card/lib/default-host-config.d.ts +3 -0
  56. package/dist/components/docyrus/adaptive-card/lib/expression.d.ts +12 -0
  57. package/dist/components/docyrus/adaptive-card/lib/interpolate.d.ts +2 -0
  58. package/dist/components/docyrus/adaptive-card/lib/parse-card.d.ts +4 -0
  59. package/dist/components/docyrus/adaptive-card/lib/size-tokens.d.ts +16 -0
  60. package/dist/components/docyrus/adaptive-card/lib/spacing-tokens.d.ts +4 -0
  61. package/dist/components/docyrus/adaptive-card/lib/templating.d.ts +6 -0
  62. package/dist/components/docyrus/adaptive-card/lib/validate-inputs.d.ts +7 -0
  63. package/dist/components/docyrus/adaptive-card/lib/version.d.ts +5 -0
  64. package/dist/components/docyrus/adaptive-card/register-default-elements.d.ts +1 -0
  65. package/dist/components/generative-tool.d.ts +7 -1
  66. package/dist/components/template-output.d.ts +11 -0
  67. package/dist/components/ui/circular-progress.d.ts +24 -0
  68. package/dist/docy-assistant.d.ts +1 -1
  69. package/dist/hooks/docyrus/use-adaptive-card.d.ts +43 -0
  70. package/dist/hooks/use-assistant-api.d.ts +13 -0
  71. package/dist/index.js +5831 -1547
  72. package/dist/index.js.map +1 -1
  73. package/dist/internal/plate-editor/editor/plugins/emoji-kit.d.ts +2 -5
  74. package/dist/internal/plate-editor/editor/plugins/mention-base-kit.d.ts +2 -11
  75. package/dist/internal/plate-editor/editor/plugins/mention-kit.d.ts +2 -11
  76. package/dist/internal/plate-editor/editor/plugins/slash-kit.d.ts +2 -1
  77. package/dist/styles.css +458 -34
  78. package/dist/types/index.d.ts +5 -6
  79. package/dist/views/assistant-view.d.ts +16 -5
  80. package/dist/views/chat-panel.d.ts +12 -1
  81. package/dist/views/message-list.d.ts +2 -1
  82. package/package.json +10 -2
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; when false the agent selector moves to the top of the sidebar |
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 selection
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"` | Deployment selector endpoint |
256
- | `baseAgentSelectorUrl` | `string` | `"/ai/agent-deployments/base"` | Base agent selector endpoint |
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,12 @@
1
+ import { type AdaptiveCardPayload } from './docyrus/adaptive-card';
2
+ import { type ToolActionEvent } from '../types';
3
+ interface AdaptiveCardToolProps {
4
+ payload: AdaptiveCardPayload;
5
+ data?: unknown;
6
+ toolName: string;
7
+ toolCallId: string;
8
+ onToolAction?: (event: ToolActionEvent) => void;
9
+ }
10
+ export declare function AdaptiveCardTool({ payload, data, toolName, toolCallId, onToolAction }: AdaptiveCardToolProps): import("react/jsx-runtime").JSX.Element;
11
+ export declare function extractAdaptiveCardPayload(value: unknown): AdaptiveCardPayload | null;
12
+ export {};
@@ -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 {};
@@ -0,0 +1,7 @@
1
+ import { type AdaptiveCardAction } from './adaptive-card-types';
2
+ interface ActionBarProps {
3
+ actions: Array<AdaptiveCardAction> | undefined;
4
+ variant?: 'card-footer' | 'inline' | 'nested';
5
+ }
6
+ export declare function ActionBar({ actions, variant }: ActionBarProps): import("react/jsx-runtime").JSX.Element | null;
7
+ export {};
@@ -0,0 +1,11 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type AdaptiveCardAction } from '../adaptive-card-types';
3
+ interface ActionButtonProps {
4
+ action: AdaptiveCardAction;
5
+ onClick: () => void;
6
+ asChild?: boolean;
7
+ children?: ReactNode;
8
+ className?: string;
9
+ }
10
+ export declare function ActionButton({ action, onClick, asChild, children, className }: ActionButtonProps): import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -0,0 +1,4 @@
1
+ import { type AdaptiveCardActionExecute } from '../adaptive-card-types';
2
+ export declare function ActionExecuteButton({ action }: {
3
+ action: AdaptiveCardActionExecute;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { type AdaptiveCardActionOpenUrl } from '../adaptive-card-types';
2
+ export declare function ActionOpenUrlButton({ action }: {
3
+ action: AdaptiveCardActionOpenUrl;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { type AdaptiveCardActionResetInputs } from '../adaptive-card-types';
2
+ export declare function ActionResetInputsButton({ action }: {
3
+ action: AdaptiveCardActionResetInputs;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { type AdaptiveCardActionShowCard } from '../adaptive-card-types';
2
+ export declare function ActionShowCardButton({ action }: {
3
+ action: AdaptiveCardActionShowCard;
4
+ }): import("react/jsx-runtime").JSX.Element;
5
+ export declare function ShowCardPanel({ action }: {
6
+ action: AdaptiveCardActionShowCard;
7
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { type AdaptiveCardActionSubmit } from '../adaptive-card-types';
2
+ export declare function ActionSubmitButton({ action }: {
3
+ action: AdaptiveCardActionSubmit;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { type AdaptiveCardActionToggleVisibility } from '../adaptive-card-types';
2
+ export declare function ActionToggleVisibilityButton({ action }: {
3
+ action: AdaptiveCardActionToggleVisibility;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,43 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type AdaptiveCardActionEvent, type AdaptiveCardActionExecute, type AdaptiveCardActionOpenUrl, type AdaptiveCardActionResetInputs, type AdaptiveCardActionShowCard, type AdaptiveCardActionSubmit, type AdaptiveCardActionToggleVisibility, type AdaptiveCardChoice, type AdaptiveCardHostConfig, type AdaptiveCardInputValue, type AdaptiveCardPayload, type ElementRenderer } from './adaptive-card-types';
3
+ import { type ValidationResult } from './lib/validate-inputs';
4
+ export interface AdaptiveCardContextValue {
5
+ card: AdaptiveCardPayload;
6
+ hostConfig: AdaptiveCardHostConfig;
7
+ customElements: Record<string, ElementRenderer>;
8
+ visibilityOverrides: Record<string, boolean>;
9
+ inputs: Record<string, AdaptiveCardInputValue>;
10
+ validations: Record<string, ValidationResult>;
11
+ showCardOpen: Record<string, boolean>;
12
+ hasSubmittedOnce: boolean;
13
+ setInput: (id: string, value: AdaptiveCardInputValue) => void;
14
+ registerInput: (id: string, initial: AdaptiveCardInputValue) => void;
15
+ unregisterInput: (id: string) => void;
16
+ submit: (action: AdaptiveCardActionSubmit) => void;
17
+ execute: (action: AdaptiveCardActionExecute) => void;
18
+ openUrl: (action: AdaptiveCardActionOpenUrl) => void;
19
+ toggleVisibility: (action: AdaptiveCardActionToggleVisibility) => void;
20
+ toggleShowCard: (action: AdaptiveCardActionShowCard) => void;
21
+ resetInputs: (action: AdaptiveCardActionResetInputs) => void;
22
+ dispatchEvent: (event: AdaptiveCardActionEvent) => void;
23
+ queryChoices: (request: {
24
+ dataset: string;
25
+ search: string;
26
+ inputId: string;
27
+ }) => Promise<Array<AdaptiveCardChoice>>;
28
+ }
29
+ export declare function AdaptiveCardProvider({ value, children }: {
30
+ value: AdaptiveCardContextValue;
31
+ children: ReactNode;
32
+ }): import("react/jsx-runtime").JSX.Element;
33
+ export declare function useAdaptiveCardContext(): AdaptiveCardContextValue;
34
+ export declare function useAdaptiveCardInput(id: string): {
35
+ value: string | number | boolean | string[] | null;
36
+ setValue: (next: AdaptiveCardInputValue) => void;
37
+ validation: ValidationResult;
38
+ showError: boolean;
39
+ };
40
+ export declare function isElementVisible(element: {
41
+ id?: string;
42
+ isVisible?: boolean;
43
+ }, overrides: Record<string, boolean>): boolean;