@uipath/orchestrator-tool 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/tool.js +645 -9
  2. package/package.json +2 -2
package/dist/tool.js CHANGED
@@ -21250,7 +21250,7 @@ var init_server = __esm(() => {
21250
21250
  var package_default = {
21251
21251
  name: "@uipath/orchestrator-tool",
21252
21252
  license: "MIT",
21253
- version: "1.197.0-preview.65",
21253
+ version: "1.197.0-preview.67",
21254
21254
  description: "Manage Orchestrator folders, jobs, processes, and releases.",
21255
21255
  private: false,
21256
21256
  repository: {
@@ -26632,9 +26632,228 @@ function getOutputFilter() {
26632
26632
  return filterSlot.get();
26633
26633
  }
26634
26634
 
26635
+ // ../common/src/telemetry/command-terminal.ts
26636
+ var recordedFailureSlot = singleton("CommandTelemetryFailure");
26637
+ var AUTH_ERROR_CODES = new Set([
26638
+ "authentication_required",
26639
+ "permission_denied"
26640
+ ]);
26641
+ var VALIDATION_ERROR_CODES = new Set(["invalid_argument"]);
26642
+ var NETWORK_HTTP_ERROR_CODES = new Set([
26643
+ "network_error",
26644
+ "rate_limited",
26645
+ "server_error",
26646
+ "not_found",
26647
+ "method_not_allowed"
26648
+ ]);
26649
+ var TIMEOUT_ERROR_CODES = new Set(["timeout"]);
26650
+ var NETWORK_OS_ERROR_CODES = new Set([
26651
+ "ECONNREFUSED",
26652
+ "ECONNRESET",
26653
+ "ENOTFOUND",
26654
+ "EAI_AGAIN",
26655
+ "EPIPE",
26656
+ "EHOSTUNREACH",
26657
+ "ENETUNREACH",
26658
+ "EAI_FAIL"
26659
+ ]);
26660
+ var TIMEOUT_OS_ERROR_CODES = new Set(["ETIMEDOUT", "ESOCKETTIMEDOUT"]);
26661
+ var TLS_ERROR_CODES2 = new Set([
26662
+ "SELF_SIGNED_CERT_IN_CHAIN",
26663
+ "DEPTH_ZERO_SELF_SIGNED_CERT",
26664
+ "UNABLE_TO_VERIFY_LEAF_SIGNATURE",
26665
+ "UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
26666
+ "UNABLE_TO_GET_ISSUER_CERT",
26667
+ "CERT_HAS_EXPIRED",
26668
+ "CERT_UNTRUSTED",
26669
+ "ERR_TLS_CERT_ALTNAME_INVALID"
26670
+ ]);
26671
+ var MISSING_DEPENDENCY_CODES = new Set([
26672
+ "MODULE_NOT_FOUND",
26673
+ "ERR_MODULE_NOT_FOUND"
26674
+ ]);
26675
+ var INTERNAL_ERROR_NAMES = new Set([
26676
+ "TypeError",
26677
+ "ReferenceError",
26678
+ "SyntaxError",
26679
+ "RangeError"
26680
+ ]);
26681
+ function isRecord(value) {
26682
+ return value !== null && typeof value === "object";
26683
+ }
26684
+ function stringField(value, field) {
26685
+ if (!isRecord(value)) {
26686
+ return;
26687
+ }
26688
+ const raw = value[field];
26689
+ return typeof raw === "string" ? raw : undefined;
26690
+ }
26691
+ function numberField(value, field) {
26692
+ if (!isRecord(value)) {
26693
+ return;
26694
+ }
26695
+ const raw = value[field];
26696
+ return typeof raw === "number" ? raw : undefined;
26697
+ }
26698
+ function findStringInCauseChain(error, field) {
26699
+ let current = error;
26700
+ for (let depth = 0;depth < 5 && current !== null && typeof current === "object"; depth++) {
26701
+ const value = stringField(current, field);
26702
+ if (value) {
26703
+ return value;
26704
+ }
26705
+ current = current.cause;
26706
+ }
26707
+ return;
26708
+ }
26709
+ function findCodeInCauseChain(error) {
26710
+ return findStringInCauseChain(error, "code");
26711
+ }
26712
+ function isSpawnEnoent(error) {
26713
+ const code = findCodeInCauseChain(error);
26714
+ if (code !== "ENOENT") {
26715
+ return false;
26716
+ }
26717
+ const syscall = findStringInCauseChain(error, "syscall");
26718
+ return syscall?.startsWith("spawn") === true;
26719
+ }
26720
+ function isCancellationError(error, exitCode, pollSignal) {
26721
+ if (exitCode === 130) {
26722
+ return true;
26723
+ }
26724
+ if (!isRecord(error)) {
26725
+ return false;
26726
+ }
26727
+ if (numberField(error, "exitCode") === 130) {
26728
+ return true;
26729
+ }
26730
+ const name = stringField(error, "name");
26731
+ if (name === "ExitPromptError") {
26732
+ return true;
26733
+ }
26734
+ if (name === "AbortError" && pollSignal?.aborted) {
26735
+ return true;
26736
+ }
26737
+ const message = stringField(error, "message");
26738
+ return message?.includes("SIGINT") === true;
26739
+ }
26740
+ function terminalSignalFor(input, outcome) {
26741
+ if (input.recordedFailure?.terminalSignal) {
26742
+ return input.recordedFailure.terminalSignal;
26743
+ }
26744
+ const explicit = findStringInCauseChain(input.error, "terminalSignal") ?? findStringInCauseChain(input.error, "signal");
26745
+ if (explicit) {
26746
+ return explicit;
26747
+ }
26748
+ return outcome === "cancelled" ? "SIGINT" : undefined;
26749
+ }
26750
+ function classifyHttpStatus(status) {
26751
+ if (status === 401 || status === 403) {
26752
+ return "auth";
26753
+ }
26754
+ if (status === 400 || status === 409 || status === 422) {
26755
+ return "validation";
26756
+ }
26757
+ if (status === 408) {
26758
+ return "timeout";
26759
+ }
26760
+ return "network_http";
26761
+ }
26762
+ function classifyFromResult(result) {
26763
+ switch (result) {
26764
+ case "AuthenticationError":
26765
+ return "auth";
26766
+ case "ValidationError":
26767
+ return "validation";
26768
+ case "TimeoutError":
26769
+ return "timeout";
26770
+ default:
26771
+ return;
26772
+ }
26773
+ }
26774
+ function classifyFromErrorCode(errorCode) {
26775
+ if (!errorCode) {
26776
+ return;
26777
+ }
26778
+ if (AUTH_ERROR_CODES.has(errorCode)) {
26779
+ return "auth";
26780
+ }
26781
+ if (VALIDATION_ERROR_CODES.has(errorCode)) {
26782
+ return "validation";
26783
+ }
26784
+ if (TIMEOUT_ERROR_CODES.has(errorCode)) {
26785
+ return "timeout";
26786
+ }
26787
+ if (NETWORK_HTTP_ERROR_CODES.has(errorCode)) {
26788
+ return "network_http";
26789
+ }
26790
+ return;
26791
+ }
26792
+ function classifyFromError(error) {
26793
+ const code = findCodeInCauseChain(error);
26794
+ if (code) {
26795
+ if (code.startsWith("commander.")) {
26796
+ return "validation";
26797
+ }
26798
+ if (NETWORK_OS_ERROR_CODES.has(code) || TLS_ERROR_CODES2.has(code)) {
26799
+ return "network_http";
26800
+ }
26801
+ if (TIMEOUT_OS_ERROR_CODES.has(code)) {
26802
+ return "timeout";
26803
+ }
26804
+ if (MISSING_DEPENDENCY_CODES.has(code) || isSpawnEnoent(error)) {
26805
+ return "missing_dependency";
26806
+ }
26807
+ }
26808
+ const message = stringField(error, "message");
26809
+ if (message?.includes("fetch failed") === true) {
26810
+ return "network_http";
26811
+ }
26812
+ const name = stringField(error, "name");
26813
+ if (name && INTERNAL_ERROR_NAMES.has(name)) {
26814
+ return "internal";
26815
+ }
26816
+ return;
26817
+ }
26818
+ function classifyError2(input) {
26819
+ const recorded = input.recordedFailure;
26820
+ if (recorded?.errorClass) {
26821
+ return recorded.errorClass;
26822
+ }
26823
+ const status = recorded?.context?.httpStatus;
26824
+ if (status !== undefined) {
26825
+ return classifyHttpStatus(status);
26826
+ }
26827
+ return classifyFromResult(recorded?.result) ?? classifyFromErrorCode(recorded?.errorCode) ?? classifyFromError(input.error) ?? "unknown";
26828
+ }
26829
+ function recordCommandFailureTelemetry(failure) {
26830
+ recordedFailureSlot.set(failure);
26831
+ }
26832
+ function clearRecordedCommandFailureTelemetry() {
26833
+ recordedFailureSlot.clear();
26834
+ }
26835
+ function takeRecordedCommandFailureTelemetry() {
26836
+ const failure = recordedFailureSlot.get();
26837
+ recordedFailureSlot.clear();
26838
+ return failure;
26839
+ }
26840
+ function buildCommandTerminalTelemetryProperties(input) {
26841
+ const cancelled = isCancellationError(input.error, input.exitCode, input.pollSignal);
26842
+ const outcome = input.recordedFailure?.terminalOutcome ?? (input.exitCode === 0 ? "success" : cancelled ? "cancelled" : "failure");
26843
+ const errorClass = outcome === "success" || outcome === "no_op" ? undefined : outcome === "cancelled" ? "user_cancelled" : classifyError2(input);
26844
+ const terminalSignal = terminalSignalFor(input, outcome);
26845
+ return {
26846
+ exit_code: input.exitCode,
26847
+ terminal_outcome: outcome,
26848
+ ...errorClass ? { error_class: errorClass } : {},
26849
+ ...terminalSignal ? { terminal_signal: terminalSignal } : {}
26850
+ };
26851
+ }
26852
+
26635
26853
  // ../common/src/telemetry/telemetry-events.ts
26636
26854
  var CommonTelemetryEvents = {
26637
- Error: "uip.error"
26855
+ Error: "uip.error",
26856
+ ShipSucceeded: "ship_succeeded"
26638
26857
  };
26639
26858
 
26640
26859
  // ../common/src/registry.ts
@@ -26701,6 +26920,136 @@ function formatMessage(category, name, properties) {
26701
26920
  }
26702
26921
  return message;
26703
26922
  }
26923
+ // ../common/src/telemetry/detect-agent.ts
26924
+ var KNOWN_AGENTS = [
26925
+ { envVar: "CLAUDECODE", value: "1", id: "claude-code" },
26926
+ { envVar: "CURSOR_AGENT", value: "1", id: "cursor" },
26927
+ { envVar: "GEMINI_CLI", value: "1", id: "gemini-cli" },
26928
+ { envVar: "CODEX_THREAD_ID", id: "codex" },
26929
+ { envVar: "CODEX_SANDBOX", id: "codex" },
26930
+ { envVar: "AUGMENT_AGENT", value: "1", id: "augment" },
26931
+ { envVar: "CLINE_ACTIVE", value: "true", id: "cline" }
26932
+ ];
26933
+ function detectAgentFromEnv(env) {
26934
+ for (const agent of KNOWN_AGENTS) {
26935
+ const envValue = env[agent.envVar];
26936
+ if (agent.value !== undefined) {
26937
+ if (envValue === agent.value)
26938
+ return agent.id;
26939
+ } else {
26940
+ if (envValue)
26941
+ return agent.id;
26942
+ }
26943
+ }
26944
+ const agentEnv = env.AGENT;
26945
+ if (agentEnv) {
26946
+ if (agentEnv === "1" || agentEnv === "true")
26947
+ return "unknown";
26948
+ if (agentEnv.length <= 32)
26949
+ return agentEnv.toLowerCase();
26950
+ }
26951
+ return;
26952
+ }
26953
+ // ../common/src/telemetry/environment-info.ts
26954
+ var LOCAL_HOSTS = new Set(["localhost", "127.0.0.1", "::1", "[::1]"]);
26955
+ // ../common/src/telemetry/execution-context.ts
26956
+ var authSignalSlot = singleton("TelemetryExecutionContextAuthSignal");
26957
+ var isTruthy = (value) => value !== undefined && value !== "" && value !== "0" && value.toLowerCase() !== "false";
26958
+ var isEqual = (value, expected) => value?.toLowerCase() === expected;
26959
+ var CI_SIGNATURES = [
26960
+ {
26961
+ provider: "github_actions",
26962
+ matches: (env) => isTruthy(env.GITHUB_ACTIONS),
26963
+ isScheduler: (env) => env.GITHUB_EVENT_NAME === "schedule"
26964
+ },
26965
+ {
26966
+ provider: "azure_devops",
26967
+ matches: (env) => isTruthy(env.TF_BUILD),
26968
+ isScheduler: (env) => isEqual(env.BUILD_REASON, "schedule")
26969
+ },
26970
+ {
26971
+ provider: "gitlab",
26972
+ matches: (env) => isTruthy(env.GITLAB_CI),
26973
+ isScheduler: (env) => env.CI_PIPELINE_SOURCE === "schedule"
26974
+ },
26975
+ {
26976
+ provider: "circleci",
26977
+ matches: (env) => isTruthy(env.CIRCLECI),
26978
+ isScheduler: (env) => env.CIRCLE_PIPELINE_TRIGGER_SOURCE === "scheduled_pipeline"
26979
+ },
26980
+ {
26981
+ provider: "jenkins",
26982
+ matches: (env) => isTruthy(env.JENKINS_URL) || isTruthy(env.JENKINS_HOME)
26983
+ },
26984
+ {
26985
+ provider: "teamcity",
26986
+ matches: (env) => isTruthy(env.TEAMCITY_VERSION)
26987
+ },
26988
+ {
26989
+ provider: "buildkite",
26990
+ matches: (env) => isTruthy(env.BUILDKITE),
26991
+ isScheduler: (env) => env.BUILDKITE_SOURCE === "schedule"
26992
+ },
26993
+ {
26994
+ provider: "bitbucket",
26995
+ matches: (env) => isTruthy(env.BITBUCKET_BUILD_NUMBER)
26996
+ },
26997
+ {
26998
+ provider: "travis",
26999
+ matches: (env) => isTruthy(env.TRAVIS)
27000
+ },
27001
+ {
27002
+ provider: "appveyor",
27003
+ matches: (env) => isTruthy(env.APPVEYOR)
27004
+ },
27005
+ {
27006
+ provider: "generic",
27007
+ matches: (env) => isTruthy(env.CI)
27008
+ }
27009
+ ];
27010
+ function currentEnv() {
27011
+ return typeof process === "undefined" ? {} : process.env;
27012
+ }
27013
+ function currentTtyState() {
27014
+ if (typeof process === "undefined")
27015
+ return false;
27016
+ return Boolean(process.stdout?.isTTY || process.stdin?.isTTY || process.stderr?.isTTY);
27017
+ }
27018
+ function detectCi(env) {
27019
+ const signature = CI_SIGNATURES.find((candidate) => candidate.matches(env));
27020
+ if (!signature)
27021
+ return;
27022
+ return {
27023
+ executionContext: signature.isScheduler?.(env) ? "scheduler" : "ci",
27024
+ ciProvider: signature.provider
27025
+ };
27026
+ }
27027
+ function detectExecutionContext(options = {}) {
27028
+ const env = options.env ?? currentEnv();
27029
+ const ci = detectCi(env);
27030
+ if (ci)
27031
+ return ci;
27032
+ const agent = options.agent ?? detectAgentFromEnv(env);
27033
+ if (agent) {
27034
+ return { executionContext: "agent" };
27035
+ }
27036
+ const authSignal = options.authSignal ?? authSignalSlot.get();
27037
+ if (authSignal === "service_account") {
27038
+ return { executionContext: "service_account" };
27039
+ }
27040
+ const isTty = options.isTty ?? currentTtyState();
27041
+ if (isTty) {
27042
+ return { executionContext: "manual" };
27043
+ }
27044
+ return { executionContext: "unknown" };
27045
+ }
27046
+ function getExecutionContextTelemetryProperties() {
27047
+ const detected = detectExecutionContext();
27048
+ return {
27049
+ execution_context: detected.executionContext,
27050
+ ...detected.ciProvider ? { ci_provider: detected.ciProvider } : {}
27051
+ };
27052
+ }
26704
27053
  // ../common/src/telemetry/node-context-storage.ts
26705
27054
  import { AsyncLocalStorage } from "node:async_hooks";
26706
27055
 
@@ -26713,6 +27062,26 @@ class NodeContextStorage {
26713
27062
  return this.storage.getStore();
26714
27063
  }
26715
27064
  }
27065
+ // ../common/src/telemetry/session-id.ts
27066
+ var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
27067
+ var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
27068
+ var telemetrySessionIdSlot = singleton("TelemetrySessionId");
27069
+ function getProcessEnv() {
27070
+ return globalThis.process?.env;
27071
+ }
27072
+ function normalizeSessionId(value) {
27073
+ if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
27074
+ return;
27075
+ }
27076
+ const trimmed = String(value).trim();
27077
+ return trimmed || undefined;
27078
+ }
27079
+ function getConfiguredTelemetrySessionId() {
27080
+ return normalizeSessionId(getProcessEnv()?.[TELEMETRY_SESSION_ID_ENV]);
27081
+ }
27082
+ function resolveTelemetrySessionId(existingSessionId) {
27083
+ return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
27084
+ }
26716
27085
  // ../common/src/telemetry/global-telemetry-properties.ts
26717
27086
  var telemetryPropsSlot = singleton("TelemetryDefaultProps");
26718
27087
  function getGlobalTelemetryProperties() {
@@ -26797,12 +27166,22 @@ class TelemetryService {
26797
27166
  return this.contextStorage.getContext();
26798
27167
  }
26799
27168
  enrichPropertiesWithContext(properties, context) {
26800
- return {
26801
- ...getGlobalTelemetryProperties(),
27169
+ const globalProperties = getGlobalTelemetryProperties();
27170
+ const existingSessionId = properties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? this.defaultProperties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? globalProperties?.[TELEMETRY_SESSION_ID_PROPERTY];
27171
+ const sessionId = resolveTelemetrySessionId(existingSessionId);
27172
+ const enriched = {
27173
+ ...getExecutionContextTelemetryProperties(),
27174
+ ...globalProperties,
26802
27175
  ...this.defaultProperties,
26803
27176
  ...properties,
26804
27177
  ...context
26805
27178
  };
27179
+ if (sessionId === undefined) {
27180
+ delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
27181
+ } else {
27182
+ enriched[TELEMETRY_SESSION_ID_PROPERTY] = sessionId;
27183
+ }
27184
+ return enriched;
26806
27185
  }
26807
27186
  generateId() {
26808
27187
  return crypto.randomUUID().replaceAll("-", "");
@@ -27293,8 +27672,24 @@ var OutputFormatter;
27293
27672
  data.ErrorCode ??= defaultErrorCodeForFailure(data);
27294
27673
  data.Retry ??= defaultRetryForErrorCode(data.ErrorCode);
27295
27674
  process.exitCode = EXIT_CODES[data.Result] ?? 1;
27296
- const { SuppressTelemetry, ...envelope } = data;
27297
- if (!SuppressTelemetry) {
27675
+ recordCommandFailureTelemetry({
27676
+ result: data.Result,
27677
+ errorCode: data.ErrorCode,
27678
+ retry: data.Retry,
27679
+ message: data.Message,
27680
+ context: data.Context,
27681
+ exitCode: process.exitCode,
27682
+ errorClass: data.TelemetryErrorClass,
27683
+ terminalOutcome: data.TelemetryTerminalOutcome,
27684
+ terminalSignal: data.TelemetryTerminalSignal
27685
+ });
27686
+ const suppressTelemetry = data.SuppressTelemetry === true;
27687
+ const envelope = { ...data };
27688
+ delete envelope.SuppressTelemetry;
27689
+ delete envelope.TelemetryErrorClass;
27690
+ delete envelope.TelemetryTerminalOutcome;
27691
+ delete envelope.TelemetryTerminalSignal;
27692
+ if (!suppressTelemetry) {
27298
27693
  telemetry.trackEvent(CommonTelemetryEvents.Error, {
27299
27694
  result: data.Result,
27300
27695
  errorCode: data.ErrorCode,
@@ -27357,6 +27752,158 @@ var OutputFormatter;
27357
27752
  OutputFormatter.formatToString = formatToString;
27358
27753
  })(OutputFormatter ||= {});
27359
27754
 
27755
+ // ../common/src/telemetry/command-attribution.ts
27756
+ var LEGACY_SKILL_NAMESPACE = "uipath:";
27757
+ var MAX_SKILL_NAME_LENGTH = 80;
27758
+ var SKILL_NAME_PATTERN = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
27759
+ function productMode(productArea, mode) {
27760
+ return { product_area: productArea, mode };
27761
+ }
27762
+ function attributionRecord(groups) {
27763
+ const record = {};
27764
+ for (const [productArea, mode, names] of groups) {
27765
+ const attribution = productMode(productArea, mode);
27766
+ for (const name of names) {
27767
+ record[name] = attribution;
27768
+ }
27769
+ }
27770
+ return record;
27771
+ }
27772
+ function commandAttribution(groups) {
27773
+ const entries = [];
27774
+ for (const [productArea, mode, prefixes] of groups) {
27775
+ const attribution = productMode(productArea, mode);
27776
+ for (const prefix of prefixes) {
27777
+ entries.push({ prefix, attribution });
27778
+ }
27779
+ }
27780
+ return entries;
27781
+ }
27782
+ var SKILL_ATTRIBUTION = attributionRecord([
27783
+ ["admin", "operate", ["uipath-admin"]],
27784
+ ["agents", "build", ["uipath-agents"]],
27785
+ ["api-workflow", "build", ["uipath-api-workflow"]],
27786
+ ["automation-discovery", "build", ["uipath-automation-discovery"]],
27787
+ ["coded-apps", "build", ["uipath-coded-apps"]],
27788
+ ["data-fabric", "operate", ["uipath-data-fabric"]],
27789
+ ["cli", "troubleshoot", ["uipath-feedback"]],
27790
+ ["governance", "operate", ["uipath-governance"]],
27791
+ ["action-center", "build", ["uipath-human-in-the-loop"]],
27792
+ ["document-understanding", "build", ["uipath-ixp"]],
27793
+ [
27794
+ "maestro",
27795
+ "build",
27796
+ ["uipath-maestro-bpmn", "uipath-maestro-case", "uipath-maestro-flow"]
27797
+ ],
27798
+ ["agenthub", "build", ["uipath-mcp-servers"]],
27799
+ ["solution", "build", ["uipath-planner", "uipath-solution"]],
27800
+ ["platform", "operate", ["uipath-platform"]],
27801
+ ["quality", "troubleshoot", ["uipath-review"]],
27802
+ ["rpa", "build", ["uipath-rpa"]],
27803
+ ["cli", "operate", ["uipath-skill-catalog"]],
27804
+ ["action-center", "operate", ["uipath-tasks"]],
27805
+ ["test-manager", "operate", ["uipath-test"]],
27806
+ ["platform", "troubleshoot", ["uipath-troubleshoot"]]
27807
+ ]);
27808
+ var KNOWN_SKILL_NAMES = new Set(Object.keys(SKILL_ATTRIBUTION));
27809
+ var COMMAND_ATTRIBUTION = commandAttribution([
27810
+ ["cli", "troubleshoot", ["uip.feedback"]],
27811
+ ["llm-gateway", "operate", ["uip.llm-configuration", "uip.model-hub"]],
27812
+ ["context-grounding", "build", ["uip.context-grounding"]],
27813
+ ["api-workflow", "build", ["uip.api-workflow"]],
27814
+ ["rpa", "build", ["uip.rpa-legacy"]],
27815
+ ["conversational", "operate", ["uip.conversational"]],
27816
+ ["agents", "build", ["uip.codedagent", "uip.agent"]],
27817
+ ["agenthub", "build", ["uip.agenthub"]],
27818
+ ["coded-apps", "build", ["uip.codedapp"]],
27819
+ ["functions", "build", ["uip.functions"]],
27820
+ ["solution", "build", ["uip.solution"]],
27821
+ ["maestro", "build", ["uip.maestro", "uip.case", "uip.flow"]],
27822
+ ["llm-observability", "troubleshoot", ["uip.traces"]],
27823
+ ["platform", "operate", ["uip.platform"]],
27824
+ ["admin", "operate", ["uip.admin"]],
27825
+ ["automation-ops", "operate", ["uip.aops"]],
27826
+ ["documentation", "troubleshoot", ["uip.docsai"]],
27827
+ ["governance", "operate", ["uip.gov"]],
27828
+ ["insights", "operate", ["uip.insights"]],
27829
+ ["document-understanding", "build", ["uip.ixp"]],
27830
+ ["process-mining", "operate", ["uip.pm"]],
27831
+ ["action-center", "operate", ["uip.tasks"]],
27832
+ ["test-manager", "operate", ["uip.tm"]],
27833
+ ["vertical-solutions", "build", ["uip.vss"]],
27834
+ ["data-fabric", "operate", ["uip.df"]],
27835
+ ["integration-service", "build", ["uip.is"]],
27836
+ ["orchestrator", "operate", ["uip.or"]],
27837
+ [
27838
+ "cli",
27839
+ "operate",
27840
+ [
27841
+ "uip.login",
27842
+ "uip.logout",
27843
+ "uip.user",
27844
+ "uip.config",
27845
+ "uip.tools",
27846
+ "uip.skills",
27847
+ "uip.completion",
27848
+ "uip.update",
27849
+ "uip.mcp",
27850
+ "uip.track"
27851
+ ]
27852
+ ]
27853
+ ]).sort((a, b) => b.prefix.length - a.prefix.length);
27854
+ function normalizeCommandPath(value) {
27855
+ if (typeof value !== "string") {
27856
+ return;
27857
+ }
27858
+ const trimmed = value.trim().toLowerCase();
27859
+ if (!trimmed) {
27860
+ return;
27861
+ }
27862
+ const tokens = trimmed.includes(" ") ? trimmed.split(/\s+/).filter((token) => token.length > 0).filter((token) => !token.startsWith("-")) : trimmed.split(".").filter((token) => token.length > 0);
27863
+ if (tokens.length === 0) {
27864
+ return;
27865
+ }
27866
+ const commandTokens = tokens[0] === "uip" ? tokens : ["uip", ...tokens];
27867
+ return commandTokens.join(".");
27868
+ }
27869
+ function getCommandProductModeAttribution(commandPath) {
27870
+ const normalized = normalizeCommandPath(commandPath);
27871
+ if (!normalized) {
27872
+ return;
27873
+ }
27874
+ return COMMAND_ATTRIBUTION.find(({ prefix }) => normalized === prefix || normalized.startsWith(`${prefix}.`))?.attribution;
27875
+ }
27876
+ function normalizeSkillNameWithOptions(value, options) {
27877
+ if (typeof value !== "string") {
27878
+ return;
27879
+ }
27880
+ const normalized = value.trim().toLowerCase();
27881
+ if (!normalized) {
27882
+ return;
27883
+ }
27884
+ const hasLegacyNamespace = normalized.startsWith(LEGACY_SKILL_NAMESPACE);
27885
+ if (hasLegacyNamespace && !options.allowLegacyNamespace) {
27886
+ return;
27887
+ }
27888
+ const skillName = hasLegacyNamespace ? normalized.slice(LEGACY_SKILL_NAMESPACE.length) : normalized;
27889
+ if (skillName.length > MAX_SKILL_NAME_LENGTH || !SKILL_NAME_PATTERN.test(skillName) || !KNOWN_SKILL_NAMES.has(skillName)) {
27890
+ return;
27891
+ }
27892
+ return skillName;
27893
+ }
27894
+ function normalizeSkillName(value) {
27895
+ return normalizeSkillNameWithOptions(value, {
27896
+ allowLegacyNamespace: false
27897
+ });
27898
+ }
27899
+ function buildCommandTelemetryAttribution(commandPath, skillSource) {
27900
+ const skillName = normalizeSkillName(skillSource);
27901
+ return {
27902
+ ...skillName ? { skill_name: skillName } : {},
27903
+ ...getCommandProductModeAttribution(commandPath)
27904
+ };
27905
+ }
27906
+
27360
27907
  // ../common/src/telemetry/pii-redactor.ts
27361
27908
  var REDACTED = "[REDACTED]";
27362
27909
  var MAX_VALUE_LENGTH = 200;
@@ -27542,6 +28089,12 @@ function commandHelpHint(commandPath) {
27542
28089
  const command = commandPath.replace(/\./g, " ");
27543
28090
  return `An unexpected error occurred. Run '${command} --help' to verify command syntax, or run with --log-level debug for details.`;
27544
28091
  }
28092
+ function isPromptCancellation(error) {
28093
+ return error instanceof Error && error.name === "ExitPromptError";
28094
+ }
28095
+ function exitCodeFromProcess(fallback) {
28096
+ return typeof process.exitCode === "number" ? process.exitCode : fallback;
28097
+ }
27545
28098
  Command.prototype.trackedAction = function(context, fn, properties) {
27546
28099
  const command = this;
27547
28100
  return this.action(async (...args) => {
@@ -27549,6 +28102,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
27549
28102
  const props = typeof properties === "function" ? properties(...args) : properties;
27550
28103
  const startTime = performance.now();
27551
28104
  let errorMessage;
28105
+ let fallbackExitCode = EXIT_CODES.Success;
28106
+ clearRecordedCommandFailureTelemetry();
27552
28107
  const [error] = await catchError(fn(...args));
27553
28108
  if (error) {
27554
28109
  errorMessage = error instanceof Error ? error.message : String(error);
@@ -27563,6 +28118,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
27563
28118
  const customRetry = isRetryHint(typedRetry) ? typedRetry : undefined;
27564
28119
  const typedContext = typed.context ?? typed.Context;
27565
28120
  const customContext = isErrorContext(typedContext) ? typedContext : undefined;
28121
+ const cancellationExitCode = typed.exitCode === 130 || isPromptCancellation(error) ? 130 : undefined;
28122
+ fallbackExitCode = cancellationExitCode ?? EXIT_CODES[finalResult];
27566
28123
  OutputFormatter.error({
27567
28124
  Result: finalResult,
27568
28125
  ...customErrorCode ? { ErrorCode: customErrorCode } : {},
@@ -27571,16 +28128,26 @@ Command.prototype.trackedAction = function(context, fn, properties) {
27571
28128
  ...customRetry ? { Retry: customRetry } : {},
27572
28129
  ...customContext ? { Context: customContext } : {}
27573
28130
  });
27574
- context.exit(EXIT_CODES[finalResult]);
28131
+ context.exit(fallbackExitCode);
27575
28132
  }
27576
28133
  const durationMs = performance.now() - startTime;
27577
- const success = !error && (process.exitCode === undefined || process.exitCode === 0);
28134
+ const exitCode = fallbackExitCode === 130 ? fallbackExitCode : exitCodeFromProcess(fallbackExitCode);
28135
+ const recordedFailure = takeRecordedCommandFailureTelemetry();
28136
+ const success = !error && exitCode === 0;
28137
+ const terminalTelemetry = buildCommandTerminalTelemetryProperties({
28138
+ error,
28139
+ exitCode,
28140
+ recordedFailure,
28141
+ pollSignal: context.pollSignal
28142
+ });
27578
28143
  telemetry.trackEvent(telemetryName, redactProperties({
27579
28144
  ...extractCommandParams(command),
27580
28145
  ...props,
28146
+ ...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
27581
28147
  command: "true",
27582
28148
  duration: String(durationMs),
27583
28149
  success: String(success),
28150
+ ...terminalTelemetry,
27584
28151
  ...errorMessage ? { errorMessage } : {}
27585
28152
  }));
27586
28153
  });
@@ -28165,6 +28732,36 @@ function installRequestHeaderForwarding(BaseApiClass, patchKey, forward) {
28165
28732
  function installSdkUserAgentHeader(BaseApiClass, userAgent) {
28166
28733
  installRequestHeaderForwarding(BaseApiClass, userAgentPatchKey(userAgent), (headers) => addSdkUserAgentHeader(headers, userAgent));
28167
28734
  }
28735
+ // ../common/src/telemetry/ship-succeeded.ts
28736
+ var shippedKeysSlot = singleton("ShipSucceededDedupeKeys");
28737
+ function getShippedKeys() {
28738
+ const existing = shippedKeysSlot.get();
28739
+ if (existing) {
28740
+ return existing;
28741
+ }
28742
+ const keys = new Set;
28743
+ shippedKeysSlot.set(keys);
28744
+ return keys;
28745
+ }
28746
+ function dedupeKey(payload) {
28747
+ return [
28748
+ payload.command_name,
28749
+ payload.ship_kind,
28750
+ payload.target,
28751
+ payload.project_type,
28752
+ payload.artifact_correlation_key ?? payload.package_version_key ?? payload.deployment_key ?? payload.solution_id ?? payload.package_name ?? ""
28753
+ ].join("|");
28754
+ }
28755
+ function trackShipSucceeded(payload) {
28756
+ const keys = getShippedKeys();
28757
+ const key = dedupeKey(payload);
28758
+ if (keys.has(key)) {
28759
+ return false;
28760
+ }
28761
+ keys.add(key);
28762
+ telemetry.trackEvent(CommonTelemetryEvents.ShipSucceeded, redactProperties({ ...payload }));
28763
+ return true;
28764
+ }
28168
28765
  // ../common/src/tool-provider.ts
28169
28766
  var factorySlot = singleton("PackagerFactoryProvider");
28170
28767
  // ../orchestrator-sdk/generated/src/runtime.ts
@@ -58030,6 +58627,32 @@ var registerMachinesCommand = (program2) => {
58030
58627
  };
58031
58628
 
58032
58629
  // src/commands/packages.ts
58630
+ function parsePackageKey(key) {
58631
+ if (!key) {
58632
+ return {};
58633
+ }
58634
+ const separatorIndex = key.lastIndexOf(":");
58635
+ if (separatorIndex <= 0 || separatorIndex === key.length - 1) {
58636
+ return { packageName: key };
58637
+ }
58638
+ return {
58639
+ packageName: key.slice(0, separatorIndex),
58640
+ packageVersion: key.slice(separatorIndex + 1)
58641
+ };
58642
+ }
58643
+ function getUploadedPackageKey(value) {
58644
+ const readKey = (candidate) => {
58645
+ if (typeof candidate !== "object" || candidate === null) {
58646
+ return;
58647
+ }
58648
+ const key = candidate.key;
58649
+ return typeof key === "string" ? key : undefined;
58650
+ };
58651
+ if (Array.isArray(value)) {
58652
+ return value.map(readKey).find((key) => key !== undefined);
58653
+ }
58654
+ return readKey(value);
58655
+ }
58033
58656
  function formatPackage(proc) {
58034
58657
  return {
58035
58658
  Key: proc.key || "",
@@ -58517,6 +59140,19 @@ var registerPackagesCommand = (program2) => {
58517
59140
  Response: result.value ?? null
58518
59141
  }
58519
59142
  });
59143
+ const packageKey = getUploadedPackageKey(result.value);
59144
+ const packageInfo = parsePackageKey(packageKey);
59145
+ trackShipSucceeded({
59146
+ ship_kind: "upload",
59147
+ target: target.folderKey === undefined ? "orchestrator_tenant_package_feed" : "orchestrator_folder_package_feed",
59148
+ project_type: "rpa",
59149
+ command_name: "uip.or.packages.upload",
59150
+ artifact_correlation_key: packageKey ?? fileName,
59151
+ package_name: packageInfo.packageName,
59152
+ package_version: packageInfo.packageVersion,
59153
+ folder_key: target.folderKey,
59154
+ feed_id: target.feedId
59155
+ });
58520
59156
  });
58521
59157
  packages.command("download").description("Download a .nupkg automation package from the Orchestrator feed. " + "The key format is 'PackageId:Version' (e.g., 'MyProcess:1.0.0'). " + "Use 'packages list' or 'packages versions' to find the key.").argument("<key>", "Package version key (format: 'PackageId:Version', e.g., 'MyProcess:1.0.0')").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("--feed-id <feedId>", "Feed ID (optional, defaults to tenant feed)").option("--folder-path <path>", "Folder path (e.g., 'Shared')").option("--folder-key <key>", "Folder key (GUID)").requiredOption("-d, --destination <file>", "Destination file path to save the downloaded package").examples(PACKAGES_DOWNLOAD_EXAMPLES).trackedAction(processContext, async (key, options) => {
58522
59158
  const [targetError, target] = await catchError(resolvePackageFeedTarget(options));
@@ -66692,4 +67328,4 @@ export {
66692
67328
  metadata
66693
67329
  };
66694
67330
 
66695
- //# debugId=AF89EF9E3EC6D09464756E2164756E21
67331
+ //# debugId=55B0367734E6EB6D64756E2164756E21
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/orchestrator-tool",
3
3
  "license": "MIT",
4
- "version": "1.197.0-preview.65",
4
+ "version": "1.197.0-preview.67",
5
5
  "description": "Manage Orchestrator folders, jobs, processes, and releases.",
6
6
  "private": false,
7
7
  "repository": {
@@ -26,5 +26,5 @@
26
26
  "files": [
27
27
  "dist"
28
28
  ],
29
- "gitHead": "9388ccbe5e739c9578bfd9b5395980fb63e11d9c"
29
+ "gitHead": "579e7d41cb100fcb8130eec8ed1c9b5b55feaf0b"
30
30
  }