@uipath/conversational-tool 1.205.0-preview.276 → 1.206.0-preview.279

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 ADDED
@@ -0,0 +1,42 @@
1
+ # @uipath/conversational-tool
2
+
3
+ Adds `uip conversational` to the `uip` CLI: talk to deployed conversational processes (Orchestrator releases marked conversational — today, conversational agents). List agents, create and manage conversations, chat in real time, read exchanges and messages, give feedback, and route SIP trunks for voice.
4
+
5
+ The tool wraps the conversational service of `@uipath/uipath-typescript`. See also [docs/tools/conversational.md](../../docs/tools/conversational.md).
6
+
7
+ ## Commands
8
+
9
+ | Command | Purpose |
10
+ | --- | --- |
11
+ | `agents list` / `agents get` | List conversational agents, or get one by `--release-id` and `--folder-id`. |
12
+ | `conversations create` | Start a conversation against a release (`--release-id`, `--folder-id`). |
13
+ | `conversations list` / `get` / `update` / `delete` | Manage conversations. `list` pages with `--cursor`. |
14
+ | `conversations attachments upload` / `get-uri` | Upload a file, or get a pre-signed upload URI. |
15
+ | `chat <conversation-id>` | Chat in real time; `-m, --message` sends one message and exits. |
16
+ | `exchanges list` / `get` / `feedback` | Read a conversation's exchanges and rate one (`--rating positive` or `negative`). |
17
+ | `messages get` / `get-content-part` | Read one message, or one content part of it. |
18
+ | `trunks list` / `trunks assign <trunk>` | List SIP trunks; route a trunk's inbound calls to a deployed Flow process, or `--clear` it. |
19
+ | `user-settings get` / `update` | Read or change your profile and context settings. |
20
+
21
+ ## Examples
22
+
23
+ ```bash
24
+ uip conversational agents list --output json
25
+ uip conversational conversations create --release-id <release-id> --folder-id <folder-id> --label "Support test"
26
+ uip conversational chat <conversation-id> --message "Hello"
27
+ uip conversational exchanges list <conversation-id> --limit 10
28
+ uip conversational exchanges feedback <conversation-id> <exchange-id> --rating positive --comment "Helpful"
29
+ uip conversational conversations delete <conversation-id> --yes
30
+ uip conversational trunks list --direction inbound
31
+ uip conversational trunks assign <trunk> --process-key <release-key> --folder-key <folder-key> --yes
32
+ ```
33
+
34
+ ## Output
35
+
36
+ Keys inside `Data` keep the service's camelCase (`agentInput.inline`, tool call inputs and results round-trip verbatim); the envelope stays PascalCase. List commands return a `nextCursor` string to pass to `--cursor`.
37
+
38
+ ## Authentication
39
+
40
+ Run `uip login` first. Interactive (user) logins and external-application (client-credentials) logins both work; under app auth the CLI sends a fixed external user id, so every caller sharing that client id shares one conversation history and profile.
41
+
42
+ `chat` uses an interactive terminal and is not available in the browser build.
@@ -1,11 +1,13 @@
1
1
  import {
2
- CLI_EXTERNAL_USER_ID,
3
- addSdkUserAgentHeader,
4
- getLoginStatusAsync,
2
+ package_default,
3
+ catchError,
4
+ carriedErrorCode,
5
+ hasIdentityInstructionContext,
5
6
  getSdkUserAgentToken,
6
- package_default
7
- } from "./tool-3a0mhv82.js";
8
- import"./tool-1yh8g550.js";
7
+ addSdkUserAgentHeader,
8
+ getAuthContext,
9
+ CLI_EXTERNAL_USER_ID
10
+ } from "./tool-gmy31v7s.js";
9
11
 
10
12
  // src/api/cas-client.ts
11
13
  var SDK_USER_AGENT = getSdkUserAgentToken(package_default);
@@ -14,26 +16,31 @@ var MAX_SIP_TRUNK_PAGES = 100;
14
16
 
15
17
  class CasApiError extends Error {
16
18
  status;
17
- constructor(message, status) {
19
+ instructionContext;
20
+ constructor(message, status, instructionContext) {
18
21
  super(message);
19
22
  this.status = status;
23
+ this.instructionContext = instructionContext;
20
24
  this.name = "CasApiError";
21
25
  }
22
26
  }
23
27
  var getCasSession = async () => {
24
- const status = await getLoginStatusAsync();
25
- if (status.loginStatus !== "Logged in" || !status.accessToken || !status.baseUrl || !status.organizationId || !status.tenantId) {
26
- throw new CasApiError(status.hint ?? "Not logged in. Run 'uip login' first.", 401);
28
+ const [authError, auth] = await catchError(getAuthContext({ requireOrganizationId: true, requireTenantId: true }));
29
+ if (authError) {
30
+ if (carriedErrorCode(authError) === "authentication_required") {
31
+ throw new CasApiError(authError.message, 401, hasIdentityInstructionContext(authError) ? "identity" : "auth");
32
+ }
33
+ throw authError;
27
34
  }
28
35
  return {
29
- baseUrl: status.baseUrl,
30
- organizationId: status.organizationId,
31
- tenantId: status.tenantId,
32
- accessToken: status.accessToken
36
+ baseUrl: auth.baseUrl,
37
+ organizationId: auth.organizationId,
38
+ tenantId: auth.tenantId,
39
+ accessToken: auth.accessToken
33
40
  };
34
41
  };
35
42
  var casFetch = async (session, path, init) => {
36
- const response = await fetch(`${session.baseUrl}/${session.organizationId}/${session.tenantId}/autopilotforeveryone_${path}`, {
43
+ const response = await fetch(`${session.baseUrl}/${encodeURIComponent(session.organizationId)}/${encodeURIComponent(session.tenantId)}/autopilotforeveryone_${path}`, {
37
44
  method: init?.method ?? "GET",
38
45
  headers: addSdkUserAgentHeader({
39
46
  Authorization: `Bearer ${session.accessToken}`,
@@ -98,11 +105,10 @@ var updateSipTrunkBinding = async (trunkId, binding) => {
98
105
  return data.trunk;
99
106
  };
100
107
  export {
101
- CasApiError,
102
108
  listSipTrunks,
103
109
  listVoiceEntryPoints,
104
110
  resolveSipTrunk,
105
111
  updateSipTrunkBinding
106
112
  };
107
113
 
108
- //# debugId=EA8B2BC22FD4574664756E2164756E21
114
+ //# debugId=31EDB9E7B97CA7BB64756E2164756E21
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  require_execAsync
3
- } from "./tool-yerrea90.js";
3
+ } from "./tool-1f0pnfrv.js";
4
4
  import {
5
5
  require_src
6
- } from "./tool-mpvp5rqs.js";
6
+ } from "./tool-3spqea6t.js";
7
7
  import {
8
8
  __commonJS,
9
9
  __require
10
- } from "./tool-1yh8g550.js";
10
+ } from "./tool-6an893wm.js";
11
11
 
12
12
  // ../../node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-bsd.js
13
13
  var require_getMachineId_bsd = __commonJS(function(exports) {
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  require_execAsync
3
- } from "./tool-yerrea90.js";
3
+ } from "./tool-1f0pnfrv.js";
4
4
  import {
5
5
  require_src
6
- } from "./tool-mpvp5rqs.js";
6
+ } from "./tool-3spqea6t.js";
7
7
  import {
8
8
  __commonJS
9
- } from "./tool-1yh8g550.js";
9
+ } from "./tool-6an893wm.js";
10
10
 
11
11
  // ../../node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-darwin.js
12
12
  var require_getMachineId_darwin = __commonJS(function(exports) {
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  require_src
3
- } from "./tool-mpvp5rqs.js";
3
+ } from "./tool-3spqea6t.js";
4
4
  import {
5
5
  __commonJS,
6
6
  __require
7
- } from "./tool-1yh8g550.js";
7
+ } from "./tool-6an893wm.js";
8
8
 
9
9
  // ../../node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-linux.js
10
10
  var require_getMachineId_linux = __commonJS(function(exports) {
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  require_src
3
- } from "./tool-mpvp5rqs.js";
3
+ } from "./tool-3spqea6t.js";
4
4
  import {
5
5
  __commonJS
6
- } from "./tool-1yh8g550.js";
6
+ } from "./tool-6an893wm.js";
7
7
 
8
8
  // ../../node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-unsupported.js
9
9
  var require_getMachineId_unsupported = __commonJS(function(exports) {
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  require_execAsync
3
- } from "./tool-yerrea90.js";
3
+ } from "./tool-1f0pnfrv.js";
4
4
  import {
5
5
  require_src
6
- } from "./tool-mpvp5rqs.js";
6
+ } from "./tool-3spqea6t.js";
7
7
  import {
8
8
  __commonJS,
9
9
  __require
10
- } from "./tool-1yh8g550.js";
10
+ } from "./tool-6an893wm.js";
11
11
 
12
12
  // ../../node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-win.js
13
13
  var require_getMachineId_win = __commonJS(function(exports) {