@uipath/conversational-tool 1.197.0-preview.65 → 1.197.0-preview.66

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 (2) hide show
  1. package/dist/tool.js +580 -11
  2. package/package.json +2 -2
package/dist/tool.js CHANGED
@@ -38301,7 +38301,7 @@ var init_conversational_agent = __esm(() => {
38301
38301
  var package_default = {
38302
38302
  name: "@uipath/conversational-tool",
38303
38303
  license: "MIT",
38304
- version: "1.197.0-preview.65",
38304
+ version: "1.197.0-preview.66",
38305
38305
  description: "Handle conversations with deployed UiPath conversational processes.",
38306
38306
  type: "module",
38307
38307
  main: "./dist/tool.js",
@@ -43402,9 +43402,228 @@ function getOutputFilter() {
43402
43402
  return filterSlot.get();
43403
43403
  }
43404
43404
 
43405
+ // ../common/src/telemetry/command-terminal.ts
43406
+ var recordedFailureSlot = singleton("CommandTelemetryFailure");
43407
+ var AUTH_ERROR_CODES = new Set([
43408
+ "authentication_required",
43409
+ "permission_denied"
43410
+ ]);
43411
+ var VALIDATION_ERROR_CODES = new Set(["invalid_argument"]);
43412
+ var NETWORK_HTTP_ERROR_CODES = new Set([
43413
+ "network_error",
43414
+ "rate_limited",
43415
+ "server_error",
43416
+ "not_found",
43417
+ "method_not_allowed"
43418
+ ]);
43419
+ var TIMEOUT_ERROR_CODES = new Set(["timeout"]);
43420
+ var NETWORK_OS_ERROR_CODES = new Set([
43421
+ "ECONNREFUSED",
43422
+ "ECONNRESET",
43423
+ "ENOTFOUND",
43424
+ "EAI_AGAIN",
43425
+ "EPIPE",
43426
+ "EHOSTUNREACH",
43427
+ "ENETUNREACH",
43428
+ "EAI_FAIL"
43429
+ ]);
43430
+ var TIMEOUT_OS_ERROR_CODES = new Set(["ETIMEDOUT", "ESOCKETTIMEDOUT"]);
43431
+ var TLS_ERROR_CODES2 = new Set([
43432
+ "SELF_SIGNED_CERT_IN_CHAIN",
43433
+ "DEPTH_ZERO_SELF_SIGNED_CERT",
43434
+ "UNABLE_TO_VERIFY_LEAF_SIGNATURE",
43435
+ "UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
43436
+ "UNABLE_TO_GET_ISSUER_CERT",
43437
+ "CERT_HAS_EXPIRED",
43438
+ "CERT_UNTRUSTED",
43439
+ "ERR_TLS_CERT_ALTNAME_INVALID"
43440
+ ]);
43441
+ var MISSING_DEPENDENCY_CODES = new Set([
43442
+ "MODULE_NOT_FOUND",
43443
+ "ERR_MODULE_NOT_FOUND"
43444
+ ]);
43445
+ var INTERNAL_ERROR_NAMES = new Set([
43446
+ "TypeError",
43447
+ "ReferenceError",
43448
+ "SyntaxError",
43449
+ "RangeError"
43450
+ ]);
43451
+ function isRecord(value) {
43452
+ return value !== null && typeof value === "object";
43453
+ }
43454
+ function stringField(value, field) {
43455
+ if (!isRecord(value)) {
43456
+ return;
43457
+ }
43458
+ const raw = value[field];
43459
+ return typeof raw === "string" ? raw : undefined;
43460
+ }
43461
+ function numberField(value, field) {
43462
+ if (!isRecord(value)) {
43463
+ return;
43464
+ }
43465
+ const raw = value[field];
43466
+ return typeof raw === "number" ? raw : undefined;
43467
+ }
43468
+ function findStringInCauseChain(error, field) {
43469
+ let current = error;
43470
+ for (let depth = 0;depth < 5 && current !== null && typeof current === "object"; depth++) {
43471
+ const value = stringField(current, field);
43472
+ if (value) {
43473
+ return value;
43474
+ }
43475
+ current = current.cause;
43476
+ }
43477
+ return;
43478
+ }
43479
+ function findCodeInCauseChain(error) {
43480
+ return findStringInCauseChain(error, "code");
43481
+ }
43482
+ function isSpawnEnoent(error) {
43483
+ const code = findCodeInCauseChain(error);
43484
+ if (code !== "ENOENT") {
43485
+ return false;
43486
+ }
43487
+ const syscall = findStringInCauseChain(error, "syscall");
43488
+ return syscall?.startsWith("spawn") === true;
43489
+ }
43490
+ function isCancellationError(error, exitCode, pollSignal) {
43491
+ if (exitCode === 130) {
43492
+ return true;
43493
+ }
43494
+ if (!isRecord(error)) {
43495
+ return false;
43496
+ }
43497
+ if (numberField(error, "exitCode") === 130) {
43498
+ return true;
43499
+ }
43500
+ const name = stringField(error, "name");
43501
+ if (name === "ExitPromptError") {
43502
+ return true;
43503
+ }
43504
+ if (name === "AbortError" && pollSignal?.aborted) {
43505
+ return true;
43506
+ }
43507
+ const message = stringField(error, "message");
43508
+ return message?.includes("SIGINT") === true;
43509
+ }
43510
+ function terminalSignalFor(input, outcome) {
43511
+ if (input.recordedFailure?.terminalSignal) {
43512
+ return input.recordedFailure.terminalSignal;
43513
+ }
43514
+ const explicit = findStringInCauseChain(input.error, "terminalSignal") ?? findStringInCauseChain(input.error, "signal");
43515
+ if (explicit) {
43516
+ return explicit;
43517
+ }
43518
+ return outcome === "cancelled" ? "SIGINT" : undefined;
43519
+ }
43520
+ function classifyHttpStatus(status) {
43521
+ if (status === 401 || status === 403) {
43522
+ return "auth";
43523
+ }
43524
+ if (status === 400 || status === 409 || status === 422) {
43525
+ return "validation";
43526
+ }
43527
+ if (status === 408) {
43528
+ return "timeout";
43529
+ }
43530
+ return "network_http";
43531
+ }
43532
+ function classifyFromResult(result) {
43533
+ switch (result) {
43534
+ case "AuthenticationError":
43535
+ return "auth";
43536
+ case "ValidationError":
43537
+ return "validation";
43538
+ case "TimeoutError":
43539
+ return "timeout";
43540
+ default:
43541
+ return;
43542
+ }
43543
+ }
43544
+ function classifyFromErrorCode(errorCode) {
43545
+ if (!errorCode) {
43546
+ return;
43547
+ }
43548
+ if (AUTH_ERROR_CODES.has(errorCode)) {
43549
+ return "auth";
43550
+ }
43551
+ if (VALIDATION_ERROR_CODES.has(errorCode)) {
43552
+ return "validation";
43553
+ }
43554
+ if (TIMEOUT_ERROR_CODES.has(errorCode)) {
43555
+ return "timeout";
43556
+ }
43557
+ if (NETWORK_HTTP_ERROR_CODES.has(errorCode)) {
43558
+ return "network_http";
43559
+ }
43560
+ return;
43561
+ }
43562
+ function classifyFromError(error) {
43563
+ const code = findCodeInCauseChain(error);
43564
+ if (code) {
43565
+ if (code.startsWith("commander.")) {
43566
+ return "validation";
43567
+ }
43568
+ if (NETWORK_OS_ERROR_CODES.has(code) || TLS_ERROR_CODES2.has(code)) {
43569
+ return "network_http";
43570
+ }
43571
+ if (TIMEOUT_OS_ERROR_CODES.has(code)) {
43572
+ return "timeout";
43573
+ }
43574
+ if (MISSING_DEPENDENCY_CODES.has(code) || isSpawnEnoent(error)) {
43575
+ return "missing_dependency";
43576
+ }
43577
+ }
43578
+ const message = stringField(error, "message");
43579
+ if (message?.includes("fetch failed") === true) {
43580
+ return "network_http";
43581
+ }
43582
+ const name = stringField(error, "name");
43583
+ if (name && INTERNAL_ERROR_NAMES.has(name)) {
43584
+ return "internal";
43585
+ }
43586
+ return;
43587
+ }
43588
+ function classifyError(input) {
43589
+ const recorded = input.recordedFailure;
43590
+ if (recorded?.errorClass) {
43591
+ return recorded.errorClass;
43592
+ }
43593
+ const status = recorded?.context?.httpStatus;
43594
+ if (status !== undefined) {
43595
+ return classifyHttpStatus(status);
43596
+ }
43597
+ return classifyFromResult(recorded?.result) ?? classifyFromErrorCode(recorded?.errorCode) ?? classifyFromError(input.error) ?? "unknown";
43598
+ }
43599
+ function recordCommandFailureTelemetry(failure) {
43600
+ recordedFailureSlot.set(failure);
43601
+ }
43602
+ function clearRecordedCommandFailureTelemetry() {
43603
+ recordedFailureSlot.clear();
43604
+ }
43605
+ function takeRecordedCommandFailureTelemetry() {
43606
+ const failure = recordedFailureSlot.get();
43607
+ recordedFailureSlot.clear();
43608
+ return failure;
43609
+ }
43610
+ function buildCommandTerminalTelemetryProperties(input) {
43611
+ const cancelled = isCancellationError(input.error, input.exitCode, input.pollSignal);
43612
+ const outcome = input.recordedFailure?.terminalOutcome ?? (input.exitCode === 0 ? "success" : cancelled ? "cancelled" : "failure");
43613
+ const errorClass = outcome === "success" || outcome === "no_op" ? undefined : outcome === "cancelled" ? "user_cancelled" : classifyError(input);
43614
+ const terminalSignal = terminalSignalFor(input, outcome);
43615
+ return {
43616
+ exit_code: input.exitCode,
43617
+ terminal_outcome: outcome,
43618
+ ...errorClass ? { error_class: errorClass } : {},
43619
+ ...terminalSignal ? { terminal_signal: terminalSignal } : {}
43620
+ };
43621
+ }
43622
+
43405
43623
  // ../common/src/telemetry/telemetry-events.ts
43406
43624
  var CommonTelemetryEvents = {
43407
- Error: "uip.error"
43625
+ Error: "uip.error",
43626
+ ShipSucceeded: "ship_succeeded"
43408
43627
  };
43409
43628
 
43410
43629
  // ../common/src/registry.ts
@@ -43471,6 +43690,136 @@ function formatMessage(category, name, properties) {
43471
43690
  }
43472
43691
  return message;
43473
43692
  }
43693
+ // ../common/src/telemetry/detect-agent.ts
43694
+ var KNOWN_AGENTS = [
43695
+ { envVar: "CLAUDECODE", value: "1", id: "claude-code" },
43696
+ { envVar: "CURSOR_AGENT", value: "1", id: "cursor" },
43697
+ { envVar: "GEMINI_CLI", value: "1", id: "gemini-cli" },
43698
+ { envVar: "CODEX_THREAD_ID", id: "codex" },
43699
+ { envVar: "CODEX_SANDBOX", id: "codex" },
43700
+ { envVar: "AUGMENT_AGENT", value: "1", id: "augment" },
43701
+ { envVar: "CLINE_ACTIVE", value: "true", id: "cline" }
43702
+ ];
43703
+ function detectAgentFromEnv(env) {
43704
+ for (const agent of KNOWN_AGENTS) {
43705
+ const envValue = env[agent.envVar];
43706
+ if (agent.value !== undefined) {
43707
+ if (envValue === agent.value)
43708
+ return agent.id;
43709
+ } else {
43710
+ if (envValue)
43711
+ return agent.id;
43712
+ }
43713
+ }
43714
+ const agentEnv = env.AGENT;
43715
+ if (agentEnv) {
43716
+ if (agentEnv === "1" || agentEnv === "true")
43717
+ return "unknown";
43718
+ if (agentEnv.length <= 32)
43719
+ return agentEnv.toLowerCase();
43720
+ }
43721
+ return;
43722
+ }
43723
+ // ../common/src/telemetry/environment-info.ts
43724
+ var LOCAL_HOSTS = new Set(["localhost", "127.0.0.1", "::1", "[::1]"]);
43725
+ // ../common/src/telemetry/execution-context.ts
43726
+ var authSignalSlot = singleton("TelemetryExecutionContextAuthSignal");
43727
+ var isTruthy = (value) => value !== undefined && value !== "" && value !== "0" && value.toLowerCase() !== "false";
43728
+ var isEqual = (value, expected) => value?.toLowerCase() === expected;
43729
+ var CI_SIGNATURES = [
43730
+ {
43731
+ provider: "github_actions",
43732
+ matches: (env) => isTruthy(env.GITHUB_ACTIONS),
43733
+ isScheduler: (env) => env.GITHUB_EVENT_NAME === "schedule"
43734
+ },
43735
+ {
43736
+ provider: "azure_devops",
43737
+ matches: (env) => isTruthy(env.TF_BUILD),
43738
+ isScheduler: (env) => isEqual(env.BUILD_REASON, "schedule")
43739
+ },
43740
+ {
43741
+ provider: "gitlab",
43742
+ matches: (env) => isTruthy(env.GITLAB_CI),
43743
+ isScheduler: (env) => env.CI_PIPELINE_SOURCE === "schedule"
43744
+ },
43745
+ {
43746
+ provider: "circleci",
43747
+ matches: (env) => isTruthy(env.CIRCLECI),
43748
+ isScheduler: (env) => env.CIRCLE_PIPELINE_TRIGGER_SOURCE === "scheduled_pipeline"
43749
+ },
43750
+ {
43751
+ provider: "jenkins",
43752
+ matches: (env) => isTruthy(env.JENKINS_URL) || isTruthy(env.JENKINS_HOME)
43753
+ },
43754
+ {
43755
+ provider: "teamcity",
43756
+ matches: (env) => isTruthy(env.TEAMCITY_VERSION)
43757
+ },
43758
+ {
43759
+ provider: "buildkite",
43760
+ matches: (env) => isTruthy(env.BUILDKITE),
43761
+ isScheduler: (env) => env.BUILDKITE_SOURCE === "schedule"
43762
+ },
43763
+ {
43764
+ provider: "bitbucket",
43765
+ matches: (env) => isTruthy(env.BITBUCKET_BUILD_NUMBER)
43766
+ },
43767
+ {
43768
+ provider: "travis",
43769
+ matches: (env) => isTruthy(env.TRAVIS)
43770
+ },
43771
+ {
43772
+ provider: "appveyor",
43773
+ matches: (env) => isTruthy(env.APPVEYOR)
43774
+ },
43775
+ {
43776
+ provider: "generic",
43777
+ matches: (env) => isTruthy(env.CI)
43778
+ }
43779
+ ];
43780
+ function currentEnv() {
43781
+ return typeof process === "undefined" ? {} : process.env;
43782
+ }
43783
+ function currentTtyState() {
43784
+ if (typeof process === "undefined")
43785
+ return false;
43786
+ return Boolean(process.stdout?.isTTY || process.stdin?.isTTY || process.stderr?.isTTY);
43787
+ }
43788
+ function detectCi(env) {
43789
+ const signature = CI_SIGNATURES.find((candidate) => candidate.matches(env));
43790
+ if (!signature)
43791
+ return;
43792
+ return {
43793
+ executionContext: signature.isScheduler?.(env) ? "scheduler" : "ci",
43794
+ ciProvider: signature.provider
43795
+ };
43796
+ }
43797
+ function detectExecutionContext(options = {}) {
43798
+ const env = options.env ?? currentEnv();
43799
+ const ci = detectCi(env);
43800
+ if (ci)
43801
+ return ci;
43802
+ const agent = options.agent ?? detectAgentFromEnv(env);
43803
+ if (agent) {
43804
+ return { executionContext: "agent" };
43805
+ }
43806
+ const authSignal = options.authSignal ?? authSignalSlot.get();
43807
+ if (authSignal === "service_account") {
43808
+ return { executionContext: "service_account" };
43809
+ }
43810
+ const isTty = options.isTty ?? currentTtyState();
43811
+ if (isTty) {
43812
+ return { executionContext: "manual" };
43813
+ }
43814
+ return { executionContext: "unknown" };
43815
+ }
43816
+ function getExecutionContextTelemetryProperties() {
43817
+ const detected = detectExecutionContext();
43818
+ return {
43819
+ execution_context: detected.executionContext,
43820
+ ...detected.ciProvider ? { ci_provider: detected.ciProvider } : {}
43821
+ };
43822
+ }
43474
43823
  // ../common/src/telemetry/node-context-storage.ts
43475
43824
  import { AsyncLocalStorage } from "node:async_hooks";
43476
43825
 
@@ -43483,6 +43832,26 @@ class NodeContextStorage {
43483
43832
  return this.storage.getStore();
43484
43833
  }
43485
43834
  }
43835
+ // ../common/src/telemetry/session-id.ts
43836
+ var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
43837
+ var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
43838
+ var telemetrySessionIdSlot = singleton("TelemetrySessionId");
43839
+ function getProcessEnv() {
43840
+ return globalThis.process?.env;
43841
+ }
43842
+ function normalizeSessionId(value) {
43843
+ if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
43844
+ return;
43845
+ }
43846
+ const trimmed = String(value).trim();
43847
+ return trimmed || undefined;
43848
+ }
43849
+ function getConfiguredTelemetrySessionId() {
43850
+ return normalizeSessionId(getProcessEnv()?.[TELEMETRY_SESSION_ID_ENV]);
43851
+ }
43852
+ function resolveTelemetrySessionId(existingSessionId) {
43853
+ return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
43854
+ }
43486
43855
  // ../common/src/telemetry/global-telemetry-properties.ts
43487
43856
  var telemetryPropsSlot = singleton("TelemetryDefaultProps");
43488
43857
  function getGlobalTelemetryProperties() {
@@ -43567,12 +43936,22 @@ class TelemetryService {
43567
43936
  return this.contextStorage.getContext();
43568
43937
  }
43569
43938
  enrichPropertiesWithContext(properties, context) {
43570
- return {
43571
- ...getGlobalTelemetryProperties(),
43939
+ const globalProperties = getGlobalTelemetryProperties();
43940
+ const existingSessionId = properties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? this.defaultProperties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? globalProperties?.[TELEMETRY_SESSION_ID_PROPERTY];
43941
+ const sessionId = resolveTelemetrySessionId(existingSessionId);
43942
+ const enriched = {
43943
+ ...getExecutionContextTelemetryProperties(),
43944
+ ...globalProperties,
43572
43945
  ...this.defaultProperties,
43573
43946
  ...properties,
43574
43947
  ...context
43575
43948
  };
43949
+ if (sessionId === undefined) {
43950
+ delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
43951
+ } else {
43952
+ enriched[TELEMETRY_SESSION_ID_PROPERTY] = sessionId;
43953
+ }
43954
+ return enriched;
43576
43955
  }
43577
43956
  generateId() {
43578
43957
  return crypto.randomUUID().replaceAll("-", "");
@@ -44042,8 +44421,24 @@ var OutputFormatter;
44042
44421
  data.ErrorCode ??= defaultErrorCodeForFailure(data);
44043
44422
  data.Retry ??= defaultRetryForErrorCode(data.ErrorCode);
44044
44423
  process.exitCode = EXIT_CODES[data.Result] ?? 1;
44045
- const { SuppressTelemetry, ...envelope } = data;
44046
- if (!SuppressTelemetry) {
44424
+ recordCommandFailureTelemetry({
44425
+ result: data.Result,
44426
+ errorCode: data.ErrorCode,
44427
+ retry: data.Retry,
44428
+ message: data.Message,
44429
+ context: data.Context,
44430
+ exitCode: process.exitCode,
44431
+ errorClass: data.TelemetryErrorClass,
44432
+ terminalOutcome: data.TelemetryTerminalOutcome,
44433
+ terminalSignal: data.TelemetryTerminalSignal
44434
+ });
44435
+ const suppressTelemetry = data.SuppressTelemetry === true;
44436
+ const envelope = { ...data };
44437
+ delete envelope.SuppressTelemetry;
44438
+ delete envelope.TelemetryErrorClass;
44439
+ delete envelope.TelemetryTerminalOutcome;
44440
+ delete envelope.TelemetryTerminalSignal;
44441
+ if (!suppressTelemetry) {
44047
44442
  telemetry.trackEvent(CommonTelemetryEvents.Error, {
44048
44443
  result: data.Result,
44049
44444
  errorCode: data.ErrorCode,
@@ -44106,6 +44501,158 @@ var OutputFormatter;
44106
44501
  OutputFormatter.formatToString = formatToString;
44107
44502
  })(OutputFormatter ||= {});
44108
44503
 
44504
+ // ../common/src/telemetry/command-attribution.ts
44505
+ var LEGACY_SKILL_NAMESPACE = "uipath:";
44506
+ var MAX_SKILL_NAME_LENGTH = 80;
44507
+ var SKILL_NAME_PATTERN = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
44508
+ function productMode(productArea, mode) {
44509
+ return { product_area: productArea, mode };
44510
+ }
44511
+ function attributionRecord(groups) {
44512
+ const record = {};
44513
+ for (const [productArea, mode, names] of groups) {
44514
+ const attribution = productMode(productArea, mode);
44515
+ for (const name of names) {
44516
+ record[name] = attribution;
44517
+ }
44518
+ }
44519
+ return record;
44520
+ }
44521
+ function commandAttribution(groups) {
44522
+ const entries = [];
44523
+ for (const [productArea, mode, prefixes] of groups) {
44524
+ const attribution = productMode(productArea, mode);
44525
+ for (const prefix of prefixes) {
44526
+ entries.push({ prefix, attribution });
44527
+ }
44528
+ }
44529
+ return entries;
44530
+ }
44531
+ var SKILL_ATTRIBUTION = attributionRecord([
44532
+ ["admin", "operate", ["uipath-admin"]],
44533
+ ["agents", "build", ["uipath-agents"]],
44534
+ ["api-workflow", "build", ["uipath-api-workflow"]],
44535
+ ["automation-discovery", "build", ["uipath-automation-discovery"]],
44536
+ ["coded-apps", "build", ["uipath-coded-apps"]],
44537
+ ["data-fabric", "operate", ["uipath-data-fabric"]],
44538
+ ["cli", "troubleshoot", ["uipath-feedback"]],
44539
+ ["governance", "operate", ["uipath-governance"]],
44540
+ ["action-center", "build", ["uipath-human-in-the-loop"]],
44541
+ ["document-understanding", "build", ["uipath-ixp"]],
44542
+ [
44543
+ "maestro",
44544
+ "build",
44545
+ ["uipath-maestro-bpmn", "uipath-maestro-case", "uipath-maestro-flow"]
44546
+ ],
44547
+ ["agenthub", "build", ["uipath-mcp-servers"]],
44548
+ ["solution", "build", ["uipath-planner", "uipath-solution"]],
44549
+ ["platform", "operate", ["uipath-platform"]],
44550
+ ["quality", "troubleshoot", ["uipath-review"]],
44551
+ ["rpa", "build", ["uipath-rpa"]],
44552
+ ["cli", "operate", ["uipath-skill-catalog"]],
44553
+ ["action-center", "operate", ["uipath-tasks"]],
44554
+ ["test-manager", "operate", ["uipath-test"]],
44555
+ ["platform", "troubleshoot", ["uipath-troubleshoot"]]
44556
+ ]);
44557
+ var KNOWN_SKILL_NAMES = new Set(Object.keys(SKILL_ATTRIBUTION));
44558
+ var COMMAND_ATTRIBUTION = commandAttribution([
44559
+ ["cli", "troubleshoot", ["uip.feedback"]],
44560
+ ["llm-gateway", "operate", ["uip.llm-configuration", "uip.model-hub"]],
44561
+ ["context-grounding", "build", ["uip.context-grounding"]],
44562
+ ["api-workflow", "build", ["uip.api-workflow"]],
44563
+ ["rpa", "build", ["uip.rpa-legacy"]],
44564
+ ["conversational", "operate", ["uip.conversational"]],
44565
+ ["agents", "build", ["uip.codedagent", "uip.agent"]],
44566
+ ["agenthub", "build", ["uip.agenthub"]],
44567
+ ["coded-apps", "build", ["uip.codedapp"]],
44568
+ ["functions", "build", ["uip.functions"]],
44569
+ ["solution", "build", ["uip.solution"]],
44570
+ ["maestro", "build", ["uip.maestro", "uip.case", "uip.flow"]],
44571
+ ["llm-observability", "troubleshoot", ["uip.traces"]],
44572
+ ["platform", "operate", ["uip.platform"]],
44573
+ ["admin", "operate", ["uip.admin"]],
44574
+ ["automation-ops", "operate", ["uip.aops"]],
44575
+ ["documentation", "troubleshoot", ["uip.docsai"]],
44576
+ ["governance", "operate", ["uip.gov"]],
44577
+ ["insights", "operate", ["uip.insights"]],
44578
+ ["document-understanding", "build", ["uip.ixp"]],
44579
+ ["process-mining", "operate", ["uip.pm"]],
44580
+ ["action-center", "operate", ["uip.tasks"]],
44581
+ ["test-manager", "operate", ["uip.tm"]],
44582
+ ["vertical-solutions", "build", ["uip.vss"]],
44583
+ ["data-fabric", "operate", ["uip.df"]],
44584
+ ["integration-service", "build", ["uip.is"]],
44585
+ ["orchestrator", "operate", ["uip.or"]],
44586
+ [
44587
+ "cli",
44588
+ "operate",
44589
+ [
44590
+ "uip.login",
44591
+ "uip.logout",
44592
+ "uip.user",
44593
+ "uip.config",
44594
+ "uip.tools",
44595
+ "uip.skills",
44596
+ "uip.completion",
44597
+ "uip.update",
44598
+ "uip.mcp",
44599
+ "uip.track"
44600
+ ]
44601
+ ]
44602
+ ]).sort((a, b) => b.prefix.length - a.prefix.length);
44603
+ function normalizeCommandPath(value) {
44604
+ if (typeof value !== "string") {
44605
+ return;
44606
+ }
44607
+ const trimmed = value.trim().toLowerCase();
44608
+ if (!trimmed) {
44609
+ return;
44610
+ }
44611
+ const tokens = trimmed.includes(" ") ? trimmed.split(/\s+/).filter((token) => token.length > 0).filter((token) => !token.startsWith("-")) : trimmed.split(".").filter((token) => token.length > 0);
44612
+ if (tokens.length === 0) {
44613
+ return;
44614
+ }
44615
+ const commandTokens = tokens[0] === "uip" ? tokens : ["uip", ...tokens];
44616
+ return commandTokens.join(".");
44617
+ }
44618
+ function getCommandProductModeAttribution(commandPath) {
44619
+ const normalized = normalizeCommandPath(commandPath);
44620
+ if (!normalized) {
44621
+ return;
44622
+ }
44623
+ return COMMAND_ATTRIBUTION.find(({ prefix }) => normalized === prefix || normalized.startsWith(`${prefix}.`))?.attribution;
44624
+ }
44625
+ function normalizeSkillNameWithOptions(value, options) {
44626
+ if (typeof value !== "string") {
44627
+ return;
44628
+ }
44629
+ const normalized = value.trim().toLowerCase();
44630
+ if (!normalized) {
44631
+ return;
44632
+ }
44633
+ const hasLegacyNamespace = normalized.startsWith(LEGACY_SKILL_NAMESPACE);
44634
+ if (hasLegacyNamespace && !options.allowLegacyNamespace) {
44635
+ return;
44636
+ }
44637
+ const skillName = hasLegacyNamespace ? normalized.slice(LEGACY_SKILL_NAMESPACE.length) : normalized;
44638
+ if (skillName.length > MAX_SKILL_NAME_LENGTH || !SKILL_NAME_PATTERN.test(skillName) || !KNOWN_SKILL_NAMES.has(skillName)) {
44639
+ return;
44640
+ }
44641
+ return skillName;
44642
+ }
44643
+ function normalizeSkillName(value) {
44644
+ return normalizeSkillNameWithOptions(value, {
44645
+ allowLegacyNamespace: false
44646
+ });
44647
+ }
44648
+ function buildCommandTelemetryAttribution(commandPath, skillSource) {
44649
+ const skillName = normalizeSkillName(skillSource);
44650
+ return {
44651
+ ...skillName ? { skill_name: skillName } : {},
44652
+ ...getCommandProductModeAttribution(commandPath)
44653
+ };
44654
+ }
44655
+
44109
44656
  // ../common/src/telemetry/pii-redactor.ts
44110
44657
  var REDACTED = "[REDACTED]";
44111
44658
  var MAX_VALUE_LENGTH = 200;
@@ -44291,6 +44838,12 @@ function commandHelpHint(commandPath) {
44291
44838
  const command = commandPath.replace(/\./g, " ");
44292
44839
  return `An unexpected error occurred. Run '${command} --help' to verify command syntax, or run with --log-level debug for details.`;
44293
44840
  }
44841
+ function isPromptCancellation(error) {
44842
+ return error instanceof Error && error.name === "ExitPromptError";
44843
+ }
44844
+ function exitCodeFromProcess(fallback) {
44845
+ return typeof process.exitCode === "number" ? process.exitCode : fallback;
44846
+ }
44294
44847
  Command.prototype.trackedAction = function(context, fn, properties) {
44295
44848
  const command = this;
44296
44849
  return this.action(async (...args) => {
@@ -44298,6 +44851,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
44298
44851
  const props = typeof properties === "function" ? properties(...args) : properties;
44299
44852
  const startTime = performance.now();
44300
44853
  let errorMessage;
44854
+ let fallbackExitCode = EXIT_CODES.Success;
44855
+ clearRecordedCommandFailureTelemetry();
44301
44856
  const [error] = await catchError(fn(...args));
44302
44857
  if (error) {
44303
44858
  errorMessage = error instanceof Error ? error.message : String(error);
@@ -44312,6 +44867,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
44312
44867
  const customRetry = isRetryHint(typedRetry) ? typedRetry : undefined;
44313
44868
  const typedContext = typed.context ?? typed.Context;
44314
44869
  const customContext = isErrorContext(typedContext) ? typedContext : undefined;
44870
+ const cancellationExitCode = typed.exitCode === 130 || isPromptCancellation(error) ? 130 : undefined;
44871
+ fallbackExitCode = cancellationExitCode ?? EXIT_CODES[finalResult];
44315
44872
  OutputFormatter.error({
44316
44873
  Result: finalResult,
44317
44874
  ...customErrorCode ? { ErrorCode: customErrorCode } : {},
@@ -44320,16 +44877,26 @@ Command.prototype.trackedAction = function(context, fn, properties) {
44320
44877
  ...customRetry ? { Retry: customRetry } : {},
44321
44878
  ...customContext ? { Context: customContext } : {}
44322
44879
  });
44323
- context.exit(EXIT_CODES[finalResult]);
44880
+ context.exit(fallbackExitCode);
44324
44881
  }
44325
44882
  const durationMs = performance.now() - startTime;
44326
- const success = !error && (process.exitCode === undefined || process.exitCode === 0);
44883
+ const exitCode = fallbackExitCode === 130 ? fallbackExitCode : exitCodeFromProcess(fallbackExitCode);
44884
+ const recordedFailure = takeRecordedCommandFailureTelemetry();
44885
+ const success = !error && exitCode === 0;
44886
+ const terminalTelemetry = buildCommandTerminalTelemetryProperties({
44887
+ error,
44888
+ exitCode,
44889
+ recordedFailure,
44890
+ pollSignal: context.pollSignal
44891
+ });
44327
44892
  telemetry.trackEvent(telemetryName, redactProperties({
44328
44893
  ...extractCommandParams(command),
44329
44894
  ...props,
44895
+ ...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
44330
44896
  command: "true",
44331
44897
  duration: String(durationMs),
44332
44898
  success: String(success),
44899
+ ...terminalTelemetry,
44333
44900
  ...errorMessage ? { errorMessage } : {}
44334
44901
  }));
44335
44902
  });
@@ -44440,6 +45007,8 @@ var ScreenLogger;
44440
45007
  })(ScreenLogger ||= {});
44441
45008
  // ../common/src/sdk-user-agent.ts
44442
45009
  var sdkUserAgentHostToken = singleton("SdkUserAgentHostToken");
45010
+ // ../common/src/telemetry/ship-succeeded.ts
45011
+ var shippedKeysSlot = singleton("ShipSucceededDedupeKeys");
44443
45012
  // ../common/src/tool-provider.ts
44444
45013
  var factorySlot = singleton("PackagerFactoryProvider");
44445
45014
  // ../auth/src/config.ts
@@ -50451,7 +51020,7 @@ function validateConfig(config2) {
50451
51020
  function isCompleteConfig(config2) {
50452
51021
  return hasRequiredBaseFields(config2) && hasValidAuthConfig(config2);
50453
51022
  }
50454
- function normalizeBaseUrl(url) {
51023
+ function normalizeBaseUrl2(url) {
50455
51024
  return url.endsWith("/") ? url.slice(0, -1) : url;
50456
51025
  }
50457
51026
  var REGISTRY_KEY2 = Symbol.for("@uipath/sdk-internals-registry");
@@ -50625,7 +51194,7 @@ _UiPath_config = new WeakMap, _UiPath_authService = new WeakMap, _UiPath_initial
50625
51194
  const hasSecretAuth = hasSecretConfig(config2);
50626
51195
  const hasOAuthAuth = hasOAuthConfig(config2);
50627
51196
  const internalConfig = new UiPathConfig({
50628
- baseUrl: normalizeBaseUrl(config2.baseUrl),
51197
+ baseUrl: normalizeBaseUrl2(config2.baseUrl),
50629
51198
  orgName: config2.orgName,
50630
51199
  tenantName: config2.tenantName,
50631
51200
  secret: hasSecretAuth ? config2.secret : undefined,
@@ -56246,4 +56815,4 @@ export {
56246
56815
  metadata
56247
56816
  };
56248
56817
 
56249
- //# debugId=298655A372D988B064756E2164756E21
56818
+ //# debugId=8C27C8AC0B0C0D1464756E2164756E21
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/conversational-tool",
3
3
  "license": "MIT",
4
- "version": "1.197.0-preview.65",
4
+ "version": "1.197.0-preview.66",
5
5
  "description": "Handle conversations with deployed UiPath conversational processes.",
6
6
  "type": "module",
7
7
  "main": "./dist/tool.js",
@@ -17,5 +17,5 @@
17
17
  "publishConfig": {
18
18
  "registry": "https://registry.npmjs.org/"
19
19
  },
20
- "gitHead": "9388ccbe5e739c9578bfd9b5395980fb63e11d9c"
20
+ "gitHead": "386b0837882b19062bf744c74949cdf9c5e48dea"
21
21
  }