@uipath/solution-tool 1.197.0-preview.64 → 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.
package/dist/deploy.js CHANGED
@@ -24882,8 +24882,8 @@ var require_util_map_includes = __commonJS((exports) => {
24882
24882
  const { uniqueKeys } = ctx.options;
24883
24883
  if (uniqueKeys === false)
24884
24884
  return false;
24885
- const isEqual = typeof uniqueKeys === "function" ? uniqueKeys : (a, b) => a === b || identity.isScalar(a) && identity.isScalar(b) && a.value === b.value;
24886
- return items.some((pair) => isEqual(pair.key, search2));
24885
+ const isEqual2 = typeof uniqueKeys === "function" ? uniqueKeys : (a, b) => a === b || identity.isScalar(a) && identity.isScalar(b) && a.value === b.value;
24886
+ return items.some((pair) => isEqual2(pair.key, search2));
24887
24887
  }
24888
24888
  exports.mapIncludes = mapIncludes;
24889
24889
  });
@@ -33488,9 +33488,228 @@ function getOutputFilter() {
33488
33488
  return filterSlot.get();
33489
33489
  }
33490
33490
 
33491
+ // ../common/src/telemetry/command-terminal.ts
33492
+ var recordedFailureSlot = singleton("CommandTelemetryFailure");
33493
+ var AUTH_ERROR_CODES = new Set([
33494
+ "authentication_required",
33495
+ "permission_denied"
33496
+ ]);
33497
+ var VALIDATION_ERROR_CODES = new Set(["invalid_argument"]);
33498
+ var NETWORK_HTTP_ERROR_CODES = new Set([
33499
+ "network_error",
33500
+ "rate_limited",
33501
+ "server_error",
33502
+ "not_found",
33503
+ "method_not_allowed"
33504
+ ]);
33505
+ var TIMEOUT_ERROR_CODES = new Set(["timeout"]);
33506
+ var NETWORK_OS_ERROR_CODES = new Set([
33507
+ "ECONNREFUSED",
33508
+ "ECONNRESET",
33509
+ "ENOTFOUND",
33510
+ "EAI_AGAIN",
33511
+ "EPIPE",
33512
+ "EHOSTUNREACH",
33513
+ "ENETUNREACH",
33514
+ "EAI_FAIL"
33515
+ ]);
33516
+ var TIMEOUT_OS_ERROR_CODES = new Set(["ETIMEDOUT", "ESOCKETTIMEDOUT"]);
33517
+ var TLS_ERROR_CODES2 = new Set([
33518
+ "SELF_SIGNED_CERT_IN_CHAIN",
33519
+ "DEPTH_ZERO_SELF_SIGNED_CERT",
33520
+ "UNABLE_TO_VERIFY_LEAF_SIGNATURE",
33521
+ "UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
33522
+ "UNABLE_TO_GET_ISSUER_CERT",
33523
+ "CERT_HAS_EXPIRED",
33524
+ "CERT_UNTRUSTED",
33525
+ "ERR_TLS_CERT_ALTNAME_INVALID"
33526
+ ]);
33527
+ var MISSING_DEPENDENCY_CODES = new Set([
33528
+ "MODULE_NOT_FOUND",
33529
+ "ERR_MODULE_NOT_FOUND"
33530
+ ]);
33531
+ var INTERNAL_ERROR_NAMES = new Set([
33532
+ "TypeError",
33533
+ "ReferenceError",
33534
+ "SyntaxError",
33535
+ "RangeError"
33536
+ ]);
33537
+ function isRecord(value) {
33538
+ return value !== null && typeof value === "object";
33539
+ }
33540
+ function stringField(value, field) {
33541
+ if (!isRecord(value)) {
33542
+ return;
33543
+ }
33544
+ const raw = value[field];
33545
+ return typeof raw === "string" ? raw : undefined;
33546
+ }
33547
+ function numberField(value, field) {
33548
+ if (!isRecord(value)) {
33549
+ return;
33550
+ }
33551
+ const raw = value[field];
33552
+ return typeof raw === "number" ? raw : undefined;
33553
+ }
33554
+ function findStringInCauseChain(error, field) {
33555
+ let current = error;
33556
+ for (let depth = 0;depth < 5 && current !== null && typeof current === "object"; depth++) {
33557
+ const value = stringField(current, field);
33558
+ if (value) {
33559
+ return value;
33560
+ }
33561
+ current = current.cause;
33562
+ }
33563
+ return;
33564
+ }
33565
+ function findCodeInCauseChain(error) {
33566
+ return findStringInCauseChain(error, "code");
33567
+ }
33568
+ function isSpawnEnoent(error) {
33569
+ const code = findCodeInCauseChain(error);
33570
+ if (code !== "ENOENT") {
33571
+ return false;
33572
+ }
33573
+ const syscall = findStringInCauseChain(error, "syscall");
33574
+ return syscall?.startsWith("spawn") === true;
33575
+ }
33576
+ function isCancellationError(error, exitCode, pollSignal) {
33577
+ if (exitCode === 130) {
33578
+ return true;
33579
+ }
33580
+ if (!isRecord(error)) {
33581
+ return false;
33582
+ }
33583
+ if (numberField(error, "exitCode") === 130) {
33584
+ return true;
33585
+ }
33586
+ const name = stringField(error, "name");
33587
+ if (name === "ExitPromptError") {
33588
+ return true;
33589
+ }
33590
+ if (name === "AbortError" && pollSignal?.aborted) {
33591
+ return true;
33592
+ }
33593
+ const message = stringField(error, "message");
33594
+ return message?.includes("SIGINT") === true;
33595
+ }
33596
+ function terminalSignalFor(input, outcome) {
33597
+ if (input.recordedFailure?.terminalSignal) {
33598
+ return input.recordedFailure.terminalSignal;
33599
+ }
33600
+ const explicit = findStringInCauseChain(input.error, "terminalSignal") ?? findStringInCauseChain(input.error, "signal");
33601
+ if (explicit) {
33602
+ return explicit;
33603
+ }
33604
+ return outcome === "cancelled" ? "SIGINT" : undefined;
33605
+ }
33606
+ function classifyHttpStatus(status) {
33607
+ if (status === 401 || status === 403) {
33608
+ return "auth";
33609
+ }
33610
+ if (status === 400 || status === 409 || status === 422) {
33611
+ return "validation";
33612
+ }
33613
+ if (status === 408) {
33614
+ return "timeout";
33615
+ }
33616
+ return "network_http";
33617
+ }
33618
+ function classifyFromResult(result) {
33619
+ switch (result) {
33620
+ case "AuthenticationError":
33621
+ return "auth";
33622
+ case "ValidationError":
33623
+ return "validation";
33624
+ case "TimeoutError":
33625
+ return "timeout";
33626
+ default:
33627
+ return;
33628
+ }
33629
+ }
33630
+ function classifyFromErrorCode(errorCode) {
33631
+ if (!errorCode) {
33632
+ return;
33633
+ }
33634
+ if (AUTH_ERROR_CODES.has(errorCode)) {
33635
+ return "auth";
33636
+ }
33637
+ if (VALIDATION_ERROR_CODES.has(errorCode)) {
33638
+ return "validation";
33639
+ }
33640
+ if (TIMEOUT_ERROR_CODES.has(errorCode)) {
33641
+ return "timeout";
33642
+ }
33643
+ if (NETWORK_HTTP_ERROR_CODES.has(errorCode)) {
33644
+ return "network_http";
33645
+ }
33646
+ return;
33647
+ }
33648
+ function classifyFromError(error) {
33649
+ const code = findCodeInCauseChain(error);
33650
+ if (code) {
33651
+ if (code.startsWith("commander.")) {
33652
+ return "validation";
33653
+ }
33654
+ if (NETWORK_OS_ERROR_CODES.has(code) || TLS_ERROR_CODES2.has(code)) {
33655
+ return "network_http";
33656
+ }
33657
+ if (TIMEOUT_OS_ERROR_CODES.has(code)) {
33658
+ return "timeout";
33659
+ }
33660
+ if (MISSING_DEPENDENCY_CODES.has(code) || isSpawnEnoent(error)) {
33661
+ return "missing_dependency";
33662
+ }
33663
+ }
33664
+ const message = stringField(error, "message");
33665
+ if (message?.includes("fetch failed") === true) {
33666
+ return "network_http";
33667
+ }
33668
+ const name = stringField(error, "name");
33669
+ if (name && INTERNAL_ERROR_NAMES.has(name)) {
33670
+ return "internal";
33671
+ }
33672
+ return;
33673
+ }
33674
+ function classifyError2(input) {
33675
+ const recorded = input.recordedFailure;
33676
+ if (recorded?.errorClass) {
33677
+ return recorded.errorClass;
33678
+ }
33679
+ const status = recorded?.context?.httpStatus;
33680
+ if (status !== undefined) {
33681
+ return classifyHttpStatus(status);
33682
+ }
33683
+ return classifyFromResult(recorded?.result) ?? classifyFromErrorCode(recorded?.errorCode) ?? classifyFromError(input.error) ?? "unknown";
33684
+ }
33685
+ function recordCommandFailureTelemetry(failure) {
33686
+ recordedFailureSlot.set(failure);
33687
+ }
33688
+ function clearRecordedCommandFailureTelemetry() {
33689
+ recordedFailureSlot.clear();
33690
+ }
33691
+ function takeRecordedCommandFailureTelemetry() {
33692
+ const failure = recordedFailureSlot.get();
33693
+ recordedFailureSlot.clear();
33694
+ return failure;
33695
+ }
33696
+ function buildCommandTerminalTelemetryProperties(input) {
33697
+ const cancelled = isCancellationError(input.error, input.exitCode, input.pollSignal);
33698
+ const outcome = input.recordedFailure?.terminalOutcome ?? (input.exitCode === 0 ? "success" : cancelled ? "cancelled" : "failure");
33699
+ const errorClass = outcome === "success" || outcome === "no_op" ? undefined : outcome === "cancelled" ? "user_cancelled" : classifyError2(input);
33700
+ const terminalSignal = terminalSignalFor(input, outcome);
33701
+ return {
33702
+ exit_code: input.exitCode,
33703
+ terminal_outcome: outcome,
33704
+ ...errorClass ? { error_class: errorClass } : {},
33705
+ ...terminalSignal ? { terminal_signal: terminalSignal } : {}
33706
+ };
33707
+ }
33708
+
33491
33709
  // ../common/src/telemetry/telemetry-events.ts
33492
33710
  var CommonTelemetryEvents = {
33493
- Error: "uip.error"
33711
+ Error: "uip.error",
33712
+ ShipSucceeded: "ship_succeeded"
33494
33713
  };
33495
33714
 
33496
33715
  // ../common/src/registry.ts
@@ -33557,6 +33776,136 @@ function formatMessage(category, name, properties) {
33557
33776
  }
33558
33777
  return message;
33559
33778
  }
33779
+ // ../common/src/telemetry/detect-agent.ts
33780
+ var KNOWN_AGENTS = [
33781
+ { envVar: "CLAUDECODE", value: "1", id: "claude-code" },
33782
+ { envVar: "CURSOR_AGENT", value: "1", id: "cursor" },
33783
+ { envVar: "GEMINI_CLI", value: "1", id: "gemini-cli" },
33784
+ { envVar: "CODEX_THREAD_ID", id: "codex" },
33785
+ { envVar: "CODEX_SANDBOX", id: "codex" },
33786
+ { envVar: "AUGMENT_AGENT", value: "1", id: "augment" },
33787
+ { envVar: "CLINE_ACTIVE", value: "true", id: "cline" }
33788
+ ];
33789
+ function detectAgentFromEnv(env) {
33790
+ for (const agent of KNOWN_AGENTS) {
33791
+ const envValue = env[agent.envVar];
33792
+ if (agent.value !== undefined) {
33793
+ if (envValue === agent.value)
33794
+ return agent.id;
33795
+ } else {
33796
+ if (envValue)
33797
+ return agent.id;
33798
+ }
33799
+ }
33800
+ const agentEnv = env.AGENT;
33801
+ if (agentEnv) {
33802
+ if (agentEnv === "1" || agentEnv === "true")
33803
+ return "unknown";
33804
+ if (agentEnv.length <= 32)
33805
+ return agentEnv.toLowerCase();
33806
+ }
33807
+ return;
33808
+ }
33809
+ // ../common/src/telemetry/environment-info.ts
33810
+ var LOCAL_HOSTS = new Set(["localhost", "127.0.0.1", "::1", "[::1]"]);
33811
+ // ../common/src/telemetry/execution-context.ts
33812
+ var authSignalSlot = singleton("TelemetryExecutionContextAuthSignal");
33813
+ var isTruthy = (value) => value !== undefined && value !== "" && value !== "0" && value.toLowerCase() !== "false";
33814
+ var isEqual = (value, expected) => value?.toLowerCase() === expected;
33815
+ var CI_SIGNATURES = [
33816
+ {
33817
+ provider: "github_actions",
33818
+ matches: (env) => isTruthy(env.GITHUB_ACTIONS),
33819
+ isScheduler: (env) => env.GITHUB_EVENT_NAME === "schedule"
33820
+ },
33821
+ {
33822
+ provider: "azure_devops",
33823
+ matches: (env) => isTruthy(env.TF_BUILD),
33824
+ isScheduler: (env) => isEqual(env.BUILD_REASON, "schedule")
33825
+ },
33826
+ {
33827
+ provider: "gitlab",
33828
+ matches: (env) => isTruthy(env.GITLAB_CI),
33829
+ isScheduler: (env) => env.CI_PIPELINE_SOURCE === "schedule"
33830
+ },
33831
+ {
33832
+ provider: "circleci",
33833
+ matches: (env) => isTruthy(env.CIRCLECI),
33834
+ isScheduler: (env) => env.CIRCLE_PIPELINE_TRIGGER_SOURCE === "scheduled_pipeline"
33835
+ },
33836
+ {
33837
+ provider: "jenkins",
33838
+ matches: (env) => isTruthy(env.JENKINS_URL) || isTruthy(env.JENKINS_HOME)
33839
+ },
33840
+ {
33841
+ provider: "teamcity",
33842
+ matches: (env) => isTruthy(env.TEAMCITY_VERSION)
33843
+ },
33844
+ {
33845
+ provider: "buildkite",
33846
+ matches: (env) => isTruthy(env.BUILDKITE),
33847
+ isScheduler: (env) => env.BUILDKITE_SOURCE === "schedule"
33848
+ },
33849
+ {
33850
+ provider: "bitbucket",
33851
+ matches: (env) => isTruthy(env.BITBUCKET_BUILD_NUMBER)
33852
+ },
33853
+ {
33854
+ provider: "travis",
33855
+ matches: (env) => isTruthy(env.TRAVIS)
33856
+ },
33857
+ {
33858
+ provider: "appveyor",
33859
+ matches: (env) => isTruthy(env.APPVEYOR)
33860
+ },
33861
+ {
33862
+ provider: "generic",
33863
+ matches: (env) => isTruthy(env.CI)
33864
+ }
33865
+ ];
33866
+ function currentEnv() {
33867
+ return typeof process === "undefined" ? {} : process.env;
33868
+ }
33869
+ function currentTtyState() {
33870
+ if (typeof process === "undefined")
33871
+ return false;
33872
+ return Boolean(process.stdout?.isTTY || process.stdin?.isTTY || process.stderr?.isTTY);
33873
+ }
33874
+ function detectCi(env) {
33875
+ const signature = CI_SIGNATURES.find((candidate) => candidate.matches(env));
33876
+ if (!signature)
33877
+ return;
33878
+ return {
33879
+ executionContext: signature.isScheduler?.(env) ? "scheduler" : "ci",
33880
+ ciProvider: signature.provider
33881
+ };
33882
+ }
33883
+ function detectExecutionContext(options = {}) {
33884
+ const env = options.env ?? currentEnv();
33885
+ const ci = detectCi(env);
33886
+ if (ci)
33887
+ return ci;
33888
+ const agent = options.agent ?? detectAgentFromEnv(env);
33889
+ if (agent) {
33890
+ return { executionContext: "agent" };
33891
+ }
33892
+ const authSignal = options.authSignal ?? authSignalSlot.get();
33893
+ if (authSignal === "service_account") {
33894
+ return { executionContext: "service_account" };
33895
+ }
33896
+ const isTty = options.isTty ?? currentTtyState();
33897
+ if (isTty) {
33898
+ return { executionContext: "manual" };
33899
+ }
33900
+ return { executionContext: "unknown" };
33901
+ }
33902
+ function getExecutionContextTelemetryProperties() {
33903
+ const detected = detectExecutionContext();
33904
+ return {
33905
+ execution_context: detected.executionContext,
33906
+ ...detected.ciProvider ? { ci_provider: detected.ciProvider } : {}
33907
+ };
33908
+ }
33560
33909
  // ../common/src/telemetry/node-context-storage.ts
33561
33910
  import { AsyncLocalStorage } from "node:async_hooks";
33562
33911
 
@@ -33569,6 +33918,26 @@ class NodeContextStorage {
33569
33918
  return this.storage.getStore();
33570
33919
  }
33571
33920
  }
33921
+ // ../common/src/telemetry/session-id.ts
33922
+ var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
33923
+ var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
33924
+ var telemetrySessionIdSlot = singleton("TelemetrySessionId");
33925
+ function getProcessEnv() {
33926
+ return globalThis.process?.env;
33927
+ }
33928
+ function normalizeSessionId(value) {
33929
+ if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
33930
+ return;
33931
+ }
33932
+ const trimmed = String(value).trim();
33933
+ return trimmed || undefined;
33934
+ }
33935
+ function getConfiguredTelemetrySessionId() {
33936
+ return normalizeSessionId(getProcessEnv()?.[TELEMETRY_SESSION_ID_ENV]);
33937
+ }
33938
+ function resolveTelemetrySessionId(existingSessionId) {
33939
+ return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
33940
+ }
33572
33941
  // ../common/src/telemetry/global-telemetry-properties.ts
33573
33942
  var telemetryPropsSlot = singleton("TelemetryDefaultProps");
33574
33943
  function getGlobalTelemetryProperties() {
@@ -33653,12 +34022,22 @@ class TelemetryService {
33653
34022
  return this.contextStorage.getContext();
33654
34023
  }
33655
34024
  enrichPropertiesWithContext(properties, context) {
33656
- return {
33657
- ...getGlobalTelemetryProperties(),
34025
+ const globalProperties = getGlobalTelemetryProperties();
34026
+ const existingSessionId = properties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? this.defaultProperties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? globalProperties?.[TELEMETRY_SESSION_ID_PROPERTY];
34027
+ const sessionId = resolveTelemetrySessionId(existingSessionId);
34028
+ const enriched = {
34029
+ ...getExecutionContextTelemetryProperties(),
34030
+ ...globalProperties,
33658
34031
  ...this.defaultProperties,
33659
34032
  ...properties,
33660
34033
  ...context
33661
34034
  };
34035
+ if (sessionId === undefined) {
34036
+ delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
34037
+ } else {
34038
+ enriched[TELEMETRY_SESSION_ID_PROPERTY] = sessionId;
34039
+ }
34040
+ return enriched;
33662
34041
  }
33663
34042
  generateId() {
33664
34043
  return crypto.randomUUID().replaceAll("-", "");
@@ -34128,8 +34507,24 @@ var OutputFormatter;
34128
34507
  data.ErrorCode ??= defaultErrorCodeForFailure(data);
34129
34508
  data.Retry ??= defaultRetryForErrorCode(data.ErrorCode);
34130
34509
  process.exitCode = EXIT_CODES[data.Result] ?? 1;
34131
- const { SuppressTelemetry, ...envelope } = data;
34132
- if (!SuppressTelemetry) {
34510
+ recordCommandFailureTelemetry({
34511
+ result: data.Result,
34512
+ errorCode: data.ErrorCode,
34513
+ retry: data.Retry,
34514
+ message: data.Message,
34515
+ context: data.Context,
34516
+ exitCode: process.exitCode,
34517
+ errorClass: data.TelemetryErrorClass,
34518
+ terminalOutcome: data.TelemetryTerminalOutcome,
34519
+ terminalSignal: data.TelemetryTerminalSignal
34520
+ });
34521
+ const suppressTelemetry = data.SuppressTelemetry === true;
34522
+ const envelope = { ...data };
34523
+ delete envelope.SuppressTelemetry;
34524
+ delete envelope.TelemetryErrorClass;
34525
+ delete envelope.TelemetryTerminalOutcome;
34526
+ delete envelope.TelemetryTerminalSignal;
34527
+ if (!suppressTelemetry) {
34133
34528
  telemetry.trackEvent(CommonTelemetryEvents.Error, {
34134
34529
  result: data.Result,
34135
34530
  errorCode: data.ErrorCode,
@@ -34192,6 +34587,158 @@ var OutputFormatter;
34192
34587
  OutputFormatter.formatToString = formatToString;
34193
34588
  })(OutputFormatter ||= {});
34194
34589
 
34590
+ // ../common/src/telemetry/command-attribution.ts
34591
+ var LEGACY_SKILL_NAMESPACE = "uipath:";
34592
+ var MAX_SKILL_NAME_LENGTH = 80;
34593
+ var SKILL_NAME_PATTERN = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
34594
+ function productMode(productArea, mode) {
34595
+ return { product_area: productArea, mode };
34596
+ }
34597
+ function attributionRecord(groups) {
34598
+ const record = {};
34599
+ for (const [productArea, mode, names] of groups) {
34600
+ const attribution = productMode(productArea, mode);
34601
+ for (const name of names) {
34602
+ record[name] = attribution;
34603
+ }
34604
+ }
34605
+ return record;
34606
+ }
34607
+ function commandAttribution(groups) {
34608
+ const entries = [];
34609
+ for (const [productArea, mode, prefixes] of groups) {
34610
+ const attribution = productMode(productArea, mode);
34611
+ for (const prefix of prefixes) {
34612
+ entries.push({ prefix, attribution });
34613
+ }
34614
+ }
34615
+ return entries;
34616
+ }
34617
+ var SKILL_ATTRIBUTION = attributionRecord([
34618
+ ["admin", "operate", ["uipath-admin"]],
34619
+ ["agents", "build", ["uipath-agents"]],
34620
+ ["api-workflow", "build", ["uipath-api-workflow"]],
34621
+ ["automation-discovery", "build", ["uipath-automation-discovery"]],
34622
+ ["coded-apps", "build", ["uipath-coded-apps"]],
34623
+ ["data-fabric", "operate", ["uipath-data-fabric"]],
34624
+ ["cli", "troubleshoot", ["uipath-feedback"]],
34625
+ ["governance", "operate", ["uipath-governance"]],
34626
+ ["action-center", "build", ["uipath-human-in-the-loop"]],
34627
+ ["document-understanding", "build", ["uipath-ixp"]],
34628
+ [
34629
+ "maestro",
34630
+ "build",
34631
+ ["uipath-maestro-bpmn", "uipath-maestro-case", "uipath-maestro-flow"]
34632
+ ],
34633
+ ["agenthub", "build", ["uipath-mcp-servers"]],
34634
+ ["solution", "build", ["uipath-planner", "uipath-solution"]],
34635
+ ["platform", "operate", ["uipath-platform"]],
34636
+ ["quality", "troubleshoot", ["uipath-review"]],
34637
+ ["rpa", "build", ["uipath-rpa"]],
34638
+ ["cli", "operate", ["uipath-skill-catalog"]],
34639
+ ["action-center", "operate", ["uipath-tasks"]],
34640
+ ["test-manager", "operate", ["uipath-test"]],
34641
+ ["platform", "troubleshoot", ["uipath-troubleshoot"]]
34642
+ ]);
34643
+ var KNOWN_SKILL_NAMES = new Set(Object.keys(SKILL_ATTRIBUTION));
34644
+ var COMMAND_ATTRIBUTION = commandAttribution([
34645
+ ["cli", "troubleshoot", ["uip.feedback"]],
34646
+ ["llm-gateway", "operate", ["uip.llm-configuration", "uip.model-hub"]],
34647
+ ["context-grounding", "build", ["uip.context-grounding"]],
34648
+ ["api-workflow", "build", ["uip.api-workflow"]],
34649
+ ["rpa", "build", ["uip.rpa-legacy"]],
34650
+ ["conversational", "operate", ["uip.conversational"]],
34651
+ ["agents", "build", ["uip.codedagent", "uip.agent"]],
34652
+ ["agenthub", "build", ["uip.agenthub"]],
34653
+ ["coded-apps", "build", ["uip.codedapp"]],
34654
+ ["functions", "build", ["uip.functions"]],
34655
+ ["solution", "build", ["uip.solution"]],
34656
+ ["maestro", "build", ["uip.maestro", "uip.case", "uip.flow"]],
34657
+ ["llm-observability", "troubleshoot", ["uip.traces"]],
34658
+ ["platform", "operate", ["uip.platform"]],
34659
+ ["admin", "operate", ["uip.admin"]],
34660
+ ["automation-ops", "operate", ["uip.aops"]],
34661
+ ["documentation", "troubleshoot", ["uip.docsai"]],
34662
+ ["governance", "operate", ["uip.gov"]],
34663
+ ["insights", "operate", ["uip.insights"]],
34664
+ ["document-understanding", "build", ["uip.ixp"]],
34665
+ ["process-mining", "operate", ["uip.pm"]],
34666
+ ["action-center", "operate", ["uip.tasks"]],
34667
+ ["test-manager", "operate", ["uip.tm"]],
34668
+ ["vertical-solutions", "build", ["uip.vss"]],
34669
+ ["data-fabric", "operate", ["uip.df"]],
34670
+ ["integration-service", "build", ["uip.is"]],
34671
+ ["orchestrator", "operate", ["uip.or"]],
34672
+ [
34673
+ "cli",
34674
+ "operate",
34675
+ [
34676
+ "uip.login",
34677
+ "uip.logout",
34678
+ "uip.user",
34679
+ "uip.config",
34680
+ "uip.tools",
34681
+ "uip.skills",
34682
+ "uip.completion",
34683
+ "uip.update",
34684
+ "uip.mcp",
34685
+ "uip.track"
34686
+ ]
34687
+ ]
34688
+ ]).sort((a, b) => b.prefix.length - a.prefix.length);
34689
+ function normalizeCommandPath(value) {
34690
+ if (typeof value !== "string") {
34691
+ return;
34692
+ }
34693
+ const trimmed = value.trim().toLowerCase();
34694
+ if (!trimmed) {
34695
+ return;
34696
+ }
34697
+ const tokens = trimmed.includes(" ") ? trimmed.split(/\s+/).filter((token) => token.length > 0).filter((token) => !token.startsWith("-")) : trimmed.split(".").filter((token) => token.length > 0);
34698
+ if (tokens.length === 0) {
34699
+ return;
34700
+ }
34701
+ const commandTokens = tokens[0] === "uip" ? tokens : ["uip", ...tokens];
34702
+ return commandTokens.join(".");
34703
+ }
34704
+ function getCommandProductModeAttribution(commandPath) {
34705
+ const normalized = normalizeCommandPath(commandPath);
34706
+ if (!normalized) {
34707
+ return;
34708
+ }
34709
+ return COMMAND_ATTRIBUTION.find(({ prefix }) => normalized === prefix || normalized.startsWith(`${prefix}.`))?.attribution;
34710
+ }
34711
+ function normalizeSkillNameWithOptions(value, options) {
34712
+ if (typeof value !== "string") {
34713
+ return;
34714
+ }
34715
+ const normalized = value.trim().toLowerCase();
34716
+ if (!normalized) {
34717
+ return;
34718
+ }
34719
+ const hasLegacyNamespace = normalized.startsWith(LEGACY_SKILL_NAMESPACE);
34720
+ if (hasLegacyNamespace && !options.allowLegacyNamespace) {
34721
+ return;
34722
+ }
34723
+ const skillName = hasLegacyNamespace ? normalized.slice(LEGACY_SKILL_NAMESPACE.length) : normalized;
34724
+ if (skillName.length > MAX_SKILL_NAME_LENGTH || !SKILL_NAME_PATTERN.test(skillName) || !KNOWN_SKILL_NAMES.has(skillName)) {
34725
+ return;
34726
+ }
34727
+ return skillName;
34728
+ }
34729
+ function normalizeSkillName(value) {
34730
+ return normalizeSkillNameWithOptions(value, {
34731
+ allowLegacyNamespace: false
34732
+ });
34733
+ }
34734
+ function buildCommandTelemetryAttribution(commandPath, skillSource) {
34735
+ const skillName = normalizeSkillName(skillSource);
34736
+ return {
34737
+ ...skillName ? { skill_name: skillName } : {},
34738
+ ...getCommandProductModeAttribution(commandPath)
34739
+ };
34740
+ }
34741
+
34195
34742
  // ../common/src/telemetry/pii-redactor.ts
34196
34743
  var REDACTED = "[REDACTED]";
34197
34744
  var MAX_VALUE_LENGTH = 200;
@@ -34377,6 +34924,12 @@ function commandHelpHint(commandPath) {
34377
34924
  const command = commandPath.replace(/\./g, " ");
34378
34925
  return `An unexpected error occurred. Run '${command} --help' to verify command syntax, or run with --log-level debug for details.`;
34379
34926
  }
34927
+ function isPromptCancellation(error) {
34928
+ return error instanceof Error && error.name === "ExitPromptError";
34929
+ }
34930
+ function exitCodeFromProcess(fallback) {
34931
+ return typeof process.exitCode === "number" ? process.exitCode : fallback;
34932
+ }
34380
34933
  Command.prototype.trackedAction = function(context, fn, properties) {
34381
34934
  const command = this;
34382
34935
  return this.action(async (...args) => {
@@ -34384,6 +34937,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
34384
34937
  const props = typeof properties === "function" ? properties(...args) : properties;
34385
34938
  const startTime = performance.now();
34386
34939
  let errorMessage;
34940
+ let fallbackExitCode = EXIT_CODES.Success;
34941
+ clearRecordedCommandFailureTelemetry();
34387
34942
  const [error] = await catchError(fn(...args));
34388
34943
  if (error) {
34389
34944
  errorMessage = error instanceof Error ? error.message : String(error);
@@ -34398,6 +34953,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
34398
34953
  const customRetry = isRetryHint(typedRetry) ? typedRetry : undefined;
34399
34954
  const typedContext = typed.context ?? typed.Context;
34400
34955
  const customContext = isErrorContext(typedContext) ? typedContext : undefined;
34956
+ const cancellationExitCode = typed.exitCode === 130 || isPromptCancellation(error) ? 130 : undefined;
34957
+ fallbackExitCode = cancellationExitCode ?? EXIT_CODES[finalResult];
34401
34958
  OutputFormatter.error({
34402
34959
  Result: finalResult,
34403
34960
  ...customErrorCode ? { ErrorCode: customErrorCode } : {},
@@ -34406,16 +34963,26 @@ Command.prototype.trackedAction = function(context, fn, properties) {
34406
34963
  ...customRetry ? { Retry: customRetry } : {},
34407
34964
  ...customContext ? { Context: customContext } : {}
34408
34965
  });
34409
- context.exit(EXIT_CODES[finalResult]);
34966
+ context.exit(fallbackExitCode);
34410
34967
  }
34411
34968
  const durationMs = performance.now() - startTime;
34412
- const success = !error && (process.exitCode === undefined || process.exitCode === 0);
34969
+ const exitCode = fallbackExitCode === 130 ? fallbackExitCode : exitCodeFromProcess(fallbackExitCode);
34970
+ const recordedFailure = takeRecordedCommandFailureTelemetry();
34971
+ const success = !error && exitCode === 0;
34972
+ const terminalTelemetry = buildCommandTerminalTelemetryProperties({
34973
+ error,
34974
+ exitCode,
34975
+ recordedFailure,
34976
+ pollSignal: context.pollSignal
34977
+ });
34413
34978
  telemetry.trackEvent(telemetryName, redactProperties({
34414
34979
  ...extractCommandParams(command),
34415
34980
  ...props,
34981
+ ...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
34416
34982
  command: "true",
34417
34983
  duration: String(durationMs),
34418
34984
  success: String(success),
34985
+ ...terminalTelemetry,
34419
34986
  ...errorMessage ? { errorMessage } : {}
34420
34987
  }));
34421
34988
  });
@@ -34979,6 +35546,8 @@ function installRequestHeaderForwarding(BaseApiClass, patchKey, forward) {
34979
35546
  function installSdkUserAgentHeader(BaseApiClass, userAgent) {
34980
35547
  installRequestHeaderForwarding(BaseApiClass, userAgentPatchKey(userAgent), (headers) => addSdkUserAgentHeader(headers, userAgent));
34981
35548
  }
35549
+ // ../common/src/telemetry/ship-succeeded.ts
35550
+ var shippedKeysSlot = singleton("ShipSucceededDedupeKeys");
34982
35551
  // ../common/src/tool-provider.ts
34983
35552
  var factorySlot = singleton("PackagerFactoryProvider");
34984
35553
  // ../pipelines-sdk/generated/src/runtime.ts
@@ -36335,7 +36904,7 @@ function coerceWorkflowErrorMessage(raw) {
36335
36904
  const trimmed = raw.trim();
36336
36905
  return trimmed ? { errorMessage: trimmed } : undefined;
36337
36906
  }
36338
- if (!isRecord(raw)) {
36907
+ if (!isRecord2(raw)) {
36339
36908
  return { errorMessage: String(raw) };
36340
36909
  }
36341
36910
  if (typeof raw.errorMessage === "string" && raw.errorMessage.trim()) {
@@ -36348,7 +36917,7 @@ function coerceWorkflowErrorMessage(raw) {
36348
36917
  }
36349
36918
  return { errorMessage: stringifyUnexpectedWorkflowError(raw) };
36350
36919
  }
36351
- function isRecord(value) {
36920
+ function isRecord2(value) {
36352
36921
  return typeof value === "object" && value !== null;
36353
36922
  }
36354
36923
  function stringifyUnexpectedWorkflowError(value) {
@@ -36669,7 +37238,7 @@ class JSONApiResponse2 {
36669
37238
  var package_default2 = {
36670
37239
  name: "@uipath/solution-sdk",
36671
37240
  license: "MIT",
36672
- version: "1.197.0-preview.64",
37241
+ version: "1.197.0-preview.66",
36673
37242
  repository: {
36674
37243
  type: "git",
36675
37244
  url: "https://github.com/UiPath/cli.git",
@@ -42232,4 +42801,4 @@ export {
42232
42801
  activateDeploymentAsync
42233
42802
  };
42234
42803
 
42235
- //# debugId=09D902948C1C2D2264756E2164756E21
42804
+ //# debugId=6B2DB30D4487950764756E2164756E21