@uipath/agent-tool 1.199.0-preview.91 → 1.199.0-preview.97

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 +523 -303
  2. package/package.json +2 -2
package/dist/tool.js CHANGED
@@ -9154,10 +9154,36 @@ class NodeContextStorage {
9154
9154
  }
9155
9155
  var init_node_context_storage = () => {};
9156
9156
 
9157
- // ../common/src/telemetry/session-id.ts
9157
+ // ../common/src/telemetry/trace-context.ts
9158
9158
  function getProcessEnv() {
9159
9159
  return globalThis.process?.env;
9160
9160
  }
9161
+ function parseInboundTraceparent(value) {
9162
+ if (!value) {
9163
+ return;
9164
+ }
9165
+ const match = TRACEPARENT_PATTERN.exec(value.trim().toLowerCase());
9166
+ if (!match) {
9167
+ return;
9168
+ }
9169
+ const [, traceId, parentSpanId] = match;
9170
+ if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
9171
+ return;
9172
+ }
9173
+ return { traceId, parentSpanId };
9174
+ }
9175
+ function getInboundTraceContext() {
9176
+ return parseInboundTraceparent(getProcessEnv()?.[TELEMETRY_TRACEPARENT_ENV]);
9177
+ }
9178
+ var TELEMETRY_TRACEPARENT_ENV = "TRACEPARENT", TRACEPARENT_PATTERN;
9179
+ var init_trace_context = __esm(() => {
9180
+ TRACEPARENT_PATTERN = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
9181
+ });
9182
+
9183
+ // ../common/src/telemetry/session-id.ts
9184
+ function getProcessEnv2() {
9185
+ return globalThis.process?.env;
9186
+ }
9161
9187
  function normalizeSessionId(value) {
9162
9188
  if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
9163
9189
  return;
@@ -9166,15 +9192,27 @@ function normalizeSessionId(value) {
9166
9192
  return trimmed || undefined;
9167
9193
  }
9168
9194
  function getConfiguredTelemetrySessionId() {
9169
- return normalizeSessionId(getProcessEnv()?.[TELEMETRY_SESSION_ID_ENV]);
9195
+ return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
9170
9196
  }
9171
9197
  function resolveTelemetrySessionId(existingSessionId) {
9172
9198
  return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
9173
9199
  }
9174
- var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID", TELEMETRY_SESSION_ID_PROPERTY = "session_id", telemetrySessionIdSlot;
9200
+ function getTelemetryOperationId() {
9201
+ const existing = telemetryOperationIdSlot.get();
9202
+ if (existing) {
9203
+ return existing;
9204
+ }
9205
+ const inboundTraceId = getInboundTraceContext()?.traceId;
9206
+ const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
9207
+ telemetryOperationIdSlot.set(generated);
9208
+ return generated;
9209
+ }
9210
+ var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID", TELEMETRY_SESSION_ID_PROPERTY = "session_id", telemetrySessionIdSlot, telemetryOperationIdSlot;
9175
9211
  var init_session_id = __esm(() => {
9176
9212
  init_singleton();
9213
+ init_trace_context();
9177
9214
  telemetrySessionIdSlot = singleton("TelemetrySessionId");
9215
+ telemetryOperationIdSlot = singleton("TelemetryOperationId");
9178
9216
  });
9179
9217
 
9180
9218
  // ../common/src/telemetry/global-telemetry-properties.ts
@@ -9187,6 +9225,140 @@ var init_global_telemetry_properties = __esm(() => {
9187
9225
  telemetryPropsSlot = singleton("TelemetryDefaultProps");
9188
9226
  });
9189
9227
 
9228
+ // ../common/src/telemetry/pii-redactor.ts
9229
+ function shortHash(input) {
9230
+ let hash = 2166136261;
9231
+ for (let i = 0;i < input.length; i++) {
9232
+ hash ^= input.charCodeAt(i);
9233
+ hash = Math.imul(hash, 16777619);
9234
+ }
9235
+ return (hash >>> 0).toString(16).padStart(8, "0");
9236
+ }
9237
+ function redactUrl(raw) {
9238
+ try {
9239
+ const url = new URL(raw);
9240
+ return `${url.protocol}//${url.host}`;
9241
+ } catch {
9242
+ return `url#${shortHash(raw)}`;
9243
+ }
9244
+ }
9245
+ function redactValueDetectors(value) {
9246
+ let out = value;
9247
+ out = out.replace(JWT_PATTERN, () => REDACTED);
9248
+ out = out.replace(URL_PATTERN, (match) => {
9249
+ const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
9250
+ const core2 = trailing ? match.slice(0, -trailing.length) : match;
9251
+ return `${redactUrl(core2)}${trailing}`;
9252
+ });
9253
+ out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
9254
+ out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
9255
+ out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
9256
+ out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
9257
+ if (out.length > MAX_VALUE_LENGTH) {
9258
+ out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
9259
+ }
9260
+ return out;
9261
+ }
9262
+ function redactValue(value) {
9263
+ return redactValueDetectors(value);
9264
+ }
9265
+ function redactError(error) {
9266
+ const safe = new Error(redactValueDetectors(error.message ?? ""));
9267
+ safe.name = error.name;
9268
+ safe.stack = typeof error.stack === "string" ? redactValueDetectors(error.stack) : undefined;
9269
+ return safe;
9270
+ }
9271
+ function nameTokens(name) {
9272
+ 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);
9273
+ }
9274
+ function isSensitiveName(name) {
9275
+ const tokens = nameTokens(name);
9276
+ for (let i = 0;i < tokens.length; i++) {
9277
+ const token = tokens[i];
9278
+ if (SENSITIVE_NAME_TOKENS.has(token)) {
9279
+ return true;
9280
+ }
9281
+ if (token === "key" || token === "keys") {
9282
+ const prev = tokens[i - 1];
9283
+ if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
9284
+ return true;
9285
+ }
9286
+ }
9287
+ }
9288
+ return false;
9289
+ }
9290
+ function redactProperty(name, value) {
9291
+ if (value === undefined || value === null) {
9292
+ return;
9293
+ }
9294
+ if (isSensitiveName(name)) {
9295
+ return REDACTED;
9296
+ }
9297
+ if (typeof value === "boolean" || typeof value === "number") {
9298
+ return value;
9299
+ }
9300
+ if (typeof value !== "string") {
9301
+ return "[OBJECT]";
9302
+ }
9303
+ return redactValueDetectors(value);
9304
+ }
9305
+ function redactProperties(properties) {
9306
+ const out = {};
9307
+ for (const [name, value] of Object.entries(properties)) {
9308
+ const redacted = redactProperty(name, value);
9309
+ if (redacted !== undefined) {
9310
+ out[name] = redacted;
9311
+ }
9312
+ }
9313
+ return out;
9314
+ }
9315
+ 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;
9316
+ var init_pii_redactor = __esm(() => {
9317
+ SENSITIVE_NAME_TOKENS = new Set([
9318
+ "token",
9319
+ "tokens",
9320
+ "secret",
9321
+ "secrets",
9322
+ "password",
9323
+ "passwords",
9324
+ "pwd",
9325
+ "credential",
9326
+ "credentials",
9327
+ "auth",
9328
+ "authentication",
9329
+ "authorization",
9330
+ "authority",
9331
+ "cert",
9332
+ "certificate",
9333
+ "certificates"
9334
+ ]);
9335
+ SENSITIVE_KEY_PREFIXES = new Set([
9336
+ "api",
9337
+ "access",
9338
+ "client",
9339
+ "private",
9340
+ "public",
9341
+ "signing",
9342
+ "encryption",
9343
+ "session",
9344
+ "master",
9345
+ "shared",
9346
+ "root",
9347
+ "ssh",
9348
+ "rsa",
9349
+ "aes",
9350
+ "hmac",
9351
+ "oauth"
9352
+ ]);
9353
+ 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;
9354
+ EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
9355
+ JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
9356
+ LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
9357
+ USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
9358
+ URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
9359
+ URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
9360
+ });
9361
+
9190
9362
  // ../common/src/telemetry/telemetry-service.ts
9191
9363
  class TelemetryService {
9192
9364
  telemetryProvider;
@@ -9214,11 +9386,15 @@ class TelemetryService {
9214
9386
  trackException(error, properties) {
9215
9387
  const context = this.getCurrentContext();
9216
9388
  const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
9217
- this.telemetryProvider.trackException(error, enrichedProperties);
9389
+ this.telemetryProvider.trackException(redactError(error), enrichedProperties);
9218
9390
  }
9219
9391
  async trackRequest(name, fn, properties) {
9392
+ const parentContext = this.getCurrentContext();
9393
+ const operationId = parentContext?.operationId ?? this.operationId ?? getTelemetryOperationId();
9394
+ const parentId = parentContext ? parentContext.id : this.inboundParentIdFor(operationId);
9220
9395
  const context = {
9221
- operationId: this.operationId ?? this.generateId(),
9396
+ operationId,
9397
+ ...parentId !== undefined ? { parentId } : {},
9222
9398
  id: this.generateId()
9223
9399
  };
9224
9400
  const startTime = performance.now();
@@ -9236,6 +9412,45 @@ class TelemetryService {
9236
9412
  throw error;
9237
9413
  }
9238
9414
  }
9415
+ trackRequestResult(name, durationMs, success, properties, context) {
9416
+ const requestContext = context ?? {
9417
+ operationId: this.operationId ?? getTelemetryOperationId(),
9418
+ id: this.generateId()
9419
+ };
9420
+ const enrichedProperties = this.enrichPropertiesWithContext(properties, requestContext);
9421
+ this.telemetryProvider.trackRequest(name, durationMs, success, enrichedProperties);
9422
+ }
9423
+ createRequestContext() {
9424
+ const operationId = this.operationId ?? getTelemetryOperationId();
9425
+ const parentId = this.inboundParentIdFor(operationId);
9426
+ return {
9427
+ operationId,
9428
+ ...parentId !== undefined ? { parentId } : {},
9429
+ id: this.generateId()
9430
+ };
9431
+ }
9432
+ inboundParentIdFor(operationId) {
9433
+ const inbound = getInboundTraceContext();
9434
+ return inbound && inbound.traceId === operationId ? inbound.parentSpanId : undefined;
9435
+ }
9436
+ runWithContext(context, fn) {
9437
+ return this.contextStorage.run(context, fn);
9438
+ }
9439
+ createDependencyContext() {
9440
+ const parentContext = this.getCurrentContext();
9441
+ if (!parentContext) {
9442
+ return;
9443
+ }
9444
+ return {
9445
+ operationId: parentContext.operationId,
9446
+ parentId: parentContext.id,
9447
+ id: this.generateId()
9448
+ };
9449
+ }
9450
+ trackDependencyResult(name, type2, durationMs, success, properties, context, resultCode) {
9451
+ const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
9452
+ this.telemetryProvider.trackDependency(redactValue(name), type2, durationMs, success, enrichedProperties, resultCode);
9453
+ }
9239
9454
  async trackDependencyOperation(name, type2, fn, properties) {
9240
9455
  const parentContext = this.getCurrentContext();
9241
9456
  if (!parentContext) {
@@ -9272,8 +9487,12 @@ class TelemetryService {
9272
9487
  ...getExecutionContextTelemetryProperties(),
9273
9488
  ...globalProperties,
9274
9489
  ...this.defaultProperties,
9275
- ...properties,
9276
- ...context
9490
+ ...redactProperties(properties ?? {}),
9491
+ ...context ? {
9492
+ [TELEMETRY_OPERATION_ID_PROPERTY]: context.operationId,
9493
+ ...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY]: context.parentId } : {},
9494
+ [TELEMETRY_SPAN_ID_PROPERTY]: context.id
9495
+ } : {}
9277
9496
  };
9278
9497
  if (sessionId === undefined) {
9279
9498
  delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
@@ -9283,13 +9502,30 @@ class TelemetryService {
9283
9502
  return enriched;
9284
9503
  }
9285
9504
  generateId() {
9286
- return crypto.randomUUID().replaceAll("-", "");
9505
+ const bytes = new Uint8Array(8);
9506
+ let hex = "";
9507
+ do {
9508
+ crypto.getRandomValues(bytes);
9509
+ hex = "";
9510
+ for (const byte of bytes) {
9511
+ hex += byte.toString(16).padStart(2, "0");
9512
+ }
9513
+ } while (/^0+$/.test(hex));
9514
+ return hex;
9287
9515
  }
9288
9516
  }
9517
+ 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";
9289
9518
  var init_telemetry_service = __esm(() => {
9290
9519
  init_execution_context();
9291
9520
  init_global_telemetry_properties();
9521
+ init_pii_redactor();
9292
9522
  init_session_id();
9523
+ init_trace_context();
9524
+ });
9525
+
9526
+ // ../common/src/telemetry/tracked-fetch.ts
9527
+ var init_tracked_fetch = __esm(() => {
9528
+ init_telemetry_init();
9293
9529
  });
9294
9530
 
9295
9531
  // ../common/src/telemetry/node.ts
@@ -9301,6 +9537,8 @@ var init_node2 = __esm(() => {
9301
9537
  init_node_context_storage();
9302
9538
  init_session_id();
9303
9539
  init_telemetry_service();
9540
+ init_trace_context();
9541
+ init_tracked_fetch();
9304
9542
  });
9305
9543
 
9306
9544
  // ../common/src/telemetry/node-appinsights-telemetry-provider.ts
@@ -9310,6 +9548,7 @@ var init_node_appinsights_telemetry_provider = __esm(() => {
9310
9548
  init_singleton();
9311
9549
  init_global_telemetry_properties();
9312
9550
  init_session_id();
9551
+ init_telemetry_service();
9313
9552
  init_global_telemetry_properties();
9314
9553
  providerSlot = singleton("TelemetryProvider");
9315
9554
  });
@@ -10028,150 +10267,21 @@ var init_command_attribution = __esm(() => {
10028
10267
  ]).sort((a, b) => b.prefix.length - a.prefix.length);
10029
10268
  });
10030
10269
 
10031
- // ../common/src/telemetry/pii-redactor.ts
10032
- function shortHash(input) {
10033
- let hash = 2166136261;
10034
- for (let i = 0;i < input.length; i++) {
10035
- hash ^= input.charCodeAt(i);
10036
- hash = Math.imul(hash, 16777619);
10037
- }
10038
- return (hash >>> 0).toString(16).padStart(8, "0");
10039
- }
10040
- function redactUrl(raw) {
10041
- try {
10042
- const url = new URL(raw);
10043
- return `${url.protocol}//${url.host}`;
10044
- } catch {
10045
- return `url#${shortHash(raw)}`;
10046
- }
10047
- }
10048
- function redactValueDetectors(value) {
10049
- let out = value;
10050
- out = out.replace(JWT_PATTERN, () => REDACTED);
10051
- out = out.replace(URL_PATTERN, (match) => {
10052
- const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
10053
- const core2 = trailing ? match.slice(0, -trailing.length) : match;
10054
- return `${redactUrl(core2)}${trailing}`;
10055
- });
10056
- out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
10057
- out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
10058
- out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
10059
- out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
10060
- if (out.length > MAX_VALUE_LENGTH) {
10061
- out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
10062
- }
10063
- return out;
10064
- }
10065
- function nameTokens(name) {
10066
- 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);
10067
- }
10068
- function isSensitiveName(name) {
10069
- const tokens = nameTokens(name);
10070
- for (let i = 0;i < tokens.length; i++) {
10071
- const token = tokens[i];
10072
- if (SENSITIVE_NAME_TOKENS.has(token)) {
10073
- return true;
10074
- }
10075
- if (token === "key" || token === "keys") {
10076
- const prev = tokens[i - 1];
10077
- if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
10078
- return true;
10079
- }
10080
- }
10081
- }
10082
- return false;
10083
- }
10084
- function redactProperty(name, value) {
10085
- if (value === undefined || value === null) {
10086
- return;
10087
- }
10088
- if (isSensitiveName(name)) {
10089
- return REDACTED;
10090
- }
10091
- if (typeof value === "boolean" || typeof value === "number") {
10092
- return value;
10093
- }
10094
- if (typeof value !== "string") {
10095
- return "[OBJECT]";
10096
- }
10097
- return redactValueDetectors(value);
10098
- }
10099
- function redactProperties(properties) {
10100
- const out = {};
10101
- for (const [name, value] of Object.entries(properties)) {
10102
- const redacted = redactProperty(name, value);
10103
- if (redacted !== undefined) {
10104
- out[name] = redacted;
10105
- }
10106
- }
10107
- return out;
10108
- }
10109
- 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;
10110
- var init_pii_redactor = __esm(() => {
10111
- SENSITIVE_NAME_TOKENS = new Set([
10112
- "token",
10113
- "tokens",
10114
- "secret",
10115
- "secrets",
10116
- "password",
10117
- "passwords",
10118
- "pwd",
10119
- "credential",
10120
- "credentials",
10121
- "auth",
10122
- "authentication",
10123
- "authorization",
10124
- "authority",
10125
- "cert",
10126
- "certificate",
10127
- "certificates"
10128
- ]);
10129
- SENSITIVE_KEY_PREFIXES = new Set([
10130
- "api",
10131
- "access",
10132
- "client",
10133
- "private",
10134
- "public",
10135
- "signing",
10136
- "encryption",
10137
- "session",
10138
- "master",
10139
- "shared",
10140
- "root",
10141
- "ssh",
10142
- "rsa",
10143
- "aes",
10144
- "hmac",
10145
- "oauth"
10146
- ]);
10147
- 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;
10148
- EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
10149
- JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
10150
- LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
10151
- USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
10152
- URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
10153
- URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
10154
- });
10155
-
10156
10270
  // ../common/src/trackedAction.ts
10157
10271
  function extractCommandParams(cmd) {
10158
10272
  const params = {};
10273
+ const add2 = (name, value) => {
10274
+ if (name && value !== undefined) {
10275
+ params[`${TELEMETRY_COMMAND_ARG_PREFIX}${name}`] = value;
10276
+ }
10277
+ };
10159
10278
  const registered = cmd.registeredArguments ?? [];
10160
10279
  const processed = cmd.processedArgs ?? [];
10161
10280
  for (let i = 0;i < registered.length; i++) {
10162
- const value = processed[i];
10163
- if (value === undefined) {
10164
- continue;
10165
- }
10166
- const name = registered[i].name();
10167
- if (name) {
10168
- params[name] = value;
10169
- }
10281
+ add2(registered[i].name(), processed[i]);
10170
10282
  }
10171
10283
  for (const [key, value] of Object.entries(cmd.opts())) {
10172
- if (value !== undefined) {
10173
- params[key] = value;
10174
- }
10284
+ add2(key, value);
10175
10285
  }
10176
10286
  return params;
10177
10287
  }
@@ -10209,7 +10319,7 @@ function isPromptCancellation(error) {
10209
10319
  function exitCodeFromProcess(fallback) {
10210
10320
  return typeof process.exitCode === "number" ? process.exitCode : fallback;
10211
10321
  }
10212
- var pollSignalSlot, cliErrorCodeValues, retryHintValues, processContext;
10322
+ var pollSignalSlot, cliErrorCodeValues, retryHintValues, TELEMETRY_COMMAND_ARG_PREFIX = "uip.cmd.arg.", processContext;
10213
10323
  var init_trackedAction = __esm(() => {
10214
10324
  init_esm();
10215
10325
  init_formatter();
@@ -10235,11 +10345,12 @@ var init_trackedAction = __esm(() => {
10235
10345
  return this.action(async (...args) => {
10236
10346
  const telemetryName = deriveCommandPath(command);
10237
10347
  const props = typeof properties === "function" ? properties(...args) : properties;
10348
+ const requestContext = telemetry.createRequestContext();
10238
10349
  const startTime = performance.now();
10239
10350
  let errorMessage;
10240
10351
  let fallbackExitCode = EXIT_CODES.Success;
10241
10352
  clearRecordedCommandFailureTelemetry();
10242
- const [error] = await catchError(fn(...args));
10353
+ const [error] = await catchError(telemetry.runWithContext(requestContext, () => fn(...args)));
10243
10354
  if (error) {
10244
10355
  errorMessage = error instanceof Error ? error.message : String(error);
10245
10356
  logger.debug(`[trackedAction] ${telemetryName} failed: ${errorMessage}`);
@@ -10275,16 +10386,21 @@ var init_trackedAction = __esm(() => {
10275
10386
  recordedFailure,
10276
10387
  pollSignal: context.pollSignal
10277
10388
  });
10278
- telemetry.trackEvent(telemetryName, redactProperties({
10279
- ...extractCommandParams(command),
10389
+ const commandParams = extractCommandParams(command);
10390
+ if (props) {
10391
+ for (const key of Object.keys(props)) {
10392
+ delete commandParams[`${TELEMETRY_COMMAND_ARG_PREFIX}${key}`];
10393
+ }
10394
+ }
10395
+ const baseProperties = redactProperties({
10396
+ ...commandParams,
10280
10397
  ...props,
10281
10398
  ...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
10282
10399
  command: "true",
10283
- duration: String(durationMs),
10284
- success: String(success),
10285
10400
  ...terminalTelemetry,
10286
10401
  ...errorMessage ? { errorMessage } : {}
10287
- }));
10402
+ });
10403
+ telemetry.trackRequestResult(telemetryName, durationMs, success, baseProperties, requestContext);
10288
10404
  });
10289
10405
  };
10290
10406
  });
@@ -65849,7 +65965,7 @@ var init_package = __esm(() => {
65849
65965
  package_default6 = {
65850
65966
  name: "@uipath/integrationservice-sdk",
65851
65967
  license: "MIT",
65852
- version: "1.199.0-preview.91",
65968
+ version: "1.199.0-preview.97",
65853
65969
  repository: {
65854
65970
  type: "git",
65855
65971
  url: "https://github.com/UiPath/cli.git",
@@ -90151,7 +90267,7 @@ import"./packager-tool.js";
90151
90267
  var package_default = {
90152
90268
  name: "@uipath/agent-tool",
90153
90269
  license: "MIT",
90154
- version: "1.199.0-preview.91",
90270
+ version: "1.199.0-preview.97",
90155
90271
  description: "cli plugin for creating and managing UiPath low-code agents",
90156
90272
  private: false,
90157
90273
  repository: {
@@ -95172,7 +95288,7 @@ class TextApiResponse2 {
95172
95288
  var package_default3 = {
95173
95289
  name: "@uipath/solution-sdk",
95174
95290
  license: "MIT",
95175
- version: "1.199.0-preview.91",
95291
+ version: "1.199.0-preview.97",
95176
95292
  repository: {
95177
95293
  type: "git",
95178
95294
  url: "https://github.com/UiPath/cli.git",
@@ -98842,7 +98958,7 @@ class VoidApiResponse3 {
98842
98958
  var package_default4 = {
98843
98959
  name: "@uipath/agent-sdk",
98844
98960
  license: "MIT",
98845
- version: "1.199.0-preview.91",
98961
+ version: "1.199.0-preview.97",
98846
98962
  description: "SDK for the UiPath Agent Runtime API — evaluation execution and debug sessions.",
98847
98963
  repository: {
98848
98964
  type: "git",
@@ -151038,10 +151154,33 @@ class NodeContextStorage2 {
151038
151154
  return this.storage.getStore();
151039
151155
  }
151040
151156
  }
151157
+ var TELEMETRY_TRACEPARENT_ENV2 = "TRACEPARENT";
151158
+ var TRACEPARENT_PATTERN2 = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
151159
+ function getProcessEnv3() {
151160
+ return globalThis.process?.env;
151161
+ }
151162
+ function parseInboundTraceparent2(value) {
151163
+ if (!value) {
151164
+ return;
151165
+ }
151166
+ const match = TRACEPARENT_PATTERN2.exec(value.trim().toLowerCase());
151167
+ if (!match) {
151168
+ return;
151169
+ }
151170
+ const [, traceId, parentSpanId] = match;
151171
+ if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
151172
+ return;
151173
+ }
151174
+ return { traceId, parentSpanId };
151175
+ }
151176
+ function getInboundTraceContext2() {
151177
+ return parseInboundTraceparent2(getProcessEnv3()?.[TELEMETRY_TRACEPARENT_ENV2]);
151178
+ }
151041
151179
  var TELEMETRY_SESSION_ID_ENV2 = "UIPATH_SESSION_ID";
151042
151180
  var TELEMETRY_SESSION_ID_PROPERTY2 = "session_id";
151043
151181
  var telemetrySessionIdSlot2 = singleton3("TelemetrySessionId");
151044
- function getProcessEnv2() {
151182
+ var telemetryOperationIdSlot2 = singleton3("TelemetryOperationId");
151183
+ function getProcessEnv22() {
151045
151184
  return globalThis.process?.env;
151046
151185
  }
151047
151186
  function normalizeSessionId2(value) {
@@ -151052,15 +151191,159 @@ function normalizeSessionId2(value) {
151052
151191
  return trimmed || undefined;
151053
151192
  }
151054
151193
  function getConfiguredTelemetrySessionId2() {
151055
- return normalizeSessionId2(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV2]);
151194
+ return normalizeSessionId2(getProcessEnv22()?.[TELEMETRY_SESSION_ID_ENV2]);
151056
151195
  }
151057
151196
  function resolveTelemetrySessionId2(existingSessionId) {
151058
151197
  return getConfiguredTelemetrySessionId2() ?? normalizeSessionId2(existingSessionId);
151059
151198
  }
151199
+ function getTelemetryOperationId2() {
151200
+ const existing = telemetryOperationIdSlot2.get();
151201
+ if (existing) {
151202
+ return existing;
151203
+ }
151204
+ const inboundTraceId = getInboundTraceContext2()?.traceId;
151205
+ const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
151206
+ telemetryOperationIdSlot2.set(generated);
151207
+ return generated;
151208
+ }
151060
151209
  var telemetryPropsSlot2 = singleton3("TelemetryDefaultProps");
151061
151210
  function getGlobalTelemetryProperties2() {
151062
151211
  return telemetryPropsSlot2.get();
151063
151212
  }
151213
+ var REDACTED2 = "[REDACTED]";
151214
+ var MAX_VALUE_LENGTH2 = 200;
151215
+ var SENSITIVE_NAME_TOKENS2 = new Set([
151216
+ "token",
151217
+ "tokens",
151218
+ "secret",
151219
+ "secrets",
151220
+ "password",
151221
+ "passwords",
151222
+ "pwd",
151223
+ "credential",
151224
+ "credentials",
151225
+ "auth",
151226
+ "authentication",
151227
+ "authorization",
151228
+ "authority",
151229
+ "cert",
151230
+ "certificate",
151231
+ "certificates"
151232
+ ]);
151233
+ var SENSITIVE_KEY_PREFIXES2 = new Set([
151234
+ "api",
151235
+ "access",
151236
+ "client",
151237
+ "private",
151238
+ "public",
151239
+ "signing",
151240
+ "encryption",
151241
+ "session",
151242
+ "master",
151243
+ "shared",
151244
+ "root",
151245
+ "ssh",
151246
+ "rsa",
151247
+ "aes",
151248
+ "hmac",
151249
+ "oauth"
151250
+ ]);
151251
+ var UUID_PATTERN3 = /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi;
151252
+ var EMAIL_PATTERN2 = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
151253
+ var JWT_PATTERN2 = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
151254
+ var LONG_TOKEN_PATTERN2 = /\b[A-Za-z0-9_-]{40,}\b/g;
151255
+ var USER_HOME_PATTERN2 = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
151256
+ var URL_PATTERN2 = /\bhttps?:\/\/[^\s,;]+/gi;
151257
+ var URL_TRAILING_PUNCT2 = /[.,;:!?)\]}>'"]+$/;
151258
+ function shortHash2(input) {
151259
+ let hash = 2166136261;
151260
+ for (let i2 = 0;i2 < input.length; i2++) {
151261
+ hash ^= input.charCodeAt(i2);
151262
+ hash = Math.imul(hash, 16777619);
151263
+ }
151264
+ return (hash >>> 0).toString(16).padStart(8, "0");
151265
+ }
151266
+ function redactUrl2(raw) {
151267
+ try {
151268
+ const url = new URL(raw);
151269
+ return `${url.protocol}//${url.host}`;
151270
+ } catch {
151271
+ return `url#${shortHash2(raw)}`;
151272
+ }
151273
+ }
151274
+ function redactValueDetectors2(value) {
151275
+ let out = value;
151276
+ out = out.replace(JWT_PATTERN2, () => REDACTED2);
151277
+ out = out.replace(URL_PATTERN2, (match) => {
151278
+ const trailing = match.match(URL_TRAILING_PUNCT2)?.[0] ?? "";
151279
+ const core22 = trailing ? match.slice(0, -trailing.length) : match;
151280
+ return `${redactUrl2(core22)}${trailing}`;
151281
+ });
151282
+ out = out.replace(USER_HOME_PATTERN2, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
151283
+ out = out.replace(EMAIL_PATTERN2, (match) => `email#${shortHash2(match)}`);
151284
+ out = out.replace(UUID_PATTERN3, (match) => `uuid#${shortHash2(match)}`);
151285
+ out = out.replace(LONG_TOKEN_PATTERN2, () => REDACTED2);
151286
+ if (out.length > MAX_VALUE_LENGTH2) {
151287
+ out = `${out.slice(0, MAX_VALUE_LENGTH2)}…`;
151288
+ }
151289
+ return out;
151290
+ }
151291
+ function redactValue2(value) {
151292
+ return redactValueDetectors2(value);
151293
+ }
151294
+ function redactError2(error) {
151295
+ const safe = new Error(redactValueDetectors2(error.message ?? ""));
151296
+ safe.name = error.name;
151297
+ safe.stack = typeof error.stack === "string" ? redactValueDetectors2(error.stack) : undefined;
151298
+ return safe;
151299
+ }
151300
+ function nameTokens2(name) {
151301
+ 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);
151302
+ }
151303
+ function isSensitiveName2(name) {
151304
+ const tokens = nameTokens2(name);
151305
+ for (let i2 = 0;i2 < tokens.length; i2++) {
151306
+ const token = tokens[i2];
151307
+ if (SENSITIVE_NAME_TOKENS2.has(token)) {
151308
+ return true;
151309
+ }
151310
+ if (token === "key" || token === "keys") {
151311
+ const prev = tokens[i2 - 1];
151312
+ if (prev && SENSITIVE_KEY_PREFIXES2.has(prev)) {
151313
+ return true;
151314
+ }
151315
+ }
151316
+ }
151317
+ return false;
151318
+ }
151319
+ function redactProperty2(name, value) {
151320
+ if (value === undefined || value === null) {
151321
+ return;
151322
+ }
151323
+ if (isSensitiveName2(name)) {
151324
+ return REDACTED2;
151325
+ }
151326
+ if (typeof value === "boolean" || typeof value === "number") {
151327
+ return value;
151328
+ }
151329
+ if (typeof value !== "string") {
151330
+ return "[OBJECT]";
151331
+ }
151332
+ return redactValueDetectors2(value);
151333
+ }
151334
+ function redactProperties2(properties) {
151335
+ const out = {};
151336
+ for (const [name, value] of Object.entries(properties)) {
151337
+ const redacted = redactProperty2(name, value);
151338
+ if (redacted !== undefined) {
151339
+ out[name] = redacted;
151340
+ }
151341
+ }
151342
+ return out;
151343
+ }
151344
+ var TELEMETRY_OPERATION_ID_PROPERTY2 = "uip.trace.operation_id";
151345
+ var TELEMETRY_PARENT_ID_PROPERTY2 = "uip.trace.parent_id";
151346
+ var TELEMETRY_SPAN_ID_PROPERTY2 = "uip.trace.span_id";
151064
151347
 
151065
151348
  class TelemetryService2 {
151066
151349
  telemetryProvider;
@@ -151088,11 +151371,15 @@ class TelemetryService2 {
151088
151371
  trackException(error, properties) {
151089
151372
  const context = this.getCurrentContext();
151090
151373
  const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
151091
- this.telemetryProvider.trackException(error, enrichedProperties);
151374
+ this.telemetryProvider.trackException(redactError2(error), enrichedProperties);
151092
151375
  }
151093
151376
  async trackRequest(name, fn, properties) {
151377
+ const parentContext = this.getCurrentContext();
151378
+ const operationId = parentContext?.operationId ?? this.operationId ?? getTelemetryOperationId2();
151379
+ const parentId = parentContext ? parentContext.id : this.inboundParentIdFor(operationId);
151094
151380
  const context = {
151095
- operationId: this.operationId ?? this.generateId(),
151381
+ operationId,
151382
+ ...parentId !== undefined ? { parentId } : {},
151096
151383
  id: this.generateId()
151097
151384
  };
151098
151385
  const startTime = performance.now();
@@ -151110,6 +151397,45 @@ class TelemetryService2 {
151110
151397
  throw error;
151111
151398
  }
151112
151399
  }
151400
+ trackRequestResult(name, durationMs, success, properties, context) {
151401
+ const requestContext = context ?? {
151402
+ operationId: this.operationId ?? getTelemetryOperationId2(),
151403
+ id: this.generateId()
151404
+ };
151405
+ const enrichedProperties = this.enrichPropertiesWithContext(properties, requestContext);
151406
+ this.telemetryProvider.trackRequest(name, durationMs, success, enrichedProperties);
151407
+ }
151408
+ createRequestContext() {
151409
+ const operationId = this.operationId ?? getTelemetryOperationId2();
151410
+ const parentId = this.inboundParentIdFor(operationId);
151411
+ return {
151412
+ operationId,
151413
+ ...parentId !== undefined ? { parentId } : {},
151414
+ id: this.generateId()
151415
+ };
151416
+ }
151417
+ inboundParentIdFor(operationId) {
151418
+ const inbound = getInboundTraceContext2();
151419
+ return inbound && inbound.traceId === operationId ? inbound.parentSpanId : undefined;
151420
+ }
151421
+ runWithContext(context, fn) {
151422
+ return this.contextStorage.run(context, fn);
151423
+ }
151424
+ createDependencyContext() {
151425
+ const parentContext = this.getCurrentContext();
151426
+ if (!parentContext) {
151427
+ return;
151428
+ }
151429
+ return {
151430
+ operationId: parentContext.operationId,
151431
+ parentId: parentContext.id,
151432
+ id: this.generateId()
151433
+ };
151434
+ }
151435
+ trackDependencyResult(name, type22, durationMs, success, properties, context, resultCode) {
151436
+ const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
151437
+ this.telemetryProvider.trackDependency(redactValue2(name), type22, durationMs, success, enrichedProperties, resultCode);
151438
+ }
151113
151439
  async trackDependencyOperation(name, type22, fn, properties) {
151114
151440
  const parentContext = this.getCurrentContext();
151115
151441
  if (!parentContext) {
@@ -151146,8 +151472,12 @@ class TelemetryService2 {
151146
151472
  ...getExecutionContextTelemetryProperties2(),
151147
151473
  ...globalProperties,
151148
151474
  ...this.defaultProperties,
151149
- ...properties,
151150
- ...context
151475
+ ...redactProperties2(properties ?? {}),
151476
+ ...context ? {
151477
+ [TELEMETRY_OPERATION_ID_PROPERTY2]: context.operationId,
151478
+ ...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY2]: context.parentId } : {},
151479
+ [TELEMETRY_SPAN_ID_PROPERTY2]: context.id
151480
+ } : {}
151151
151481
  };
151152
151482
  if (sessionId === undefined) {
151153
151483
  delete enriched[TELEMETRY_SESSION_ID_PROPERTY2];
@@ -151157,7 +151487,16 @@ class TelemetryService2 {
151157
151487
  return enriched;
151158
151488
  }
151159
151489
  generateId() {
151160
- return crypto.randomUUID().replaceAll("-", "");
151490
+ const bytes = new Uint8Array(8);
151491
+ let hex = "";
151492
+ do {
151493
+ crypto.getRandomValues(bytes);
151494
+ hex = "";
151495
+ for (const byte of bytes) {
151496
+ hex += byte.toString(16).padStart(2, "0");
151497
+ }
151498
+ } while (/^0+$/.test(hex));
151499
+ return hex;
151161
151500
  }
151162
151501
  }
151163
151502
  var providerSlot2 = singleton3("TelemetryProvider");
@@ -151854,149 +152193,24 @@ function buildCommandTelemetryAttribution2(commandPath, skillSource) {
151854
152193
  ...getCommandProductModeAttribution2(commandPath)
151855
152194
  };
151856
152195
  }
151857
- var REDACTED2 = "[REDACTED]";
151858
- var MAX_VALUE_LENGTH2 = 200;
151859
- var SENSITIVE_NAME_TOKENS2 = new Set([
151860
- "token",
151861
- "tokens",
151862
- "secret",
151863
- "secrets",
151864
- "password",
151865
- "passwords",
151866
- "pwd",
151867
- "credential",
151868
- "credentials",
151869
- "auth",
151870
- "authentication",
151871
- "authorization",
151872
- "authority",
151873
- "cert",
151874
- "certificate",
151875
- "certificates"
151876
- ]);
151877
- var SENSITIVE_KEY_PREFIXES2 = new Set([
151878
- "api",
151879
- "access",
151880
- "client",
151881
- "private",
151882
- "public",
151883
- "signing",
151884
- "encryption",
151885
- "session",
151886
- "master",
151887
- "shared",
151888
- "root",
151889
- "ssh",
151890
- "rsa",
151891
- "aes",
151892
- "hmac",
151893
- "oauth"
151894
- ]);
151895
- var UUID_PATTERN3 = /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi;
151896
- var EMAIL_PATTERN2 = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
151897
- var JWT_PATTERN2 = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
151898
- var LONG_TOKEN_PATTERN2 = /\b[A-Za-z0-9_-]{40,}\b/g;
151899
- var USER_HOME_PATTERN2 = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
151900
- var URL_PATTERN2 = /\bhttps?:\/\/[^\s,;]+/gi;
151901
- var URL_TRAILING_PUNCT2 = /[.,;:!?)\]}>'"]+$/;
151902
- function shortHash2(input) {
151903
- let hash = 2166136261;
151904
- for (let i2 = 0;i2 < input.length; i2++) {
151905
- hash ^= input.charCodeAt(i2);
151906
- hash = Math.imul(hash, 16777619);
151907
- }
151908
- return (hash >>> 0).toString(16).padStart(8, "0");
151909
- }
151910
- function redactUrl2(raw) {
151911
- try {
151912
- const url = new URL(raw);
151913
- return `${url.protocol}//${url.host}`;
151914
- } catch {
151915
- return `url#${shortHash2(raw)}`;
151916
- }
151917
- }
151918
- function redactValueDetectors2(value) {
151919
- let out = value;
151920
- out = out.replace(JWT_PATTERN2, () => REDACTED2);
151921
- out = out.replace(URL_PATTERN2, (match) => {
151922
- const trailing = match.match(URL_TRAILING_PUNCT2)?.[0] ?? "";
151923
- const core22 = trailing ? match.slice(0, -trailing.length) : match;
151924
- return `${redactUrl2(core22)}${trailing}`;
151925
- });
151926
- out = out.replace(USER_HOME_PATTERN2, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
151927
- out = out.replace(EMAIL_PATTERN2, (match) => `email#${shortHash2(match)}`);
151928
- out = out.replace(UUID_PATTERN3, (match) => `uuid#${shortHash2(match)}`);
151929
- out = out.replace(LONG_TOKEN_PATTERN2, () => REDACTED2);
151930
- if (out.length > MAX_VALUE_LENGTH2) {
151931
- out = `${out.slice(0, MAX_VALUE_LENGTH2)}…`;
151932
- }
151933
- return out;
151934
- }
151935
- function nameTokens2(name) {
151936
- 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);
151937
- }
151938
- function isSensitiveName2(name) {
151939
- const tokens = nameTokens2(name);
151940
- for (let i2 = 0;i2 < tokens.length; i2++) {
151941
- const token = tokens[i2];
151942
- if (SENSITIVE_NAME_TOKENS2.has(token)) {
151943
- return true;
151944
- }
151945
- if (token === "key" || token === "keys") {
151946
- const prev = tokens[i2 - 1];
151947
- if (prev && SENSITIVE_KEY_PREFIXES2.has(prev)) {
151948
- return true;
151949
- }
151950
- }
151951
- }
151952
- return false;
151953
- }
151954
- function redactProperty2(name, value) {
151955
- if (value === undefined || value === null) {
151956
- return;
151957
- }
151958
- if (isSensitiveName2(name)) {
151959
- return REDACTED2;
151960
- }
151961
- if (typeof value === "boolean" || typeof value === "number") {
151962
- return value;
151963
- }
151964
- if (typeof value !== "string") {
151965
- return "[OBJECT]";
151966
- }
151967
- return redactValueDetectors2(value);
151968
- }
151969
- function redactProperties2(properties) {
151970
- const out = {};
151971
- for (const [name, value] of Object.entries(properties)) {
151972
- const redacted = redactProperty2(name, value);
151973
- if (redacted !== undefined) {
151974
- out[name] = redacted;
151975
- }
151976
- }
151977
- return out;
151978
- }
151979
152196
  var pollSignalSlot2 = singleton3("PollSignal");
151980
152197
  var cliErrorCodeValues2 = new Set(CLI_ERROR_CODES2);
151981
152198
  var retryHintValues2 = new Set(RETRY_HINTS2);
152199
+ var TELEMETRY_COMMAND_ARG_PREFIX2 = "uip.cmd.arg.";
151982
152200
  function extractCommandParams2(cmd) {
151983
152201
  const params = {};
152202
+ const add22 = (name, value) => {
152203
+ if (name && value !== undefined) {
152204
+ params[`${TELEMETRY_COMMAND_ARG_PREFIX2}${name}`] = value;
152205
+ }
152206
+ };
151984
152207
  const registered = cmd.registeredArguments ?? [];
151985
152208
  const processed = cmd.processedArgs ?? [];
151986
152209
  for (let i2 = 0;i2 < registered.length; i2++) {
151987
- const value = processed[i2];
151988
- if (value === undefined) {
151989
- continue;
151990
- }
151991
- const name = registered[i2].name();
151992
- if (name) {
151993
- params[name] = value;
151994
- }
152210
+ add22(registered[i2].name(), processed[i2]);
151995
152211
  }
151996
152212
  for (const [key, value] of Object.entries(cmd.opts())) {
151997
- if (value !== undefined) {
151998
- params[key] = value;
151999
- }
152213
+ add22(key, value);
152000
152214
  }
152001
152215
  return params;
152002
152216
  }
@@ -152039,11 +152253,12 @@ Command3.prototype.trackedAction = function(context, fn, properties) {
152039
152253
  return this.action(async (...args) => {
152040
152254
  const telemetryName = deriveCommandPath2(command);
152041
152255
  const props2 = typeof properties === "function" ? properties(...args) : properties;
152256
+ const requestContext = telemetry2.createRequestContext();
152042
152257
  const startTime = performance.now();
152043
152258
  let errorMessage3;
152044
152259
  let fallbackExitCode = EXIT_CODES3.Success;
152045
152260
  clearRecordedCommandFailureTelemetry2();
152046
- const [error] = await catchError4(fn(...args));
152261
+ const [error] = await catchError4(telemetry2.runWithContext(requestContext, () => fn(...args)));
152047
152262
  if (error) {
152048
152263
  errorMessage3 = error instanceof Error ? error.message : String(error);
152049
152264
  logger3.debug(`[trackedAction] ${telemetryName} failed: ${errorMessage3}`);
@@ -152079,16 +152294,21 @@ Command3.prototype.trackedAction = function(context, fn, properties) {
152079
152294
  recordedFailure,
152080
152295
  pollSignal: context.pollSignal
152081
152296
  });
152082
- telemetry2.trackEvent(telemetryName, redactProperties2({
152083
- ...extractCommandParams2(command),
152297
+ const commandParams = extractCommandParams2(command);
152298
+ if (props2) {
152299
+ for (const key of Object.keys(props2)) {
152300
+ delete commandParams[`${TELEMETRY_COMMAND_ARG_PREFIX2}${key}`];
152301
+ }
152302
+ }
152303
+ const baseProperties = redactProperties2({
152304
+ ...commandParams,
152084
152305
  ...props2,
152085
152306
  ...buildCommandTelemetryAttribution2(telemetryName, process.env.UIPATH_SKILL),
152086
152307
  command: "true",
152087
- duration: String(durationMs),
152088
- success: String(success),
152089
152308
  ...terminalTelemetry,
152090
152309
  ...errorMessage3 ? { errorMessage: errorMessage3 } : {}
152091
- }));
152310
+ });
152311
+ telemetry2.trackRequestResult(telemetryName, durationMs, success, baseProperties, requestContext);
152092
152312
  });
152093
152313
  };
152094
152314
  var guardInstalledSlot2 = singleton3("ConsoleGuardInstalled");
@@ -152444,7 +152664,7 @@ function querystringSingleKey5(key, value, keyPrefix = "") {
152444
152664
  var package_default5 = {
152445
152665
  name: "@uipath/solution-sdk",
152446
152666
  license: "MIT",
152447
- version: "1.199.0-preview.91",
152667
+ version: "1.199.0-preview.97",
152448
152668
  repository: {
152449
152669
  type: "git",
152450
152670
  url: "https://github.com/UiPath/cli.git",
@@ -197696,4 +197916,4 @@ export {
197696
197916
  metadata
197697
197917
  };
197698
197918
 
197699
- //# debugId=D09A8E478ED5519764756E2164756E21
197919
+ //# debugId=0F1DA5D94470D25C64756E2164756E21
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/agent-tool",
3
3
  "license": "MIT",
4
- "version": "1.199.0-preview.91",
4
+ "version": "1.199.0-preview.97",
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": "f428cb1e61ba89ad18394b0c6106784055699f02"
29
+ "gitHead": "087ae21e842f27bde5eb0013892c9487bfe60568"
30
30
  }