@uipath/flow-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.
package/dist/tool.js CHANGED
@@ -186065,7 +186065,27 @@ class NodeContextStorage2 {
186065
186065
  return this.storage.getStore();
186066
186066
  }
186067
186067
  }
186068
- function getProcessEnv2() {
186068
+ function getProcessEnv3() {
186069
+ return globalThis.process?.env;
186070
+ }
186071
+ function parseInboundTraceparent2(value) {
186072
+ if (!value) {
186073
+ return;
186074
+ }
186075
+ const match = TRACEPARENT_PATTERN2.exec(value.trim().toLowerCase());
186076
+ if (!match) {
186077
+ return;
186078
+ }
186079
+ const [, traceId, parentSpanId] = match;
186080
+ if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
186081
+ return;
186082
+ }
186083
+ return { traceId, parentSpanId };
186084
+ }
186085
+ function getInboundTraceContext2() {
186086
+ return parseInboundTraceparent2(getProcessEnv3()?.[TELEMETRY_TRACEPARENT_ENV2]);
186087
+ }
186088
+ function getProcessEnv22() {
186069
186089
  return globalThis.process?.env;
186070
186090
  }
186071
186091
  function normalizeSessionId2(value) {
@@ -186076,14 +186096,110 @@ function normalizeSessionId2(value) {
186076
186096
  return trimmed || undefined;
186077
186097
  }
186078
186098
  function getConfiguredTelemetrySessionId2() {
186079
- return normalizeSessionId2(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV2]);
186099
+ return normalizeSessionId2(getProcessEnv22()?.[TELEMETRY_SESSION_ID_ENV2]);
186080
186100
  }
186081
186101
  function resolveTelemetrySessionId2(existingSessionId) {
186082
186102
  return getConfiguredTelemetrySessionId2() ?? normalizeSessionId2(existingSessionId);
186083
186103
  }
186104
+ function getTelemetryOperationId2() {
186105
+ const existing = telemetryOperationIdSlot2.get();
186106
+ if (existing) {
186107
+ return existing;
186108
+ }
186109
+ const inboundTraceId = getInboundTraceContext2()?.traceId;
186110
+ const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
186111
+ telemetryOperationIdSlot2.set(generated);
186112
+ return generated;
186113
+ }
186084
186114
  function getGlobalTelemetryProperties2() {
186085
186115
  return telemetryPropsSlot2.get();
186086
186116
  }
186117
+ function shortHash2(input2) {
186118
+ let hash3 = 2166136261;
186119
+ for (let i3 = 0;i3 < input2.length; i3++) {
186120
+ hash3 ^= input2.charCodeAt(i3);
186121
+ hash3 = Math.imul(hash3, 16777619);
186122
+ }
186123
+ return (hash3 >>> 0).toString(16).padStart(8, "0");
186124
+ }
186125
+ function redactUrl2(raw) {
186126
+ try {
186127
+ const url5 = new URL(raw);
186128
+ return `${url5.protocol}//${url5.host}`;
186129
+ } catch {
186130
+ return `url#${shortHash2(raw)}`;
186131
+ }
186132
+ }
186133
+ function redactValueDetectors2(value) {
186134
+ let out = value;
186135
+ out = out.replace(JWT_PATTERN2, () => REDACTED2);
186136
+ out = out.replace(URL_PATTERN2, (match) => {
186137
+ const trailing = match.match(URL_TRAILING_PUNCT2)?.[0] ?? "";
186138
+ const core22 = trailing ? match.slice(0, -trailing.length) : match;
186139
+ return `${redactUrl2(core22)}${trailing}`;
186140
+ });
186141
+ out = out.replace(USER_HOME_PATTERN2, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
186142
+ out = out.replace(EMAIL_PATTERN2, (match) => `email#${shortHash2(match)}`);
186143
+ out = out.replace(UUID_PATTERN3, (match) => `uuid#${shortHash2(match)}`);
186144
+ out = out.replace(LONG_TOKEN_PATTERN2, () => REDACTED2);
186145
+ if (out.length > MAX_VALUE_LENGTH2) {
186146
+ out = `${out.slice(0, MAX_VALUE_LENGTH2)}…`;
186147
+ }
186148
+ return out;
186149
+ }
186150
+ function redactValue2(value) {
186151
+ return redactValueDetectors2(value);
186152
+ }
186153
+ function redactError2(error95) {
186154
+ const safe = new Error(redactValueDetectors2(error95.message ?? ""));
186155
+ safe.name = error95.name;
186156
+ safe.stack = typeof error95.stack === "string" ? redactValueDetectors2(error95.stack) : undefined;
186157
+ return safe;
186158
+ }
186159
+ function nameTokens2(name2) {
186160
+ return name2.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").split(/[\s._-]+/).map((t11) => t11.toLowerCase()).filter(Boolean);
186161
+ }
186162
+ function isSensitiveName2(name2) {
186163
+ const tokens = nameTokens2(name2);
186164
+ for (let i3 = 0;i3 < tokens.length; i3++) {
186165
+ const token = tokens[i3];
186166
+ if (SENSITIVE_NAME_TOKENS2.has(token)) {
186167
+ return true;
186168
+ }
186169
+ if (token === "key" || token === "keys") {
186170
+ const prev = tokens[i3 - 1];
186171
+ if (prev && SENSITIVE_KEY_PREFIXES2.has(prev)) {
186172
+ return true;
186173
+ }
186174
+ }
186175
+ }
186176
+ return false;
186177
+ }
186178
+ function redactProperty2(name2, value) {
186179
+ if (value === undefined || value === null) {
186180
+ return;
186181
+ }
186182
+ if (isSensitiveName2(name2)) {
186183
+ return REDACTED2;
186184
+ }
186185
+ if (typeof value === "boolean" || typeof value === "number") {
186186
+ return value;
186187
+ }
186188
+ if (typeof value !== "string") {
186189
+ return "[OBJECT]";
186190
+ }
186191
+ return redactValueDetectors2(value);
186192
+ }
186193
+ function redactProperties2(properties) {
186194
+ const out = {};
186195
+ for (const [name2, value] of Object.entries(properties)) {
186196
+ const redacted = redactProperty2(name2, value);
186197
+ if (redacted !== undefined) {
186198
+ out[name2] = redacted;
186199
+ }
186200
+ }
186201
+ return out;
186202
+ }
186087
186203
 
186088
186204
  class TelemetryService2 {
186089
186205
  telemetryProvider;
@@ -186111,11 +186227,15 @@ class TelemetryService2 {
186111
186227
  trackException(error95, properties) {
186112
186228
  const context = this.getCurrentContext();
186113
186229
  const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
186114
- this.telemetryProvider.trackException(error95, enrichedProperties);
186230
+ this.telemetryProvider.trackException(redactError2(error95), enrichedProperties);
186115
186231
  }
186116
186232
  async trackRequest(name2, fn2, properties) {
186233
+ const parentContext = this.getCurrentContext();
186234
+ const operationId = parentContext?.operationId ?? this.operationId ?? getTelemetryOperationId2();
186235
+ const parentId = parentContext ? parentContext.id : this.inboundParentIdFor(operationId);
186117
186236
  const context = {
186118
- operationId: this.operationId ?? this.generateId(),
186237
+ operationId,
186238
+ ...parentId !== undefined ? { parentId } : {},
186119
186239
  id: this.generateId()
186120
186240
  };
186121
186241
  const startTime = performance.now();
@@ -186133,6 +186253,45 @@ class TelemetryService2 {
186133
186253
  throw error95;
186134
186254
  }
186135
186255
  }
186256
+ trackRequestResult(name2, durationMs, success5, properties, context) {
186257
+ const requestContext = context ?? {
186258
+ operationId: this.operationId ?? getTelemetryOperationId2(),
186259
+ id: this.generateId()
186260
+ };
186261
+ const enrichedProperties = this.enrichPropertiesWithContext(properties, requestContext);
186262
+ this.telemetryProvider.trackRequest(name2, durationMs, success5, enrichedProperties);
186263
+ }
186264
+ createRequestContext() {
186265
+ const operationId = this.operationId ?? getTelemetryOperationId2();
186266
+ const parentId = this.inboundParentIdFor(operationId);
186267
+ return {
186268
+ operationId,
186269
+ ...parentId !== undefined ? { parentId } : {},
186270
+ id: this.generateId()
186271
+ };
186272
+ }
186273
+ inboundParentIdFor(operationId) {
186274
+ const inbound = getInboundTraceContext2();
186275
+ return inbound && inbound.traceId === operationId ? inbound.parentSpanId : undefined;
186276
+ }
186277
+ runWithContext(context, fn2) {
186278
+ return this.contextStorage.run(context, fn2);
186279
+ }
186280
+ createDependencyContext() {
186281
+ const parentContext = this.getCurrentContext();
186282
+ if (!parentContext) {
186283
+ return;
186284
+ }
186285
+ return {
186286
+ operationId: parentContext.operationId,
186287
+ parentId: parentContext.id,
186288
+ id: this.generateId()
186289
+ };
186290
+ }
186291
+ trackDependencyResult(name2, type22, durationMs, success5, properties, context, resultCode) {
186292
+ const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
186293
+ this.telemetryProvider.trackDependency(redactValue2(name2), type22, durationMs, success5, enrichedProperties, resultCode);
186294
+ }
186136
186295
  async trackDependencyOperation(name2, type22, fn2, properties) {
186137
186296
  const parentContext = this.getCurrentContext();
186138
186297
  if (!parentContext) {
@@ -186169,8 +186328,12 @@ class TelemetryService2 {
186169
186328
  ...getExecutionContextTelemetryProperties2(),
186170
186329
  ...globalProperties,
186171
186330
  ...this.defaultProperties,
186172
- ...properties,
186173
- ...context
186331
+ ...redactProperties2(properties ?? {}),
186332
+ ...context ? {
186333
+ [TELEMETRY_OPERATION_ID_PROPERTY2]: context.operationId,
186334
+ ...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY2]: context.parentId } : {},
186335
+ [TELEMETRY_SPAN_ID_PROPERTY2]: context.id
186336
+ } : {}
186174
186337
  };
186175
186338
  if (sessionId === undefined) {
186176
186339
  delete enriched[TELEMETRY_SESSION_ID_PROPERTY2];
@@ -186180,7 +186343,16 @@ class TelemetryService2 {
186180
186343
  return enriched;
186181
186344
  }
186182
186345
  generateId() {
186183
- return crypto.randomUUID().replaceAll("-", "");
186346
+ const bytes = new Uint8Array(8);
186347
+ let hex4 = "";
186348
+ do {
186349
+ crypto.getRandomValues(bytes);
186350
+ hex4 = "";
186351
+ for (const byte of bytes) {
186352
+ hex4 += byte.toString(16).padStart(2, "0");
186353
+ }
186354
+ } while (/^0+$/.test(hex4));
186355
+ return hex4;
186184
186356
  }
186185
186357
  }
186186
186358
  function getGlobalTelemetryInstance2() {
@@ -186634,101 +186806,20 @@ function buildCommandTelemetryAttribution2(commandPath, skillSource) {
186634
186806
  ...getCommandProductModeAttribution2(commandPath)
186635
186807
  };
186636
186808
  }
186637
- function shortHash2(input2) {
186638
- let hash3 = 2166136261;
186639
- for (let i3 = 0;i3 < input2.length; i3++) {
186640
- hash3 ^= input2.charCodeAt(i3);
186641
- hash3 = Math.imul(hash3, 16777619);
186642
- }
186643
- return (hash3 >>> 0).toString(16).padStart(8, "0");
186644
- }
186645
- function redactUrl2(raw) {
186646
- try {
186647
- const url5 = new URL(raw);
186648
- return `${url5.protocol}//${url5.host}`;
186649
- } catch {
186650
- return `url#${shortHash2(raw)}`;
186651
- }
186652
- }
186653
- function redactValueDetectors2(value) {
186654
- let out = value;
186655
- out = out.replace(JWT_PATTERN2, () => REDACTED2);
186656
- out = out.replace(URL_PATTERN2, (match) => {
186657
- const trailing = match.match(URL_TRAILING_PUNCT2)?.[0] ?? "";
186658
- const core22 = trailing ? match.slice(0, -trailing.length) : match;
186659
- return `${redactUrl2(core22)}${trailing}`;
186660
- });
186661
- out = out.replace(USER_HOME_PATTERN2, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
186662
- out = out.replace(EMAIL_PATTERN2, (match) => `email#${shortHash2(match)}`);
186663
- out = out.replace(UUID_PATTERN3, (match) => `uuid#${shortHash2(match)}`);
186664
- out = out.replace(LONG_TOKEN_PATTERN2, () => REDACTED2);
186665
- if (out.length > MAX_VALUE_LENGTH2) {
186666
- out = `${out.slice(0, MAX_VALUE_LENGTH2)}…`;
186667
- }
186668
- return out;
186669
- }
186670
- function nameTokens2(name2) {
186671
- return name2.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").split(/[\s_-]+/).map((t11) => t11.toLowerCase()).filter(Boolean);
186672
- }
186673
- function isSensitiveName2(name2) {
186674
- const tokens = nameTokens2(name2);
186675
- for (let i3 = 0;i3 < tokens.length; i3++) {
186676
- const token = tokens[i3];
186677
- if (SENSITIVE_NAME_TOKENS2.has(token)) {
186678
- return true;
186679
- }
186680
- if (token === "key" || token === "keys") {
186681
- const prev = tokens[i3 - 1];
186682
- if (prev && SENSITIVE_KEY_PREFIXES2.has(prev)) {
186683
- return true;
186684
- }
186685
- }
186686
- }
186687
- return false;
186688
- }
186689
- function redactProperty2(name2, value) {
186690
- if (value === undefined || value === null) {
186691
- return;
186692
- }
186693
- if (isSensitiveName2(name2)) {
186694
- return REDACTED2;
186695
- }
186696
- if (typeof value === "boolean" || typeof value === "number") {
186697
- return value;
186698
- }
186699
- if (typeof value !== "string") {
186700
- return "[OBJECT]";
186701
- }
186702
- return redactValueDetectors2(value);
186703
- }
186704
- function redactProperties2(properties) {
186705
- const out = {};
186706
- for (const [name2, value] of Object.entries(properties)) {
186707
- const redacted = redactProperty2(name2, value);
186708
- if (redacted !== undefined) {
186709
- out[name2] = redacted;
186710
- }
186711
- }
186712
- return out;
186713
- }
186714
186809
  function extractCommandParams2(cmd) {
186715
186810
  const params = {};
186811
+ const add22 = (name2, value) => {
186812
+ if (name2 && value !== undefined) {
186813
+ params[`${TELEMETRY_COMMAND_ARG_PREFIX2}${name2}`] = value;
186814
+ }
186815
+ };
186716
186816
  const registered = cmd.registeredArguments ?? [];
186717
186817
  const processed = cmd.processedArgs ?? [];
186718
186818
  for (let i3 = 0;i3 < registered.length; i3++) {
186719
- const value = processed[i3];
186720
- if (value === undefined) {
186721
- continue;
186722
- }
186723
- const name2 = registered[i3].name();
186724
- if (name2) {
186725
- params[name2] = value;
186726
- }
186819
+ add22(registered[i3].name(), processed[i3]);
186727
186820
  }
186728
186821
  for (const [key, value] of Object.entries(cmd.opts())) {
186729
- if (value !== undefined) {
186730
- params[key] = value;
186731
- }
186822
+ add22(key, value);
186732
186823
  }
186733
186824
  return params;
186734
186825
  }
@@ -190321,7 +190412,7 @@ var de_default10, en4, es_default10, es_MX_default6, fr_default10, ja_default10,
190321
190412
  }
190322
190413
  return result;
190323
190414
  }
190324
- }, TreeInterpreterInstance2, TreeInterpreter_default2, jsYaml2, loader2, common2, hasRequiredCommon2, exception2, hasRequiredException2, snippet2, hasRequiredSnippet2, type2, hasRequiredType2, schema71, hasRequiredSchema2, str2, hasRequiredStr2, seq2, hasRequiredSeq2, map7, hasRequiredMap2, failsafe2, hasRequiredFailsafe2, _null12, hasRequired_null2, bool2, hasRequiredBool2, int6, hasRequiredInt2, float2, hasRequiredFloat2, json6, hasRequiredJson2, core5, hasRequiredCore2, timestamp2, hasRequiredTimestamp2, merge6, hasRequiredMerge2, binary2, hasRequiredBinary2, omap2, hasRequiredOmap2, pairs2, hasRequiredPairs2, set7, hasRequiredSet2, _default9, hasRequired_default2, hasRequiredLoader2, dumper2, hasRequiredDumper2, hasRequiredJsYaml2, jsYamlExports2, yaml2, Type2, Schema2, FAILSAFE_SCHEMA2, JSON_SCHEMA2, CORE_SCHEMA2, DEFAULT_SCHEMA2, load2, loadAll2, dump2, YAMLException2, types4, 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_PATTERN3, 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, globalLogHandler = (logMessage) => {
190415
+ }, TreeInterpreterInstance2, TreeInterpreter_default2, jsYaml2, loader2, common2, hasRequiredCommon2, exception2, hasRequiredException2, snippet2, hasRequiredSnippet2, type2, hasRequiredType2, schema71, hasRequiredSchema2, str2, hasRequiredStr2, seq2, hasRequiredSeq2, map7, hasRequiredMap2, failsafe2, hasRequiredFailsafe2, _null12, hasRequired_null2, bool2, hasRequiredBool2, int6, hasRequiredInt2, float2, hasRequiredFloat2, json6, hasRequiredJson2, core5, hasRequiredCore2, timestamp2, hasRequiredTimestamp2, merge6, hasRequiredMerge2, binary2, hasRequiredBinary2, omap2, hasRequiredOmap2, pairs2, hasRequiredPairs2, set7, hasRequiredSet2, _default9, hasRequired_default2, hasRequiredLoader2, dumper2, hasRequiredDumper2, hasRequiredJsYaml2, jsYamlExports2, yaml2, Type2, Schema2, FAILSAFE_SCHEMA2, JSON_SCHEMA2, CORE_SCHEMA2, DEFAULT_SCHEMA2, load2, loadAll2, dump2, YAMLException2, types4, 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_PATTERN3, 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, globalLogHandler = (logMessage) => {
190325
190416
  const formattedMessage = logMessage.toFormattedString();
190326
190417
  switch (logMessage.logLevel) {
190327
190418
  case LogLevel.Debug:
@@ -194243,8 +194334,53 @@ Expecting one of '${allowedValues.join("', '")}'`);
194243
194334
  matches: (env) => isTruthy2(env.CI)
194244
194335
  }
194245
194336
  ];
194337
+ TRACEPARENT_PATTERN2 = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
194246
194338
  telemetrySessionIdSlot2 = singleton3("TelemetrySessionId");
194339
+ telemetryOperationIdSlot2 = singleton3("TelemetryOperationId");
194247
194340
  telemetryPropsSlot2 = singleton3("TelemetryDefaultProps");
194341
+ SENSITIVE_NAME_TOKENS2 = new Set([
194342
+ "token",
194343
+ "tokens",
194344
+ "secret",
194345
+ "secrets",
194346
+ "password",
194347
+ "passwords",
194348
+ "pwd",
194349
+ "credential",
194350
+ "credentials",
194351
+ "auth",
194352
+ "authentication",
194353
+ "authorization",
194354
+ "authority",
194355
+ "cert",
194356
+ "certificate",
194357
+ "certificates"
194358
+ ]);
194359
+ SENSITIVE_KEY_PREFIXES2 = new Set([
194360
+ "api",
194361
+ "access",
194362
+ "client",
194363
+ "private",
194364
+ "public",
194365
+ "signing",
194366
+ "encryption",
194367
+ "session",
194368
+ "master",
194369
+ "shared",
194370
+ "root",
194371
+ "ssh",
194372
+ "rsa",
194373
+ "aes",
194374
+ "hmac",
194375
+ "oauth"
194376
+ ]);
194377
+ 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;
194378
+ EMAIL_PATTERN2 = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
194379
+ JWT_PATTERN2 = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
194380
+ LONG_TOKEN_PATTERN2 = /\b[A-Za-z0-9_-]{40,}\b/g;
194381
+ USER_HOME_PATTERN2 = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
194382
+ URL_PATTERN2 = /\bhttps?:\/\/[^\s,;]+/gi;
194383
+ URL_TRAILING_PUNCT2 = /[.,;:!?)\]}>'"]+$/;
194248
194384
  providerSlot2 = singleton3("TelemetryProvider");
194249
194385
  telemetryInstanceSlot2 = singleton3("TelemetryService");
194250
194386
  DEFAULT_AI_CONNECTION_STRING2 = atob("SW5zdHJ1bWVudGF0aW9uS2V5PTliZDM3NDgyLTgxMGUtNDQyYS1hYWE2LWQzOGVmNjVjNjY3NDtJbmdlc3Rpb25FbmRwb2ludD1odHRwczovL3dlc3RldXJvcGUtNS5pbi5hcHBsaWNhdGlvbmluc2lnaHRzLmF6dXJlLmNvbS87TGl2ZUVuZHBvaW50PWh0dHBzOi8vd2VzdGV1cm9wZS5saXZlZGlhZ25vc3RpY3MubW9uaXRvci5henVyZS5jb20vO0FwcGxpY2F0aW9uSWQ9MzU2OTdlZjEtOGJkMC00ZjE5LWEyN2MtZDg3Y2NhYzY2ZDJj");
@@ -194482,49 +194618,6 @@ Expecting one of '${allowedValues.join("', '")}'`);
194482
194618
  ]
194483
194619
  ]
194484
194620
  ]).sort((a2, b3) => b3.prefix.length - a2.prefix.length);
194485
- SENSITIVE_NAME_TOKENS2 = new Set([
194486
- "token",
194487
- "tokens",
194488
- "secret",
194489
- "secrets",
194490
- "password",
194491
- "passwords",
194492
- "pwd",
194493
- "credential",
194494
- "credentials",
194495
- "auth",
194496
- "authentication",
194497
- "authorization",
194498
- "authority",
194499
- "cert",
194500
- "certificate",
194501
- "certificates"
194502
- ]);
194503
- SENSITIVE_KEY_PREFIXES2 = new Set([
194504
- "api",
194505
- "access",
194506
- "client",
194507
- "private",
194508
- "public",
194509
- "signing",
194510
- "encryption",
194511
- "session",
194512
- "master",
194513
- "shared",
194514
- "root",
194515
- "ssh",
194516
- "rsa",
194517
- "aes",
194518
- "hmac",
194519
- "oauth"
194520
- ]);
194521
- 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;
194522
- EMAIL_PATTERN2 = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
194523
- JWT_PATTERN2 = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
194524
- LONG_TOKEN_PATTERN2 = /\b[A-Za-z0-9_-]{40,}\b/g;
194525
- USER_HOME_PATTERN2 = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
194526
- URL_PATTERN2 = /\bhttps?:\/\/[^\s,;]+/gi;
194527
- URL_TRAILING_PUNCT2 = /[.,;:!?)\]}>'"]+$/;
194528
194621
  pollSignalSlot2 = singleton3("PollSignal");
194529
194622
  cliErrorCodeValues2 = new Set(CLI_ERROR_CODES2);
194530
194623
  retryHintValues2 = new Set(RETRY_HINTS2);
@@ -194533,11 +194626,12 @@ Expecting one of '${allowedValues.join("', '")}'`);
194533
194626
  return this.action(async (...args) => {
194534
194627
  const telemetryName = deriveCommandPath2(command);
194535
194628
  const props = typeof properties === "function" ? properties(...args) : properties;
194629
+ const requestContext = telemetry2.createRequestContext();
194536
194630
  const startTime = performance.now();
194537
194631
  let errorMessage2;
194538
194632
  let fallbackExitCode = EXIT_CODES2.Success;
194539
194633
  clearRecordedCommandFailureTelemetry2();
194540
- const [error95] = await catchError3(fn2(...args));
194634
+ const [error95] = await catchError3(telemetry2.runWithContext(requestContext, () => fn2(...args)));
194541
194635
  if (error95) {
194542
194636
  errorMessage2 = error95 instanceof Error ? error95.message : String(error95);
194543
194637
  logger3.debug(`[trackedAction] ${telemetryName} failed: ${errorMessage2}`);
@@ -194573,16 +194667,21 @@ Expecting one of '${allowedValues.join("', '")}'`);
194573
194667
  recordedFailure,
194574
194668
  pollSignal: context.pollSignal
194575
194669
  });
194576
- telemetry2.trackEvent(telemetryName, redactProperties2({
194577
- ...extractCommandParams2(command),
194670
+ const commandParams = extractCommandParams2(command);
194671
+ if (props) {
194672
+ for (const key of Object.keys(props)) {
194673
+ delete commandParams[`${TELEMETRY_COMMAND_ARG_PREFIX2}${key}`];
194674
+ }
194675
+ }
194676
+ const baseProperties = redactProperties2({
194677
+ ...commandParams,
194578
194678
  ...props,
194579
194679
  ...buildCommandTelemetryAttribution2(telemetryName, process.env.UIPATH_SKILL),
194580
194680
  command: "true",
194581
- duration: String(durationMs),
194582
- success: String(success5),
194583
194681
  ...terminalTelemetry,
194584
194682
  ...errorMessage2 ? { errorMessage: errorMessage2 } : {}
194585
- }));
194683
+ });
194684
+ telemetry2.trackRequestResult(telemetryName, durationMs, success5, baseProperties, requestContext);
194586
194685
  });
194587
194686
  };
194588
194687
  guardInstalledSlot2 = singleton3("ConsoleGuardInstalled");
@@ -194754,7 +194853,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
194754
194853
  package_default6 = {
194755
194854
  name: "@uipath/project-packager",
194756
194855
  license: "MIT",
194757
- version: "1.198.0-preview.95",
194856
+ version: "1.198.0",
194758
194857
  description: "UiPath Project Packager - core library for packing individual UiPath projects",
194759
194858
  type: "module",
194760
194859
  main: "./dist/index.js",
@@ -286630,7 +286729,7 @@ import"./packager-tool.js";
286630
286729
  var package_default = {
286631
286730
  name: "@uipath/flow-tool",
286632
286731
  license: "MIT",
286633
- version: "1.198.0-preview.95",
286732
+ version: "1.198.0",
286634
286733
  description: "Create, debug, and run UiPath Flow projects and jobs.",
286635
286734
  private: false,
286636
286735
  repository: {
@@ -292890,11 +292989,36 @@ class NodeContextStorage {
292890
292989
  return this.storage.getStore();
292891
292990
  }
292892
292991
  }
292992
+ // ../common/src/telemetry/trace-context.ts
292993
+ var TELEMETRY_TRACEPARENT_ENV = "TRACEPARENT";
292994
+ var TRACEPARENT_PATTERN = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
292995
+ function getProcessEnv() {
292996
+ return globalThis.process?.env;
292997
+ }
292998
+ function parseInboundTraceparent(value) {
292999
+ if (!value) {
293000
+ return;
293001
+ }
293002
+ const match = TRACEPARENT_PATTERN.exec(value.trim().toLowerCase());
293003
+ if (!match) {
293004
+ return;
293005
+ }
293006
+ const [, traceId, parentSpanId] = match;
293007
+ if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
293008
+ return;
293009
+ }
293010
+ return { traceId, parentSpanId };
293011
+ }
293012
+ function getInboundTraceContext() {
293013
+ return parseInboundTraceparent(getProcessEnv()?.[TELEMETRY_TRACEPARENT_ENV]);
293014
+ }
293015
+
292893
293016
  // ../common/src/telemetry/session-id.ts
292894
293017
  var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
292895
293018
  var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
292896
293019
  var telemetrySessionIdSlot = singleton("TelemetrySessionId");
292897
- function getProcessEnv() {
293020
+ var telemetryOperationIdSlot = singleton("TelemetryOperationId");
293021
+ function getProcessEnv2() {
292898
293022
  return globalThis.process?.env;
292899
293023
  }
292900
293024
  function normalizeSessionId(value) {
@@ -292905,18 +293029,165 @@ function normalizeSessionId(value) {
292905
293029
  return trimmed || undefined;
292906
293030
  }
292907
293031
  function getConfiguredTelemetrySessionId() {
292908
- return normalizeSessionId(getProcessEnv()?.[TELEMETRY_SESSION_ID_ENV]);
293032
+ return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
292909
293033
  }
292910
293034
  function resolveTelemetrySessionId(existingSessionId) {
292911
293035
  return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
292912
293036
  }
293037
+ function getTelemetryOperationId() {
293038
+ const existing = telemetryOperationIdSlot.get();
293039
+ if (existing) {
293040
+ return existing;
293041
+ }
293042
+ const inboundTraceId = getInboundTraceContext()?.traceId;
293043
+ const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
293044
+ telemetryOperationIdSlot.set(generated);
293045
+ return generated;
293046
+ }
292913
293047
  // ../common/src/telemetry/global-telemetry-properties.ts
292914
293048
  var telemetryPropsSlot = singleton("TelemetryDefaultProps");
292915
293049
  function getGlobalTelemetryProperties() {
292916
293050
  return telemetryPropsSlot.get();
292917
293051
  }
292918
293052
 
293053
+ // ../common/src/telemetry/pii-redactor.ts
293054
+ var REDACTED = "[REDACTED]";
293055
+ var MAX_VALUE_LENGTH = 200;
293056
+ var SENSITIVE_NAME_TOKENS = new Set([
293057
+ "token",
293058
+ "tokens",
293059
+ "secret",
293060
+ "secrets",
293061
+ "password",
293062
+ "passwords",
293063
+ "pwd",
293064
+ "credential",
293065
+ "credentials",
293066
+ "auth",
293067
+ "authentication",
293068
+ "authorization",
293069
+ "authority",
293070
+ "cert",
293071
+ "certificate",
293072
+ "certificates"
293073
+ ]);
293074
+ var SENSITIVE_KEY_PREFIXES = new Set([
293075
+ "api",
293076
+ "access",
293077
+ "client",
293078
+ "private",
293079
+ "public",
293080
+ "signing",
293081
+ "encryption",
293082
+ "session",
293083
+ "master",
293084
+ "shared",
293085
+ "root",
293086
+ "ssh",
293087
+ "rsa",
293088
+ "aes",
293089
+ "hmac",
293090
+ "oauth"
293091
+ ]);
293092
+ 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;
293093
+ var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
293094
+ var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
293095
+ var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
293096
+ var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
293097
+ var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
293098
+ var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
293099
+ function shortHash(input) {
293100
+ let hash = 2166136261;
293101
+ for (let i = 0;i < input.length; i++) {
293102
+ hash ^= input.charCodeAt(i);
293103
+ hash = Math.imul(hash, 16777619);
293104
+ }
293105
+ return (hash >>> 0).toString(16).padStart(8, "0");
293106
+ }
293107
+ function redactUrl(raw) {
293108
+ try {
293109
+ const url = new URL(raw);
293110
+ return `${url.protocol}//${url.host}`;
293111
+ } catch {
293112
+ return `url#${shortHash(raw)}`;
293113
+ }
293114
+ }
293115
+ function redactValueDetectors(value) {
293116
+ let out = value;
293117
+ out = out.replace(JWT_PATTERN, () => REDACTED);
293118
+ out = out.replace(URL_PATTERN, (match) => {
293119
+ const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
293120
+ const core2 = trailing ? match.slice(0, -trailing.length) : match;
293121
+ return `${redactUrl(core2)}${trailing}`;
293122
+ });
293123
+ out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
293124
+ out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
293125
+ out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
293126
+ out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
293127
+ if (out.length > MAX_VALUE_LENGTH) {
293128
+ out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
293129
+ }
293130
+ return out;
293131
+ }
293132
+ function redactValue(value) {
293133
+ return redactValueDetectors(value);
293134
+ }
293135
+ function redactError(error) {
293136
+ const safe = new Error(redactValueDetectors(error.message ?? ""));
293137
+ safe.name = error.name;
293138
+ safe.stack = typeof error.stack === "string" ? redactValueDetectors(error.stack) : undefined;
293139
+ return safe;
293140
+ }
293141
+ function nameTokens(name) {
293142
+ 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);
293143
+ }
293144
+ function isSensitiveName(name) {
293145
+ const tokens = nameTokens(name);
293146
+ for (let i = 0;i < tokens.length; i++) {
293147
+ const token = tokens[i];
293148
+ if (SENSITIVE_NAME_TOKENS.has(token)) {
293149
+ return true;
293150
+ }
293151
+ if (token === "key" || token === "keys") {
293152
+ const prev = tokens[i - 1];
293153
+ if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
293154
+ return true;
293155
+ }
293156
+ }
293157
+ }
293158
+ return false;
293159
+ }
293160
+ function redactProperty(name, value) {
293161
+ if (value === undefined || value === null) {
293162
+ return;
293163
+ }
293164
+ if (isSensitiveName(name)) {
293165
+ return REDACTED;
293166
+ }
293167
+ if (typeof value === "boolean" || typeof value === "number") {
293168
+ return value;
293169
+ }
293170
+ if (typeof value !== "string") {
293171
+ return "[OBJECT]";
293172
+ }
293173
+ return redactValueDetectors(value);
293174
+ }
293175
+ function redactProperties(properties) {
293176
+ const out = {};
293177
+ for (const [name, value] of Object.entries(properties)) {
293178
+ const redacted = redactProperty(name, value);
293179
+ if (redacted !== undefined) {
293180
+ out[name] = redacted;
293181
+ }
293182
+ }
293183
+ return out;
293184
+ }
293185
+
292919
293186
  // ../common/src/telemetry/telemetry-service.ts
293187
+ var TELEMETRY_OPERATION_ID_PROPERTY = "uip.trace.operation_id";
293188
+ var TELEMETRY_PARENT_ID_PROPERTY = "uip.trace.parent_id";
293189
+ var TELEMETRY_SPAN_ID_PROPERTY = "uip.trace.span_id";
293190
+
292920
293191
  class TelemetryService {
292921
293192
  telemetryProvider;
292922
293193
  contextStorage;
@@ -292943,11 +293214,15 @@ class TelemetryService {
292943
293214
  trackException(error, properties) {
292944
293215
  const context = this.getCurrentContext();
292945
293216
  const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
292946
- this.telemetryProvider.trackException(error, enrichedProperties);
293217
+ this.telemetryProvider.trackException(redactError(error), enrichedProperties);
292947
293218
  }
292948
293219
  async trackRequest(name, fn, properties) {
293220
+ const parentContext = this.getCurrentContext();
293221
+ const operationId = parentContext?.operationId ?? this.operationId ?? getTelemetryOperationId();
293222
+ const parentId = parentContext ? parentContext.id : this.inboundParentIdFor(operationId);
292949
293223
  const context = {
292950
- operationId: this.operationId ?? this.generateId(),
293224
+ operationId,
293225
+ ...parentId !== undefined ? { parentId } : {},
292951
293226
  id: this.generateId()
292952
293227
  };
292953
293228
  const startTime = performance.now();
@@ -292965,6 +293240,45 @@ class TelemetryService {
292965
293240
  throw error;
292966
293241
  }
292967
293242
  }
293243
+ trackRequestResult(name, durationMs, success, properties, context) {
293244
+ const requestContext = context ?? {
293245
+ operationId: this.operationId ?? getTelemetryOperationId(),
293246
+ id: this.generateId()
293247
+ };
293248
+ const enrichedProperties = this.enrichPropertiesWithContext(properties, requestContext);
293249
+ this.telemetryProvider.trackRequest(name, durationMs, success, enrichedProperties);
293250
+ }
293251
+ createRequestContext() {
293252
+ const operationId = this.operationId ?? getTelemetryOperationId();
293253
+ const parentId = this.inboundParentIdFor(operationId);
293254
+ return {
293255
+ operationId,
293256
+ ...parentId !== undefined ? { parentId } : {},
293257
+ id: this.generateId()
293258
+ };
293259
+ }
293260
+ inboundParentIdFor(operationId) {
293261
+ const inbound = getInboundTraceContext();
293262
+ return inbound && inbound.traceId === operationId ? inbound.parentSpanId : undefined;
293263
+ }
293264
+ runWithContext(context, fn) {
293265
+ return this.contextStorage.run(context, fn);
293266
+ }
293267
+ createDependencyContext() {
293268
+ const parentContext = this.getCurrentContext();
293269
+ if (!parentContext) {
293270
+ return;
293271
+ }
293272
+ return {
293273
+ operationId: parentContext.operationId,
293274
+ parentId: parentContext.id,
293275
+ id: this.generateId()
293276
+ };
293277
+ }
293278
+ trackDependencyResult(name, type2, durationMs, success, properties, context, resultCode) {
293279
+ const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
293280
+ this.telemetryProvider.trackDependency(redactValue(name), type2, durationMs, success, enrichedProperties, resultCode);
293281
+ }
292968
293282
  async trackDependencyOperation(name, type2, fn, properties) {
292969
293283
  const parentContext = this.getCurrentContext();
292970
293284
  if (!parentContext) {
@@ -293001,8 +293315,12 @@ class TelemetryService {
293001
293315
  ...getExecutionContextTelemetryProperties(),
293002
293316
  ...globalProperties,
293003
293317
  ...this.defaultProperties,
293004
- ...properties,
293005
- ...context
293318
+ ...redactProperties(properties ?? {}),
293319
+ ...context ? {
293320
+ [TELEMETRY_OPERATION_ID_PROPERTY]: context.operationId,
293321
+ ...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY]: context.parentId } : {},
293322
+ [TELEMETRY_SPAN_ID_PROPERTY]: context.id
293323
+ } : {}
293006
293324
  };
293007
293325
  if (sessionId === undefined) {
293008
293326
  delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
@@ -293012,7 +293330,16 @@ class TelemetryService {
293012
293330
  return enriched;
293013
293331
  }
293014
293332
  generateId() {
293015
- return crypto.randomUUID().replaceAll("-", "");
293333
+ const bytes = new Uint8Array(8);
293334
+ let hex = "";
293335
+ do {
293336
+ crypto.getRandomValues(bytes);
293337
+ hex = "";
293338
+ for (const byte of bytes) {
293339
+ hex += byte.toString(16).padStart(2, "0");
293340
+ }
293341
+ } while (/^0+$/.test(hex));
293342
+ return hex;
293016
293343
  }
293017
293344
  }
293018
293345
  // ../common/src/telemetry/node-appinsights-telemetry-provider.ts
@@ -293714,134 +294041,11 @@ function buildCommandTelemetryAttribution(commandPath, skillSource) {
293714
294041
  };
293715
294042
  }
293716
294043
 
293717
- // ../common/src/telemetry/pii-redactor.ts
293718
- var REDACTED = "[REDACTED]";
293719
- var MAX_VALUE_LENGTH = 200;
293720
- var SENSITIVE_NAME_TOKENS = new Set([
293721
- "token",
293722
- "tokens",
293723
- "secret",
293724
- "secrets",
293725
- "password",
293726
- "passwords",
293727
- "pwd",
293728
- "credential",
293729
- "credentials",
293730
- "auth",
293731
- "authentication",
293732
- "authorization",
293733
- "authority",
293734
- "cert",
293735
- "certificate",
293736
- "certificates"
293737
- ]);
293738
- var SENSITIVE_KEY_PREFIXES = new Set([
293739
- "api",
293740
- "access",
293741
- "client",
293742
- "private",
293743
- "public",
293744
- "signing",
293745
- "encryption",
293746
- "session",
293747
- "master",
293748
- "shared",
293749
- "root",
293750
- "ssh",
293751
- "rsa",
293752
- "aes",
293753
- "hmac",
293754
- "oauth"
293755
- ]);
293756
- 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;
293757
- var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
293758
- var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
293759
- var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
293760
- var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
293761
- var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
293762
- var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
293763
- function shortHash(input) {
293764
- let hash = 2166136261;
293765
- for (let i = 0;i < input.length; i++) {
293766
- hash ^= input.charCodeAt(i);
293767
- hash = Math.imul(hash, 16777619);
293768
- }
293769
- return (hash >>> 0).toString(16).padStart(8, "0");
293770
- }
293771
- function redactUrl(raw) {
293772
- try {
293773
- const url = new URL(raw);
293774
- return `${url.protocol}//${url.host}`;
293775
- } catch {
293776
- return `url#${shortHash(raw)}`;
293777
- }
293778
- }
293779
- function redactValueDetectors(value) {
293780
- let out = value;
293781
- out = out.replace(JWT_PATTERN, () => REDACTED);
293782
- out = out.replace(URL_PATTERN, (match) => {
293783
- const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
293784
- const core2 = trailing ? match.slice(0, -trailing.length) : match;
293785
- return `${redactUrl(core2)}${trailing}`;
293786
- });
293787
- out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
293788
- out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
293789
- out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
293790
- out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
293791
- if (out.length > MAX_VALUE_LENGTH) {
293792
- out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
293793
- }
293794
- return out;
293795
- }
293796
- function nameTokens(name) {
293797
- 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);
293798
- }
293799
- function isSensitiveName(name) {
293800
- const tokens = nameTokens(name);
293801
- for (let i = 0;i < tokens.length; i++) {
293802
- const token = tokens[i];
293803
- if (SENSITIVE_NAME_TOKENS.has(token)) {
293804
- return true;
293805
- }
293806
- if (token === "key" || token === "keys") {
293807
- const prev = tokens[i - 1];
293808
- if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
293809
- return true;
293810
- }
293811
- }
293812
- }
293813
- return false;
293814
- }
293815
- function redactProperty(name, value) {
293816
- if (value === undefined || value === null) {
293817
- return;
293818
- }
293819
- if (isSensitiveName(name)) {
293820
- return REDACTED;
293821
- }
293822
- if (typeof value === "boolean" || typeof value === "number") {
293823
- return value;
293824
- }
293825
- if (typeof value !== "string") {
293826
- return "[OBJECT]";
293827
- }
293828
- return redactValueDetectors(value);
293829
- }
293830
- function redactProperties(properties) {
293831
- const out = {};
293832
- for (const [name, value] of Object.entries(properties)) {
293833
- const redacted = redactProperty(name, value);
293834
- if (redacted !== undefined) {
293835
- out[name] = redacted;
293836
- }
293837
- }
293838
- return out;
293839
- }
293840
-
293841
294044
  // ../common/src/trackedAction.ts
293842
294045
  var pollSignalSlot = singleton("PollSignal");
293843
294046
  var cliErrorCodeValues = new Set(CLI_ERROR_CODES);
293844
294047
  var retryHintValues = new Set(RETRY_HINTS);
294048
+ var TELEMETRY_COMMAND_ARG_PREFIX = "uip.cmd.arg.";
293845
294049
  var processContext = {
293846
294050
  exit: (code) => {
293847
294051
  process.exitCode = code;
@@ -293852,22 +294056,18 @@ var processContext = {
293852
294056
  };
293853
294057
  function extractCommandParams(cmd) {
293854
294058
  const params = {};
294059
+ const add2 = (name, value) => {
294060
+ if (name && value !== undefined) {
294061
+ params[`${TELEMETRY_COMMAND_ARG_PREFIX}${name}`] = value;
294062
+ }
294063
+ };
293855
294064
  const registered = cmd.registeredArguments ?? [];
293856
294065
  const processed = cmd.processedArgs ?? [];
293857
294066
  for (let i = 0;i < registered.length; i++) {
293858
- const value = processed[i];
293859
- if (value === undefined) {
293860
- continue;
293861
- }
293862
- const name = registered[i].name();
293863
- if (name) {
293864
- params[name] = value;
293865
- }
294067
+ add2(registered[i].name(), processed[i]);
293866
294068
  }
293867
294069
  for (const [key, value] of Object.entries(cmd.opts())) {
293868
- if (value !== undefined) {
293869
- params[key] = value;
293870
- }
294070
+ add2(key, value);
293871
294071
  }
293872
294072
  return params;
293873
294073
  }
@@ -293910,11 +294110,12 @@ Command.prototype.trackedAction = function(context, fn, properties) {
293910
294110
  return this.action(async (...args) => {
293911
294111
  const telemetryName = deriveCommandPath(command);
293912
294112
  const props = typeof properties === "function" ? properties(...args) : properties;
294113
+ const requestContext = telemetry.createRequestContext();
293913
294114
  const startTime = performance.now();
293914
294115
  let errorMessage;
293915
294116
  let fallbackExitCode = EXIT_CODES.Success;
293916
294117
  clearRecordedCommandFailureTelemetry();
293917
- const [error] = await catchError(fn(...args));
294118
+ const [error] = await catchError(telemetry.runWithContext(requestContext, () => fn(...args)));
293918
294119
  if (error) {
293919
294120
  errorMessage = error instanceof Error ? error.message : String(error);
293920
294121
  logger.debug(`[trackedAction] ${telemetryName} failed: ${errorMessage}`);
@@ -293950,16 +294151,21 @@ Command.prototype.trackedAction = function(context, fn, properties) {
293950
294151
  recordedFailure,
293951
294152
  pollSignal: context.pollSignal
293952
294153
  });
293953
- telemetry.trackEvent(telemetryName, redactProperties({
293954
- ...extractCommandParams(command),
294154
+ const commandParams = extractCommandParams(command);
294155
+ if (props) {
294156
+ for (const key of Object.keys(props)) {
294157
+ delete commandParams[`${TELEMETRY_COMMAND_ARG_PREFIX}${key}`];
294158
+ }
294159
+ }
294160
+ const baseProperties = redactProperties({
294161
+ ...commandParams,
293955
294162
  ...props,
293956
294163
  ...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
293957
294164
  command: "true",
293958
- duration: String(durationMs),
293959
- success: String(success),
293960
294165
  ...terminalTelemetry,
293961
294166
  ...errorMessage ? { errorMessage } : {}
293962
- }));
294167
+ });
294168
+ telemetry.trackRequestResult(telemetryName, durationMs, success, baseProperties, requestContext);
293963
294169
  });
293964
294170
  };
293965
294171
  // ../common/src/console-guard.ts
@@ -295037,7 +295243,7 @@ init_dist3();
295037
295243
  // ../packager/packager-tool-flow/package.json
295038
295244
  var package_default2 = {
295039
295245
  name: "@uipath/packager-tool-flow",
295040
- version: "1.198.0-preview.95",
295246
+ version: "1.198.0",
295041
295247
  description: "UiPath Flow tool implementation",
295042
295248
  type: "module",
295043
295249
  exports: {
@@ -337999,7 +338205,7 @@ class TextApiResponse {
337999
338205
  var package_default3 = {
338000
338206
  name: "@uipath/integrationservice-sdk",
338001
338207
  license: "MIT",
338002
- version: "1.198.0-preview.95",
338208
+ version: "1.198.0",
338003
338209
  repository: {
338004
338210
  type: "git",
338005
338211
  url: "https://github.com/UiPath/cli.git",
@@ -356235,7 +356441,7 @@ function querystringSingleKey4(key, value, keyPrefix = "") {
356235
356441
  var package_default5 = {
356236
356442
  name: "@uipath/solution-sdk",
356237
356443
  license: "MIT",
356238
- version: "1.198.0-preview.95",
356444
+ version: "1.198.0",
356239
356445
  repository: {
356240
356446
  type: "git",
356241
356447
  url: "https://github.com/UiPath/cli.git",
@@ -369448,7 +369654,7 @@ function querystringSingleKey6(key, value, keyPrefix = "") {
369448
369654
  var package_default7 = {
369449
369655
  name: "@uipath/agent-sdk",
369450
369656
  license: "MIT",
369451
- version: "1.198.0-preview.95",
369657
+ version: "1.198.0",
369452
369658
  description: "SDK for the UiPath Agent Runtime API — evaluation execution and debug sessions.",
369453
369659
  repository: {
369454
369660
  type: "git",
@@ -370196,4 +370402,4 @@ export {
370196
370402
  metadata
370197
370403
  };
370198
370404
 
370199
- //# debugId=4721E34C6C8DFF7D64756E2164756E21
370405
+ //# debugId=5957C49E5B5B358A64756E2164756E21