@uipath/gov-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.
Files changed (2) hide show
  1. package/dist/tool.js +578 -9
  2. package/package.json +2 -2
package/dist/tool.js CHANGED
@@ -21230,7 +21230,7 @@ var require_commander = __commonJS((exports) => {
21230
21230
  var package_default = {
21231
21231
  name: "@uipath/gov-tool",
21232
21232
  license: "MIT",
21233
- version: "1.197.0-preview.64",
21233
+ version: "1.197.0-preview.66",
21234
21234
  description: "Manage UiPath governance — AOps policies, Access policies, and compliance packs.",
21235
21235
  private: false,
21236
21236
  repository: {
@@ -28785,9 +28785,228 @@ function getOutputFilter() {
28785
28785
  return filterSlot.get();
28786
28786
  }
28787
28787
 
28788
+ // ../../common/src/telemetry/command-terminal.ts
28789
+ var recordedFailureSlot = singleton("CommandTelemetryFailure");
28790
+ var AUTH_ERROR_CODES = new Set([
28791
+ "authentication_required",
28792
+ "permission_denied"
28793
+ ]);
28794
+ var VALIDATION_ERROR_CODES = new Set(["invalid_argument"]);
28795
+ var NETWORK_HTTP_ERROR_CODES = new Set([
28796
+ "network_error",
28797
+ "rate_limited",
28798
+ "server_error",
28799
+ "not_found",
28800
+ "method_not_allowed"
28801
+ ]);
28802
+ var TIMEOUT_ERROR_CODES = new Set(["timeout"]);
28803
+ var NETWORK_OS_ERROR_CODES = new Set([
28804
+ "ECONNREFUSED",
28805
+ "ECONNRESET",
28806
+ "ENOTFOUND",
28807
+ "EAI_AGAIN",
28808
+ "EPIPE",
28809
+ "EHOSTUNREACH",
28810
+ "ENETUNREACH",
28811
+ "EAI_FAIL"
28812
+ ]);
28813
+ var TIMEOUT_OS_ERROR_CODES = new Set(["ETIMEDOUT", "ESOCKETTIMEDOUT"]);
28814
+ var TLS_ERROR_CODES2 = new Set([
28815
+ "SELF_SIGNED_CERT_IN_CHAIN",
28816
+ "DEPTH_ZERO_SELF_SIGNED_CERT",
28817
+ "UNABLE_TO_VERIFY_LEAF_SIGNATURE",
28818
+ "UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
28819
+ "UNABLE_TO_GET_ISSUER_CERT",
28820
+ "CERT_HAS_EXPIRED",
28821
+ "CERT_UNTRUSTED",
28822
+ "ERR_TLS_CERT_ALTNAME_INVALID"
28823
+ ]);
28824
+ var MISSING_DEPENDENCY_CODES = new Set([
28825
+ "MODULE_NOT_FOUND",
28826
+ "ERR_MODULE_NOT_FOUND"
28827
+ ]);
28828
+ var INTERNAL_ERROR_NAMES = new Set([
28829
+ "TypeError",
28830
+ "ReferenceError",
28831
+ "SyntaxError",
28832
+ "RangeError"
28833
+ ]);
28834
+ function isRecord(value) {
28835
+ return value !== null && typeof value === "object";
28836
+ }
28837
+ function stringField(value, field) {
28838
+ if (!isRecord(value)) {
28839
+ return;
28840
+ }
28841
+ const raw = value[field];
28842
+ return typeof raw === "string" ? raw : undefined;
28843
+ }
28844
+ function numberField(value, field) {
28845
+ if (!isRecord(value)) {
28846
+ return;
28847
+ }
28848
+ const raw = value[field];
28849
+ return typeof raw === "number" ? raw : undefined;
28850
+ }
28851
+ function findStringInCauseChain(error, field) {
28852
+ let current = error;
28853
+ for (let depth = 0;depth < 5 && current !== null && typeof current === "object"; depth++) {
28854
+ const value = stringField(current, field);
28855
+ if (value) {
28856
+ return value;
28857
+ }
28858
+ current = current.cause;
28859
+ }
28860
+ return;
28861
+ }
28862
+ function findCodeInCauseChain(error) {
28863
+ return findStringInCauseChain(error, "code");
28864
+ }
28865
+ function isSpawnEnoent(error) {
28866
+ const code = findCodeInCauseChain(error);
28867
+ if (code !== "ENOENT") {
28868
+ return false;
28869
+ }
28870
+ const syscall = findStringInCauseChain(error, "syscall");
28871
+ return syscall?.startsWith("spawn") === true;
28872
+ }
28873
+ function isCancellationError(error, exitCode, pollSignal) {
28874
+ if (exitCode === 130) {
28875
+ return true;
28876
+ }
28877
+ if (!isRecord(error)) {
28878
+ return false;
28879
+ }
28880
+ if (numberField(error, "exitCode") === 130) {
28881
+ return true;
28882
+ }
28883
+ const name = stringField(error, "name");
28884
+ if (name === "ExitPromptError") {
28885
+ return true;
28886
+ }
28887
+ if (name === "AbortError" && pollSignal?.aborted) {
28888
+ return true;
28889
+ }
28890
+ const message = stringField(error, "message");
28891
+ return message?.includes("SIGINT") === true;
28892
+ }
28893
+ function terminalSignalFor(input, outcome) {
28894
+ if (input.recordedFailure?.terminalSignal) {
28895
+ return input.recordedFailure.terminalSignal;
28896
+ }
28897
+ const explicit = findStringInCauseChain(input.error, "terminalSignal") ?? findStringInCauseChain(input.error, "signal");
28898
+ if (explicit) {
28899
+ return explicit;
28900
+ }
28901
+ return outcome === "cancelled" ? "SIGINT" : undefined;
28902
+ }
28903
+ function classifyHttpStatus(status) {
28904
+ if (status === 401 || status === 403) {
28905
+ return "auth";
28906
+ }
28907
+ if (status === 400 || status === 409 || status === 422) {
28908
+ return "validation";
28909
+ }
28910
+ if (status === 408) {
28911
+ return "timeout";
28912
+ }
28913
+ return "network_http";
28914
+ }
28915
+ function classifyFromResult(result) {
28916
+ switch (result) {
28917
+ case "AuthenticationError":
28918
+ return "auth";
28919
+ case "ValidationError":
28920
+ return "validation";
28921
+ case "TimeoutError":
28922
+ return "timeout";
28923
+ default:
28924
+ return;
28925
+ }
28926
+ }
28927
+ function classifyFromErrorCode(errorCode2) {
28928
+ if (!errorCode2) {
28929
+ return;
28930
+ }
28931
+ if (AUTH_ERROR_CODES.has(errorCode2)) {
28932
+ return "auth";
28933
+ }
28934
+ if (VALIDATION_ERROR_CODES.has(errorCode2)) {
28935
+ return "validation";
28936
+ }
28937
+ if (TIMEOUT_ERROR_CODES.has(errorCode2)) {
28938
+ return "timeout";
28939
+ }
28940
+ if (NETWORK_HTTP_ERROR_CODES.has(errorCode2)) {
28941
+ return "network_http";
28942
+ }
28943
+ return;
28944
+ }
28945
+ function classifyFromError(error) {
28946
+ const code = findCodeInCauseChain(error);
28947
+ if (code) {
28948
+ if (code.startsWith("commander.")) {
28949
+ return "validation";
28950
+ }
28951
+ if (NETWORK_OS_ERROR_CODES.has(code) || TLS_ERROR_CODES2.has(code)) {
28952
+ return "network_http";
28953
+ }
28954
+ if (TIMEOUT_OS_ERROR_CODES.has(code)) {
28955
+ return "timeout";
28956
+ }
28957
+ if (MISSING_DEPENDENCY_CODES.has(code) || isSpawnEnoent(error)) {
28958
+ return "missing_dependency";
28959
+ }
28960
+ }
28961
+ const message = stringField(error, "message");
28962
+ if (message?.includes("fetch failed") === true) {
28963
+ return "network_http";
28964
+ }
28965
+ const name = stringField(error, "name");
28966
+ if (name && INTERNAL_ERROR_NAMES.has(name)) {
28967
+ return "internal";
28968
+ }
28969
+ return;
28970
+ }
28971
+ function classifyError2(input) {
28972
+ const recorded = input.recordedFailure;
28973
+ if (recorded?.errorClass) {
28974
+ return recorded.errorClass;
28975
+ }
28976
+ const status = recorded?.context?.httpStatus;
28977
+ if (status !== undefined) {
28978
+ return classifyHttpStatus(status);
28979
+ }
28980
+ return classifyFromResult(recorded?.result) ?? classifyFromErrorCode(recorded?.errorCode) ?? classifyFromError(input.error) ?? "unknown";
28981
+ }
28982
+ function recordCommandFailureTelemetry(failure) {
28983
+ recordedFailureSlot.set(failure);
28984
+ }
28985
+ function clearRecordedCommandFailureTelemetry() {
28986
+ recordedFailureSlot.clear();
28987
+ }
28988
+ function takeRecordedCommandFailureTelemetry() {
28989
+ const failure = recordedFailureSlot.get();
28990
+ recordedFailureSlot.clear();
28991
+ return failure;
28992
+ }
28993
+ function buildCommandTerminalTelemetryProperties(input) {
28994
+ const cancelled = isCancellationError(input.error, input.exitCode, input.pollSignal);
28995
+ const outcome = input.recordedFailure?.terminalOutcome ?? (input.exitCode === 0 ? "success" : cancelled ? "cancelled" : "failure");
28996
+ const errorClass = outcome === "success" || outcome === "no_op" ? undefined : outcome === "cancelled" ? "user_cancelled" : classifyError2(input);
28997
+ const terminalSignal = terminalSignalFor(input, outcome);
28998
+ return {
28999
+ exit_code: input.exitCode,
29000
+ terminal_outcome: outcome,
29001
+ ...errorClass ? { error_class: errorClass } : {},
29002
+ ...terminalSignal ? { terminal_signal: terminalSignal } : {}
29003
+ };
29004
+ }
29005
+
28788
29006
  // ../../common/src/telemetry/telemetry-events.ts
28789
29007
  var CommonTelemetryEvents = {
28790
- Error: "uip.error"
29008
+ Error: "uip.error",
29009
+ ShipSucceeded: "ship_succeeded"
28791
29010
  };
28792
29011
 
28793
29012
  // ../../common/src/registry.ts
@@ -28854,6 +29073,136 @@ function formatMessage(category, name, properties) {
28854
29073
  }
28855
29074
  return message;
28856
29075
  }
29076
+ // ../../common/src/telemetry/detect-agent.ts
29077
+ var KNOWN_AGENTS = [
29078
+ { envVar: "CLAUDECODE", value: "1", id: "claude-code" },
29079
+ { envVar: "CURSOR_AGENT", value: "1", id: "cursor" },
29080
+ { envVar: "GEMINI_CLI", value: "1", id: "gemini-cli" },
29081
+ { envVar: "CODEX_THREAD_ID", id: "codex" },
29082
+ { envVar: "CODEX_SANDBOX", id: "codex" },
29083
+ { envVar: "AUGMENT_AGENT", value: "1", id: "augment" },
29084
+ { envVar: "CLINE_ACTIVE", value: "true", id: "cline" }
29085
+ ];
29086
+ function detectAgentFromEnv(env) {
29087
+ for (const agent of KNOWN_AGENTS) {
29088
+ const envValue = env[agent.envVar];
29089
+ if (agent.value !== undefined) {
29090
+ if (envValue === agent.value)
29091
+ return agent.id;
29092
+ } else {
29093
+ if (envValue)
29094
+ return agent.id;
29095
+ }
29096
+ }
29097
+ const agentEnv = env.AGENT;
29098
+ if (agentEnv) {
29099
+ if (agentEnv === "1" || agentEnv === "true")
29100
+ return "unknown";
29101
+ if (agentEnv.length <= 32)
29102
+ return agentEnv.toLowerCase();
29103
+ }
29104
+ return;
29105
+ }
29106
+ // ../../common/src/telemetry/environment-info.ts
29107
+ var LOCAL_HOSTS = new Set(["localhost", "127.0.0.1", "::1", "[::1]"]);
29108
+ // ../../common/src/telemetry/execution-context.ts
29109
+ var authSignalSlot = singleton("TelemetryExecutionContextAuthSignal");
29110
+ var isTruthy = (value) => value !== undefined && value !== "" && value !== "0" && value.toLowerCase() !== "false";
29111
+ var isEqual = (value, expected) => value?.toLowerCase() === expected;
29112
+ var CI_SIGNATURES = [
29113
+ {
29114
+ provider: "github_actions",
29115
+ matches: (env) => isTruthy(env.GITHUB_ACTIONS),
29116
+ isScheduler: (env) => env.GITHUB_EVENT_NAME === "schedule"
29117
+ },
29118
+ {
29119
+ provider: "azure_devops",
29120
+ matches: (env) => isTruthy(env.TF_BUILD),
29121
+ isScheduler: (env) => isEqual(env.BUILD_REASON, "schedule")
29122
+ },
29123
+ {
29124
+ provider: "gitlab",
29125
+ matches: (env) => isTruthy(env.GITLAB_CI),
29126
+ isScheduler: (env) => env.CI_PIPELINE_SOURCE === "schedule"
29127
+ },
29128
+ {
29129
+ provider: "circleci",
29130
+ matches: (env) => isTruthy(env.CIRCLECI),
29131
+ isScheduler: (env) => env.CIRCLE_PIPELINE_TRIGGER_SOURCE === "scheduled_pipeline"
29132
+ },
29133
+ {
29134
+ provider: "jenkins",
29135
+ matches: (env) => isTruthy(env.JENKINS_URL) || isTruthy(env.JENKINS_HOME)
29136
+ },
29137
+ {
29138
+ provider: "teamcity",
29139
+ matches: (env) => isTruthy(env.TEAMCITY_VERSION)
29140
+ },
29141
+ {
29142
+ provider: "buildkite",
29143
+ matches: (env) => isTruthy(env.BUILDKITE),
29144
+ isScheduler: (env) => env.BUILDKITE_SOURCE === "schedule"
29145
+ },
29146
+ {
29147
+ provider: "bitbucket",
29148
+ matches: (env) => isTruthy(env.BITBUCKET_BUILD_NUMBER)
29149
+ },
29150
+ {
29151
+ provider: "travis",
29152
+ matches: (env) => isTruthy(env.TRAVIS)
29153
+ },
29154
+ {
29155
+ provider: "appveyor",
29156
+ matches: (env) => isTruthy(env.APPVEYOR)
29157
+ },
29158
+ {
29159
+ provider: "generic",
29160
+ matches: (env) => isTruthy(env.CI)
29161
+ }
29162
+ ];
29163
+ function currentEnv() {
29164
+ return typeof process === "undefined" ? {} : process.env;
29165
+ }
29166
+ function currentTtyState() {
29167
+ if (typeof process === "undefined")
29168
+ return false;
29169
+ return Boolean(process.stdout?.isTTY || process.stdin?.isTTY || process.stderr?.isTTY);
29170
+ }
29171
+ function detectCi(env) {
29172
+ const signature = CI_SIGNATURES.find((candidate) => candidate.matches(env));
29173
+ if (!signature)
29174
+ return;
29175
+ return {
29176
+ executionContext: signature.isScheduler?.(env) ? "scheduler" : "ci",
29177
+ ciProvider: signature.provider
29178
+ };
29179
+ }
29180
+ function detectExecutionContext(options = {}) {
29181
+ const env = options.env ?? currentEnv();
29182
+ const ci = detectCi(env);
29183
+ if (ci)
29184
+ return ci;
29185
+ const agent = options.agent ?? detectAgentFromEnv(env);
29186
+ if (agent) {
29187
+ return { executionContext: "agent" };
29188
+ }
29189
+ const authSignal = options.authSignal ?? authSignalSlot.get();
29190
+ if (authSignal === "service_account") {
29191
+ return { executionContext: "service_account" };
29192
+ }
29193
+ const isTty = options.isTty ?? currentTtyState();
29194
+ if (isTty) {
29195
+ return { executionContext: "manual" };
29196
+ }
29197
+ return { executionContext: "unknown" };
29198
+ }
29199
+ function getExecutionContextTelemetryProperties() {
29200
+ const detected = detectExecutionContext();
29201
+ return {
29202
+ execution_context: detected.executionContext,
29203
+ ...detected.ciProvider ? { ci_provider: detected.ciProvider } : {}
29204
+ };
29205
+ }
28857
29206
  // ../../common/src/telemetry/node-context-storage.ts
28858
29207
  import { AsyncLocalStorage } from "node:async_hooks";
28859
29208
 
@@ -28866,6 +29215,26 @@ class NodeContextStorage {
28866
29215
  return this.storage.getStore();
28867
29216
  }
28868
29217
  }
29218
+ // ../../common/src/telemetry/session-id.ts
29219
+ var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
29220
+ var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
29221
+ var telemetrySessionIdSlot = singleton("TelemetrySessionId");
29222
+ function getProcessEnv() {
29223
+ return globalThis.process?.env;
29224
+ }
29225
+ function normalizeSessionId(value) {
29226
+ if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
29227
+ return;
29228
+ }
29229
+ const trimmed = String(value).trim();
29230
+ return trimmed || undefined;
29231
+ }
29232
+ function getConfiguredTelemetrySessionId() {
29233
+ return normalizeSessionId(getProcessEnv()?.[TELEMETRY_SESSION_ID_ENV]);
29234
+ }
29235
+ function resolveTelemetrySessionId(existingSessionId) {
29236
+ return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
29237
+ }
28869
29238
  // ../../common/src/telemetry/telemetry-service.ts
28870
29239
  class TelemetryService {
28871
29240
  telemetryProvider;
@@ -28944,12 +29313,22 @@ class TelemetryService {
28944
29313
  return this.contextStorage.getContext();
28945
29314
  }
28946
29315
  enrichPropertiesWithContext(properties, context) {
28947
- return {
28948
- ...getGlobalTelemetryProperties(),
29316
+ const globalProperties = getGlobalTelemetryProperties();
29317
+ const existingSessionId = properties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? this.defaultProperties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? globalProperties?.[TELEMETRY_SESSION_ID_PROPERTY];
29318
+ const sessionId = resolveTelemetrySessionId(existingSessionId);
29319
+ const enriched = {
29320
+ ...getExecutionContextTelemetryProperties(),
29321
+ ...globalProperties,
28949
29322
  ...this.defaultProperties,
28950
29323
  ...properties,
28951
29324
  ...context
28952
29325
  };
29326
+ if (sessionId === undefined) {
29327
+ delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
29328
+ } else {
29329
+ enriched[TELEMETRY_SESSION_ID_PROPERTY] = sessionId;
29330
+ }
29331
+ return enriched;
28953
29332
  }
28954
29333
  generateId() {
28955
29334
  return crypto.randomUUID().replaceAll("-", "");
@@ -29419,8 +29798,24 @@ var OutputFormatter;
29419
29798
  data.ErrorCode ??= defaultErrorCodeForFailure(data);
29420
29799
  data.Retry ??= defaultRetryForErrorCode(data.ErrorCode);
29421
29800
  process.exitCode = EXIT_CODES[data.Result] ?? 1;
29422
- const { SuppressTelemetry, ...envelope } = data;
29423
- if (!SuppressTelemetry) {
29801
+ recordCommandFailureTelemetry({
29802
+ result: data.Result,
29803
+ errorCode: data.ErrorCode,
29804
+ retry: data.Retry,
29805
+ message: data.Message,
29806
+ context: data.Context,
29807
+ exitCode: process.exitCode,
29808
+ errorClass: data.TelemetryErrorClass,
29809
+ terminalOutcome: data.TelemetryTerminalOutcome,
29810
+ terminalSignal: data.TelemetryTerminalSignal
29811
+ });
29812
+ const suppressTelemetry = data.SuppressTelemetry === true;
29813
+ const envelope = { ...data };
29814
+ delete envelope.SuppressTelemetry;
29815
+ delete envelope.TelemetryErrorClass;
29816
+ delete envelope.TelemetryTerminalOutcome;
29817
+ delete envelope.TelemetryTerminalSignal;
29818
+ if (!suppressTelemetry) {
29424
29819
  telemetry.trackEvent(CommonTelemetryEvents.Error, {
29425
29820
  result: data.Result,
29426
29821
  errorCode: data.ErrorCode,
@@ -29483,6 +29878,158 @@ var OutputFormatter;
29483
29878
  OutputFormatter.formatToString = formatToString;
29484
29879
  })(OutputFormatter ||= {});
29485
29880
 
29881
+ // ../../common/src/telemetry/command-attribution.ts
29882
+ var LEGACY_SKILL_NAMESPACE = "uipath:";
29883
+ var MAX_SKILL_NAME_LENGTH = 80;
29884
+ var SKILL_NAME_PATTERN = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
29885
+ function productMode(productArea, mode) {
29886
+ return { product_area: productArea, mode };
29887
+ }
29888
+ function attributionRecord(groups) {
29889
+ const record = {};
29890
+ for (const [productArea, mode, names] of groups) {
29891
+ const attribution = productMode(productArea, mode);
29892
+ for (const name of names) {
29893
+ record[name] = attribution;
29894
+ }
29895
+ }
29896
+ return record;
29897
+ }
29898
+ function commandAttribution(groups) {
29899
+ const entries = [];
29900
+ for (const [productArea, mode, prefixes] of groups) {
29901
+ const attribution = productMode(productArea, mode);
29902
+ for (const prefix of prefixes) {
29903
+ entries.push({ prefix, attribution });
29904
+ }
29905
+ }
29906
+ return entries;
29907
+ }
29908
+ var SKILL_ATTRIBUTION = attributionRecord([
29909
+ ["admin", "operate", ["uipath-admin"]],
29910
+ ["agents", "build", ["uipath-agents"]],
29911
+ ["api-workflow", "build", ["uipath-api-workflow"]],
29912
+ ["automation-discovery", "build", ["uipath-automation-discovery"]],
29913
+ ["coded-apps", "build", ["uipath-coded-apps"]],
29914
+ ["data-fabric", "operate", ["uipath-data-fabric"]],
29915
+ ["cli", "troubleshoot", ["uipath-feedback"]],
29916
+ ["governance", "operate", ["uipath-governance"]],
29917
+ ["action-center", "build", ["uipath-human-in-the-loop"]],
29918
+ ["document-understanding", "build", ["uipath-ixp"]],
29919
+ [
29920
+ "maestro",
29921
+ "build",
29922
+ ["uipath-maestro-bpmn", "uipath-maestro-case", "uipath-maestro-flow"]
29923
+ ],
29924
+ ["agenthub", "build", ["uipath-mcp-servers"]],
29925
+ ["solution", "build", ["uipath-planner", "uipath-solution"]],
29926
+ ["platform", "operate", ["uipath-platform"]],
29927
+ ["quality", "troubleshoot", ["uipath-review"]],
29928
+ ["rpa", "build", ["uipath-rpa"]],
29929
+ ["cli", "operate", ["uipath-skill-catalog"]],
29930
+ ["action-center", "operate", ["uipath-tasks"]],
29931
+ ["test-manager", "operate", ["uipath-test"]],
29932
+ ["platform", "troubleshoot", ["uipath-troubleshoot"]]
29933
+ ]);
29934
+ var KNOWN_SKILL_NAMES = new Set(Object.keys(SKILL_ATTRIBUTION));
29935
+ var COMMAND_ATTRIBUTION = commandAttribution([
29936
+ ["cli", "troubleshoot", ["uip.feedback"]],
29937
+ ["llm-gateway", "operate", ["uip.llm-configuration", "uip.model-hub"]],
29938
+ ["context-grounding", "build", ["uip.context-grounding"]],
29939
+ ["api-workflow", "build", ["uip.api-workflow"]],
29940
+ ["rpa", "build", ["uip.rpa-legacy"]],
29941
+ ["conversational", "operate", ["uip.conversational"]],
29942
+ ["agents", "build", ["uip.codedagent", "uip.agent"]],
29943
+ ["agenthub", "build", ["uip.agenthub"]],
29944
+ ["coded-apps", "build", ["uip.codedapp"]],
29945
+ ["functions", "build", ["uip.functions"]],
29946
+ ["solution", "build", ["uip.solution"]],
29947
+ ["maestro", "build", ["uip.maestro", "uip.case", "uip.flow"]],
29948
+ ["llm-observability", "troubleshoot", ["uip.traces"]],
29949
+ ["platform", "operate", ["uip.platform"]],
29950
+ ["admin", "operate", ["uip.admin"]],
29951
+ ["automation-ops", "operate", ["uip.aops"]],
29952
+ ["documentation", "troubleshoot", ["uip.docsai"]],
29953
+ ["governance", "operate", ["uip.gov"]],
29954
+ ["insights", "operate", ["uip.insights"]],
29955
+ ["document-understanding", "build", ["uip.ixp"]],
29956
+ ["process-mining", "operate", ["uip.pm"]],
29957
+ ["action-center", "operate", ["uip.tasks"]],
29958
+ ["test-manager", "operate", ["uip.tm"]],
29959
+ ["vertical-solutions", "build", ["uip.vss"]],
29960
+ ["data-fabric", "operate", ["uip.df"]],
29961
+ ["integration-service", "build", ["uip.is"]],
29962
+ ["orchestrator", "operate", ["uip.or"]],
29963
+ [
29964
+ "cli",
29965
+ "operate",
29966
+ [
29967
+ "uip.login",
29968
+ "uip.logout",
29969
+ "uip.user",
29970
+ "uip.config",
29971
+ "uip.tools",
29972
+ "uip.skills",
29973
+ "uip.completion",
29974
+ "uip.update",
29975
+ "uip.mcp",
29976
+ "uip.track"
29977
+ ]
29978
+ ]
29979
+ ]).sort((a, b) => b.prefix.length - a.prefix.length);
29980
+ function normalizeCommandPath(value) {
29981
+ if (typeof value !== "string") {
29982
+ return;
29983
+ }
29984
+ const trimmed = value.trim().toLowerCase();
29985
+ if (!trimmed) {
29986
+ return;
29987
+ }
29988
+ const tokens = trimmed.includes(" ") ? trimmed.split(/\s+/).filter((token) => token.length > 0).filter((token) => !token.startsWith("-")) : trimmed.split(".").filter((token) => token.length > 0);
29989
+ if (tokens.length === 0) {
29990
+ return;
29991
+ }
29992
+ const commandTokens = tokens[0] === "uip" ? tokens : ["uip", ...tokens];
29993
+ return commandTokens.join(".");
29994
+ }
29995
+ function getCommandProductModeAttribution(commandPath) {
29996
+ const normalized = normalizeCommandPath(commandPath);
29997
+ if (!normalized) {
29998
+ return;
29999
+ }
30000
+ return COMMAND_ATTRIBUTION.find(({ prefix }) => normalized === prefix || normalized.startsWith(`${prefix}.`))?.attribution;
30001
+ }
30002
+ function normalizeSkillNameWithOptions(value, options) {
30003
+ if (typeof value !== "string") {
30004
+ return;
30005
+ }
30006
+ const normalized = value.trim().toLowerCase();
30007
+ if (!normalized) {
30008
+ return;
30009
+ }
30010
+ const hasLegacyNamespace = normalized.startsWith(LEGACY_SKILL_NAMESPACE);
30011
+ if (hasLegacyNamespace && !options.allowLegacyNamespace) {
30012
+ return;
30013
+ }
30014
+ const skillName = hasLegacyNamespace ? normalized.slice(LEGACY_SKILL_NAMESPACE.length) : normalized;
30015
+ if (skillName.length > MAX_SKILL_NAME_LENGTH || !SKILL_NAME_PATTERN.test(skillName) || !KNOWN_SKILL_NAMES.has(skillName)) {
30016
+ return;
30017
+ }
30018
+ return skillName;
30019
+ }
30020
+ function normalizeSkillName(value) {
30021
+ return normalizeSkillNameWithOptions(value, {
30022
+ allowLegacyNamespace: false
30023
+ });
30024
+ }
30025
+ function buildCommandTelemetryAttribution(commandPath, skillSource) {
30026
+ const skillName = normalizeSkillName(skillSource);
30027
+ return {
30028
+ ...skillName ? { skill_name: skillName } : {},
30029
+ ...getCommandProductModeAttribution(commandPath)
30030
+ };
30031
+ }
30032
+
29486
30033
  // ../../common/src/telemetry/pii-redactor.ts
29487
30034
  var REDACTED = "[REDACTED]";
29488
30035
  var MAX_VALUE_LENGTH = 200;
@@ -29668,6 +30215,12 @@ function commandHelpHint(commandPath) {
29668
30215
  const command = commandPath.replace(/\./g, " ");
29669
30216
  return `An unexpected error occurred. Run '${command} --help' to verify command syntax, or run with --log-level debug for details.`;
29670
30217
  }
30218
+ function isPromptCancellation(error) {
30219
+ return error instanceof Error && error.name === "ExitPromptError";
30220
+ }
30221
+ function exitCodeFromProcess(fallback) {
30222
+ return typeof process.exitCode === "number" ? process.exitCode : fallback;
30223
+ }
29671
30224
  Command.prototype.trackedAction = function(context, fn, properties) {
29672
30225
  const command = this;
29673
30226
  return this.action(async (...args) => {
@@ -29675,6 +30228,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
29675
30228
  const props = typeof properties === "function" ? properties(...args) : properties;
29676
30229
  const startTime = performance.now();
29677
30230
  let errorMessage2;
30231
+ let fallbackExitCode = EXIT_CODES.Success;
30232
+ clearRecordedCommandFailureTelemetry();
29678
30233
  const [error] = await catchError2(fn(...args));
29679
30234
  if (error) {
29680
30235
  errorMessage2 = error instanceof Error ? error.message : String(error);
@@ -29689,6 +30244,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
29689
30244
  const customRetry = isRetryHint(typedRetry) ? typedRetry : undefined;
29690
30245
  const typedContext = typed.context ?? typed.Context;
29691
30246
  const customContext = isErrorContext(typedContext) ? typedContext : undefined;
30247
+ const cancellationExitCode = typed.exitCode === 130 || isPromptCancellation(error) ? 130 : undefined;
30248
+ fallbackExitCode = cancellationExitCode ?? EXIT_CODES[finalResult];
29692
30249
  OutputFormatter.error({
29693
30250
  Result: finalResult,
29694
30251
  ...customErrorCode ? { ErrorCode: customErrorCode } : {},
@@ -29697,16 +30254,26 @@ Command.prototype.trackedAction = function(context, fn, properties) {
29697
30254
  ...customRetry ? { Retry: customRetry } : {},
29698
30255
  ...customContext ? { Context: customContext } : {}
29699
30256
  });
29700
- context.exit(EXIT_CODES[finalResult]);
30257
+ context.exit(fallbackExitCode);
29701
30258
  }
29702
30259
  const durationMs = performance.now() - startTime;
29703
- const success = !error && (process.exitCode === undefined || process.exitCode === 0);
30260
+ const exitCode = fallbackExitCode === 130 ? fallbackExitCode : exitCodeFromProcess(fallbackExitCode);
30261
+ const recordedFailure = takeRecordedCommandFailureTelemetry();
30262
+ const success = !error && exitCode === 0;
30263
+ const terminalTelemetry = buildCommandTerminalTelemetryProperties({
30264
+ error,
30265
+ exitCode,
30266
+ recordedFailure,
30267
+ pollSignal: context.pollSignal
30268
+ });
29704
30269
  telemetry.trackEvent(telemetryName, redactProperties({
29705
30270
  ...extractCommandParams(command),
29706
30271
  ...props,
30272
+ ...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
29707
30273
  command: "true",
29708
30274
  duration: String(durationMs),
29709
30275
  success: String(success),
30276
+ ...terminalTelemetry,
29710
30277
  ...errorMessage2 ? { errorMessage: errorMessage2 } : {}
29711
30278
  }));
29712
30279
  });
@@ -29787,6 +30354,8 @@ var ScreenLogger;
29787
30354
  }
29788
30355
  ScreenLogger.progress = progress;
29789
30356
  })(ScreenLogger ||= {});
30357
+ // ../../common/src/telemetry/ship-succeeded.ts
30358
+ var shippedKeysSlot = singleton("ShipSucceededDedupeKeys");
29790
30359
  // ../../common/src/tool-provider.ts
29791
30360
  var factorySlot = singleton("PackagerFactoryProvider");
29792
30361
  // src/commands/access-policy/policy.ts
@@ -58346,4 +58915,4 @@ export {
58346
58915
  metadata
58347
58916
  };
58348
58917
 
58349
- //# debugId=37116C836766B7F364756E2164756E21
58918
+ //# debugId=E2E4F74EC96D9DD464756E2164756E21
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/gov-tool",
3
3
  "license": "MIT",
4
- "version": "1.197.0-preview.64",
4
+ "version": "1.197.0-preview.66",
5
5
  "description": "Manage UiPath governance — AOps policies, Access policies, and compliance packs.",
6
6
  "private": false,
7
7
  "repository": {
@@ -23,5 +23,5 @@
23
23
  "files": [
24
24
  "dist"
25
25
  ],
26
- "gitHead": "3977b977945bf519336258da69fd271433eaaef4"
26
+ "gitHead": "386b0837882b19062bf744c74949cdf9c5e48dea"
27
27
  }