@uipath/ui-widgets-conversational-agent-chat 1.0.1 → 1.0.3

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 (40) hide show
  1. package/README.md +53 -0
  2. package/dist/ConversationalAgentChat.css +17899 -6
  3. package/dist/ConversationalAgentChat.d.ts.map +1 -1
  4. package/dist/ConversationalAgentChat.js +30 -0
  5. package/dist/ConversationalAgentChat.js.map +1 -1
  6. package/dist/ConversationalAgentPickerChat.d.ts +4 -0
  7. package/dist/ConversationalAgentPickerChat.d.ts.map +1 -0
  8. package/dist/ConversationalAgentPickerChat.js +113 -0
  9. package/dist/ConversationalAgentPickerChat.js.map +1 -0
  10. package/dist/ConversationalAgentPickerChat.stories.d.ts +96 -0
  11. package/dist/ConversationalAgentPickerChat.stories.d.ts.map +1 -0
  12. package/dist/ConversationalAgentPickerChat.stories.js +209 -0
  13. package/dist/ConversationalAgentPickerChat.stories.js.map +1 -0
  14. package/dist/components/AgentList.d.ts +10 -0
  15. package/dist/components/AgentList.d.ts.map +1 -0
  16. package/dist/components/AgentList.js +20 -0
  17. package/dist/components/AgentList.js.map +1 -0
  18. package/dist/components/agentUtils.d.ts +4 -0
  19. package/dist/components/agentUtils.d.ts.map +1 -0
  20. package/dist/components/agentUtils.js +24 -0
  21. package/dist/components/agentUtils.js.map +1 -0
  22. package/dist/components/useFavorites.d.ts +7 -0
  23. package/dist/components/useFavorites.d.ts.map +1 -0
  24. package/dist/components/useFavorites.js +47 -0
  25. package/dist/components/useFavorites.js.map +1 -0
  26. package/dist/index.d.ts +2 -1
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +1 -0
  29. package/dist/index.js.map +1 -1
  30. package/dist/types.d.ts +17 -1
  31. package/dist/types.d.ts.map +1 -1
  32. package/dist/types.js +2 -0
  33. package/dist/types.js.map +1 -1
  34. package/dist/utils/telemetryUtils.js +1 -1
  35. package/dist/utils/telemetryUtils.js.map +1 -1
  36. package/dist/version.d.ts +2 -0
  37. package/dist/version.d.ts.map +1 -0
  38. package/dist/version.js +3 -0
  39. package/dist/version.js.map +1 -0
  40. package/package.json +3 -2
package/README.md CHANGED
@@ -69,6 +69,59 @@ function App() {
69
69
  | `agentId` | `number` | Yes | The ID of the conversational agent release |
70
70
  | `folderId` | `number` | Yes | The folder ID where conversations will be stored |
71
71
 
72
+ ## `ConversationalAgentPickerChat` (agent picker + chat)
73
+
74
+ 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.
75
+
76
+ ### Usage
77
+
78
+ ```tsx
79
+ import { ConversationalAgentPickerChat } from "@uipath/ui-widgets-conversational-agent-chat";
80
+ import "@uipath/ui-widgets-conversational-agent-chat/ConversationalAgentChat.css";
81
+ import { UiPath } from "@uipath/uipath-typescript/core";
82
+ import { useEffect, useState } from "react";
83
+
84
+ function App() {
85
+ const [sdk, setSdk] = useState<UiPath | null>(null);
86
+
87
+ useEffect(() => {
88
+ const init = async () => {
89
+ const uipath = new UiPath({
90
+ baseUrl: "https://cloud.uipath.com",
91
+ orgName: "your-org",
92
+ tenantName: "your-tenant",
93
+ secret: "your-secret",
94
+ });
95
+ await uipath.initialize();
96
+ setSdk(uipath);
97
+ };
98
+ init();
99
+ }, []);
100
+
101
+ if (!sdk) return <div>Loading...</div>;
102
+
103
+ return <ConversationalAgentPickerChat sdk={sdk} />;
104
+ }
105
+ ```
106
+
107
+ ### Props
108
+
109
+ | Prop | Type | Required | Description |
110
+ | ----------------- | ---------------------------------------------- | -------- | ---------------------------------------------------------------------- |
111
+ | `sdk` | `UiPath` | Yes | UiPath SDK instance. Changing it refetches the list and resets the UI. |
112
+ | `locale` | `Locale` | No | Passthrough to the inner chat. |
113
+ | `theme` | `"light" \| "dark" \| "light-hc" \| "dark-hc"` | No | Passthrough to the inner chat. |
114
+ | `readOnly` | `boolean` | No | Passthrough to the inner chat. |
115
+ | `overrideLabels` | `OverrideLabels` | No | Passthrough to the inner chat. |
116
+ | `onAgentSelected` | `(agent: AgentSummary) => void` | No | Fired when the user picks an agent (telemetry, routing, etc.). |
117
+
118
+ ### Behavior
119
+
120
+ - Calls `ConversationalAgent(sdk).getAll()` on mount → renders one row per agent (`name` + `description`).
121
+ - Clicking an agent swaps to the chat view with that agent's `id` and `folderId`.
122
+ - "Back" clears the selection and returns to the list (no refetch).
123
+ - 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.
124
+
72
125
  ## Features in Detail
73
126
 
74
127
  ### Streaming Responses