@uipath/ui-widgets-conversational-agent-chat 1.1.5 → 1.1.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.
Files changed (46) hide show
  1. package/README.md +62 -62
  2. package/dist/ConversationalAgentChat.css +835 -96
  3. package/dist/ConversationalAgentChat.d.ts +1 -1
  4. package/dist/ConversationalAgentChat.d.ts.map +1 -1
  5. package/dist/ConversationalAgentChat.js +80 -33
  6. package/dist/ConversationalAgentChat.js.map +1 -1
  7. package/dist/ConversationalAgentChat.stories.d.ts +1 -0
  8. package/dist/ConversationalAgentChat.stories.d.ts.map +1 -1
  9. package/dist/components/AgentSchemaForm/AgentSchemaField.d.ts +1 -1
  10. package/dist/components/AgentSchemaForm/AgentSchemaField.d.ts.map +1 -1
  11. package/dist/components/AgentSchemaForm/AgentSchemaField.js +9 -19
  12. package/dist/components/AgentSchemaForm/AgentSchemaField.js.map +1 -1
  13. package/dist/components/AgentSchemaForm/omitEmptyOptionalValues.d.ts +8 -0
  14. package/dist/components/AgentSchemaForm/omitEmptyOptionalValues.d.ts.map +1 -0
  15. package/dist/components/AgentSchemaForm/omitEmptyOptionalValues.js +31 -0
  16. package/dist/components/AgentSchemaForm/omitEmptyOptionalValues.js.map +1 -0
  17. package/dist/components/ClientSideTool.d.ts.map +1 -1
  18. package/dist/components/ClientSideTool.js +8 -3
  19. package/dist/components/ClientSideTool.js.map +1 -1
  20. package/dist/i18n/i18n.config.d.ts.map +1 -1
  21. package/dist/i18n/i18n.config.js +27 -0
  22. package/dist/i18n/i18n.config.js.map +1 -1
  23. package/dist/i18n/locales/de/index.json +319 -0
  24. package/dist/i18n/locales/en/index.json +3 -0
  25. package/dist/i18n/locales/es/index.json +319 -0
  26. package/dist/i18n/locales/es-mx/index.json +319 -0
  27. package/dist/i18n/locales/fr/index.json +319 -0
  28. package/dist/i18n/locales/ja/index.json +319 -0
  29. package/dist/i18n/locales/keys/index.json +3 -0
  30. package/dist/i18n/locales/ko/index.json +319 -0
  31. package/dist/i18n/locales/pt/index.json +319 -0
  32. package/dist/i18n/locales/pt-br/index.json +319 -0
  33. package/dist/i18n/locales/ro/index.json +319 -0
  34. package/dist/i18n/locales/tr/index.json +319 -0
  35. package/dist/i18n/locales/zh-cn/index.json +319 -0
  36. package/dist/i18n/locales/zh-tw/index.json +319 -0
  37. package/dist/index.d.ts +1 -0
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +1 -0
  40. package/dist/index.js.map +1 -1
  41. package/dist/types.d.ts +4 -1
  42. package/dist/types.d.ts.map +1 -1
  43. package/dist/types.js.map +1 -1
  44. package/dist/version.d.ts +1 -1
  45. package/dist/version.js +1 -1
  46. package/package.json +4 -4
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # Conversational Agent Chat Widget
1
+ # @uipath/ui-widgets-conversational-agent-chat
2
2
 
3
- A React component that provides a conversational AI chat interface powered by UiPath Conversational Agents. Built on top of UiPath Apollo React components, this widget enables seamless integration of AI-powered chat functionality into your applications.
3
+ A React chat interface powered by [UiPath Conversational Agents](https://uipath.github.io/uipath-typescript/api/interfaces/ConversationalAgentServiceModel/). Built on UiPath Apollo React chat components, it drops an AI chat experience into your application with streaming, attachments and tool-call visibility.
4
4
 
5
5
  ## Features
6
6
 
@@ -10,7 +10,7 @@ A React component that provides a conversational AI chat interface powered by Ui
10
10
  - Conversation history management
11
11
  - Start new conversations or continue existing ones
12
12
  - Built on Apollo React chat components
13
- - Built with TypeScript for type safety
13
+ - Written in TypeScript for type safety
14
14
 
15
15
  ## Installation
16
16
 
@@ -18,17 +18,16 @@ A React component that provides a conversational AI chat interface powered by Ui
18
18
  npm install @uipath/ui-widgets-conversational-agent-chat
19
19
  ```
20
20
 
21
- ## Peer Dependencies
22
-
23
- This package requires the following peer dependencies:
21
+ ### Peer dependencies
24
22
 
25
23
  ```bash
26
- npm install react@^19.2.0 react-dom@^19.2.0 @uipath/uipath-typescript@^1.3.10
24
+ npm install react@^19.2.0 react-dom@^19.2.0 @uipath/uipath-typescript@^1.5.5
27
25
  ```
28
26
 
29
27
  ## Usage
30
28
 
31
- > **Note:** Add either `light` or `dark` class to your HTML `<body>` element to enable proper theming.
29
+ > **Note: Theming**
30
+ > Add either a `light` or `dark` class to your HTML `<body>` element to enable proper theming.
32
31
 
33
32
  ```tsx
34
33
  import { ConversationalAgentChat } from "@uipath/ui-widgets-conversational-agent-chat";
@@ -42,10 +41,13 @@ function App() {
42
41
  useEffect(() => {
43
42
  const init = async () => {
44
43
  const uipath = new UiPath({
45
- baseUrl: "https://cloud.uipath.com",
44
+ baseUrl: "https://api.uipath.com",
46
45
  orgName: "your-org",
47
46
  tenantName: "your-tenant",
48
- secret: "your-secret",
47
+ clientId: "your-client-id",
48
+ redirectUri: "http://localhost:3000/callback",
49
+ scope:
50
+ "OR.Execution OR.Folders OR.Users OR.Jobs ConversationalAgents Traces.Api",
49
51
  });
50
52
  await uipath.initialize();
51
53
  setSdk(uipath);
@@ -59,25 +61,24 @@ function App() {
59
61
  }
60
62
  ```
61
63
 
62
- ## API Reference
63
-
64
- ### Props
64
+ > **Info: Scopes for streaming**
65
+ > The `ConversationalAgents` scope is what makes the real-time WebSocket session work; without it the REST calls succeed but the socket connection fails. See [OAuth Scopes](https://uipath.github.io/uipath-typescript/oauth-scopes/#conversational-agent) for the authoritative list.
65
66
 
66
- | Prop | Type | Required | Description |
67
- | ------------------------ | ------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
68
- | `sdk` | `UiPath` | Yes | UiPath SDK instance for API communication |
69
- | `agentId` | `number` | No | The ID of the conversational agent release. Required unless `existingConversationId` is provided. |
70
- | `folderId` | `number` | No | The folder ID the agent lives in. When omitted, the widget resolves it by listing agents and matching on `agentId` — prefer passing it when known. |
71
- | `existingConversationId` | `string` | No | Load an existing conversation by ID instead of creating a new one on first message. |
72
- | `inputSchema` | `InputSchema` | No | Agent input schema. Takes precedence over the schema derived from the resolved agent; use when the caller has the schema but the agent can't be resolved (e.g. an in-progress draft). |
73
- | `isDebugMode` | `boolean` | No | Debug flow: opens an empty conversation up front so inputs are collected in the widget, and submits update the existing conversation instead of creating a new one. |
74
- | `externalUserId` | `string` | No | External user identifier sent as `x-uipath-external-user-id` (HTTP header / WebSocket query param). Required when authenticating via an app-scoped external app; omit for standard user tokens. |
67
+ ## Props
75
68
 
76
- ## `ConversationalAgentPickerChat` (agent picker + chat)
69
+ | Prop | Type | Required | Description |
70
+ | ------------------------ | ------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
71
+ | `sdk` | `UiPath` | Yes | UiPath SDK instance for API communication |
72
+ | `agentId` | `number` | No | The ID of the conversational agent release. Required unless `existingConversationId` is provided |
73
+ | `folderId` | `number` | No | The folder ID the agent lives in. When omitted, the widget resolves it by listing agents and matching on `agentId` — prefer passing it when known |
74
+ | `existingConversationId` | `string` | No | Load an existing conversation by ID instead of creating a new one on the first message |
75
+ | `inputSchema` | `InputSchema` | No | Agent input schema. Takes precedence over the schema derived from the resolved agent; use when the caller has the schema but the agent can't be resolved (e.g. an in-progress draft) |
76
+ | `isDebugMode` | `boolean` | No | Debug flow: opens an empty conversation up front so inputs are collected in the widget, and submits update the existing conversation instead of creating a new one |
77
+ | `externalUserId` | `string` | No | External user identifier sent as `x-uipath-external-user-id` (HTTP header / WebSocket query param). Required when authenticating via an app-scoped external app; omit for standard user tokens |
77
78
 
78
- A higher-level component that lists all conversational agents accessible to a given SDK and opens a chat with the selected one. Useful when you don't know the `agentId`/`folderId` up front and want the user to pick.
79
+ ## Agent picker + chat
79
80
 
80
- ### Usage
81
+ `ConversationalAgentPickerChat` is a higher-level component that lists every conversational agent reachable by a given SDK instance and opens a chat with the selected one. Use it when you don't know the `agentId` / `folderId` up front and want the user to pick.
81
82
 
82
83
  ```tsx
83
84
  import { ConversationalAgentPickerChat } from "@uipath/ui-widgets-conversational-agent-chat";
@@ -91,10 +92,13 @@ function App() {
91
92
  useEffect(() => {
92
93
  const init = async () => {
93
94
  const uipath = new UiPath({
94
- baseUrl: "https://cloud.uipath.com",
95
+ baseUrl: "https://api.uipath.com",
95
96
  orgName: "your-org",
96
97
  tenantName: "your-tenant",
97
- secret: "your-secret",
98
+ clientId: "your-client-id",
99
+ redirectUri: "http://localhost:3000/callback",
100
+ scope:
101
+ "OR.Execution OR.Folders OR.Users OR.Jobs ConversationalAgents Traces.Api",
98
102
  });
99
103
  await uipath.initialize();
100
104
  setSdk(uipath);
@@ -110,58 +114,60 @@ function App() {
110
114
 
111
115
  ### Props
112
116
 
113
- | Prop | Type | Required | Description |
114
- | ----------------- | ---------------------------------------------- | -------- | ---------------------------------------------------------------------- |
115
- | `sdk` | `UiPath` | Yes | UiPath SDK instance. Changing it refetches the list and resets the UI. |
116
- | `locale` | `Locale` | No | Passthrough to the inner chat. |
117
- | `theme` | `"light" \| "dark" \| "light-hc" \| "dark-hc"` | No | Passthrough to the inner chat. |
118
- | `readOnly` | `boolean` | No | Passthrough to the inner chat. |
119
- | `overrideLabels` | `OverrideLabels` | No | Passthrough to the inner chat. |
120
- | `onAgentSelected` | `(agent: AgentSummary) => void` | No | Fired when the user picks an agent (telemetry, routing, etc.). |
117
+ | Prop | Type | Required | Description |
118
+ | ----------------- | ---------------------------------------------- | -------- | --------------------------------------------------------------------- |
119
+ | `sdk` | `UiPath` | Yes | UiPath SDK instance. Changing it refetches the list and resets the UI |
120
+ | `locale` | `Locale` | No | Passthrough to the inner chat |
121
+ | `theme` | `"light" \| "dark" \| "light-hc" \| "dark-hc"` | No | Passthrough to the inner chat |
122
+ | `readOnly` | `boolean` | No | Passthrough to the inner chat |
123
+ | `overrideLabels` | `OverrideLabels` | No | Passthrough to the inner chat |
124
+ | `onAgentSelected` | `(agent: AgentSummary) => void` | No | Fired when the user picks an agent (telemetry, routing, etc.) |
121
125
 
122
126
  ### Behavior
123
127
 
124
- - Calls `ConversationalAgent(sdk).getAll()` on mount → renders one row per agent (`name` + `description`).
128
+ - Calls `ConversationalAgent(sdk).getAll()` on mount, then renders one row per agent (`name` + `description`).
125
129
  - Clicking an agent swaps to the chat view with that agent's `id` and `folderId`.
126
- - "Back" clears the selection and returns to the list (no refetch).
127
- - If the user's accessible tenants live behind your own auth/chrome, switch tenants by rebuilding the `UiPath` instance and passing the new one as `sdk` — the picker handles the rest.
130
+ - **Back** clears the selection and returns to the list — no refetch.
131
+ - If the user's accessible tenants live behind your own auth or chrome, switch tenants by rebuilding the `UiPath` instance and passing the new one as `sdk`; the picker handles the rest.
128
132
 
129
- ## Features in Detail
133
+ ## Features in detail
130
134
 
131
- ### Streaming Responses
135
+ ### Streaming responses
132
136
 
133
- The component supports real-time streaming of AI responses, providing a smooth conversational experience as the agent generates its reply.
137
+ Responses stream in real time, so the conversation stays fluid while the agent generates its reply.
134
138
 
135
- ### File Attachments
139
+ ### File attachments
136
140
 
137
- Users can attach files to their messages via drag and drop or file picker.
141
+ Users can attach files to their messages via drag and drop or the file picker.
138
142
 
139
- ### Tool Call Tracking
143
+ ### Tool call tracking
140
144
 
141
- When the conversational agent uses tools, the component automatically displays:
145
+ When the agent uses tools, the widget displays:
142
146
 
143
147
  - Tool name and input parameters
144
148
  - Execution status
145
149
  - Output results
146
150
  - Error handling
147
151
 
148
- ### Session Management
152
+ ### Session management
149
153
 
150
- The widget automatically handles:
151
-
152
- - Conversation creation and persistence
153
- - Session initialization and maintenance
154
- - Multiple conversation support via "New Chat"
154
+ The widget handles conversation creation and persistence, session initialization and maintenance, and multiple conversations via **New Chat**.
155
155
 
156
156
  ## Styling
157
157
 
158
- The component comes with default styles. Import the CSS file in your application:
159
-
160
158
  ```tsx
161
159
  import "@uipath/ui-widgets-conversational-agent-chat/ConversationalAgentChat.css";
162
160
  ```
163
161
 
164
- The chat interface supports both light and dark themes through the UiPath Apollo design system.
162
+ Both light and dark themes are supported through the UiPath Apollo design system.
163
+
164
+ ## TypeScript
165
+
166
+ ```tsx
167
+ import type { ConversationalAgentChatProps } from "@uipath/ui-widgets-conversational-agent-chat";
168
+ ```
169
+
170
+ <!-- docs:ignore -->
165
171
 
166
172
  ## Development
167
173
 
@@ -193,14 +199,8 @@ npm run test:ui
193
199
  npm run test:coverage
194
200
  ```
195
201
 
196
- ## TypeScript Support
197
-
198
- This package is written in TypeScript and includes type definitions. Import types as needed:
199
-
200
- ```tsx
201
- import type { ConversationalAgentChatProps } from "@uipath/ui-widgets-conversational-agent-chat";
202
- ```
203
-
204
202
  ## License
205
203
 
206
204
  MIT
205
+
206
+ <!-- /docs:ignore -->