@uipath/api-workflow-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 +749 -444
  2. package/package.json +2 -2
package/dist/tool.js CHANGED
@@ -28571,7 +28571,27 @@ class NodeContextStorage2 {
28571
28571
  return this.storage.getStore();
28572
28572
  }
28573
28573
  }
28574
- function getProcessEnv2() {
28574
+ function getProcessEnv3() {
28575
+ return globalThis.process?.env;
28576
+ }
28577
+ function parseInboundTraceparent2(value) {
28578
+ if (!value) {
28579
+ return;
28580
+ }
28581
+ const match = TRACEPARENT_PATTERN2.exec(value.trim().toLowerCase());
28582
+ if (!match) {
28583
+ return;
28584
+ }
28585
+ const [, traceId, parentSpanId] = match;
28586
+ if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
28587
+ return;
28588
+ }
28589
+ return { traceId, parentSpanId };
28590
+ }
28591
+ function getInboundTraceContext2() {
28592
+ return parseInboundTraceparent2(getProcessEnv3()?.[TELEMETRY_TRACEPARENT_ENV2]);
28593
+ }
28594
+ function getProcessEnv22() {
28575
28595
  return globalThis.process?.env;
28576
28596
  }
28577
28597
  function normalizeSessionId2(value) {
@@ -28582,14 +28602,110 @@ function normalizeSessionId2(value) {
28582
28602
  return trimmed || undefined;
28583
28603
  }
28584
28604
  function getConfiguredTelemetrySessionId2() {
28585
- return normalizeSessionId2(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV2]);
28605
+ return normalizeSessionId2(getProcessEnv22()?.[TELEMETRY_SESSION_ID_ENV2]);
28586
28606
  }
28587
28607
  function resolveTelemetrySessionId2(existingSessionId) {
28588
28608
  return getConfiguredTelemetrySessionId2() ?? normalizeSessionId2(existingSessionId);
28589
28609
  }
28610
+ function getTelemetryOperationId2() {
28611
+ const existing = telemetryOperationIdSlot2.get();
28612
+ if (existing) {
28613
+ return existing;
28614
+ }
28615
+ const inboundTraceId = getInboundTraceContext2()?.traceId;
28616
+ const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
28617
+ telemetryOperationIdSlot2.set(generated);
28618
+ return generated;
28619
+ }
28590
28620
  function getGlobalTelemetryProperties2() {
28591
28621
  return telemetryPropsSlot2.get();
28592
28622
  }
28623
+ function shortHash2(input) {
28624
+ let hash = 2166136261;
28625
+ for (let i2 = 0;i2 < input.length; i2++) {
28626
+ hash ^= input.charCodeAt(i2);
28627
+ hash = Math.imul(hash, 16777619);
28628
+ }
28629
+ return (hash >>> 0).toString(16).padStart(8, "0");
28630
+ }
28631
+ function redactUrl2(raw) {
28632
+ try {
28633
+ const url = new URL(raw);
28634
+ return `${url.protocol}//${url.host}`;
28635
+ } catch {
28636
+ return `url#${shortHash2(raw)}`;
28637
+ }
28638
+ }
28639
+ function redactValueDetectors2(value) {
28640
+ let out = value;
28641
+ out = out.replace(JWT_PATTERN2, () => REDACTED2);
28642
+ out = out.replace(URL_PATTERN2, (match) => {
28643
+ const trailing = match.match(URL_TRAILING_PUNCT2)?.[0] ?? "";
28644
+ const core22 = trailing ? match.slice(0, -trailing.length) : match;
28645
+ return `${redactUrl2(core22)}${trailing}`;
28646
+ });
28647
+ out = out.replace(USER_HOME_PATTERN2, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
28648
+ out = out.replace(EMAIL_PATTERN2, (match) => `email#${shortHash2(match)}`);
28649
+ out = out.replace(UUID_PATTERN2, (match) => `uuid#${shortHash2(match)}`);
28650
+ out = out.replace(LONG_TOKEN_PATTERN2, () => REDACTED2);
28651
+ if (out.length > MAX_VALUE_LENGTH2) {
28652
+ out = `${out.slice(0, MAX_VALUE_LENGTH2)}…`;
28653
+ }
28654
+ return out;
28655
+ }
28656
+ function redactValue2(value) {
28657
+ return redactValueDetectors2(value);
28658
+ }
28659
+ function redactError2(error) {
28660
+ const safe = new Error(redactValueDetectors2(error.message ?? ""));
28661
+ safe.name = error.name;
28662
+ safe.stack = typeof error.stack === "string" ? redactValueDetectors2(error.stack) : undefined;
28663
+ return safe;
28664
+ }
28665
+ function nameTokens2(name) {
28666
+ 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);
28667
+ }
28668
+ function isSensitiveName2(name) {
28669
+ const tokens = nameTokens2(name);
28670
+ for (let i2 = 0;i2 < tokens.length; i2++) {
28671
+ const token = tokens[i2];
28672
+ if (SENSITIVE_NAME_TOKENS2.has(token)) {
28673
+ return true;
28674
+ }
28675
+ if (token === "key" || token === "keys") {
28676
+ const prev = tokens[i2 - 1];
28677
+ if (prev && SENSITIVE_KEY_PREFIXES2.has(prev)) {
28678
+ return true;
28679
+ }
28680
+ }
28681
+ }
28682
+ return false;
28683
+ }
28684
+ function redactProperty2(name, value) {
28685
+ if (value === undefined || value === null) {
28686
+ return;
28687
+ }
28688
+ if (isSensitiveName2(name)) {
28689
+ return REDACTED2;
28690
+ }
28691
+ if (typeof value === "boolean" || typeof value === "number") {
28692
+ return value;
28693
+ }
28694
+ if (typeof value !== "string") {
28695
+ return "[OBJECT]";
28696
+ }
28697
+ return redactValueDetectors2(value);
28698
+ }
28699
+ function redactProperties2(properties) {
28700
+ const out = {};
28701
+ for (const [name, value] of Object.entries(properties)) {
28702
+ const redacted = redactProperty2(name, value);
28703
+ if (redacted !== undefined) {
28704
+ out[name] = redacted;
28705
+ }
28706
+ }
28707
+ return out;
28708
+ }
28593
28709
 
28594
28710
  class TelemetryService2 {
28595
28711
  telemetryProvider;
@@ -28617,11 +28733,15 @@ class TelemetryService2 {
28617
28733
  trackException(error, properties) {
28618
28734
  const context = this.getCurrentContext();
28619
28735
  const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
28620
- this.telemetryProvider.trackException(error, enrichedProperties);
28736
+ this.telemetryProvider.trackException(redactError2(error), enrichedProperties);
28621
28737
  }
28622
28738
  async trackRequest(name, fn, properties) {
28739
+ const parentContext = this.getCurrentContext();
28740
+ const operationId = parentContext?.operationId ?? this.operationId ?? getTelemetryOperationId2();
28741
+ const parentId = parentContext ? parentContext.id : this.inboundParentIdFor(operationId);
28623
28742
  const context = {
28624
- operationId: this.operationId ?? this.generateId(),
28743
+ operationId,
28744
+ ...parentId !== undefined ? { parentId } : {},
28625
28745
  id: this.generateId()
28626
28746
  };
28627
28747
  const startTime = performance.now();
@@ -28639,6 +28759,45 @@ class TelemetryService2 {
28639
28759
  throw error;
28640
28760
  }
28641
28761
  }
28762
+ trackRequestResult(name, durationMs, success, properties, context) {
28763
+ const requestContext = context ?? {
28764
+ operationId: this.operationId ?? getTelemetryOperationId2(),
28765
+ id: this.generateId()
28766
+ };
28767
+ const enrichedProperties = this.enrichPropertiesWithContext(properties, requestContext);
28768
+ this.telemetryProvider.trackRequest(name, durationMs, success, enrichedProperties);
28769
+ }
28770
+ createRequestContext() {
28771
+ const operationId = this.operationId ?? getTelemetryOperationId2();
28772
+ const parentId = this.inboundParentIdFor(operationId);
28773
+ return {
28774
+ operationId,
28775
+ ...parentId !== undefined ? { parentId } : {},
28776
+ id: this.generateId()
28777
+ };
28778
+ }
28779
+ inboundParentIdFor(operationId) {
28780
+ const inbound = getInboundTraceContext2();
28781
+ return inbound && inbound.traceId === operationId ? inbound.parentSpanId : undefined;
28782
+ }
28783
+ runWithContext(context, fn) {
28784
+ return this.contextStorage.run(context, fn);
28785
+ }
28786
+ createDependencyContext() {
28787
+ const parentContext = this.getCurrentContext();
28788
+ if (!parentContext) {
28789
+ return;
28790
+ }
28791
+ return {
28792
+ operationId: parentContext.operationId,
28793
+ parentId: parentContext.id,
28794
+ id: this.generateId()
28795
+ };
28796
+ }
28797
+ trackDependencyResult(name, type22, durationMs, success, properties, context, resultCode) {
28798
+ const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
28799
+ this.telemetryProvider.trackDependency(redactValue2(name), type22, durationMs, success, enrichedProperties, resultCode);
28800
+ }
28642
28801
  async trackDependencyOperation(name, type22, fn, properties) {
28643
28802
  const parentContext = this.getCurrentContext();
28644
28803
  if (!parentContext) {
@@ -28675,8 +28834,12 @@ class TelemetryService2 {
28675
28834
  ...getExecutionContextTelemetryProperties2(),
28676
28835
  ...globalProperties,
28677
28836
  ...this.defaultProperties,
28678
- ...properties,
28679
- ...context
28837
+ ...redactProperties2(properties ?? {}),
28838
+ ...context ? {
28839
+ [TELEMETRY_OPERATION_ID_PROPERTY2]: context.operationId,
28840
+ ...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY2]: context.parentId } : {},
28841
+ [TELEMETRY_SPAN_ID_PROPERTY2]: context.id
28842
+ } : {}
28680
28843
  };
28681
28844
  if (sessionId === undefined) {
28682
28845
  delete enriched[TELEMETRY_SESSION_ID_PROPERTY2];
@@ -28686,7 +28849,16 @@ class TelemetryService2 {
28686
28849
  return enriched;
28687
28850
  }
28688
28851
  generateId() {
28689
- return crypto.randomUUID().replaceAll("-", "");
28852
+ const bytes = new Uint8Array(8);
28853
+ let hex = "";
28854
+ do {
28855
+ crypto.getRandomValues(bytes);
28856
+ hex = "";
28857
+ for (const byte of bytes) {
28858
+ hex += byte.toString(16).padStart(2, "0");
28859
+ }
28860
+ } while (/^0+$/.test(hex));
28861
+ return hex;
28690
28862
  }
28691
28863
  }
28692
28864
  function getGlobalTelemetryInstance2() {
@@ -29140,101 +29312,20 @@ function buildCommandTelemetryAttribution2(commandPath, skillSource) {
29140
29312
  ...getCommandProductModeAttribution2(commandPath)
29141
29313
  };
29142
29314
  }
29143
- function shortHash2(input) {
29144
- let hash = 2166136261;
29145
- for (let i2 = 0;i2 < input.length; i2++) {
29146
- hash ^= input.charCodeAt(i2);
29147
- hash = Math.imul(hash, 16777619);
29148
- }
29149
- return (hash >>> 0).toString(16).padStart(8, "0");
29150
- }
29151
- function redactUrl2(raw) {
29152
- try {
29153
- const url = new URL(raw);
29154
- return `${url.protocol}//${url.host}`;
29155
- } catch {
29156
- return `url#${shortHash2(raw)}`;
29157
- }
29158
- }
29159
- function redactValueDetectors2(value) {
29160
- let out = value;
29161
- out = out.replace(JWT_PATTERN2, () => REDACTED2);
29162
- out = out.replace(URL_PATTERN2, (match) => {
29163
- const trailing = match.match(URL_TRAILING_PUNCT2)?.[0] ?? "";
29164
- const core22 = trailing ? match.slice(0, -trailing.length) : match;
29165
- return `${redactUrl2(core22)}${trailing}`;
29166
- });
29167
- out = out.replace(USER_HOME_PATTERN2, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
29168
- out = out.replace(EMAIL_PATTERN2, (match) => `email#${shortHash2(match)}`);
29169
- out = out.replace(UUID_PATTERN2, (match) => `uuid#${shortHash2(match)}`);
29170
- out = out.replace(LONG_TOKEN_PATTERN2, () => REDACTED2);
29171
- if (out.length > MAX_VALUE_LENGTH2) {
29172
- out = `${out.slice(0, MAX_VALUE_LENGTH2)}…`;
29173
- }
29174
- return out;
29175
- }
29176
- function nameTokens2(name) {
29177
- 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);
29178
- }
29179
- function isSensitiveName2(name) {
29180
- const tokens = nameTokens2(name);
29181
- for (let i2 = 0;i2 < tokens.length; i2++) {
29182
- const token = tokens[i2];
29183
- if (SENSITIVE_NAME_TOKENS2.has(token)) {
29184
- return true;
29185
- }
29186
- if (token === "key" || token === "keys") {
29187
- const prev = tokens[i2 - 1];
29188
- if (prev && SENSITIVE_KEY_PREFIXES2.has(prev)) {
29189
- return true;
29190
- }
29191
- }
29192
- }
29193
- return false;
29194
- }
29195
- function redactProperty2(name, value) {
29196
- if (value === undefined || value === null) {
29197
- return;
29198
- }
29199
- if (isSensitiveName2(name)) {
29200
- return REDACTED2;
29201
- }
29202
- if (typeof value === "boolean" || typeof value === "number") {
29203
- return value;
29204
- }
29205
- if (typeof value !== "string") {
29206
- return "[OBJECT]";
29207
- }
29208
- return redactValueDetectors2(value);
29209
- }
29210
- function redactProperties2(properties) {
29211
- const out = {};
29212
- for (const [name, value] of Object.entries(properties)) {
29213
- const redacted = redactProperty2(name, value);
29214
- if (redacted !== undefined) {
29215
- out[name] = redacted;
29216
- }
29217
- }
29218
- return out;
29219
- }
29220
29315
  function extractCommandParams2(cmd) {
29221
29316
  const params = {};
29317
+ const add22 = (name, value) => {
29318
+ if (name && value !== undefined) {
29319
+ params[`${TELEMETRY_COMMAND_ARG_PREFIX2}${name}`] = value;
29320
+ }
29321
+ };
29222
29322
  const registered = cmd.registeredArguments ?? [];
29223
29323
  const processed = cmd.processedArgs ?? [];
29224
29324
  for (let i2 = 0;i2 < registered.length; i2++) {
29225
- const value = processed[i2];
29226
- if (value === undefined) {
29227
- continue;
29228
- }
29229
- const name = registered[i2].name();
29230
- if (name) {
29231
- params[name] = value;
29232
- }
29325
+ add22(registered[i2].name(), processed[i2]);
29233
29326
  }
29234
29327
  for (const [key, value] of Object.entries(cmd.opts())) {
29235
- if (value !== undefined) {
29236
- params[key] = value;
29237
- }
29328
+ add22(key, value);
29238
29329
  }
29239
29330
  return params;
29240
29331
  }
@@ -31446,7 +31537,7 @@ var __create2, __getProtoOf2, __defProp2, __getOwnPropNames2, __hasOwnProp2, __t
31446
31537
  }
31447
31538
  return result;
31448
31539
  }
31449
- }, TreeInterpreterInstance2, TreeInterpreter_default2, jsYaml2, loader2, common2, hasRequiredCommon2, exception2, hasRequiredException2, snippet2, hasRequiredSnippet2, type2, hasRequiredType2, schema2, hasRequiredSchema2, str2, hasRequiredStr2, seq2, hasRequiredSeq2, map2, hasRequiredMap2, failsafe2, hasRequiredFailsafe2, _null2, hasRequired_null2, bool2, hasRequiredBool2, int2, hasRequiredInt2, float2, hasRequiredFloat2, json2, hasRequiredJson2, core2, hasRequiredCore2, timestamp2, hasRequiredTimestamp2, merge2, hasRequiredMerge2, binary2, hasRequiredBinary2, omap2, hasRequiredOmap2, pairs2, hasRequiredPairs2, set2, hasRequiredSet2, _default2, hasRequired_default2, hasRequiredLoader2, dumper2, hasRequiredDumper2, hasRequiredJsYaml2, jsYamlExports2, yaml2, Type2, Schema2, FAILSAFE_SCHEMA2, JSON_SCHEMA2, CORE_SCHEMA2, DEFAULT_SCHEMA2, load2, loadAll2, dump2, YAMLException2, types2, safeLoad2, safeLoadAll2, safeDump2, logFilePathSlot2, LogLevel3, DEFAULT_LOG_LEVEL2 = 3, SimpleLogger2, loggerSingleton2, logger3, formatSlot2, formatExplicitSlot2, helpRequestedSlot2, filterSlot2, recordedFailureSlot2, AUTH_ERROR_CODES2, VALIDATION_ERROR_CODES2, NETWORK_HTTP_ERROR_CODES2, TIMEOUT_ERROR_CODES2, NETWORK_OS_ERROR_CODES2, TIMEOUT_OS_ERROR_CODES2, TLS_ERROR_CODES22, MISSING_DEPENDENCY_CODES2, INTERNAL_ERROR_NAMES2, CommonTelemetryEvents2, KNOWN_AGENTS2, LOCAL_HOSTS2, authSignalSlot2, isTruthy2 = (value) => value !== undefined && value !== "" && value !== "0" && value.toLowerCase() !== "false", isEqual2 = (value, expected) => value?.toLowerCase() === expected, CI_SIGNATURES2, TELEMETRY_SESSION_ID_ENV2 = "UIPATH_SESSION_ID", TELEMETRY_SESSION_ID_PROPERTY2 = "session_id", telemetrySessionIdSlot2, telemetryPropsSlot2, providerSlot2, telemetryInstanceSlot2, DEFAULT_AI_CONNECTION_STRING2, _localTelemetryInstance2, telemetry2, CLI_ERROR_CODES2, RETRY_HINTS2, RESULTS2, EXIT_CODES2, FilterEvaluationError2, OutputFormatter2, LEGACY_SKILL_NAMESPACE2 = "uipath:", MAX_SKILL_NAME_LENGTH2 = 80, SKILL_NAME_PATTERN2, SKILL_ATTRIBUTION2, KNOWN_SKILL_NAMES2, COMMAND_ATTRIBUTION2, REDACTED2 = "[REDACTED]", MAX_VALUE_LENGTH2 = 200, SENSITIVE_NAME_TOKENS2, SENSITIVE_KEY_PREFIXES2, UUID_PATTERN2, EMAIL_PATTERN2, JWT_PATTERN2, LONG_TOKEN_PATTERN2, USER_HOME_PATTERN2, URL_PATTERN2, URL_TRAILING_PUNCT2, pollSignalSlot2, cliErrorCodeValues2, retryHintValues2, guardInstalledSlot2, savedOriginalsSlot2, DEFAULT_AUTH_TIMEOUT_MS3, modeSlot2, interactiveFlagSlot2, PollOutcome2, REASON_BY_OUTCOME2, TERMINAL_STATUSES2, FAILURE_STATUSES2, previewSlot2, ScreenLogger2, sdkUserAgentHostToken2, shippedKeysSlot2, factorySlot2;
31540
+ }, TreeInterpreterInstance2, TreeInterpreter_default2, jsYaml2, loader2, common2, hasRequiredCommon2, exception2, hasRequiredException2, snippet2, hasRequiredSnippet2, type2, hasRequiredType2, schema2, hasRequiredSchema2, str2, hasRequiredStr2, seq2, hasRequiredSeq2, map2, hasRequiredMap2, failsafe2, hasRequiredFailsafe2, _null2, hasRequired_null2, bool2, hasRequiredBool2, int2, hasRequiredInt2, float2, hasRequiredFloat2, json2, hasRequiredJson2, core2, hasRequiredCore2, timestamp2, hasRequiredTimestamp2, merge2, hasRequiredMerge2, binary2, hasRequiredBinary2, omap2, hasRequiredOmap2, pairs2, hasRequiredPairs2, set2, hasRequiredSet2, _default2, hasRequired_default2, hasRequiredLoader2, dumper2, hasRequiredDumper2, hasRequiredJsYaml2, jsYamlExports2, yaml2, Type2, Schema2, FAILSAFE_SCHEMA2, JSON_SCHEMA2, CORE_SCHEMA2, DEFAULT_SCHEMA2, load2, loadAll2, dump2, YAMLException2, types2, safeLoad2, safeLoadAll2, safeDump2, logFilePathSlot2, LogLevel3, DEFAULT_LOG_LEVEL2 = 3, SimpleLogger2, loggerSingleton2, logger3, formatSlot2, formatExplicitSlot2, helpRequestedSlot2, filterSlot2, recordedFailureSlot2, AUTH_ERROR_CODES2, VALIDATION_ERROR_CODES2, NETWORK_HTTP_ERROR_CODES2, TIMEOUT_ERROR_CODES2, NETWORK_OS_ERROR_CODES2, TIMEOUT_OS_ERROR_CODES2, TLS_ERROR_CODES22, MISSING_DEPENDENCY_CODES2, INTERNAL_ERROR_NAMES2, CommonTelemetryEvents2, KNOWN_AGENTS2, LOCAL_HOSTS2, authSignalSlot2, isTruthy2 = (value) => value !== undefined && value !== "" && value !== "0" && value.toLowerCase() !== "false", isEqual2 = (value, expected) => value?.toLowerCase() === expected, CI_SIGNATURES2, TELEMETRY_TRACEPARENT_ENV2 = "TRACEPARENT", TRACEPARENT_PATTERN2, TELEMETRY_SESSION_ID_ENV2 = "UIPATH_SESSION_ID", TELEMETRY_SESSION_ID_PROPERTY2 = "session_id", telemetrySessionIdSlot2, telemetryOperationIdSlot2, telemetryPropsSlot2, REDACTED2 = "[REDACTED]", MAX_VALUE_LENGTH2 = 200, SENSITIVE_NAME_TOKENS2, SENSITIVE_KEY_PREFIXES2, UUID_PATTERN2, EMAIL_PATTERN2, JWT_PATTERN2, LONG_TOKEN_PATTERN2, USER_HOME_PATTERN2, URL_PATTERN2, URL_TRAILING_PUNCT2, TELEMETRY_OPERATION_ID_PROPERTY2 = "uip.trace.operation_id", TELEMETRY_PARENT_ID_PROPERTY2 = "uip.trace.parent_id", TELEMETRY_SPAN_ID_PROPERTY2 = "uip.trace.span_id", providerSlot2, telemetryInstanceSlot2, DEFAULT_AI_CONNECTION_STRING2, _localTelemetryInstance2, telemetry2, CLI_ERROR_CODES2, RETRY_HINTS2, RESULTS2, EXIT_CODES2, FilterEvaluationError2, OutputFormatter2, LEGACY_SKILL_NAMESPACE2 = "uipath:", MAX_SKILL_NAME_LENGTH2 = 80, SKILL_NAME_PATTERN2, SKILL_ATTRIBUTION2, KNOWN_SKILL_NAMES2, COMMAND_ATTRIBUTION2, pollSignalSlot2, cliErrorCodeValues2, retryHintValues2, TELEMETRY_COMMAND_ARG_PREFIX2 = "uip.cmd.arg.", guardInstalledSlot2, savedOriginalsSlot2, DEFAULT_AUTH_TIMEOUT_MS3, modeSlot2, interactiveFlagSlot2, PollOutcome2, REASON_BY_OUTCOME2, TERMINAL_STATUSES2, FAILURE_STATUSES2, previewSlot2, ScreenLogger2, sdkUserAgentHostToken2, shippedKeysSlot2, factorySlot2;
31450
31541
  var init_dist2 = __esm(() => {
31451
31542
  __create2 = Object.create;
31452
31543
  __getProtoOf2 = Object.getPrototypeOf;
@@ -34105,8 +34196,53 @@ Expecting one of '${allowedValues.join("', '")}'`);
34105
34196
  matches: (env) => isTruthy2(env.CI)
34106
34197
  }
34107
34198
  ];
34199
+ TRACEPARENT_PATTERN2 = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
34108
34200
  telemetrySessionIdSlot2 = singleton3("TelemetrySessionId");
34201
+ telemetryOperationIdSlot2 = singleton3("TelemetryOperationId");
34109
34202
  telemetryPropsSlot2 = singleton3("TelemetryDefaultProps");
34203
+ SENSITIVE_NAME_TOKENS2 = new Set([
34204
+ "token",
34205
+ "tokens",
34206
+ "secret",
34207
+ "secrets",
34208
+ "password",
34209
+ "passwords",
34210
+ "pwd",
34211
+ "credential",
34212
+ "credentials",
34213
+ "auth",
34214
+ "authentication",
34215
+ "authorization",
34216
+ "authority",
34217
+ "cert",
34218
+ "certificate",
34219
+ "certificates"
34220
+ ]);
34221
+ SENSITIVE_KEY_PREFIXES2 = new Set([
34222
+ "api",
34223
+ "access",
34224
+ "client",
34225
+ "private",
34226
+ "public",
34227
+ "signing",
34228
+ "encryption",
34229
+ "session",
34230
+ "master",
34231
+ "shared",
34232
+ "root",
34233
+ "ssh",
34234
+ "rsa",
34235
+ "aes",
34236
+ "hmac",
34237
+ "oauth"
34238
+ ]);
34239
+ UUID_PATTERN2 = /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi;
34240
+ EMAIL_PATTERN2 = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
34241
+ JWT_PATTERN2 = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
34242
+ LONG_TOKEN_PATTERN2 = /\b[A-Za-z0-9_-]{40,}\b/g;
34243
+ USER_HOME_PATTERN2 = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
34244
+ URL_PATTERN2 = /\bhttps?:\/\/[^\s,;]+/gi;
34245
+ URL_TRAILING_PUNCT2 = /[.,;:!?)\]}>'"]+$/;
34110
34246
  providerSlot2 = singleton3("TelemetryProvider");
34111
34247
  telemetryInstanceSlot2 = singleton3("TelemetryService");
34112
34248
  DEFAULT_AI_CONNECTION_STRING2 = atob("SW5zdHJ1bWVudGF0aW9uS2V5PTliZDM3NDgyLTgxMGUtNDQyYS1hYWE2LWQzOGVmNjVjNjY3NDtJbmdlc3Rpb25FbmRwb2ludD1odHRwczovL3dlc3RldXJvcGUtNS5pbi5hcHBsaWNhdGlvbmluc2lnaHRzLmF6dXJlLmNvbS87TGl2ZUVuZHBvaW50PWh0dHBzOi8vd2VzdGV1cm9wZS5saXZlZGlhZ25vc3RpY3MubW9uaXRvci5henVyZS5jb20vO0FwcGxpY2F0aW9uSWQ9MzU2OTdlZjEtOGJkMC00ZjE5LWEyN2MtZDg3Y2NhYzY2ZDJj");
@@ -34344,49 +34480,6 @@ Expecting one of '${allowedValues.join("', '")}'`);
34344
34480
  ]
34345
34481
  ]
34346
34482
  ]).sort((a, b) => b.prefix.length - a.prefix.length);
34347
- SENSITIVE_NAME_TOKENS2 = new Set([
34348
- "token",
34349
- "tokens",
34350
- "secret",
34351
- "secrets",
34352
- "password",
34353
- "passwords",
34354
- "pwd",
34355
- "credential",
34356
- "credentials",
34357
- "auth",
34358
- "authentication",
34359
- "authorization",
34360
- "authority",
34361
- "cert",
34362
- "certificate",
34363
- "certificates"
34364
- ]);
34365
- SENSITIVE_KEY_PREFIXES2 = new Set([
34366
- "api",
34367
- "access",
34368
- "client",
34369
- "private",
34370
- "public",
34371
- "signing",
34372
- "encryption",
34373
- "session",
34374
- "master",
34375
- "shared",
34376
- "root",
34377
- "ssh",
34378
- "rsa",
34379
- "aes",
34380
- "hmac",
34381
- "oauth"
34382
- ]);
34383
- UUID_PATTERN2 = /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi;
34384
- EMAIL_PATTERN2 = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
34385
- JWT_PATTERN2 = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
34386
- LONG_TOKEN_PATTERN2 = /\b[A-Za-z0-9_-]{40,}\b/g;
34387
- USER_HOME_PATTERN2 = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
34388
- URL_PATTERN2 = /\bhttps?:\/\/[^\s,;]+/gi;
34389
- URL_TRAILING_PUNCT2 = /[.,;:!?)\]}>'"]+$/;
34390
34483
  pollSignalSlot2 = singleton3("PollSignal");
34391
34484
  cliErrorCodeValues2 = new Set(CLI_ERROR_CODES2);
34392
34485
  retryHintValues2 = new Set(RETRY_HINTS2);
@@ -34395,11 +34488,12 @@ Expecting one of '${allowedValues.join("', '")}'`);
34395
34488
  return this.action(async (...args) => {
34396
34489
  const telemetryName = deriveCommandPath2(command);
34397
34490
  const props = typeof properties === "function" ? properties(...args) : properties;
34491
+ const requestContext = telemetry2.createRequestContext();
34398
34492
  const startTime = performance.now();
34399
34493
  let errorMessage2;
34400
34494
  let fallbackExitCode = EXIT_CODES2.Success;
34401
34495
  clearRecordedCommandFailureTelemetry2();
34402
- const [error] = await catchError3(fn(...args));
34496
+ const [error] = await catchError3(telemetry2.runWithContext(requestContext, () => fn(...args)));
34403
34497
  if (error) {
34404
34498
  errorMessage2 = error instanceof Error ? error.message : String(error);
34405
34499
  logger3.debug(`[trackedAction] ${telemetryName} failed: ${errorMessage2}`);
@@ -34435,16 +34529,21 @@ Expecting one of '${allowedValues.join("', '")}'`);
34435
34529
  recordedFailure,
34436
34530
  pollSignal: context.pollSignal
34437
34531
  });
34438
- telemetry2.trackEvent(telemetryName, redactProperties2({
34439
- ...extractCommandParams2(command),
34532
+ const commandParams = extractCommandParams2(command);
34533
+ if (props) {
34534
+ for (const key of Object.keys(props)) {
34535
+ delete commandParams[`${TELEMETRY_COMMAND_ARG_PREFIX2}${key}`];
34536
+ }
34537
+ }
34538
+ const baseProperties = redactProperties2({
34539
+ ...commandParams,
34440
34540
  ...props,
34441
34541
  ...buildCommandTelemetryAttribution2(telemetryName, process.env.UIPATH_SKILL),
34442
34542
  command: "true",
34443
- duration: String(durationMs),
34444
- success: String(success),
34445
34543
  ...terminalTelemetry,
34446
34544
  ...errorMessage2 ? { errorMessage: errorMessage2 } : {}
34447
- }));
34545
+ });
34546
+ telemetry2.trackRequestResult(telemetryName, durationMs, success, baseProperties, requestContext);
34448
34547
  });
34449
34548
  };
34450
34549
  guardInstalledSlot2 = singleton3("ConsoleGuardInstalled");
@@ -41890,7 +41989,27 @@ class NodeContextStorage3 {
41890
41989
  return this.storage.getStore();
41891
41990
  }
41892
41991
  }
41893
- function getProcessEnv3() {
41992
+ function getProcessEnv4() {
41993
+ return globalThis.process?.env;
41994
+ }
41995
+ function parseInboundTraceparent3(value) {
41996
+ if (!value) {
41997
+ return;
41998
+ }
41999
+ const match = TRACEPARENT_PATTERN3.exec(value.trim().toLowerCase());
42000
+ if (!match) {
42001
+ return;
42002
+ }
42003
+ const [, traceId, parentSpanId] = match;
42004
+ if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
42005
+ return;
42006
+ }
42007
+ return { traceId, parentSpanId };
42008
+ }
42009
+ function getInboundTraceContext3() {
42010
+ return parseInboundTraceparent3(getProcessEnv4()?.[TELEMETRY_TRACEPARENT_ENV3]);
42011
+ }
42012
+ function getProcessEnv23() {
41894
42013
  return globalThis.process?.env;
41895
42014
  }
41896
42015
  function normalizeSessionId3(value) {
@@ -41901,14 +42020,110 @@ function normalizeSessionId3(value) {
41901
42020
  return trimmed || undefined;
41902
42021
  }
41903
42022
  function getConfiguredTelemetrySessionId3() {
41904
- return normalizeSessionId3(getProcessEnv3()?.[TELEMETRY_SESSION_ID_ENV3]);
42023
+ return normalizeSessionId3(getProcessEnv23()?.[TELEMETRY_SESSION_ID_ENV3]);
41905
42024
  }
41906
42025
  function resolveTelemetrySessionId3(existingSessionId) {
41907
42026
  return getConfiguredTelemetrySessionId3() ?? normalizeSessionId3(existingSessionId);
41908
42027
  }
42028
+ function getTelemetryOperationId3() {
42029
+ const existing = telemetryOperationIdSlot3.get();
42030
+ if (existing) {
42031
+ return existing;
42032
+ }
42033
+ const inboundTraceId = getInboundTraceContext3()?.traceId;
42034
+ const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
42035
+ telemetryOperationIdSlot3.set(generated);
42036
+ return generated;
42037
+ }
41909
42038
  function getGlobalTelemetryProperties3() {
41910
42039
  return telemetryPropsSlot3.get();
41911
42040
  }
42041
+ function shortHash3(input) {
42042
+ let hash = 2166136261;
42043
+ for (let i2 = 0;i2 < input.length; i2++) {
42044
+ hash ^= input.charCodeAt(i2);
42045
+ hash = Math.imul(hash, 16777619);
42046
+ }
42047
+ return (hash >>> 0).toString(16).padStart(8, "0");
42048
+ }
42049
+ function redactUrl3(raw) {
42050
+ try {
42051
+ const url = new URL(raw);
42052
+ return `${url.protocol}//${url.host}`;
42053
+ } catch {
42054
+ return `url#${shortHash3(raw)}`;
42055
+ }
42056
+ }
42057
+ function redactValueDetectors3(value) {
42058
+ let out = value;
42059
+ out = out.replace(JWT_PATTERN3, () => REDACTED3);
42060
+ out = out.replace(URL_PATTERN3, (match) => {
42061
+ const trailing = match.match(URL_TRAILING_PUNCT3)?.[0] ?? "";
42062
+ const core22 = trailing ? match.slice(0, -trailing.length) : match;
42063
+ return `${redactUrl3(core22)}${trailing}`;
42064
+ });
42065
+ out = out.replace(USER_HOME_PATTERN3, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
42066
+ out = out.replace(EMAIL_PATTERN3, (match) => `email#${shortHash3(match)}`);
42067
+ out = out.replace(UUID_PATTERN3, (match) => `uuid#${shortHash3(match)}`);
42068
+ out = out.replace(LONG_TOKEN_PATTERN3, () => REDACTED3);
42069
+ if (out.length > MAX_VALUE_LENGTH3) {
42070
+ out = `${out.slice(0, MAX_VALUE_LENGTH3)}…`;
42071
+ }
42072
+ return out;
42073
+ }
42074
+ function redactValue3(value) {
42075
+ return redactValueDetectors3(value);
42076
+ }
42077
+ function redactError3(error) {
42078
+ const safe = new Error(redactValueDetectors3(error.message ?? ""));
42079
+ safe.name = error.name;
42080
+ safe.stack = typeof error.stack === "string" ? redactValueDetectors3(error.stack) : undefined;
42081
+ return safe;
42082
+ }
42083
+ function nameTokens3(name) {
42084
+ return name.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").split(/[\s._-]+/).map((t2) => t2.toLowerCase()).filter(Boolean);
42085
+ }
42086
+ function isSensitiveName3(name) {
42087
+ const tokens = nameTokens3(name);
42088
+ for (let i2 = 0;i2 < tokens.length; i2++) {
42089
+ const token = tokens[i2];
42090
+ if (SENSITIVE_NAME_TOKENS3.has(token)) {
42091
+ return true;
42092
+ }
42093
+ if (token === "key" || token === "keys") {
42094
+ const prev = tokens[i2 - 1];
42095
+ if (prev && SENSITIVE_KEY_PREFIXES3.has(prev)) {
42096
+ return true;
42097
+ }
42098
+ }
42099
+ }
42100
+ return false;
42101
+ }
42102
+ function redactProperty3(name, value) {
42103
+ if (value === undefined || value === null) {
42104
+ return;
42105
+ }
42106
+ if (isSensitiveName3(name)) {
42107
+ return REDACTED3;
42108
+ }
42109
+ if (typeof value === "boolean" || typeof value === "number") {
42110
+ return value;
42111
+ }
42112
+ if (typeof value !== "string") {
42113
+ return "[OBJECT]";
42114
+ }
42115
+ return redactValueDetectors3(value);
42116
+ }
42117
+ function redactProperties3(properties) {
42118
+ const out = {};
42119
+ for (const [name, value] of Object.entries(properties)) {
42120
+ const redacted = redactProperty3(name, value);
42121
+ if (redacted !== undefined) {
42122
+ out[name] = redacted;
42123
+ }
42124
+ }
42125
+ return out;
42126
+ }
41912
42127
 
41913
42128
  class TelemetryService3 {
41914
42129
  telemetryProvider;
@@ -41936,11 +42151,15 @@ class TelemetryService3 {
41936
42151
  trackException(error, properties) {
41937
42152
  const context = this.getCurrentContext();
41938
42153
  const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
41939
- this.telemetryProvider.trackException(error, enrichedProperties);
42154
+ this.telemetryProvider.trackException(redactError3(error), enrichedProperties);
41940
42155
  }
41941
42156
  async trackRequest(name, fn, properties) {
42157
+ const parentContext = this.getCurrentContext();
42158
+ const operationId = parentContext?.operationId ?? this.operationId ?? getTelemetryOperationId3();
42159
+ const parentId = parentContext ? parentContext.id : this.inboundParentIdFor(operationId);
41942
42160
  const context = {
41943
- operationId: this.operationId ?? this.generateId(),
42161
+ operationId,
42162
+ ...parentId !== undefined ? { parentId } : {},
41944
42163
  id: this.generateId()
41945
42164
  };
41946
42165
  const startTime = performance.now();
@@ -41958,6 +42177,45 @@ class TelemetryService3 {
41958
42177
  throw error;
41959
42178
  }
41960
42179
  }
42180
+ trackRequestResult(name, durationMs, success, properties, context) {
42181
+ const requestContext = context ?? {
42182
+ operationId: this.operationId ?? getTelemetryOperationId3(),
42183
+ id: this.generateId()
42184
+ };
42185
+ const enrichedProperties = this.enrichPropertiesWithContext(properties, requestContext);
42186
+ this.telemetryProvider.trackRequest(name, durationMs, success, enrichedProperties);
42187
+ }
42188
+ createRequestContext() {
42189
+ const operationId = this.operationId ?? getTelemetryOperationId3();
42190
+ const parentId = this.inboundParentIdFor(operationId);
42191
+ return {
42192
+ operationId,
42193
+ ...parentId !== undefined ? { parentId } : {},
42194
+ id: this.generateId()
42195
+ };
42196
+ }
42197
+ inboundParentIdFor(operationId) {
42198
+ const inbound = getInboundTraceContext3();
42199
+ return inbound && inbound.traceId === operationId ? inbound.parentSpanId : undefined;
42200
+ }
42201
+ runWithContext(context, fn) {
42202
+ return this.contextStorage.run(context, fn);
42203
+ }
42204
+ createDependencyContext() {
42205
+ const parentContext = this.getCurrentContext();
42206
+ if (!parentContext) {
42207
+ return;
42208
+ }
42209
+ return {
42210
+ operationId: parentContext.operationId,
42211
+ parentId: parentContext.id,
42212
+ id: this.generateId()
42213
+ };
42214
+ }
42215
+ trackDependencyResult(name, type22, durationMs, success, properties, context, resultCode) {
42216
+ const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
42217
+ this.telemetryProvider.trackDependency(redactValue3(name), type22, durationMs, success, enrichedProperties, resultCode);
42218
+ }
41961
42219
  async trackDependencyOperation(name, type22, fn, properties) {
41962
42220
  const parentContext = this.getCurrentContext();
41963
42221
  if (!parentContext) {
@@ -41994,8 +42252,12 @@ class TelemetryService3 {
41994
42252
  ...getExecutionContextTelemetryProperties3(),
41995
42253
  ...globalProperties,
41996
42254
  ...this.defaultProperties,
41997
- ...properties,
41998
- ...context
42255
+ ...redactProperties3(properties ?? {}),
42256
+ ...context ? {
42257
+ [TELEMETRY_OPERATION_ID_PROPERTY3]: context.operationId,
42258
+ ...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY3]: context.parentId } : {},
42259
+ [TELEMETRY_SPAN_ID_PROPERTY3]: context.id
42260
+ } : {}
41999
42261
  };
42000
42262
  if (sessionId === undefined) {
42001
42263
  delete enriched[TELEMETRY_SESSION_ID_PROPERTY3];
@@ -42005,7 +42267,16 @@ class TelemetryService3 {
42005
42267
  return enriched;
42006
42268
  }
42007
42269
  generateId() {
42008
- return crypto.randomUUID().replaceAll("-", "");
42270
+ const bytes = new Uint8Array(8);
42271
+ let hex = "";
42272
+ do {
42273
+ crypto.getRandomValues(bytes);
42274
+ hex = "";
42275
+ for (const byte of bytes) {
42276
+ hex += byte.toString(16).padStart(2, "0");
42277
+ }
42278
+ } while (/^0+$/.test(hex));
42279
+ return hex;
42009
42280
  }
42010
42281
  }
42011
42282
  function getGlobalTelemetryInstance3() {
@@ -42459,101 +42730,20 @@ function buildCommandTelemetryAttribution3(commandPath, skillSource) {
42459
42730
  ...getCommandProductModeAttribution3(commandPath)
42460
42731
  };
42461
42732
  }
42462
- function shortHash3(input) {
42463
- let hash = 2166136261;
42464
- for (let i2 = 0;i2 < input.length; i2++) {
42465
- hash ^= input.charCodeAt(i2);
42466
- hash = Math.imul(hash, 16777619);
42467
- }
42468
- return (hash >>> 0).toString(16).padStart(8, "0");
42469
- }
42470
- function redactUrl3(raw) {
42471
- try {
42472
- const url = new URL(raw);
42473
- return `${url.protocol}//${url.host}`;
42474
- } catch {
42475
- return `url#${shortHash3(raw)}`;
42476
- }
42477
- }
42478
- function redactValueDetectors3(value) {
42479
- let out = value;
42480
- out = out.replace(JWT_PATTERN3, () => REDACTED3);
42481
- out = out.replace(URL_PATTERN3, (match) => {
42482
- const trailing = match.match(URL_TRAILING_PUNCT3)?.[0] ?? "";
42483
- const core22 = trailing ? match.slice(0, -trailing.length) : match;
42484
- return `${redactUrl3(core22)}${trailing}`;
42485
- });
42486
- out = out.replace(USER_HOME_PATTERN3, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
42487
- out = out.replace(EMAIL_PATTERN3, (match) => `email#${shortHash3(match)}`);
42488
- out = out.replace(UUID_PATTERN3, (match) => `uuid#${shortHash3(match)}`);
42489
- out = out.replace(LONG_TOKEN_PATTERN3, () => REDACTED3);
42490
- if (out.length > MAX_VALUE_LENGTH3) {
42491
- out = `${out.slice(0, MAX_VALUE_LENGTH3)}…`;
42492
- }
42493
- return out;
42494
- }
42495
- function nameTokens3(name) {
42496
- return name.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").split(/[\s_-]+/).map((t2) => t2.toLowerCase()).filter(Boolean);
42497
- }
42498
- function isSensitiveName3(name) {
42499
- const tokens = nameTokens3(name);
42500
- for (let i2 = 0;i2 < tokens.length; i2++) {
42501
- const token = tokens[i2];
42502
- if (SENSITIVE_NAME_TOKENS3.has(token)) {
42503
- return true;
42504
- }
42505
- if (token === "key" || token === "keys") {
42506
- const prev = tokens[i2 - 1];
42507
- if (prev && SENSITIVE_KEY_PREFIXES3.has(prev)) {
42508
- return true;
42509
- }
42510
- }
42511
- }
42512
- return false;
42513
- }
42514
- function redactProperty3(name, value) {
42515
- if (value === undefined || value === null) {
42516
- return;
42517
- }
42518
- if (isSensitiveName3(name)) {
42519
- return REDACTED3;
42520
- }
42521
- if (typeof value === "boolean" || typeof value === "number") {
42522
- return value;
42523
- }
42524
- if (typeof value !== "string") {
42525
- return "[OBJECT]";
42526
- }
42527
- return redactValueDetectors3(value);
42528
- }
42529
- function redactProperties3(properties) {
42530
- const out = {};
42531
- for (const [name, value] of Object.entries(properties)) {
42532
- const redacted = redactProperty3(name, value);
42533
- if (redacted !== undefined) {
42534
- out[name] = redacted;
42535
- }
42536
- }
42537
- return out;
42538
- }
42539
42733
  function extractCommandParams3(cmd) {
42540
42734
  const params = {};
42735
+ const add22 = (name, value) => {
42736
+ if (name && value !== undefined) {
42737
+ params[`${TELEMETRY_COMMAND_ARG_PREFIX3}${name}`] = value;
42738
+ }
42739
+ };
42541
42740
  const registered = cmd.registeredArguments ?? [];
42542
42741
  const processed = cmd.processedArgs ?? [];
42543
42742
  for (let i2 = 0;i2 < registered.length; i2++) {
42544
- const value = processed[i2];
42545
- if (value === undefined) {
42546
- continue;
42547
- }
42548
- const name = registered[i2].name();
42549
- if (name) {
42550
- params[name] = value;
42551
- }
42743
+ add22(registered[i2].name(), processed[i2]);
42552
42744
  }
42553
42745
  for (const [key, value] of Object.entries(cmd.opts())) {
42554
- if (value !== undefined) {
42555
- params[key] = value;
42556
- }
42746
+ add22(key, value);
42557
42747
  }
42558
42748
  return params;
42559
42749
  }
@@ -46146,7 +46336,7 @@ var de_default2, en4, es_default2, es_MX_default2, fr_default2, ja_default2, ko_
46146
46336
  }
46147
46337
  return result;
46148
46338
  }
46149
- }, TreeInterpreterInstance3, TreeInterpreter_default3, jsYaml3, loader3, common3, hasRequiredCommon3, exception3, hasRequiredException3, snippet3, hasRequiredSnippet3, type3, hasRequiredType3, schema3, hasRequiredSchema3, str3, hasRequiredStr3, seq3, hasRequiredSeq3, map3, hasRequiredMap3, failsafe3, hasRequiredFailsafe3, _null3, hasRequired_null3, bool3, hasRequiredBool3, int3, hasRequiredInt3, float3, hasRequiredFloat3, json3, hasRequiredJson3, core3, hasRequiredCore3, timestamp3, hasRequiredTimestamp3, merge3, hasRequiredMerge3, binary3, hasRequiredBinary3, omap3, hasRequiredOmap3, pairs3, hasRequiredPairs3, set3, hasRequiredSet3, _default3, hasRequired_default3, hasRequiredLoader3, dumper3, hasRequiredDumper3, hasRequiredJsYaml3, jsYamlExports3, yaml3, Type3, Schema3, FAILSAFE_SCHEMA3, JSON_SCHEMA3, CORE_SCHEMA3, DEFAULT_SCHEMA3, load3, loadAll3, dump3, YAMLException3, types3, safeLoad3, safeLoadAll3, safeDump3, logFilePathSlot3, LogLevel4, DEFAULT_LOG_LEVEL3 = 3, SimpleLogger3, loggerSingleton3, logger4, formatSlot3, formatExplicitSlot3, helpRequestedSlot3, filterSlot3, recordedFailureSlot3, AUTH_ERROR_CODES3, VALIDATION_ERROR_CODES3, NETWORK_HTTP_ERROR_CODES3, TIMEOUT_ERROR_CODES3, NETWORK_OS_ERROR_CODES3, TIMEOUT_OS_ERROR_CODES3, TLS_ERROR_CODES23, MISSING_DEPENDENCY_CODES3, INTERNAL_ERROR_NAMES3, CommonTelemetryEvents3, KNOWN_AGENTS3, LOCAL_HOSTS3, authSignalSlot3, isTruthy3 = (value) => value !== undefined && value !== "" && value !== "0" && value.toLowerCase() !== "false", isEqual3 = (value, expected) => value?.toLowerCase() === expected, CI_SIGNATURES3, TELEMETRY_SESSION_ID_ENV3 = "UIPATH_SESSION_ID", TELEMETRY_SESSION_ID_PROPERTY3 = "session_id", telemetrySessionIdSlot3, telemetryPropsSlot3, providerSlot3, telemetryInstanceSlot3, DEFAULT_AI_CONNECTION_STRING3, _localTelemetryInstance3, telemetry3, CLI_ERROR_CODES3, RETRY_HINTS3, RESULTS3, EXIT_CODES3, FilterEvaluationError3, OutputFormatter3, LEGACY_SKILL_NAMESPACE3 = "uipath:", MAX_SKILL_NAME_LENGTH3 = 80, SKILL_NAME_PATTERN3, SKILL_ATTRIBUTION3, KNOWN_SKILL_NAMES3, COMMAND_ATTRIBUTION3, REDACTED3 = "[REDACTED]", MAX_VALUE_LENGTH3 = 200, SENSITIVE_NAME_TOKENS3, SENSITIVE_KEY_PREFIXES3, UUID_PATTERN3, EMAIL_PATTERN3, JWT_PATTERN3, LONG_TOKEN_PATTERN3, USER_HOME_PATTERN3, URL_PATTERN3, URL_TRAILING_PUNCT3, pollSignalSlot3, cliErrorCodeValues3, retryHintValues3, guardInstalledSlot3, savedOriginalsSlot3, DEFAULT_AUTH_TIMEOUT_MS4, modeSlot3, interactiveFlagSlot3, PollOutcome3, REASON_BY_OUTCOME3, TERMINAL_STATUSES3, FAILURE_STATUSES3, previewSlot3, ScreenLogger3, sdkUserAgentHostToken3, shippedKeysSlot3, factorySlot3, globalLogHandler2 = (logMessage) => {
46339
+ }, TreeInterpreterInstance3, TreeInterpreter_default3, jsYaml3, loader3, common3, hasRequiredCommon3, exception3, hasRequiredException3, snippet3, hasRequiredSnippet3, type3, hasRequiredType3, schema3, hasRequiredSchema3, str3, hasRequiredStr3, seq3, hasRequiredSeq3, map3, hasRequiredMap3, failsafe3, hasRequiredFailsafe3, _null3, hasRequired_null3, bool3, hasRequiredBool3, int3, hasRequiredInt3, float3, hasRequiredFloat3, json3, hasRequiredJson3, core3, hasRequiredCore3, timestamp3, hasRequiredTimestamp3, merge3, hasRequiredMerge3, binary3, hasRequiredBinary3, omap3, hasRequiredOmap3, pairs3, hasRequiredPairs3, set3, hasRequiredSet3, _default3, hasRequired_default3, hasRequiredLoader3, dumper3, hasRequiredDumper3, hasRequiredJsYaml3, jsYamlExports3, yaml3, Type3, Schema3, FAILSAFE_SCHEMA3, JSON_SCHEMA3, CORE_SCHEMA3, DEFAULT_SCHEMA3, load3, loadAll3, dump3, YAMLException3, types3, safeLoad3, safeLoadAll3, safeDump3, logFilePathSlot3, LogLevel4, DEFAULT_LOG_LEVEL3 = 3, SimpleLogger3, loggerSingleton3, logger4, formatSlot3, formatExplicitSlot3, helpRequestedSlot3, filterSlot3, recordedFailureSlot3, AUTH_ERROR_CODES3, VALIDATION_ERROR_CODES3, NETWORK_HTTP_ERROR_CODES3, TIMEOUT_ERROR_CODES3, NETWORK_OS_ERROR_CODES3, TIMEOUT_OS_ERROR_CODES3, TLS_ERROR_CODES23, MISSING_DEPENDENCY_CODES3, INTERNAL_ERROR_NAMES3, CommonTelemetryEvents3, KNOWN_AGENTS3, LOCAL_HOSTS3, authSignalSlot3, isTruthy3 = (value) => value !== undefined && value !== "" && value !== "0" && value.toLowerCase() !== "false", isEqual3 = (value, expected) => value?.toLowerCase() === expected, CI_SIGNATURES3, TELEMETRY_TRACEPARENT_ENV3 = "TRACEPARENT", TRACEPARENT_PATTERN3, TELEMETRY_SESSION_ID_ENV3 = "UIPATH_SESSION_ID", TELEMETRY_SESSION_ID_PROPERTY3 = "session_id", telemetrySessionIdSlot3, telemetryOperationIdSlot3, telemetryPropsSlot3, REDACTED3 = "[REDACTED]", MAX_VALUE_LENGTH3 = 200, SENSITIVE_NAME_TOKENS3, SENSITIVE_KEY_PREFIXES3, UUID_PATTERN3, EMAIL_PATTERN3, JWT_PATTERN3, LONG_TOKEN_PATTERN3, USER_HOME_PATTERN3, URL_PATTERN3, URL_TRAILING_PUNCT3, TELEMETRY_OPERATION_ID_PROPERTY3 = "uip.trace.operation_id", TELEMETRY_PARENT_ID_PROPERTY3 = "uip.trace.parent_id", TELEMETRY_SPAN_ID_PROPERTY3 = "uip.trace.span_id", providerSlot3, telemetryInstanceSlot3, DEFAULT_AI_CONNECTION_STRING3, _localTelemetryInstance3, telemetry3, CLI_ERROR_CODES3, RETRY_HINTS3, RESULTS3, EXIT_CODES3, FilterEvaluationError3, OutputFormatter3, LEGACY_SKILL_NAMESPACE3 = "uipath:", MAX_SKILL_NAME_LENGTH3 = 80, SKILL_NAME_PATTERN3, SKILL_ATTRIBUTION3, KNOWN_SKILL_NAMES3, COMMAND_ATTRIBUTION3, pollSignalSlot3, cliErrorCodeValues3, retryHintValues3, TELEMETRY_COMMAND_ARG_PREFIX3 = "uip.cmd.arg.", guardInstalledSlot3, savedOriginalsSlot3, DEFAULT_AUTH_TIMEOUT_MS4, modeSlot3, interactiveFlagSlot3, PollOutcome3, REASON_BY_OUTCOME3, TERMINAL_STATUSES3, FAILURE_STATUSES3, previewSlot3, ScreenLogger3, sdkUserAgentHostToken3, shippedKeysSlot3, factorySlot3, globalLogHandler2 = (logMessage) => {
46150
46340
  const formattedMessage = logMessage.toFormattedString();
46151
46341
  switch (logMessage.logLevel) {
46152
46342
  case LogLevel2.Debug:
@@ -50068,8 +50258,53 @@ Expecting one of '${allowedValues.join("', '")}'`);
50068
50258
  matches: (env) => isTruthy3(env.CI)
50069
50259
  }
50070
50260
  ];
50261
+ TRACEPARENT_PATTERN3 = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
50071
50262
  telemetrySessionIdSlot3 = singleton4("TelemetrySessionId");
50263
+ telemetryOperationIdSlot3 = singleton4("TelemetryOperationId");
50072
50264
  telemetryPropsSlot3 = singleton4("TelemetryDefaultProps");
50265
+ SENSITIVE_NAME_TOKENS3 = new Set([
50266
+ "token",
50267
+ "tokens",
50268
+ "secret",
50269
+ "secrets",
50270
+ "password",
50271
+ "passwords",
50272
+ "pwd",
50273
+ "credential",
50274
+ "credentials",
50275
+ "auth",
50276
+ "authentication",
50277
+ "authorization",
50278
+ "authority",
50279
+ "cert",
50280
+ "certificate",
50281
+ "certificates"
50282
+ ]);
50283
+ SENSITIVE_KEY_PREFIXES3 = new Set([
50284
+ "api",
50285
+ "access",
50286
+ "client",
50287
+ "private",
50288
+ "public",
50289
+ "signing",
50290
+ "encryption",
50291
+ "session",
50292
+ "master",
50293
+ "shared",
50294
+ "root",
50295
+ "ssh",
50296
+ "rsa",
50297
+ "aes",
50298
+ "hmac",
50299
+ "oauth"
50300
+ ]);
50301
+ 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;
50302
+ EMAIL_PATTERN3 = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
50303
+ JWT_PATTERN3 = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
50304
+ LONG_TOKEN_PATTERN3 = /\b[A-Za-z0-9_-]{40,}\b/g;
50305
+ USER_HOME_PATTERN3 = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
50306
+ URL_PATTERN3 = /\bhttps?:\/\/[^\s,;]+/gi;
50307
+ URL_TRAILING_PUNCT3 = /[.,;:!?)\]}>'"]+$/;
50073
50308
  providerSlot3 = singleton4("TelemetryProvider");
50074
50309
  telemetryInstanceSlot3 = singleton4("TelemetryService");
50075
50310
  DEFAULT_AI_CONNECTION_STRING3 = atob("SW5zdHJ1bWVudGF0aW9uS2V5PTliZDM3NDgyLTgxMGUtNDQyYS1hYWE2LWQzOGVmNjVjNjY3NDtJbmdlc3Rpb25FbmRwb2ludD1odHRwczovL3dlc3RldXJvcGUtNS5pbi5hcHBsaWNhdGlvbmluc2lnaHRzLmF6dXJlLmNvbS87TGl2ZUVuZHBvaW50PWh0dHBzOi8vd2VzdGV1cm9wZS5saXZlZGlhZ25vc3RpY3MubW9uaXRvci5henVyZS5jb20vO0FwcGxpY2F0aW9uSWQ9MzU2OTdlZjEtOGJkMC00ZjE5LWEyN2MtZDg3Y2NhYzY2ZDJj");
@@ -50307,49 +50542,6 @@ Expecting one of '${allowedValues.join("', '")}'`);
50307
50542
  ]
50308
50543
  ]
50309
50544
  ]).sort((a, b) => b.prefix.length - a.prefix.length);
50310
- SENSITIVE_NAME_TOKENS3 = new Set([
50311
- "token",
50312
- "tokens",
50313
- "secret",
50314
- "secrets",
50315
- "password",
50316
- "passwords",
50317
- "pwd",
50318
- "credential",
50319
- "credentials",
50320
- "auth",
50321
- "authentication",
50322
- "authorization",
50323
- "authority",
50324
- "cert",
50325
- "certificate",
50326
- "certificates"
50327
- ]);
50328
- SENSITIVE_KEY_PREFIXES3 = new Set([
50329
- "api",
50330
- "access",
50331
- "client",
50332
- "private",
50333
- "public",
50334
- "signing",
50335
- "encryption",
50336
- "session",
50337
- "master",
50338
- "shared",
50339
- "root",
50340
- "ssh",
50341
- "rsa",
50342
- "aes",
50343
- "hmac",
50344
- "oauth"
50345
- ]);
50346
- 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;
50347
- EMAIL_PATTERN3 = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
50348
- JWT_PATTERN3 = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
50349
- LONG_TOKEN_PATTERN3 = /\b[A-Za-z0-9_-]{40,}\b/g;
50350
- USER_HOME_PATTERN3 = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
50351
- URL_PATTERN3 = /\bhttps?:\/\/[^\s,;]+/gi;
50352
- URL_TRAILING_PUNCT3 = /[.,;:!?)\]}>'"]+$/;
50353
50545
  pollSignalSlot3 = singleton4("PollSignal");
50354
50546
  cliErrorCodeValues3 = new Set(CLI_ERROR_CODES3);
50355
50547
  retryHintValues3 = new Set(RETRY_HINTS3);
@@ -50358,11 +50550,12 @@ Expecting one of '${allowedValues.join("', '")}'`);
50358
50550
  return this.action(async (...args) => {
50359
50551
  const telemetryName = deriveCommandPath3(command);
50360
50552
  const props = typeof properties === "function" ? properties(...args) : properties;
50553
+ const requestContext = telemetry3.createRequestContext();
50361
50554
  const startTime = performance.now();
50362
50555
  let errorMessage3;
50363
50556
  let fallbackExitCode = EXIT_CODES3.Success;
50364
50557
  clearRecordedCommandFailureTelemetry3();
50365
- const [error] = await catchError4(fn(...args));
50558
+ const [error] = await catchError4(telemetry3.runWithContext(requestContext, () => fn(...args)));
50366
50559
  if (error) {
50367
50560
  errorMessage3 = error instanceof Error ? error.message : String(error);
50368
50561
  logger4.debug(`[trackedAction] ${telemetryName} failed: ${errorMessage3}`);
@@ -50398,16 +50591,21 @@ Expecting one of '${allowedValues.join("', '")}'`);
50398
50591
  recordedFailure,
50399
50592
  pollSignal: context.pollSignal
50400
50593
  });
50401
- telemetry3.trackEvent(telemetryName, redactProperties3({
50402
- ...extractCommandParams3(command),
50594
+ const commandParams = extractCommandParams3(command);
50595
+ if (props) {
50596
+ for (const key of Object.keys(props)) {
50597
+ delete commandParams[`${TELEMETRY_COMMAND_ARG_PREFIX3}${key}`];
50598
+ }
50599
+ }
50600
+ const baseProperties = redactProperties3({
50601
+ ...commandParams,
50403
50602
  ...props,
50404
50603
  ...buildCommandTelemetryAttribution3(telemetryName, process.env.UIPATH_SKILL),
50405
50604
  command: "true",
50406
- duration: String(durationMs),
50407
- success: String(success),
50408
50605
  ...terminalTelemetry,
50409
50606
  ...errorMessage3 ? { errorMessage: errorMessage3 } : {}
50410
- }));
50607
+ });
50608
+ telemetry3.trackRequestResult(telemetryName, durationMs, success, baseProperties, requestContext);
50411
50609
  });
50412
50610
  };
50413
50611
  guardInstalledSlot3 = singleton4("ConsoleGuardInstalled");
@@ -50579,7 +50777,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
50579
50777
  package_default3 = {
50580
50778
  name: "@uipath/project-packager",
50581
50779
  license: "MIT",
50582
- version: "1.198.0-preview.95",
50780
+ version: "1.198.0",
50583
50781
  description: "UiPath Project Packager - core library for packing individual UiPath projects",
50584
50782
  type: "module",
50585
50783
  main: "./dist/index.js",
@@ -50973,7 +51171,7 @@ var init_package = __esm(() => {
50973
51171
  package_default4 = {
50974
51172
  name: "@uipath/project-packager",
50975
51173
  license: "MIT",
50976
- version: "1.198.0-preview.95",
51174
+ version: "1.198.0",
50977
51175
  description: "UiPath Project Packager - core library for packing individual UiPath projects",
50978
51176
  type: "module",
50979
51177
  main: "./dist/index.js",
@@ -80427,7 +80625,7 @@ import"./packager-tool.js";
80427
80625
  var package_default = {
80428
80626
  name: "@uipath/api-workflow-tool",
80429
80627
  license: "MIT",
80430
- version: "1.198.0-preview.95",
80628
+ version: "1.198.0",
80431
80629
  description: "Run UiPath API Workflows locally.",
80432
80630
  private: false,
80433
80631
  repository: {
@@ -86334,11 +86532,36 @@ class NodeContextStorage {
86334
86532
  return this.storage.getStore();
86335
86533
  }
86336
86534
  }
86535
+ // ../common/src/telemetry/trace-context.ts
86536
+ var TELEMETRY_TRACEPARENT_ENV = "TRACEPARENT";
86537
+ var TRACEPARENT_PATTERN = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
86538
+ function getProcessEnv() {
86539
+ return globalThis.process?.env;
86540
+ }
86541
+ function parseInboundTraceparent(value) {
86542
+ if (!value) {
86543
+ return;
86544
+ }
86545
+ const match = TRACEPARENT_PATTERN.exec(value.trim().toLowerCase());
86546
+ if (!match) {
86547
+ return;
86548
+ }
86549
+ const [, traceId, parentSpanId] = match;
86550
+ if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
86551
+ return;
86552
+ }
86553
+ return { traceId, parentSpanId };
86554
+ }
86555
+ function getInboundTraceContext() {
86556
+ return parseInboundTraceparent(getProcessEnv()?.[TELEMETRY_TRACEPARENT_ENV]);
86557
+ }
86558
+
86337
86559
  // ../common/src/telemetry/session-id.ts
86338
86560
  var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
86339
86561
  var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
86340
86562
  var telemetrySessionIdSlot = singleton("TelemetrySessionId");
86341
- function getProcessEnv() {
86563
+ var telemetryOperationIdSlot = singleton("TelemetryOperationId");
86564
+ function getProcessEnv2() {
86342
86565
  return globalThis.process?.env;
86343
86566
  }
86344
86567
  function normalizeSessionId(value) {
@@ -86349,18 +86572,165 @@ function normalizeSessionId(value) {
86349
86572
  return trimmed || undefined;
86350
86573
  }
86351
86574
  function getConfiguredTelemetrySessionId() {
86352
- return normalizeSessionId(getProcessEnv()?.[TELEMETRY_SESSION_ID_ENV]);
86575
+ return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
86353
86576
  }
86354
86577
  function resolveTelemetrySessionId(existingSessionId) {
86355
86578
  return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
86356
86579
  }
86580
+ function getTelemetryOperationId() {
86581
+ const existing = telemetryOperationIdSlot.get();
86582
+ if (existing) {
86583
+ return existing;
86584
+ }
86585
+ const inboundTraceId = getInboundTraceContext()?.traceId;
86586
+ const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
86587
+ telemetryOperationIdSlot.set(generated);
86588
+ return generated;
86589
+ }
86357
86590
  // ../common/src/telemetry/global-telemetry-properties.ts
86358
86591
  var telemetryPropsSlot = singleton("TelemetryDefaultProps");
86359
86592
  function getGlobalTelemetryProperties() {
86360
86593
  return telemetryPropsSlot.get();
86361
86594
  }
86362
86595
 
86596
+ // ../common/src/telemetry/pii-redactor.ts
86597
+ var REDACTED = "[REDACTED]";
86598
+ var MAX_VALUE_LENGTH = 200;
86599
+ var SENSITIVE_NAME_TOKENS = new Set([
86600
+ "token",
86601
+ "tokens",
86602
+ "secret",
86603
+ "secrets",
86604
+ "password",
86605
+ "passwords",
86606
+ "pwd",
86607
+ "credential",
86608
+ "credentials",
86609
+ "auth",
86610
+ "authentication",
86611
+ "authorization",
86612
+ "authority",
86613
+ "cert",
86614
+ "certificate",
86615
+ "certificates"
86616
+ ]);
86617
+ var SENSITIVE_KEY_PREFIXES = new Set([
86618
+ "api",
86619
+ "access",
86620
+ "client",
86621
+ "private",
86622
+ "public",
86623
+ "signing",
86624
+ "encryption",
86625
+ "session",
86626
+ "master",
86627
+ "shared",
86628
+ "root",
86629
+ "ssh",
86630
+ "rsa",
86631
+ "aes",
86632
+ "hmac",
86633
+ "oauth"
86634
+ ]);
86635
+ var 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;
86636
+ var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
86637
+ var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
86638
+ var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
86639
+ var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
86640
+ var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
86641
+ var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
86642
+ function shortHash(input) {
86643
+ let hash = 2166136261;
86644
+ for (let i = 0;i < input.length; i++) {
86645
+ hash ^= input.charCodeAt(i);
86646
+ hash = Math.imul(hash, 16777619);
86647
+ }
86648
+ return (hash >>> 0).toString(16).padStart(8, "0");
86649
+ }
86650
+ function redactUrl(raw) {
86651
+ try {
86652
+ const url = new URL(raw);
86653
+ return `${url.protocol}//${url.host}`;
86654
+ } catch {
86655
+ return `url#${shortHash(raw)}`;
86656
+ }
86657
+ }
86658
+ function redactValueDetectors(value) {
86659
+ let out = value;
86660
+ out = out.replace(JWT_PATTERN, () => REDACTED);
86661
+ out = out.replace(URL_PATTERN, (match) => {
86662
+ const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
86663
+ const core2 = trailing ? match.slice(0, -trailing.length) : match;
86664
+ return `${redactUrl(core2)}${trailing}`;
86665
+ });
86666
+ out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
86667
+ out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
86668
+ out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
86669
+ out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
86670
+ if (out.length > MAX_VALUE_LENGTH) {
86671
+ out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
86672
+ }
86673
+ return out;
86674
+ }
86675
+ function redactValue(value) {
86676
+ return redactValueDetectors(value);
86677
+ }
86678
+ function redactError(error) {
86679
+ const safe = new Error(redactValueDetectors(error.message ?? ""));
86680
+ safe.name = error.name;
86681
+ safe.stack = typeof error.stack === "string" ? redactValueDetectors(error.stack) : undefined;
86682
+ return safe;
86683
+ }
86684
+ function nameTokens(name) {
86685
+ 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);
86686
+ }
86687
+ function isSensitiveName(name) {
86688
+ const tokens = nameTokens(name);
86689
+ for (let i = 0;i < tokens.length; i++) {
86690
+ const token = tokens[i];
86691
+ if (SENSITIVE_NAME_TOKENS.has(token)) {
86692
+ return true;
86693
+ }
86694
+ if (token === "key" || token === "keys") {
86695
+ const prev = tokens[i - 1];
86696
+ if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
86697
+ return true;
86698
+ }
86699
+ }
86700
+ }
86701
+ return false;
86702
+ }
86703
+ function redactProperty(name, value) {
86704
+ if (value === undefined || value === null) {
86705
+ return;
86706
+ }
86707
+ if (isSensitiveName(name)) {
86708
+ return REDACTED;
86709
+ }
86710
+ if (typeof value === "boolean" || typeof value === "number") {
86711
+ return value;
86712
+ }
86713
+ if (typeof value !== "string") {
86714
+ return "[OBJECT]";
86715
+ }
86716
+ return redactValueDetectors(value);
86717
+ }
86718
+ function redactProperties(properties) {
86719
+ const out = {};
86720
+ for (const [name, value] of Object.entries(properties)) {
86721
+ const redacted = redactProperty(name, value);
86722
+ if (redacted !== undefined) {
86723
+ out[name] = redacted;
86724
+ }
86725
+ }
86726
+ return out;
86727
+ }
86728
+
86363
86729
  // ../common/src/telemetry/telemetry-service.ts
86730
+ var TELEMETRY_OPERATION_ID_PROPERTY = "uip.trace.operation_id";
86731
+ var TELEMETRY_PARENT_ID_PROPERTY = "uip.trace.parent_id";
86732
+ var TELEMETRY_SPAN_ID_PROPERTY = "uip.trace.span_id";
86733
+
86364
86734
  class TelemetryService {
86365
86735
  telemetryProvider;
86366
86736
  contextStorage;
@@ -86387,11 +86757,15 @@ class TelemetryService {
86387
86757
  trackException(error, properties) {
86388
86758
  const context = this.getCurrentContext();
86389
86759
  const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
86390
- this.telemetryProvider.trackException(error, enrichedProperties);
86760
+ this.telemetryProvider.trackException(redactError(error), enrichedProperties);
86391
86761
  }
86392
86762
  async trackRequest(name, fn, properties) {
86763
+ const parentContext = this.getCurrentContext();
86764
+ const operationId = parentContext?.operationId ?? this.operationId ?? getTelemetryOperationId();
86765
+ const parentId = parentContext ? parentContext.id : this.inboundParentIdFor(operationId);
86393
86766
  const context = {
86394
- operationId: this.operationId ?? this.generateId(),
86767
+ operationId,
86768
+ ...parentId !== undefined ? { parentId } : {},
86395
86769
  id: this.generateId()
86396
86770
  };
86397
86771
  const startTime = performance.now();
@@ -86409,6 +86783,45 @@ class TelemetryService {
86409
86783
  throw error;
86410
86784
  }
86411
86785
  }
86786
+ trackRequestResult(name, durationMs, success, properties, context) {
86787
+ const requestContext = context ?? {
86788
+ operationId: this.operationId ?? getTelemetryOperationId(),
86789
+ id: this.generateId()
86790
+ };
86791
+ const enrichedProperties = this.enrichPropertiesWithContext(properties, requestContext);
86792
+ this.telemetryProvider.trackRequest(name, durationMs, success, enrichedProperties);
86793
+ }
86794
+ createRequestContext() {
86795
+ const operationId = this.operationId ?? getTelemetryOperationId();
86796
+ const parentId = this.inboundParentIdFor(operationId);
86797
+ return {
86798
+ operationId,
86799
+ ...parentId !== undefined ? { parentId } : {},
86800
+ id: this.generateId()
86801
+ };
86802
+ }
86803
+ inboundParentIdFor(operationId) {
86804
+ const inbound = getInboundTraceContext();
86805
+ return inbound && inbound.traceId === operationId ? inbound.parentSpanId : undefined;
86806
+ }
86807
+ runWithContext(context, fn) {
86808
+ return this.contextStorage.run(context, fn);
86809
+ }
86810
+ createDependencyContext() {
86811
+ const parentContext = this.getCurrentContext();
86812
+ if (!parentContext) {
86813
+ return;
86814
+ }
86815
+ return {
86816
+ operationId: parentContext.operationId,
86817
+ parentId: parentContext.id,
86818
+ id: this.generateId()
86819
+ };
86820
+ }
86821
+ trackDependencyResult(name, type2, durationMs, success, properties, context, resultCode) {
86822
+ const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
86823
+ this.telemetryProvider.trackDependency(redactValue(name), type2, durationMs, success, enrichedProperties, resultCode);
86824
+ }
86412
86825
  async trackDependencyOperation(name, type2, fn, properties) {
86413
86826
  const parentContext = this.getCurrentContext();
86414
86827
  if (!parentContext) {
@@ -86445,8 +86858,12 @@ class TelemetryService {
86445
86858
  ...getExecutionContextTelemetryProperties(),
86446
86859
  ...globalProperties,
86447
86860
  ...this.defaultProperties,
86448
- ...properties,
86449
- ...context
86861
+ ...redactProperties(properties ?? {}),
86862
+ ...context ? {
86863
+ [TELEMETRY_OPERATION_ID_PROPERTY]: context.operationId,
86864
+ ...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY]: context.parentId } : {},
86865
+ [TELEMETRY_SPAN_ID_PROPERTY]: context.id
86866
+ } : {}
86450
86867
  };
86451
86868
  if (sessionId === undefined) {
86452
86869
  delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
@@ -86456,7 +86873,16 @@ class TelemetryService {
86456
86873
  return enriched;
86457
86874
  }
86458
86875
  generateId() {
86459
- return crypto.randomUUID().replaceAll("-", "");
86876
+ const bytes = new Uint8Array(8);
86877
+ let hex = "";
86878
+ do {
86879
+ crypto.getRandomValues(bytes);
86880
+ hex = "";
86881
+ for (const byte of bytes) {
86882
+ hex += byte.toString(16).padStart(2, "0");
86883
+ }
86884
+ } while (/^0+$/.test(hex));
86885
+ return hex;
86460
86886
  }
86461
86887
  }
86462
86888
  // ../common/src/telemetry/node-appinsights-telemetry-provider.ts
@@ -87192,134 +87618,11 @@ function buildCommandTelemetryAttribution(commandPath, skillSource) {
87192
87618
  };
87193
87619
  }
87194
87620
 
87195
- // ../common/src/telemetry/pii-redactor.ts
87196
- var REDACTED = "[REDACTED]";
87197
- var MAX_VALUE_LENGTH = 200;
87198
- var SENSITIVE_NAME_TOKENS = new Set([
87199
- "token",
87200
- "tokens",
87201
- "secret",
87202
- "secrets",
87203
- "password",
87204
- "passwords",
87205
- "pwd",
87206
- "credential",
87207
- "credentials",
87208
- "auth",
87209
- "authentication",
87210
- "authorization",
87211
- "authority",
87212
- "cert",
87213
- "certificate",
87214
- "certificates"
87215
- ]);
87216
- var SENSITIVE_KEY_PREFIXES = new Set([
87217
- "api",
87218
- "access",
87219
- "client",
87220
- "private",
87221
- "public",
87222
- "signing",
87223
- "encryption",
87224
- "session",
87225
- "master",
87226
- "shared",
87227
- "root",
87228
- "ssh",
87229
- "rsa",
87230
- "aes",
87231
- "hmac",
87232
- "oauth"
87233
- ]);
87234
- var 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;
87235
- var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
87236
- var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
87237
- var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
87238
- var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
87239
- var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
87240
- var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
87241
- function shortHash(input) {
87242
- let hash = 2166136261;
87243
- for (let i = 0;i < input.length; i++) {
87244
- hash ^= input.charCodeAt(i);
87245
- hash = Math.imul(hash, 16777619);
87246
- }
87247
- return (hash >>> 0).toString(16).padStart(8, "0");
87248
- }
87249
- function redactUrl(raw) {
87250
- try {
87251
- const url = new URL(raw);
87252
- return `${url.protocol}//${url.host}`;
87253
- } catch {
87254
- return `url#${shortHash(raw)}`;
87255
- }
87256
- }
87257
- function redactValueDetectors(value) {
87258
- let out = value;
87259
- out = out.replace(JWT_PATTERN, () => REDACTED);
87260
- out = out.replace(URL_PATTERN, (match) => {
87261
- const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
87262
- const core2 = trailing ? match.slice(0, -trailing.length) : match;
87263
- return `${redactUrl(core2)}${trailing}`;
87264
- });
87265
- out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
87266
- out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
87267
- out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
87268
- out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
87269
- if (out.length > MAX_VALUE_LENGTH) {
87270
- out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
87271
- }
87272
- return out;
87273
- }
87274
- function nameTokens(name) {
87275
- 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);
87276
- }
87277
- function isSensitiveName(name) {
87278
- const tokens = nameTokens(name);
87279
- for (let i = 0;i < tokens.length; i++) {
87280
- const token = tokens[i];
87281
- if (SENSITIVE_NAME_TOKENS.has(token)) {
87282
- return true;
87283
- }
87284
- if (token === "key" || token === "keys") {
87285
- const prev = tokens[i - 1];
87286
- if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
87287
- return true;
87288
- }
87289
- }
87290
- }
87291
- return false;
87292
- }
87293
- function redactProperty(name, value) {
87294
- if (value === undefined || value === null) {
87295
- return;
87296
- }
87297
- if (isSensitiveName(name)) {
87298
- return REDACTED;
87299
- }
87300
- if (typeof value === "boolean" || typeof value === "number") {
87301
- return value;
87302
- }
87303
- if (typeof value !== "string") {
87304
- return "[OBJECT]";
87305
- }
87306
- return redactValueDetectors(value);
87307
- }
87308
- function redactProperties(properties) {
87309
- const out = {};
87310
- for (const [name, value] of Object.entries(properties)) {
87311
- const redacted = redactProperty(name, value);
87312
- if (redacted !== undefined) {
87313
- out[name] = redacted;
87314
- }
87315
- }
87316
- return out;
87317
- }
87318
-
87319
87621
  // ../common/src/trackedAction.ts
87320
87622
  var pollSignalSlot = singleton("PollSignal");
87321
87623
  var cliErrorCodeValues = new Set(CLI_ERROR_CODES);
87322
87624
  var retryHintValues = new Set(RETRY_HINTS);
87625
+ var TELEMETRY_COMMAND_ARG_PREFIX = "uip.cmd.arg.";
87323
87626
  var processContext = {
87324
87627
  exit: (code) => {
87325
87628
  process.exitCode = code;
@@ -87330,22 +87633,18 @@ var processContext = {
87330
87633
  };
87331
87634
  function extractCommandParams(cmd) {
87332
87635
  const params = {};
87636
+ const add2 = (name, value) => {
87637
+ if (name && value !== undefined) {
87638
+ params[`${TELEMETRY_COMMAND_ARG_PREFIX}${name}`] = value;
87639
+ }
87640
+ };
87333
87641
  const registered = cmd.registeredArguments ?? [];
87334
87642
  const processed = cmd.processedArgs ?? [];
87335
87643
  for (let i = 0;i < registered.length; i++) {
87336
- const value = processed[i];
87337
- if (value === undefined) {
87338
- continue;
87339
- }
87340
- const name = registered[i].name();
87341
- if (name) {
87342
- params[name] = value;
87343
- }
87644
+ add2(registered[i].name(), processed[i]);
87344
87645
  }
87345
87646
  for (const [key, value] of Object.entries(cmd.opts())) {
87346
- if (value !== undefined) {
87347
- params[key] = value;
87348
- }
87647
+ add2(key, value);
87349
87648
  }
87350
87649
  return params;
87351
87650
  }
@@ -87388,11 +87687,12 @@ Command.prototype.trackedAction = function(context, fn, properties) {
87388
87687
  return this.action(async (...args) => {
87389
87688
  const telemetryName = deriveCommandPath(command);
87390
87689
  const props = typeof properties === "function" ? properties(...args) : properties;
87690
+ const requestContext = telemetry.createRequestContext();
87391
87691
  const startTime = performance.now();
87392
87692
  let errorMessage;
87393
87693
  let fallbackExitCode = EXIT_CODES.Success;
87394
87694
  clearRecordedCommandFailureTelemetry();
87395
- const [error] = await catchError(fn(...args));
87695
+ const [error] = await catchError(telemetry.runWithContext(requestContext, () => fn(...args)));
87396
87696
  if (error) {
87397
87697
  errorMessage = error instanceof Error ? error.message : String(error);
87398
87698
  logger.debug(`[trackedAction] ${telemetryName} failed: ${errorMessage}`);
@@ -87428,16 +87728,21 @@ Command.prototype.trackedAction = function(context, fn, properties) {
87428
87728
  recordedFailure,
87429
87729
  pollSignal: context.pollSignal
87430
87730
  });
87431
- telemetry.trackEvent(telemetryName, redactProperties({
87432
- ...extractCommandParams(command),
87731
+ const commandParams = extractCommandParams(command);
87732
+ if (props) {
87733
+ for (const key of Object.keys(props)) {
87734
+ delete commandParams[`${TELEMETRY_COMMAND_ARG_PREFIX}${key}`];
87735
+ }
87736
+ }
87737
+ const baseProperties = redactProperties({
87738
+ ...commandParams,
87433
87739
  ...props,
87434
87740
  ...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
87435
87741
  command: "true",
87436
- duration: String(durationMs),
87437
- success: String(success),
87438
87742
  ...terminalTelemetry,
87439
87743
  ...errorMessage ? { errorMessage } : {}
87440
- }));
87744
+ });
87745
+ telemetry.trackRequestResult(telemetryName, durationMs, success, baseProperties, requestContext);
87441
87746
  });
87442
87747
  };
87443
87748
  // ../common/src/console-guard.ts
@@ -88140,7 +88445,7 @@ class TextApiResponse {
88140
88445
  var package_default2 = {
88141
88446
  name: "@uipath/integrationservice-sdk",
88142
88447
  license: "MIT",
88143
- version: "1.198.0-preview.95",
88448
+ version: "1.198.0",
88144
88449
  repository: {
88145
88450
  type: "git",
88146
88451
  url: "https://github.com/UiPath/cli.git",
@@ -97679,7 +97984,7 @@ function querystringSingleKey3(key, value, keyPrefix = "") {
97679
97984
  var package_default5 = {
97680
97985
  name: "@uipath/solution-sdk",
97681
97986
  license: "MIT",
97682
- version: "1.198.0-preview.95",
97987
+ version: "1.198.0",
97683
97988
  repository: {
97684
97989
  type: "git",
97685
97990
  url: "https://github.com/UiPath/cli.git",
@@ -99968,4 +100273,4 @@ export {
99968
100273
  metadata
99969
100274
  };
99970
100275
 
99971
- //# debugId=F675F27B4B08531164756E2164756E21
100276
+ //# debugId=5922CA8DDFA752EA64756E2164756E21