@uipath/agent-tool 1.198.0-preview.95 → 1.198.0

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 +272 -156
  2. package/package.json +2 -2
package/dist/tool.js CHANGED
@@ -8874,10 +8874,36 @@ class NodeContextStorage {
8874
8874
  }
8875
8875
  var init_node_context_storage = () => {};
8876
8876
 
8877
- // ../common/src/telemetry/session-id.ts
8877
+ // ../common/src/telemetry/trace-context.ts
8878
8878
  function getProcessEnv() {
8879
8879
  return globalThis.process?.env;
8880
8880
  }
8881
+ function parseInboundTraceparent(value) {
8882
+ if (!value) {
8883
+ return;
8884
+ }
8885
+ const match = TRACEPARENT_PATTERN.exec(value.trim().toLowerCase());
8886
+ if (!match) {
8887
+ return;
8888
+ }
8889
+ const [, traceId, parentSpanId] = match;
8890
+ if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
8891
+ return;
8892
+ }
8893
+ return { traceId, parentSpanId };
8894
+ }
8895
+ function getInboundTraceContext() {
8896
+ return parseInboundTraceparent(getProcessEnv()?.[TELEMETRY_TRACEPARENT_ENV]);
8897
+ }
8898
+ var TELEMETRY_TRACEPARENT_ENV = "TRACEPARENT", TRACEPARENT_PATTERN;
8899
+ var init_trace_context = __esm(() => {
8900
+ TRACEPARENT_PATTERN = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
8901
+ });
8902
+
8903
+ // ../common/src/telemetry/session-id.ts
8904
+ function getProcessEnv2() {
8905
+ return globalThis.process?.env;
8906
+ }
8881
8907
  function normalizeSessionId(value) {
8882
8908
  if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
8883
8909
  return;
@@ -8886,15 +8912,27 @@ function normalizeSessionId(value) {
8886
8912
  return trimmed || undefined;
8887
8913
  }
8888
8914
  function getConfiguredTelemetrySessionId() {
8889
- return normalizeSessionId(getProcessEnv()?.[TELEMETRY_SESSION_ID_ENV]);
8915
+ return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
8890
8916
  }
8891
8917
  function resolveTelemetrySessionId(existingSessionId) {
8892
8918
  return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
8893
8919
  }
8894
- var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID", TELEMETRY_SESSION_ID_PROPERTY = "session_id", telemetrySessionIdSlot;
8920
+ function getTelemetryOperationId() {
8921
+ const existing = telemetryOperationIdSlot.get();
8922
+ if (existing) {
8923
+ return existing;
8924
+ }
8925
+ const inboundTraceId = getInboundTraceContext()?.traceId;
8926
+ const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
8927
+ telemetryOperationIdSlot.set(generated);
8928
+ return generated;
8929
+ }
8930
+ var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID", TELEMETRY_SESSION_ID_PROPERTY = "session_id", telemetrySessionIdSlot, telemetryOperationIdSlot;
8895
8931
  var init_session_id = __esm(() => {
8896
8932
  init_singleton();
8933
+ init_trace_context();
8897
8934
  telemetrySessionIdSlot = singleton("TelemetrySessionId");
8935
+ telemetryOperationIdSlot = singleton("TelemetryOperationId");
8898
8936
  });
8899
8937
 
8900
8938
  // ../common/src/telemetry/global-telemetry-properties.ts
@@ -8907,6 +8945,140 @@ var init_global_telemetry_properties = __esm(() => {
8907
8945
  telemetryPropsSlot = singleton("TelemetryDefaultProps");
8908
8946
  });
8909
8947
 
8948
+ // ../common/src/telemetry/pii-redactor.ts
8949
+ function shortHash(input) {
8950
+ let hash = 2166136261;
8951
+ for (let i = 0;i < input.length; i++) {
8952
+ hash ^= input.charCodeAt(i);
8953
+ hash = Math.imul(hash, 16777619);
8954
+ }
8955
+ return (hash >>> 0).toString(16).padStart(8, "0");
8956
+ }
8957
+ function redactUrl(raw) {
8958
+ try {
8959
+ const url = new URL(raw);
8960
+ return `${url.protocol}//${url.host}`;
8961
+ } catch {
8962
+ return `url#${shortHash(raw)}`;
8963
+ }
8964
+ }
8965
+ function redactValueDetectors(value) {
8966
+ let out = value;
8967
+ out = out.replace(JWT_PATTERN, () => REDACTED);
8968
+ out = out.replace(URL_PATTERN, (match) => {
8969
+ const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
8970
+ const core2 = trailing ? match.slice(0, -trailing.length) : match;
8971
+ return `${redactUrl(core2)}${trailing}`;
8972
+ });
8973
+ out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
8974
+ out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
8975
+ out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
8976
+ out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
8977
+ if (out.length > MAX_VALUE_LENGTH) {
8978
+ out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
8979
+ }
8980
+ return out;
8981
+ }
8982
+ function redactValue(value) {
8983
+ return redactValueDetectors(value);
8984
+ }
8985
+ function redactError(error) {
8986
+ const safe = new Error(redactValueDetectors(error.message ?? ""));
8987
+ safe.name = error.name;
8988
+ safe.stack = typeof error.stack === "string" ? redactValueDetectors(error.stack) : undefined;
8989
+ return safe;
8990
+ }
8991
+ function nameTokens(name) {
8992
+ return name.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").split(/[\s._-]+/).map((t) => t.toLowerCase()).filter(Boolean);
8993
+ }
8994
+ function isSensitiveName(name) {
8995
+ const tokens = nameTokens(name);
8996
+ for (let i = 0;i < tokens.length; i++) {
8997
+ const token = tokens[i];
8998
+ if (SENSITIVE_NAME_TOKENS.has(token)) {
8999
+ return true;
9000
+ }
9001
+ if (token === "key" || token === "keys") {
9002
+ const prev = tokens[i - 1];
9003
+ if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
9004
+ return true;
9005
+ }
9006
+ }
9007
+ }
9008
+ return false;
9009
+ }
9010
+ function redactProperty(name, value) {
9011
+ if (value === undefined || value === null) {
9012
+ return;
9013
+ }
9014
+ if (isSensitiveName(name)) {
9015
+ return REDACTED;
9016
+ }
9017
+ if (typeof value === "boolean" || typeof value === "number") {
9018
+ return value;
9019
+ }
9020
+ if (typeof value !== "string") {
9021
+ return "[OBJECT]";
9022
+ }
9023
+ return redactValueDetectors(value);
9024
+ }
9025
+ function redactProperties(properties) {
9026
+ const out = {};
9027
+ for (const [name, value] of Object.entries(properties)) {
9028
+ const redacted = redactProperty(name, value);
9029
+ if (redacted !== undefined) {
9030
+ out[name] = redacted;
9031
+ }
9032
+ }
9033
+ return out;
9034
+ }
9035
+ var REDACTED = "[REDACTED]", MAX_VALUE_LENGTH = 200, SENSITIVE_NAME_TOKENS, SENSITIVE_KEY_PREFIXES, UUID_PATTERN, EMAIL_PATTERN, JWT_PATTERN, LONG_TOKEN_PATTERN, USER_HOME_PATTERN, URL_PATTERN, URL_TRAILING_PUNCT;
9036
+ var init_pii_redactor = __esm(() => {
9037
+ SENSITIVE_NAME_TOKENS = new Set([
9038
+ "token",
9039
+ "tokens",
9040
+ "secret",
9041
+ "secrets",
9042
+ "password",
9043
+ "passwords",
9044
+ "pwd",
9045
+ "credential",
9046
+ "credentials",
9047
+ "auth",
9048
+ "authentication",
9049
+ "authorization",
9050
+ "authority",
9051
+ "cert",
9052
+ "certificate",
9053
+ "certificates"
9054
+ ]);
9055
+ SENSITIVE_KEY_PREFIXES = new Set([
9056
+ "api",
9057
+ "access",
9058
+ "client",
9059
+ "private",
9060
+ "public",
9061
+ "signing",
9062
+ "encryption",
9063
+ "session",
9064
+ "master",
9065
+ "shared",
9066
+ "root",
9067
+ "ssh",
9068
+ "rsa",
9069
+ "aes",
9070
+ "hmac",
9071
+ "oauth"
9072
+ ]);
9073
+ UUID_PATTERN = /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi;
9074
+ EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
9075
+ JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
9076
+ LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
9077
+ USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
9078
+ URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
9079
+ URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
9080
+ });
9081
+
8910
9082
  // ../common/src/telemetry/telemetry-service.ts
8911
9083
  class TelemetryService {
8912
9084
  telemetryProvider;
@@ -8934,11 +9106,15 @@ class TelemetryService {
8934
9106
  trackException(error, properties) {
8935
9107
  const context = this.getCurrentContext();
8936
9108
  const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
8937
- this.telemetryProvider.trackException(error, enrichedProperties);
9109
+ this.telemetryProvider.trackException(redactError(error), enrichedProperties);
8938
9110
  }
8939
9111
  async trackRequest(name, fn, properties) {
9112
+ const parentContext = this.getCurrentContext();
9113
+ const operationId = parentContext?.operationId ?? this.operationId ?? getTelemetryOperationId();
9114
+ const parentId = parentContext ? parentContext.id : this.inboundParentIdFor(operationId);
8940
9115
  const context = {
8941
- operationId: this.operationId ?? this.generateId(),
9116
+ operationId,
9117
+ ...parentId !== undefined ? { parentId } : {},
8942
9118
  id: this.generateId()
8943
9119
  };
8944
9120
  const startTime = performance.now();
@@ -8956,6 +9132,45 @@ class TelemetryService {
8956
9132
  throw error;
8957
9133
  }
8958
9134
  }
9135
+ trackRequestResult(name, durationMs, success, properties, context) {
9136
+ const requestContext = context ?? {
9137
+ operationId: this.operationId ?? getTelemetryOperationId(),
9138
+ id: this.generateId()
9139
+ };
9140
+ const enrichedProperties = this.enrichPropertiesWithContext(properties, requestContext);
9141
+ this.telemetryProvider.trackRequest(name, durationMs, success, enrichedProperties);
9142
+ }
9143
+ createRequestContext() {
9144
+ const operationId = this.operationId ?? getTelemetryOperationId();
9145
+ const parentId = this.inboundParentIdFor(operationId);
9146
+ return {
9147
+ operationId,
9148
+ ...parentId !== undefined ? { parentId } : {},
9149
+ id: this.generateId()
9150
+ };
9151
+ }
9152
+ inboundParentIdFor(operationId) {
9153
+ const inbound = getInboundTraceContext();
9154
+ return inbound && inbound.traceId === operationId ? inbound.parentSpanId : undefined;
9155
+ }
9156
+ runWithContext(context, fn) {
9157
+ return this.contextStorage.run(context, fn);
9158
+ }
9159
+ createDependencyContext() {
9160
+ const parentContext = this.getCurrentContext();
9161
+ if (!parentContext) {
9162
+ return;
9163
+ }
9164
+ return {
9165
+ operationId: parentContext.operationId,
9166
+ parentId: parentContext.id,
9167
+ id: this.generateId()
9168
+ };
9169
+ }
9170
+ trackDependencyResult(name, type2, durationMs, success, properties, context, resultCode) {
9171
+ const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
9172
+ this.telemetryProvider.trackDependency(redactValue(name), type2, durationMs, success, enrichedProperties, resultCode);
9173
+ }
8959
9174
  async trackDependencyOperation(name, type2, fn, properties) {
8960
9175
  const parentContext = this.getCurrentContext();
8961
9176
  if (!parentContext) {
@@ -8992,8 +9207,12 @@ class TelemetryService {
8992
9207
  ...getExecutionContextTelemetryProperties(),
8993
9208
  ...globalProperties,
8994
9209
  ...this.defaultProperties,
8995
- ...properties,
8996
- ...context
9210
+ ...redactProperties(properties ?? {}),
9211
+ ...context ? {
9212
+ [TELEMETRY_OPERATION_ID_PROPERTY]: context.operationId,
9213
+ ...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY]: context.parentId } : {},
9214
+ [TELEMETRY_SPAN_ID_PROPERTY]: context.id
9215
+ } : {}
8997
9216
  };
8998
9217
  if (sessionId === undefined) {
8999
9218
  delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
@@ -9003,13 +9222,30 @@ class TelemetryService {
9003
9222
  return enriched;
9004
9223
  }
9005
9224
  generateId() {
9006
- return crypto.randomUUID().replaceAll("-", "");
9225
+ const bytes = new Uint8Array(8);
9226
+ let hex = "";
9227
+ do {
9228
+ crypto.getRandomValues(bytes);
9229
+ hex = "";
9230
+ for (const byte of bytes) {
9231
+ hex += byte.toString(16).padStart(2, "0");
9232
+ }
9233
+ } while (/^0+$/.test(hex));
9234
+ return hex;
9007
9235
  }
9008
9236
  }
9237
+ var TELEMETRY_OPERATION_ID_PROPERTY = "uip.trace.operation_id", TELEMETRY_PARENT_ID_PROPERTY = "uip.trace.parent_id", TELEMETRY_SPAN_ID_PROPERTY = "uip.trace.span_id";
9009
9238
  var init_telemetry_service = __esm(() => {
9010
9239
  init_execution_context();
9011
9240
  init_global_telemetry_properties();
9241
+ init_pii_redactor();
9012
9242
  init_session_id();
9243
+ init_trace_context();
9244
+ });
9245
+
9246
+ // ../common/src/telemetry/tracked-fetch.ts
9247
+ var init_tracked_fetch = __esm(() => {
9248
+ init_telemetry_init();
9013
9249
  });
9014
9250
 
9015
9251
  // ../common/src/telemetry/node.ts
@@ -9021,6 +9257,8 @@ var init_node2 = __esm(() => {
9021
9257
  init_node_context_storage();
9022
9258
  init_session_id();
9023
9259
  init_telemetry_service();
9260
+ init_trace_context();
9261
+ init_tracked_fetch();
9024
9262
  });
9025
9263
 
9026
9264
  // ../common/src/telemetry/node-appinsights-telemetry-provider.ts
@@ -9030,6 +9268,7 @@ var init_node_appinsights_telemetry_provider = __esm(() => {
9030
9268
  init_singleton();
9031
9269
  init_global_telemetry_properties();
9032
9270
  init_session_id();
9271
+ init_telemetry_service();
9033
9272
  init_global_telemetry_properties();
9034
9273
  providerSlot = singleton("TelemetryProvider");
9035
9274
  });
@@ -9747,150 +9986,21 @@ var init_command_attribution = __esm(() => {
9747
9986
  ]).sort((a, b) => b.prefix.length - a.prefix.length);
9748
9987
  });
9749
9988
 
9750
- // ../common/src/telemetry/pii-redactor.ts
9751
- function shortHash(input) {
9752
- let hash = 2166136261;
9753
- for (let i = 0;i < input.length; i++) {
9754
- hash ^= input.charCodeAt(i);
9755
- hash = Math.imul(hash, 16777619);
9756
- }
9757
- return (hash >>> 0).toString(16).padStart(8, "0");
9758
- }
9759
- function redactUrl(raw) {
9760
- try {
9761
- const url = new URL(raw);
9762
- return `${url.protocol}//${url.host}`;
9763
- } catch {
9764
- return `url#${shortHash(raw)}`;
9765
- }
9766
- }
9767
- function redactValueDetectors(value) {
9768
- let out = value;
9769
- out = out.replace(JWT_PATTERN, () => REDACTED);
9770
- out = out.replace(URL_PATTERN, (match) => {
9771
- const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
9772
- const core2 = trailing ? match.slice(0, -trailing.length) : match;
9773
- return `${redactUrl(core2)}${trailing}`;
9774
- });
9775
- out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
9776
- out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
9777
- out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
9778
- out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
9779
- if (out.length > MAX_VALUE_LENGTH) {
9780
- out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
9781
- }
9782
- return out;
9783
- }
9784
- function nameTokens(name) {
9785
- return name.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").split(/[\s_-]+/).map((t) => t.toLowerCase()).filter(Boolean);
9786
- }
9787
- function isSensitiveName(name) {
9788
- const tokens = nameTokens(name);
9789
- for (let i = 0;i < tokens.length; i++) {
9790
- const token = tokens[i];
9791
- if (SENSITIVE_NAME_TOKENS.has(token)) {
9792
- return true;
9793
- }
9794
- if (token === "key" || token === "keys") {
9795
- const prev = tokens[i - 1];
9796
- if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
9797
- return true;
9798
- }
9799
- }
9800
- }
9801
- return false;
9802
- }
9803
- function redactProperty(name, value) {
9804
- if (value === undefined || value === null) {
9805
- return;
9806
- }
9807
- if (isSensitiveName(name)) {
9808
- return REDACTED;
9809
- }
9810
- if (typeof value === "boolean" || typeof value === "number") {
9811
- return value;
9812
- }
9813
- if (typeof value !== "string") {
9814
- return "[OBJECT]";
9815
- }
9816
- return redactValueDetectors(value);
9817
- }
9818
- function redactProperties(properties) {
9819
- const out = {};
9820
- for (const [name, value] of Object.entries(properties)) {
9821
- const redacted = redactProperty(name, value);
9822
- if (redacted !== undefined) {
9823
- out[name] = redacted;
9824
- }
9825
- }
9826
- return out;
9827
- }
9828
- var REDACTED = "[REDACTED]", MAX_VALUE_LENGTH = 200, SENSITIVE_NAME_TOKENS, SENSITIVE_KEY_PREFIXES, UUID_PATTERN, EMAIL_PATTERN, JWT_PATTERN, LONG_TOKEN_PATTERN, USER_HOME_PATTERN, URL_PATTERN, URL_TRAILING_PUNCT;
9829
- var init_pii_redactor = __esm(() => {
9830
- SENSITIVE_NAME_TOKENS = new Set([
9831
- "token",
9832
- "tokens",
9833
- "secret",
9834
- "secrets",
9835
- "password",
9836
- "passwords",
9837
- "pwd",
9838
- "credential",
9839
- "credentials",
9840
- "auth",
9841
- "authentication",
9842
- "authorization",
9843
- "authority",
9844
- "cert",
9845
- "certificate",
9846
- "certificates"
9847
- ]);
9848
- SENSITIVE_KEY_PREFIXES = new Set([
9849
- "api",
9850
- "access",
9851
- "client",
9852
- "private",
9853
- "public",
9854
- "signing",
9855
- "encryption",
9856
- "session",
9857
- "master",
9858
- "shared",
9859
- "root",
9860
- "ssh",
9861
- "rsa",
9862
- "aes",
9863
- "hmac",
9864
- "oauth"
9865
- ]);
9866
- UUID_PATTERN = /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi;
9867
- EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
9868
- JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
9869
- LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
9870
- USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
9871
- URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
9872
- URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
9873
- });
9874
-
9875
9989
  // ../common/src/trackedAction.ts
9876
9990
  function extractCommandParams(cmd) {
9877
9991
  const params = {};
9992
+ const add2 = (name, value) => {
9993
+ if (name && value !== undefined) {
9994
+ params[`${TELEMETRY_COMMAND_ARG_PREFIX}${name}`] = value;
9995
+ }
9996
+ };
9878
9997
  const registered = cmd.registeredArguments ?? [];
9879
9998
  const processed = cmd.processedArgs ?? [];
9880
9999
  for (let i = 0;i < registered.length; i++) {
9881
- const value = processed[i];
9882
- if (value === undefined) {
9883
- continue;
9884
- }
9885
- const name = registered[i].name();
9886
- if (name) {
9887
- params[name] = value;
9888
- }
10000
+ add2(registered[i].name(), processed[i]);
9889
10001
  }
9890
10002
  for (const [key, value] of Object.entries(cmd.opts())) {
9891
- if (value !== undefined) {
9892
- params[key] = value;
9893
- }
10003
+ add2(key, value);
9894
10004
  }
9895
10005
  return params;
9896
10006
  }
@@ -9928,7 +10038,7 @@ function isPromptCancellation(error) {
9928
10038
  function exitCodeFromProcess(fallback) {
9929
10039
  return typeof process.exitCode === "number" ? process.exitCode : fallback;
9930
10040
  }
9931
- var pollSignalSlot, cliErrorCodeValues, retryHintValues, processContext;
10041
+ var pollSignalSlot, cliErrorCodeValues, retryHintValues, TELEMETRY_COMMAND_ARG_PREFIX = "uip.cmd.arg.", processContext;
9932
10042
  var init_trackedAction = __esm(() => {
9933
10043
  init_esm();
9934
10044
  init_formatter();
@@ -9954,11 +10064,12 @@ var init_trackedAction = __esm(() => {
9954
10064
  return this.action(async (...args) => {
9955
10065
  const telemetryName = deriveCommandPath(command);
9956
10066
  const props = typeof properties === "function" ? properties(...args) : properties;
10067
+ const requestContext = telemetry.createRequestContext();
9957
10068
  const startTime = performance.now();
9958
10069
  let errorMessage;
9959
10070
  let fallbackExitCode = EXIT_CODES.Success;
9960
10071
  clearRecordedCommandFailureTelemetry();
9961
- const [error] = await catchError(fn(...args));
10072
+ const [error] = await catchError(telemetry.runWithContext(requestContext, () => fn(...args)));
9962
10073
  if (error) {
9963
10074
  errorMessage = error instanceof Error ? error.message : String(error);
9964
10075
  logger.debug(`[trackedAction] ${telemetryName} failed: ${errorMessage}`);
@@ -9994,16 +10105,21 @@ var init_trackedAction = __esm(() => {
9994
10105
  recordedFailure,
9995
10106
  pollSignal: context.pollSignal
9996
10107
  });
9997
- telemetry.trackEvent(telemetryName, redactProperties({
9998
- ...extractCommandParams(command),
10108
+ const commandParams = extractCommandParams(command);
10109
+ if (props) {
10110
+ for (const key of Object.keys(props)) {
10111
+ delete commandParams[`${TELEMETRY_COMMAND_ARG_PREFIX}${key}`];
10112
+ }
10113
+ }
10114
+ const baseProperties = redactProperties({
10115
+ ...commandParams,
9999
10116
  ...props,
10000
10117
  ...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
10001
10118
  command: "true",
10002
- duration: String(durationMs),
10003
- success: String(success),
10004
10119
  ...terminalTelemetry,
10005
10120
  ...errorMessage ? { errorMessage } : {}
10006
- }));
10121
+ });
10122
+ telemetry.trackRequestResult(telemetryName, durationMs, success, baseProperties, requestContext);
10007
10123
  });
10008
10124
  };
10009
10125
  });
@@ -65292,7 +65408,7 @@ var init_package = __esm(() => {
65292
65408
  package_default5 = {
65293
65409
  name: "@uipath/integrationservice-sdk",
65294
65410
  license: "MIT",
65295
- version: "1.198.0-preview.95",
65411
+ version: "1.198.0",
65296
65412
  repository: {
65297
65413
  type: "git",
65298
65414
  url: "https://github.com/UiPath/cli.git",
@@ -89594,7 +89710,7 @@ import"./packager-tool.js";
89594
89710
  var package_default = {
89595
89711
  name: "@uipath/agent-tool",
89596
89712
  license: "MIT",
89597
- version: "1.198.0-preview.95",
89713
+ version: "1.198.0",
89598
89714
  description: "cli plugin for creating and managing UiPath low-code agents",
89599
89715
  private: false,
89600
89716
  repository: {
@@ -94613,7 +94729,7 @@ class TextApiResponse2 {
94613
94729
  var package_default3 = {
94614
94730
  name: "@uipath/solution-sdk",
94615
94731
  license: "MIT",
94616
- version: "1.198.0-preview.95",
94732
+ version: "1.198.0",
94617
94733
  repository: {
94618
94734
  type: "git",
94619
94735
  url: "https://github.com/UiPath/cli.git",
@@ -98217,7 +98333,7 @@ class VoidApiResponse3 {
98217
98333
  var package_default4 = {
98218
98334
  name: "@uipath/agent-sdk",
98219
98335
  license: "MIT",
98220
- version: "1.198.0-preview.95",
98336
+ version: "1.198.0",
98221
98337
  description: "SDK for the UiPath Agent Runtime API — evaluation execution and debug sessions.",
98222
98338
  repository: {
98223
98339
  type: "git",
@@ -128710,4 +128826,4 @@ export {
128710
128826
  metadata
128711
128827
  };
128712
128828
 
128713
- //# debugId=465C85DDCCB9BA9064756E2164756E21
128829
+ //# debugId=559411354C1336F564756E2164756E21
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/agent-tool",
3
3
  "license": "MIT",
4
- "version": "1.198.0-preview.95",
4
+ "version": "1.198.0",
5
5
  "description": "cli plugin for creating and managing UiPath low-code agents",
6
6
  "private": false,
7
7
  "repository": {
@@ -26,5 +26,5 @@
26
26
  "files": [
27
27
  "dist"
28
28
  ],
29
- "gitHead": "7f6f14e06688fe417ecaac94186ab795a9106caa"
29
+ "gitHead": "1fadf03d7a8dd102742571dff569fdac11808afb"
30
30
  }