@uipath/solution-sdk 1.197.0-preview.65 → 1.197.0-preview.67

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/index.js +585 -16
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -2535,7 +2535,7 @@ class TextApiResponse {
2535
2535
  var package_default = {
2536
2536
  name: "@uipath/solution-sdk",
2537
2537
  license: "MIT",
2538
- version: "1.197.0-preview.65",
2538
+ version: "1.197.0-preview.67",
2539
2539
  repository: {
2540
2540
  type: "git",
2541
2541
  url: "https://github.com/UiPath/cli.git",
@@ -10447,9 +10447,228 @@ function getOutputFilter() {
10447
10447
  return filterSlot.get();
10448
10448
  }
10449
10449
 
10450
+ // ../common/src/telemetry/command-terminal.ts
10451
+ var recordedFailureSlot = singleton("CommandTelemetryFailure");
10452
+ var AUTH_ERROR_CODES = new Set([
10453
+ "authentication_required",
10454
+ "permission_denied"
10455
+ ]);
10456
+ var VALIDATION_ERROR_CODES = new Set(["invalid_argument"]);
10457
+ var NETWORK_HTTP_ERROR_CODES = new Set([
10458
+ "network_error",
10459
+ "rate_limited",
10460
+ "server_error",
10461
+ "not_found",
10462
+ "method_not_allowed"
10463
+ ]);
10464
+ var TIMEOUT_ERROR_CODES = new Set(["timeout"]);
10465
+ var NETWORK_OS_ERROR_CODES = new Set([
10466
+ "ECONNREFUSED",
10467
+ "ECONNRESET",
10468
+ "ENOTFOUND",
10469
+ "EAI_AGAIN",
10470
+ "EPIPE",
10471
+ "EHOSTUNREACH",
10472
+ "ENETUNREACH",
10473
+ "EAI_FAIL"
10474
+ ]);
10475
+ var TIMEOUT_OS_ERROR_CODES = new Set(["ETIMEDOUT", "ESOCKETTIMEDOUT"]);
10476
+ var TLS_ERROR_CODES2 = new Set([
10477
+ "SELF_SIGNED_CERT_IN_CHAIN",
10478
+ "DEPTH_ZERO_SELF_SIGNED_CERT",
10479
+ "UNABLE_TO_VERIFY_LEAF_SIGNATURE",
10480
+ "UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
10481
+ "UNABLE_TO_GET_ISSUER_CERT",
10482
+ "CERT_HAS_EXPIRED",
10483
+ "CERT_UNTRUSTED",
10484
+ "ERR_TLS_CERT_ALTNAME_INVALID"
10485
+ ]);
10486
+ var MISSING_DEPENDENCY_CODES = new Set([
10487
+ "MODULE_NOT_FOUND",
10488
+ "ERR_MODULE_NOT_FOUND"
10489
+ ]);
10490
+ var INTERNAL_ERROR_NAMES = new Set([
10491
+ "TypeError",
10492
+ "ReferenceError",
10493
+ "SyntaxError",
10494
+ "RangeError"
10495
+ ]);
10496
+ function isRecord(value) {
10497
+ return value !== null && typeof value === "object";
10498
+ }
10499
+ function stringField(value, field) {
10500
+ if (!isRecord(value)) {
10501
+ return;
10502
+ }
10503
+ const raw = value[field];
10504
+ return typeof raw === "string" ? raw : undefined;
10505
+ }
10506
+ function numberField(value, field) {
10507
+ if (!isRecord(value)) {
10508
+ return;
10509
+ }
10510
+ const raw = value[field];
10511
+ return typeof raw === "number" ? raw : undefined;
10512
+ }
10513
+ function findStringInCauseChain(error, field) {
10514
+ let current = error;
10515
+ for (let depth = 0;depth < 5 && current !== null && typeof current === "object"; depth++) {
10516
+ const value = stringField(current, field);
10517
+ if (value) {
10518
+ return value;
10519
+ }
10520
+ current = current.cause;
10521
+ }
10522
+ return;
10523
+ }
10524
+ function findCodeInCauseChain(error) {
10525
+ return findStringInCauseChain(error, "code");
10526
+ }
10527
+ function isSpawnEnoent(error) {
10528
+ const code = findCodeInCauseChain(error);
10529
+ if (code !== "ENOENT") {
10530
+ return false;
10531
+ }
10532
+ const syscall = findStringInCauseChain(error, "syscall");
10533
+ return syscall?.startsWith("spawn") === true;
10534
+ }
10535
+ function isCancellationError(error, exitCode, pollSignal) {
10536
+ if (exitCode === 130) {
10537
+ return true;
10538
+ }
10539
+ if (!isRecord(error)) {
10540
+ return false;
10541
+ }
10542
+ if (numberField(error, "exitCode") === 130) {
10543
+ return true;
10544
+ }
10545
+ const name = stringField(error, "name");
10546
+ if (name === "ExitPromptError") {
10547
+ return true;
10548
+ }
10549
+ if (name === "AbortError" && pollSignal?.aborted) {
10550
+ return true;
10551
+ }
10552
+ const message = stringField(error, "message");
10553
+ return message?.includes("SIGINT") === true;
10554
+ }
10555
+ function terminalSignalFor(input, outcome) {
10556
+ if (input.recordedFailure?.terminalSignal) {
10557
+ return input.recordedFailure.terminalSignal;
10558
+ }
10559
+ const explicit = findStringInCauseChain(input.error, "terminalSignal") ?? findStringInCauseChain(input.error, "signal");
10560
+ if (explicit) {
10561
+ return explicit;
10562
+ }
10563
+ return outcome === "cancelled" ? "SIGINT" : undefined;
10564
+ }
10565
+ function classifyHttpStatus(status) {
10566
+ if (status === 401 || status === 403) {
10567
+ return "auth";
10568
+ }
10569
+ if (status === 400 || status === 409 || status === 422) {
10570
+ return "validation";
10571
+ }
10572
+ if (status === 408) {
10573
+ return "timeout";
10574
+ }
10575
+ return "network_http";
10576
+ }
10577
+ function classifyFromResult(result) {
10578
+ switch (result) {
10579
+ case "AuthenticationError":
10580
+ return "auth";
10581
+ case "ValidationError":
10582
+ return "validation";
10583
+ case "TimeoutError":
10584
+ return "timeout";
10585
+ default:
10586
+ return;
10587
+ }
10588
+ }
10589
+ function classifyFromErrorCode(errorCode) {
10590
+ if (!errorCode) {
10591
+ return;
10592
+ }
10593
+ if (AUTH_ERROR_CODES.has(errorCode)) {
10594
+ return "auth";
10595
+ }
10596
+ if (VALIDATION_ERROR_CODES.has(errorCode)) {
10597
+ return "validation";
10598
+ }
10599
+ if (TIMEOUT_ERROR_CODES.has(errorCode)) {
10600
+ return "timeout";
10601
+ }
10602
+ if (NETWORK_HTTP_ERROR_CODES.has(errorCode)) {
10603
+ return "network_http";
10604
+ }
10605
+ return;
10606
+ }
10607
+ function classifyFromError(error) {
10608
+ const code = findCodeInCauseChain(error);
10609
+ if (code) {
10610
+ if (code.startsWith("commander.")) {
10611
+ return "validation";
10612
+ }
10613
+ if (NETWORK_OS_ERROR_CODES.has(code) || TLS_ERROR_CODES2.has(code)) {
10614
+ return "network_http";
10615
+ }
10616
+ if (TIMEOUT_OS_ERROR_CODES.has(code)) {
10617
+ return "timeout";
10618
+ }
10619
+ if (MISSING_DEPENDENCY_CODES.has(code) || isSpawnEnoent(error)) {
10620
+ return "missing_dependency";
10621
+ }
10622
+ }
10623
+ const message = stringField(error, "message");
10624
+ if (message?.includes("fetch failed") === true) {
10625
+ return "network_http";
10626
+ }
10627
+ const name = stringField(error, "name");
10628
+ if (name && INTERNAL_ERROR_NAMES.has(name)) {
10629
+ return "internal";
10630
+ }
10631
+ return;
10632
+ }
10633
+ function classifyError(input) {
10634
+ const recorded = input.recordedFailure;
10635
+ if (recorded?.errorClass) {
10636
+ return recorded.errorClass;
10637
+ }
10638
+ const status = recorded?.context?.httpStatus;
10639
+ if (status !== undefined) {
10640
+ return classifyHttpStatus(status);
10641
+ }
10642
+ return classifyFromResult(recorded?.result) ?? classifyFromErrorCode(recorded?.errorCode) ?? classifyFromError(input.error) ?? "unknown";
10643
+ }
10644
+ function recordCommandFailureTelemetry(failure) {
10645
+ recordedFailureSlot.set(failure);
10646
+ }
10647
+ function clearRecordedCommandFailureTelemetry() {
10648
+ recordedFailureSlot.clear();
10649
+ }
10650
+ function takeRecordedCommandFailureTelemetry() {
10651
+ const failure = recordedFailureSlot.get();
10652
+ recordedFailureSlot.clear();
10653
+ return failure;
10654
+ }
10655
+ function buildCommandTerminalTelemetryProperties(input) {
10656
+ const cancelled = isCancellationError(input.error, input.exitCode, input.pollSignal);
10657
+ const outcome = input.recordedFailure?.terminalOutcome ?? (input.exitCode === 0 ? "success" : cancelled ? "cancelled" : "failure");
10658
+ const errorClass = outcome === "success" || outcome === "no_op" ? undefined : outcome === "cancelled" ? "user_cancelled" : classifyError(input);
10659
+ const terminalSignal = terminalSignalFor(input, outcome);
10660
+ return {
10661
+ exit_code: input.exitCode,
10662
+ terminal_outcome: outcome,
10663
+ ...errorClass ? { error_class: errorClass } : {},
10664
+ ...terminalSignal ? { terminal_signal: terminalSignal } : {}
10665
+ };
10666
+ }
10667
+
10450
10668
  // ../common/src/telemetry/telemetry-events.ts
10451
10669
  var CommonTelemetryEvents = {
10452
- Error: "uip.error"
10670
+ Error: "uip.error",
10671
+ ShipSucceeded: "ship_succeeded"
10453
10672
  };
10454
10673
 
10455
10674
  // ../common/src/registry.ts
@@ -10516,6 +10735,136 @@ function formatMessage(category, name, properties) {
10516
10735
  }
10517
10736
  return message;
10518
10737
  }
10738
+ // ../common/src/telemetry/detect-agent.ts
10739
+ var KNOWN_AGENTS = [
10740
+ { envVar: "CLAUDECODE", value: "1", id: "claude-code" },
10741
+ { envVar: "CURSOR_AGENT", value: "1", id: "cursor" },
10742
+ { envVar: "GEMINI_CLI", value: "1", id: "gemini-cli" },
10743
+ { envVar: "CODEX_THREAD_ID", id: "codex" },
10744
+ { envVar: "CODEX_SANDBOX", id: "codex" },
10745
+ { envVar: "AUGMENT_AGENT", value: "1", id: "augment" },
10746
+ { envVar: "CLINE_ACTIVE", value: "true", id: "cline" }
10747
+ ];
10748
+ function detectAgentFromEnv(env) {
10749
+ for (const agent of KNOWN_AGENTS) {
10750
+ const envValue = env[agent.envVar];
10751
+ if (agent.value !== undefined) {
10752
+ if (envValue === agent.value)
10753
+ return agent.id;
10754
+ } else {
10755
+ if (envValue)
10756
+ return agent.id;
10757
+ }
10758
+ }
10759
+ const agentEnv = env.AGENT;
10760
+ if (agentEnv) {
10761
+ if (agentEnv === "1" || agentEnv === "true")
10762
+ return "unknown";
10763
+ if (agentEnv.length <= 32)
10764
+ return agentEnv.toLowerCase();
10765
+ }
10766
+ return;
10767
+ }
10768
+ // ../common/src/telemetry/environment-info.ts
10769
+ var LOCAL_HOSTS = new Set(["localhost", "127.0.0.1", "::1", "[::1]"]);
10770
+ // ../common/src/telemetry/execution-context.ts
10771
+ var authSignalSlot = singleton("TelemetryExecutionContextAuthSignal");
10772
+ var isTruthy = (value) => value !== undefined && value !== "" && value !== "0" && value.toLowerCase() !== "false";
10773
+ var isEqual = (value, expected) => value?.toLowerCase() === expected;
10774
+ var CI_SIGNATURES = [
10775
+ {
10776
+ provider: "github_actions",
10777
+ matches: (env) => isTruthy(env.GITHUB_ACTIONS),
10778
+ isScheduler: (env) => env.GITHUB_EVENT_NAME === "schedule"
10779
+ },
10780
+ {
10781
+ provider: "azure_devops",
10782
+ matches: (env) => isTruthy(env.TF_BUILD),
10783
+ isScheduler: (env) => isEqual(env.BUILD_REASON, "schedule")
10784
+ },
10785
+ {
10786
+ provider: "gitlab",
10787
+ matches: (env) => isTruthy(env.GITLAB_CI),
10788
+ isScheduler: (env) => env.CI_PIPELINE_SOURCE === "schedule"
10789
+ },
10790
+ {
10791
+ provider: "circleci",
10792
+ matches: (env) => isTruthy(env.CIRCLECI),
10793
+ isScheduler: (env) => env.CIRCLE_PIPELINE_TRIGGER_SOURCE === "scheduled_pipeline"
10794
+ },
10795
+ {
10796
+ provider: "jenkins",
10797
+ matches: (env) => isTruthy(env.JENKINS_URL) || isTruthy(env.JENKINS_HOME)
10798
+ },
10799
+ {
10800
+ provider: "teamcity",
10801
+ matches: (env) => isTruthy(env.TEAMCITY_VERSION)
10802
+ },
10803
+ {
10804
+ provider: "buildkite",
10805
+ matches: (env) => isTruthy(env.BUILDKITE),
10806
+ isScheduler: (env) => env.BUILDKITE_SOURCE === "schedule"
10807
+ },
10808
+ {
10809
+ provider: "bitbucket",
10810
+ matches: (env) => isTruthy(env.BITBUCKET_BUILD_NUMBER)
10811
+ },
10812
+ {
10813
+ provider: "travis",
10814
+ matches: (env) => isTruthy(env.TRAVIS)
10815
+ },
10816
+ {
10817
+ provider: "appveyor",
10818
+ matches: (env) => isTruthy(env.APPVEYOR)
10819
+ },
10820
+ {
10821
+ provider: "generic",
10822
+ matches: (env) => isTruthy(env.CI)
10823
+ }
10824
+ ];
10825
+ function currentEnv() {
10826
+ return typeof process === "undefined" ? {} : process.env;
10827
+ }
10828
+ function currentTtyState() {
10829
+ if (typeof process === "undefined")
10830
+ return false;
10831
+ return Boolean(process.stdout?.isTTY || process.stdin?.isTTY || process.stderr?.isTTY);
10832
+ }
10833
+ function detectCi(env) {
10834
+ const signature = CI_SIGNATURES.find((candidate) => candidate.matches(env));
10835
+ if (!signature)
10836
+ return;
10837
+ return {
10838
+ executionContext: signature.isScheduler?.(env) ? "scheduler" : "ci",
10839
+ ciProvider: signature.provider
10840
+ };
10841
+ }
10842
+ function detectExecutionContext(options = {}) {
10843
+ const env = options.env ?? currentEnv();
10844
+ const ci = detectCi(env);
10845
+ if (ci)
10846
+ return ci;
10847
+ const agent = options.agent ?? detectAgentFromEnv(env);
10848
+ if (agent) {
10849
+ return { executionContext: "agent" };
10850
+ }
10851
+ const authSignal = options.authSignal ?? authSignalSlot.get();
10852
+ if (authSignal === "service_account") {
10853
+ return { executionContext: "service_account" };
10854
+ }
10855
+ const isTty = options.isTty ?? currentTtyState();
10856
+ if (isTty) {
10857
+ return { executionContext: "manual" };
10858
+ }
10859
+ return { executionContext: "unknown" };
10860
+ }
10861
+ function getExecutionContextTelemetryProperties() {
10862
+ const detected = detectExecutionContext();
10863
+ return {
10864
+ execution_context: detected.executionContext,
10865
+ ...detected.ciProvider ? { ci_provider: detected.ciProvider } : {}
10866
+ };
10867
+ }
10519
10868
  // ../common/src/telemetry/node-context-storage.ts
10520
10869
  import { AsyncLocalStorage } from "node:async_hooks";
10521
10870
 
@@ -10528,6 +10877,26 @@ class NodeContextStorage {
10528
10877
  return this.storage.getStore();
10529
10878
  }
10530
10879
  }
10880
+ // ../common/src/telemetry/session-id.ts
10881
+ var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
10882
+ var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
10883
+ var telemetrySessionIdSlot = singleton("TelemetrySessionId");
10884
+ function getProcessEnv() {
10885
+ return globalThis.process?.env;
10886
+ }
10887
+ function normalizeSessionId(value) {
10888
+ if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
10889
+ return;
10890
+ }
10891
+ const trimmed = String(value).trim();
10892
+ return trimmed || undefined;
10893
+ }
10894
+ function getConfiguredTelemetrySessionId() {
10895
+ return normalizeSessionId(getProcessEnv()?.[TELEMETRY_SESSION_ID_ENV]);
10896
+ }
10897
+ function resolveTelemetrySessionId(existingSessionId) {
10898
+ return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
10899
+ }
10531
10900
  // ../common/src/telemetry/telemetry-service.ts
10532
10901
  class TelemetryService {
10533
10902
  telemetryProvider;
@@ -10606,12 +10975,22 @@ class TelemetryService {
10606
10975
  return this.contextStorage.getContext();
10607
10976
  }
10608
10977
  enrichPropertiesWithContext(properties, context) {
10609
- return {
10610
- ...getGlobalTelemetryProperties(),
10978
+ const globalProperties = getGlobalTelemetryProperties();
10979
+ const existingSessionId = properties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? this.defaultProperties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? globalProperties?.[TELEMETRY_SESSION_ID_PROPERTY];
10980
+ const sessionId = resolveTelemetrySessionId(existingSessionId);
10981
+ const enriched = {
10982
+ ...getExecutionContextTelemetryProperties(),
10983
+ ...globalProperties,
10611
10984
  ...this.defaultProperties,
10612
10985
  ...properties,
10613
10986
  ...context
10614
10987
  };
10988
+ if (sessionId === undefined) {
10989
+ delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
10990
+ } else {
10991
+ enriched[TELEMETRY_SESSION_ID_PROPERTY] = sessionId;
10992
+ }
10993
+ return enriched;
10615
10994
  }
10616
10995
  generateId() {
10617
10996
  return crypto.randomUUID().replaceAll("-", "");
@@ -11081,8 +11460,24 @@ var OutputFormatter;
11081
11460
  data.ErrorCode ??= defaultErrorCodeForFailure(data);
11082
11461
  data.Retry ??= defaultRetryForErrorCode(data.ErrorCode);
11083
11462
  process.exitCode = EXIT_CODES[data.Result] ?? 1;
11084
- const { SuppressTelemetry, ...envelope } = data;
11085
- if (!SuppressTelemetry) {
11463
+ recordCommandFailureTelemetry({
11464
+ result: data.Result,
11465
+ errorCode: data.ErrorCode,
11466
+ retry: data.Retry,
11467
+ message: data.Message,
11468
+ context: data.Context,
11469
+ exitCode: process.exitCode,
11470
+ errorClass: data.TelemetryErrorClass,
11471
+ terminalOutcome: data.TelemetryTerminalOutcome,
11472
+ terminalSignal: data.TelemetryTerminalSignal
11473
+ });
11474
+ const suppressTelemetry = data.SuppressTelemetry === true;
11475
+ const envelope = { ...data };
11476
+ delete envelope.SuppressTelemetry;
11477
+ delete envelope.TelemetryErrorClass;
11478
+ delete envelope.TelemetryTerminalOutcome;
11479
+ delete envelope.TelemetryTerminalSignal;
11480
+ if (!suppressTelemetry) {
11086
11481
  telemetry.trackEvent(CommonTelemetryEvents.Error, {
11087
11482
  result: data.Result,
11088
11483
  errorCode: data.ErrorCode,
@@ -11145,6 +11540,158 @@ var OutputFormatter;
11145
11540
  OutputFormatter.formatToString = formatToString;
11146
11541
  })(OutputFormatter ||= {});
11147
11542
 
11543
+ // ../common/src/telemetry/command-attribution.ts
11544
+ var LEGACY_SKILL_NAMESPACE = "uipath:";
11545
+ var MAX_SKILL_NAME_LENGTH = 80;
11546
+ var SKILL_NAME_PATTERN = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
11547
+ function productMode(productArea, mode) {
11548
+ return { product_area: productArea, mode };
11549
+ }
11550
+ function attributionRecord(groups) {
11551
+ const record = {};
11552
+ for (const [productArea, mode, names] of groups) {
11553
+ const attribution = productMode(productArea, mode);
11554
+ for (const name of names) {
11555
+ record[name] = attribution;
11556
+ }
11557
+ }
11558
+ return record;
11559
+ }
11560
+ function commandAttribution(groups) {
11561
+ const entries = [];
11562
+ for (const [productArea, mode, prefixes] of groups) {
11563
+ const attribution = productMode(productArea, mode);
11564
+ for (const prefix of prefixes) {
11565
+ entries.push({ prefix, attribution });
11566
+ }
11567
+ }
11568
+ return entries;
11569
+ }
11570
+ var SKILL_ATTRIBUTION = attributionRecord([
11571
+ ["admin", "operate", ["uipath-admin"]],
11572
+ ["agents", "build", ["uipath-agents"]],
11573
+ ["api-workflow", "build", ["uipath-api-workflow"]],
11574
+ ["automation-discovery", "build", ["uipath-automation-discovery"]],
11575
+ ["coded-apps", "build", ["uipath-coded-apps"]],
11576
+ ["data-fabric", "operate", ["uipath-data-fabric"]],
11577
+ ["cli", "troubleshoot", ["uipath-feedback"]],
11578
+ ["governance", "operate", ["uipath-governance"]],
11579
+ ["action-center", "build", ["uipath-human-in-the-loop"]],
11580
+ ["document-understanding", "build", ["uipath-ixp"]],
11581
+ [
11582
+ "maestro",
11583
+ "build",
11584
+ ["uipath-maestro-bpmn", "uipath-maestro-case", "uipath-maestro-flow"]
11585
+ ],
11586
+ ["agenthub", "build", ["uipath-mcp-servers"]],
11587
+ ["solution", "build", ["uipath-planner", "uipath-solution"]],
11588
+ ["platform", "operate", ["uipath-platform"]],
11589
+ ["quality", "troubleshoot", ["uipath-review"]],
11590
+ ["rpa", "build", ["uipath-rpa"]],
11591
+ ["cli", "operate", ["uipath-skill-catalog"]],
11592
+ ["action-center", "operate", ["uipath-tasks"]],
11593
+ ["test-manager", "operate", ["uipath-test"]],
11594
+ ["platform", "troubleshoot", ["uipath-troubleshoot"]]
11595
+ ]);
11596
+ var KNOWN_SKILL_NAMES = new Set(Object.keys(SKILL_ATTRIBUTION));
11597
+ var COMMAND_ATTRIBUTION = commandAttribution([
11598
+ ["cli", "troubleshoot", ["uip.feedback"]],
11599
+ ["llm-gateway", "operate", ["uip.llm-configuration", "uip.model-hub"]],
11600
+ ["context-grounding", "build", ["uip.context-grounding"]],
11601
+ ["api-workflow", "build", ["uip.api-workflow"]],
11602
+ ["rpa", "build", ["uip.rpa-legacy"]],
11603
+ ["conversational", "operate", ["uip.conversational"]],
11604
+ ["agents", "build", ["uip.codedagent", "uip.agent"]],
11605
+ ["agenthub", "build", ["uip.agenthub"]],
11606
+ ["coded-apps", "build", ["uip.codedapp"]],
11607
+ ["functions", "build", ["uip.functions"]],
11608
+ ["solution", "build", ["uip.solution"]],
11609
+ ["maestro", "build", ["uip.maestro", "uip.case", "uip.flow"]],
11610
+ ["llm-observability", "troubleshoot", ["uip.traces"]],
11611
+ ["platform", "operate", ["uip.platform"]],
11612
+ ["admin", "operate", ["uip.admin"]],
11613
+ ["automation-ops", "operate", ["uip.aops"]],
11614
+ ["documentation", "troubleshoot", ["uip.docsai"]],
11615
+ ["governance", "operate", ["uip.gov"]],
11616
+ ["insights", "operate", ["uip.insights"]],
11617
+ ["document-understanding", "build", ["uip.ixp"]],
11618
+ ["process-mining", "operate", ["uip.pm"]],
11619
+ ["action-center", "operate", ["uip.tasks"]],
11620
+ ["test-manager", "operate", ["uip.tm"]],
11621
+ ["vertical-solutions", "build", ["uip.vss"]],
11622
+ ["data-fabric", "operate", ["uip.df"]],
11623
+ ["integration-service", "build", ["uip.is"]],
11624
+ ["orchestrator", "operate", ["uip.or"]],
11625
+ [
11626
+ "cli",
11627
+ "operate",
11628
+ [
11629
+ "uip.login",
11630
+ "uip.logout",
11631
+ "uip.user",
11632
+ "uip.config",
11633
+ "uip.tools",
11634
+ "uip.skills",
11635
+ "uip.completion",
11636
+ "uip.update",
11637
+ "uip.mcp",
11638
+ "uip.track"
11639
+ ]
11640
+ ]
11641
+ ]).sort((a, b) => b.prefix.length - a.prefix.length);
11642
+ function normalizeCommandPath(value) {
11643
+ if (typeof value !== "string") {
11644
+ return;
11645
+ }
11646
+ const trimmed = value.trim().toLowerCase();
11647
+ if (!trimmed) {
11648
+ return;
11649
+ }
11650
+ const tokens = trimmed.includes(" ") ? trimmed.split(/\s+/).filter((token) => token.length > 0).filter((token) => !token.startsWith("-")) : trimmed.split(".").filter((token) => token.length > 0);
11651
+ if (tokens.length === 0) {
11652
+ return;
11653
+ }
11654
+ const commandTokens = tokens[0] === "uip" ? tokens : ["uip", ...tokens];
11655
+ return commandTokens.join(".");
11656
+ }
11657
+ function getCommandProductModeAttribution(commandPath) {
11658
+ const normalized = normalizeCommandPath(commandPath);
11659
+ if (!normalized) {
11660
+ return;
11661
+ }
11662
+ return COMMAND_ATTRIBUTION.find(({ prefix }) => normalized === prefix || normalized.startsWith(`${prefix}.`))?.attribution;
11663
+ }
11664
+ function normalizeSkillNameWithOptions(value, options) {
11665
+ if (typeof value !== "string") {
11666
+ return;
11667
+ }
11668
+ const normalized = value.trim().toLowerCase();
11669
+ if (!normalized) {
11670
+ return;
11671
+ }
11672
+ const hasLegacyNamespace = normalized.startsWith(LEGACY_SKILL_NAMESPACE);
11673
+ if (hasLegacyNamespace && !options.allowLegacyNamespace) {
11674
+ return;
11675
+ }
11676
+ const skillName = hasLegacyNamespace ? normalized.slice(LEGACY_SKILL_NAMESPACE.length) : normalized;
11677
+ if (skillName.length > MAX_SKILL_NAME_LENGTH || !SKILL_NAME_PATTERN.test(skillName) || !KNOWN_SKILL_NAMES.has(skillName)) {
11678
+ return;
11679
+ }
11680
+ return skillName;
11681
+ }
11682
+ function normalizeSkillName(value) {
11683
+ return normalizeSkillNameWithOptions(value, {
11684
+ allowLegacyNamespace: false
11685
+ });
11686
+ }
11687
+ function buildCommandTelemetryAttribution(commandPath, skillSource) {
11688
+ const skillName = normalizeSkillName(skillSource);
11689
+ return {
11690
+ ...skillName ? { skill_name: skillName } : {},
11691
+ ...getCommandProductModeAttribution(commandPath)
11692
+ };
11693
+ }
11694
+
11148
11695
  // ../common/src/telemetry/pii-redactor.ts
11149
11696
  var REDACTED = "[REDACTED]";
11150
11697
  var MAX_VALUE_LENGTH = 200;
@@ -11322,6 +11869,12 @@ function commandHelpHint(commandPath) {
11322
11869
  const command = commandPath.replace(/\./g, " ");
11323
11870
  return `An unexpected error occurred. Run '${command} --help' to verify command syntax, or run with --log-level debug for details.`;
11324
11871
  }
11872
+ function isPromptCancellation(error) {
11873
+ return error instanceof Error && error.name === "ExitPromptError";
11874
+ }
11875
+ function exitCodeFromProcess(fallback) {
11876
+ return typeof process.exitCode === "number" ? process.exitCode : fallback;
11877
+ }
11325
11878
  Command.prototype.trackedAction = function(context, fn, properties) {
11326
11879
  const command = this;
11327
11880
  return this.action(async (...args) => {
@@ -11329,6 +11882,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
11329
11882
  const props = typeof properties === "function" ? properties(...args) : properties;
11330
11883
  const startTime = performance.now();
11331
11884
  let errorMessage;
11885
+ let fallbackExitCode = EXIT_CODES.Success;
11886
+ clearRecordedCommandFailureTelemetry();
11332
11887
  const [error] = await catchError(fn(...args));
11333
11888
  if (error) {
11334
11889
  errorMessage = error instanceof Error ? error.message : String(error);
@@ -11343,6 +11898,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
11343
11898
  const customRetry = isRetryHint(typedRetry) ? typedRetry : undefined;
11344
11899
  const typedContext = typed.context ?? typed.Context;
11345
11900
  const customContext = isErrorContext(typedContext) ? typedContext : undefined;
11901
+ const cancellationExitCode = typed.exitCode === 130 || isPromptCancellation(error) ? 130 : undefined;
11902
+ fallbackExitCode = cancellationExitCode ?? EXIT_CODES[finalResult];
11346
11903
  OutputFormatter.error({
11347
11904
  Result: finalResult,
11348
11905
  ...customErrorCode ? { ErrorCode: customErrorCode } : {},
@@ -11351,16 +11908,26 @@ Command.prototype.trackedAction = function(context, fn, properties) {
11351
11908
  ...customRetry ? { Retry: customRetry } : {},
11352
11909
  ...customContext ? { Context: customContext } : {}
11353
11910
  });
11354
- context.exit(EXIT_CODES[finalResult]);
11911
+ context.exit(fallbackExitCode);
11355
11912
  }
11356
11913
  const durationMs = performance.now() - startTime;
11357
- const success = !error && (process.exitCode === undefined || process.exitCode === 0);
11914
+ const exitCode = fallbackExitCode === 130 ? fallbackExitCode : exitCodeFromProcess(fallbackExitCode);
11915
+ const recordedFailure = takeRecordedCommandFailureTelemetry();
11916
+ const success = !error && exitCode === 0;
11917
+ const terminalTelemetry = buildCommandTerminalTelemetryProperties({
11918
+ error,
11919
+ exitCode,
11920
+ recordedFailure,
11921
+ pollSignal: context.pollSignal
11922
+ });
11358
11923
  telemetry.trackEvent(telemetryName, redactProperties({
11359
11924
  ...extractCommandParams(command),
11360
11925
  ...props,
11926
+ ...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
11361
11927
  command: "true",
11362
11928
  duration: String(durationMs),
11363
11929
  success: String(success),
11930
+ ...terminalTelemetry,
11364
11931
  ...errorMessage ? { errorMessage } : {}
11365
11932
  }));
11366
11933
  });
@@ -11426,6 +11993,8 @@ var ScreenLogger;
11426
11993
  }
11427
11994
  ScreenLogger.progress = progress;
11428
11995
  })(ScreenLogger ||= {});
11996
+ // ../common/src/telemetry/ship-succeeded.ts
11997
+ var shippedKeysSlot = singleton("ShipSucceededDedupeKeys");
11429
11998
  // ../common/src/tool-provider.ts
11430
11999
  var factorySlot = singleton("PackagerFactoryProvider");
11431
12000
  // src/solution-file.ts
@@ -11456,7 +12025,7 @@ async function readUipxFile(fs7, solutionDir) {
11456
12025
  return { uipx, uipxFileName };
11457
12026
  }
11458
12027
  function validateUipxFile(parsed, uipxFileName) {
11459
- if (!isRecord(parsed)) {
12028
+ if (!isRecord2(parsed)) {
11460
12029
  throw new Error(`Invalid .uipx file: ${uipxFileName} must contain a JSON object.`);
11461
12030
  }
11462
12031
  if (typeof parsed.SolutionId !== "string" || !parsed.SolutionId.trim()) {
@@ -11466,7 +12035,7 @@ function validateUipxFile(parsed, uipxFileName) {
11466
12035
  throw new Error("Invalid .uipx file: missing Projects.");
11467
12036
  }
11468
12037
  for (const [index, project] of parsed.Projects.entries()) {
11469
- if (!isRecord(project)) {
12038
+ if (!isRecord2(project)) {
11470
12039
  throw new Error(`Invalid .uipx file: Projects[${index}] must be an object.`);
11471
12040
  }
11472
12041
  if (typeof project.ProjectRelativePath !== "string" || !project.ProjectRelativePath.trim()) {
@@ -11476,7 +12045,7 @@ function validateUipxFile(parsed, uipxFileName) {
11476
12045
  }
11477
12046
  return parsed;
11478
12047
  }
11479
- function isRecord(value) {
12048
+ function isRecord2(value) {
11480
12049
  return typeof value === "object" && value !== null && !Array.isArray(value);
11481
12050
  }
11482
12051
  function resolveSolutionDir(fs7, inputPath) {
@@ -11741,11 +12310,11 @@ async function readProjectManifest(fs7, filePath, useProjectJson) {
11741
12310
  null
11742
12311
  ];
11743
12312
  }
11744
- if (!isRecord(parsed)) {
12313
+ if (!isRecord2(parsed)) {
11745
12314
  return [new Error(`Invalid project file: ${filePath}`), null];
11746
12315
  }
11747
12316
  const designOptions = parsed.designOptions;
11748
- const outputType = useProjectJson && isRecord(designOptions) ? readString(designOptions.outputType) : undefined;
12317
+ const outputType = useProjectJson && isRecord2(designOptions) ? readString(designOptions.outputType) : undefined;
11749
12318
  const projectType = outputType ?? readString(parsed.ProjectType);
11750
12319
  if (!projectType) {
11751
12320
  return [new Error(`ProjectType not found in ${filePath}`), null];
@@ -11772,7 +12341,7 @@ async function readSolutionManifest(fs7, solutionFile) {
11772
12341
  null
11773
12342
  ];
11774
12343
  }
11775
- if (!isRecord(parsed)) {
12344
+ if (!isRecord2(parsed)) {
11776
12345
  return [
11777
12346
  new Error(`Invalid solution file: ${solutionFile} must contain a JSON object.`),
11778
12347
  null
@@ -11786,7 +12355,7 @@ async function readSolutionManifest(fs7, solutionFile) {
11786
12355
  }
11787
12356
  const projects = [];
11788
12357
  for (const [index, project] of parsed.Projects.entries()) {
11789
- if (!isRecord(project)) {
12358
+ if (!isRecord2(project)) {
11790
12359
  return [
11791
12360
  new Error(`Invalid solution file: Projects[${index}] must be an object.`),
11792
12361
  null
@@ -14295,4 +14864,4 @@ export {
14295
14864
  BASE_PATH
14296
14865
  };
14297
14866
 
14298
- //# debugId=45BEEFC2C1F3DB5D64756E2164756E21
14867
+ //# debugId=815EAEB64F547E8F64756E2164756E21
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/solution-sdk",
3
3
  "license": "MIT",
4
- "version": "1.197.0-preview.65",
4
+ "version": "1.197.0-preview.67",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/UiPath/cli.git",
@@ -31,5 +31,5 @@
31
31
  "dist"
32
32
  ],
33
33
  "private": false,
34
- "gitHead": "9388ccbe5e739c9578bfd9b5395980fb63e11d9c"
34
+ "gitHead": "579e7d41cb100fcb8130eec8ed1c9b5b55feaf0b"
35
35
  }